Remove unnecessary visibility detector

This commit is contained in:
vishnukvmd 2021-11-24 12:49:11 +05:30
parent 27510a2b97
commit 67df8e7bde

View file

@ -37,7 +37,6 @@ import 'package:photos/utils/file_uploader.dart';
import 'package:photos/utils/local_settings.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:super_logging/super_logging.dart';
import 'package:visibility_detector/visibility_detector.dart';
final _logger = Logger("main");
@ -264,32 +263,20 @@ class _EnteAppState extends State<EnteApp> with WidgetsBindingObserver {
@override
Widget build(BuildContext context) {
return VisibilityDetector(
key: GlobalKey(),
onVisibilityChanged: (visibility) {
if (visibility.visibleFraction == 1) {
Logger("EnteApp").info("App is in foreground");
AppLifecycleService.instance.onAppInForeground();
} else {
Logger("EnteApp").info("App is in background");
AppLifecycleService.instance.onAppInBackground();
}
},
child: MaterialApp(
title: "ente",
theme: themeData,
home: EnteApp._homeWidget,
debugShowCheckedModeBanner: false,
navigatorKey: Network.instance.getAlice().getNavigatorKey(),
builder: EasyLoading.init(),
supportedLocales: L10n.all,
localizationsDelegates: const [
AppLocalizations.delegate,
GlobalMaterialLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
],
),
return MaterialApp(
title: "ente",
theme: themeData,
home: EnteApp._homeWidget,
debugShowCheckedModeBanner: false,
navigatorKey: Network.instance.getAlice().getNavigatorKey(),
builder: EasyLoading.init(),
supportedLocales: L10n.all,
localizationsDelegates: const [
AppLocalizations.delegate,
GlobalMaterialLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
],
);
}