Skip to content

Commit

Permalink
Update app devices page
Browse files Browse the repository at this point in the history
Signed-off-by: Nelson Vieira <[email protected]>
  • Loading branch information
nelson-vieira committed Jun 15, 2023
1 parent ab95d0f commit b5ed0ab
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 4 deletions.
32 changes: 29 additions & 3 deletions masters-thesis/app/lib/pages/devices/devices.dart
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,35 @@ class _DevicesState extends State<Devices> {
title: Text(
device.name,
),
subtitle: Text(
device.purpose,
),
subtitle: FutureBuilder(
future: FirebaseFirestore.instance
.collection("categories")
.doc(device.category)
.get(),
builder: (context, snapshot) {
if (snapshot.hasError) {
return Center(
child: Text(
"Something went wrong! ${snapshot.error}",
style: const TextStyle(
color: Colors.white,
fontSize: 17.0,
),
textAlign: TextAlign.center,
));
} else if (snapshot.hasData) {
final category = snapshot.data!;

return Text(
category.get("name"),
style: const TextStyle(fontSize: 16.0, color: Colors.white),
);
} else {
return const Center(
child: CircularProgressIndicator(),
);
}
}),
onTap: () {
Navigator.of(context)
.pushNamed(ShowDevice.route, arguments: device);
Expand Down
2 changes: 1 addition & 1 deletion masters-thesis/app/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix.
version: 0.31.0+0.31.0
version: 0.31.1+0.31.1

environment:
sdk: '>=2.19.0 <3.0.0'
Expand Down

0 comments on commit b5ed0ab

Please sign in to comment.