diff --git a/lib/configs/App.dart b/lib/configs/App.dart index 5fcf814..f41236a 100644 --- a/lib/configs/App.dart +++ b/lib/configs/App.dart @@ -9,7 +9,7 @@ import 'AppTheme.dart'; class App { static BuildContext ctx; static bool isLtr; - static final bool showAds = true; + static bool showAds = true; static init(BuildContext context) { AppDimensions.init(context); diff --git a/lib/main.dart b/lib/main.dart index da440db..ed95b21 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,9 +1,7 @@ import 'package:flutter/material.dart'; -import 'package:flutter/foundation.dart' - show debugDefaultTargetPlatformOverride; import 'package:flutter_uis/Navigator.dart'; -import 'package:flutter_uis/io/io.dart'; +import 'package:flutter_uis/configs/App.dart'; import 'package:hive/hive.dart'; import 'package:hive_flutter/hive_flutter.dart'; @@ -17,13 +15,11 @@ void mainTest(NavigatorObserver observer) { } void _main(NavigatorObserver observer) async { + App.showAds = false; WidgetsFlutterBinding.ensureInitialized(); await Hive.initFlutter(); await Hive.openBox('app'); - if (Platform.isWindows || Platform.isLinux) { - debugDefaultTargetPlatformOverride = TargetPlatform.fuchsia; - } FlutterError.onError = (FlutterErrorDetails err) {}; final List observers = []; diff --git a/lib/screens/UIDetail/UIDetail.dart b/lib/screens/UIDetail/UIDetail.dart index af8b832..cf58267 100644 --- a/lib/screens/UIDetail/UIDetail.dart +++ b/lib/screens/UIDetail/UIDetail.dart @@ -40,6 +40,7 @@ class _Body extends StatelessWidget { @override Widget build(BuildContext context) { final UIItem uiItem = ModalRoute.of(context).settings.arguments; + return WillPopScope( onWillPop: () async { this.onClose(context); diff --git a/lib/screens/UIDetail/widgets/UIDetailContent.dart b/lib/screens/UIDetail/widgets/UIDetailContent.dart index e7bb823..439ceaf 100644 --- a/lib/screens/UIDetail/widgets/UIDetailContent.dart +++ b/lib/screens/UIDetail/widgets/UIDetailContent.dart @@ -51,7 +51,7 @@ class _UIDetailContentState extends State { void openApp(BuildContext context) { final r = Random().nextInt(4); - if (r == 2) { + if (r == 2 && App.showAds) { this.interstitialAd.show(); return; }