drawer: Only show feedback menu item when platform is Android or iOS

Because flutter_email_sender v5.0.2 is only support Android and iOS.
This commit is contained in:
Calcitem 2021-11-13 11:53:17 +08:00
parent de9620a55c
commit d0507f6dbc
2 changed files with 10 additions and 11 deletions

View File

@ -59,7 +59,7 @@ class AboutPage extends StatelessWidget {
if (!data.hasData) {
_version = '';
} else {
final packageInfo = data.data!;
final PackageInfo packageInfo = data.data!;
if (Platform.isWindows) {
_version = packageInfo.version; // TODO
@ -139,9 +139,7 @@ class AboutPage extends StatelessWidget {
Future<void> _launchFeedback() async {
String? locale = "en_US";
if (!Platform.isWindows) {
locale = await Devicelocale.currentLocale;
}
locale = await Devicelocale.currentLocale;
debugPrint("$_tag local = $locale");
if (locale != null && locale.startsWith("zh_")) {

View File

@ -173,13 +173,14 @@ class _HomeState extends State<Home> with TickerProviderStateMixin {
groupValue: _drawerIndex,
onChanged: _changeIndex,
),
CustomDrawerItem<_DrawerIndex>(
value: _DrawerIndex.feedback,
title: S.of(context).feedback,
icon: const Icon(FluentIcons.chat_warning_24_regular),
groupValue: _drawerIndex,
onChanged: _changeIndex,
),
if (Platform.isAndroid || Platform.isIOS)
CustomDrawerItem<_DrawerIndex>(
value: _DrawerIndex.feedback,
title: S.of(context).feedback,
icon: const Icon(FluentIcons.chat_warning_24_regular),
groupValue: _drawerIndex,
onChanged: _changeIndex,
),
CustomDrawerItem<_DrawerIndex>(
value: _DrawerIndex.Help,
title: S.of(context).help,