fixed missing version info

This commit is contained in:
Adrian Baumgart 2024-03-31 21:08:41 +02:00
parent dc03457397
commit b0988fcb3d
No known key found for this signature in database

View File

@ -31,7 +31,7 @@ class _SettingsViewState extends State<SettingsView> {
void getServerHealth() async { void getServerHealth() async {
var packageInfo = await PackageInfo.fromPlatform(); var packageInfo = await PackageInfo.fromPlatform();
setState(() { setState(() {
packageInfo = packageInfo; this.packageInfo = packageInfo;
}); });
final response = await globals.serverManager.getServerHealth(); final response = await globals.serverManager.getServerHealth();
response.fold((l) { response.fold((l) {
@ -77,7 +77,7 @@ class _SettingsViewState extends State<SettingsView> {
const PopupMenuItem( const PopupMenuItem(
value: 0, value: 0,
child: child:
Text("Log out...", style: TextStyle(color: Colors.red)), Text("Log out", style: TextStyle(color: Colors.red)),
) )
]; ];
}, },
@ -266,10 +266,24 @@ class _SettingsViewState extends State<SettingsView> {
Row( Row(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
children: [ children: [
Text( Container(
"${packageInfo.appName}, v${packageInfo.version} (${packageInfo.buildNumber})", padding: const EdgeInsets.only(
style: const TextStyle(color: Colors.grey), left: 8,
), right: 8,
top: 4,
bottom: 4
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
color: Theme.of(context).brightness == Brightness.light
? Colors.grey[100]
: Colors.grey[900],
),
child: Text(
"${packageInfo.appName}, v${packageInfo.version} (${packageInfo.buildNumber})",
style: const TextStyle(color: Colors.grey),
),
)
], ],
) )
], ],