Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions flutter/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,11 @@
<meta-data android:name="flutterEmbedding"
android:value="2"/>
</application>
<queries>
<intent>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" />
</intent>
</queries>
</manifest>
29 changes: 29 additions & 0 deletions flutter/lib/ui/home/app_drawer.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';

import 'package:package_info_plus/package_info_plus.dart';
import 'package:url_launcher/url_launcher.dart';

import 'package:mlperfbench/app_constants.dart';
Expand Down Expand Up @@ -160,6 +161,34 @@ Widget buildFooter(BuildContext context) {
title: Text(l10n.settingsEula),
onTap: () => launchUrl(Uri.parse(Url.eula)),
),
FutureBuilder<PackageInfo>(
future: PackageInfo.fromPlatform(),
builder: (context, snapshot) {
if (snapshot.connectionState != ConnectionState.done) {
return const SizedBox.shrink();
}
if (!snapshot.hasData) {
return const SizedBox.shrink();
}
final info = snapshot.data!;
final version = info.version;
final build = info.buildNumber;
var versionText = 'v$version';
if (build.isNotEmpty) {
versionText = '$versionText ($build)';
}
return Padding(
padding: const EdgeInsets.all(2.0),
child: Text(
versionText,
style: Theme.of(context).textTheme.bodySmall?.copyWith(
color: AppColors.drawerForeground.withOpacity(0.6),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO it would be best to avoid using non-opaque colors unless necessary. They're much more costly to render than simple 0xFF###### colors.

),
textAlign: TextAlign.center,
),
);
},
),
],
);
}
Expand Down
3 changes: 2 additions & 1 deletion flutter/lib/ui/root/app.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';

import 'package:bot_toast/bot_toast.dart';
import 'package:upgrader/upgrader.dart';

import 'package:mlperfbench/localizations/app_localizations.dart';
import 'package:mlperfbench/ui/app_styles.dart';
Expand Down Expand Up @@ -40,7 +41,7 @@ class MyApp extends StatelessWidget {
),
builder: BotToastInit(),
navigatorObservers: [BotToastNavigatorObserver()],
home: home,
home: UpgradeAlert(child: home),
);
}
}
40 changes: 40 additions & 0 deletions flutter/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.0.3"
csslib:
dependency: transitive
description:
name: csslib
sha256: "09bad715f418841f976c77db72d5398dc1253c21fb9c0c7f0b0b985860b2d58e"
url: "https://pub.dev"
source: hosted
version: "1.0.2"
cupertino_icons:
dependency: "direct main"
description:
Expand Down Expand Up @@ -567,6 +575,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.3.1"
html:
dependency: transitive
description:
name: html
sha256: "6d1264f2dffa1b1101c25a91dff0dc2daee4c18e87cd8538729773c073dbf602"
url: "https://pub.dev"
source: hosted
version: "0.15.6"
http:
dependency: "direct main"
description:
Expand Down Expand Up @@ -740,6 +756,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.0.0"
os_detect:
dependency: transitive
description:
name: os_detect
sha256: e704fb99aa30b2b9a284d87a28eef9ba262f68c25c963d5eb932f54cad07784f
url: "https://pub.dev"
source: hosted
version: "2.0.2"
package_config:
dependency: transitive
description:
Expand Down Expand Up @@ -1177,6 +1201,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.0.0+1"
upgrader:
dependency: "direct main"
description:
name: upgrader
sha256: d45483694620883107c2f5ca1dff7cdd4237b16810337a9c9c234203eb79eb5f
url: "https://pub.dev"
source: hosted
version: "10.3.0"
url_launcher:
dependency: "direct main"
description:
Expand Down Expand Up @@ -1281,6 +1313,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.4"
version:
dependency: transitive
description:
name: version
sha256: "3d4140128e6ea10d83da32fef2fa4003fccbf6852217bb854845802f04191f94"
url: "https://pub.dev"
source: hosted
version: "3.0.2"
vm_service:
dependency: transitive
description:
Expand Down
1 change: 1 addition & 0 deletions flutter/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ dependencies:
firebase_ui_auth: ^1.14.0
firebase_crashlytics: ^3.5.5
firebase_app_check: ^0.2.2+6
upgrader: ^10.3.0

dev_dependencies:
flutter_test:
Expand Down
Loading