Skip to content

Commit

Permalink
Display version number
Browse files Browse the repository at this point in the history
  • Loading branch information
up2code committed Jan 13, 2021
1 parent eb7b602 commit ef560a9
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions lib/src/pages/menu_page.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:package_info/package_info.dart';
import 'package:vocadb_app/pages.dart';
import 'package:vocadb_app/routes.dart';
import 'package:vocadb_app/services.dart';
Expand Down Expand Up @@ -66,10 +67,21 @@ class MenuPage extends StatelessWidget {
title: Text('contact'.tr),
onTap: () => Get.to(ContactUsPage()),
),
ListTile(
leading: Icon(Icons.info),
title: Text('version'.tr),
subtitle: Text('3.1'),
FutureBuilder(
future: PackageInfo.fromPlatform(),
builder: (context, snapshot) {
String versionName = 'Unknown';
if (snapshot.connectionState == ConnectionState.done) {
PackageInfo packageInfo = snapshot.data;
versionName =
'${packageInfo.version}-${packageInfo.buildNumber}';
}
return ListTile(
leading: Icon(Icons.info),
title: Text("version".tr),
subtitle: Text(versionName),
);
},
),
Obx(() => Visibility(
visible: authService.currentUser().id != null,
Expand Down

0 comments on commit ef560a9

Please sign in to comment.