Skip to content

Commit

Permalink
added occupancy text
Browse files Browse the repository at this point in the history
  • Loading branch information
peucastro committed Dec 28, 2024
1 parent bbcc63c commit 44d759a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
15 changes: 12 additions & 3 deletions packages/uni_ui/lib/cards/library_occupation_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,18 @@ class LibraryOccupationCard extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Floor ${floor.number}',
style: Theme.of(context).textTheme.bodyLarge,
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'Floor ${floor.number}',
style: Theme.of(context).textTheme.bodyLarge,
),
Text(
'${floor.occupation}/${floor.capacity}',
style: Theme.of(context).textTheme.bodyLarge,
),
],
),
const SizedBox(height: 5),
LinearPercentIndicator(
Expand Down
8 changes: 4 additions & 4 deletions packages/uni_ui/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -505,15 +505,15 @@ class MyApp extends StatelessWidget {

MyApp() {
Map<String, dynamic> occupation_json = {
'occupation': 250,
'occupation': 200,
'capacity': 300,
'floors': [
{'number': 1, 'occupation': 10, 'capacity': 50},
{'number': 2, 'occupation': 20, 'capacity': 50},
{'number': 3, 'occupation': 30, 'capacity': 50},
{'number': 3, 'occupation': 35, 'capacity': 50},
{'number': 4, 'occupation': 40, 'capacity': 50},
{'number': 5, 'occupation': 50, 'capacity': 50},
{'number': 6, 'occupation': 60, 'capacity': 50}
{'number': 5, 'occupation': 45, 'capacity': 50},
{'number': 6, 'occupation': 50, 'capacity': 50}
]
};
occupation = LibraryOccupation.fromJson(occupation_json);
Expand Down

0 comments on commit 44d759a

Please sign in to comment.