diff --git a/lib/main.dart b/lib/main.dart index f0f0af2..ce6eb3b 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -9,6 +9,7 @@ import 'package:permission_handler/permission_handler.dart'; import 'package:provider/provider.dart'; import 'package:workmanager/workmanager.dart'; import 'package:dynamic_color/dynamic_color.dart'; +import 'package:device_info_plus/device_info_plus.dart'; const String currentReleaseTag = 'v0.1.7-beta'; // KEEP THIS IN SYNC WITH GITHUB RELEASES @@ -43,10 +44,12 @@ void bgTaskCallback() { void main() async { WidgetsFlutterBinding.ensureInitialized(); - SystemChrome.setSystemUIOverlayStyle( - const SystemUiOverlayStyle(systemNavigationBarColor: Colors.transparent), - ); - SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge); + if ((await DeviceInfoPlugin().androidInfo).version.sdkInt! >= 29) { + SystemChrome.setSystemUIOverlayStyle( + const SystemUiOverlayStyle(systemNavigationBarColor: Colors.transparent), + ); + SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge); + } Workmanager().initialize( bgTaskCallback, ); diff --git a/pubspec.lock b/pubspec.lock index 075eebf..fd6e1e0 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -92,6 +92,48 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.7.8" + device_info_plus: + dependency: "direct main" + description: + name: device_info_plus + url: "https://pub.dartlang.org" + source: hosted + version: "4.1.2" + device_info_plus_linux: + dependency: transitive + description: + name: device_info_plus_linux + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.0" + device_info_plus_macos: + dependency: transitive + description: + name: device_info_plus_macos + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.0" + device_info_plus_platform_interface: + dependency: transitive + description: + name: device_info_plus_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.0" + device_info_plus_web: + dependency: transitive + description: + name: device_info_plus_web + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.0" + device_info_plus_windows: + dependency: transitive + description: + name: device_info_plus_windows + url: "https://pub.dartlang.org" + source: hosted + version: "4.0.0" dynamic_color: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index c5c9e2d..5f5969f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -50,6 +50,7 @@ dependencies: url_launcher: ^6.1.5 permission_handler: ^10.0.0 fluttertoast: ^8.0.9 + device_info_plus: ^4.1.2 dev_dependencies: