From 18e77e90030a97af1a03f25ec3372da9e59a674c Mon Sep 17 00:00:00 2001 From: Calcitem Date: Tue, 16 Feb 2021 14:39:48 +0800 Subject: [PATCH] flutter: Show mode on about page --- src/ui/flutter/lib/widgets/settings_page.dart | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/ui/flutter/lib/widgets/settings_page.dart b/src/ui/flutter/lib/widgets/settings_page.dart index 97de9fa9..eab92450 100644 --- a/src/ui/flutter/lib/widgets/settings_page.dart +++ b/src/ui/flutter/lib/widgets/settings_page.dart @@ -16,6 +16,7 @@ along with this program. If not, see . */ +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:package_info/package_info.dart'; import 'package:sanmill/common/config.dart'; @@ -367,12 +368,22 @@ class _SettingsPageState extends State { } showAbout() { - // + String mode; + if (kDebugMode) { + mode = "(Debug)"; + } else if (kProfileMode) { + mode = "Profile"; + } else if (kReleaseMode) { + mode = ""; + } else { + mode = "Test"; + } + showDialog( context: context, barrierDismissible: false, builder: (context) => AlertDialog( - title: Text(S.of(context).about + S.of(context).appName, + title: Text(S.of(context).about + S.of(context).appName + " " + mode, style: TextStyle(color: UIColors.primaryColor)), content: Column( mainAxisSize: MainAxisSize.min,