new: PlatformType

This commit is contained in:
lollipopkit
2023-03-13 12:02:48 +08:00
parent 4c4153ef98
commit c2e822f49d
18 changed files with 197 additions and 113 deletions

View File

@@ -1,5 +1,3 @@
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_gen/gen_l10n/l10n.dart';
@@ -8,6 +6,7 @@ import 'package:url_launcher/url_launcher.dart';
import '../../view/widget/card_dialog.dart';
import '../persistant_store.dart';
import 'platform.dart';
bool isDarkMode(BuildContext context) =>
Theme.of(context).brightness == Brightness.dark;
@@ -62,7 +61,7 @@ Widget buildSwitch(BuildContext context, StoreProperty<bool> prop,
}
void setTransparentNavigationBar(BuildContext context) {
if (Platform.isAndroid) {
if (isAndroid) {
SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);
SystemChrome.setSystemUIOverlayStyle(const SystemUiOverlayStyle(
systemNavigationBarColor: Colors.transparent,