initialized Application theme

This commit is contained in:
Mohammad Salameh
2024-02-15 14:00:09 +03:00
parent 16f47f744c
commit 3190361901
98 changed files with 871 additions and 1004 deletions

View File

@ -0,0 +1,35 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
class LifecycleEventHandler extends WidgetsBindingObserver {
final AsyncCallback resumeCallBack;
final AsyncCallback suspendingCallBack;
final AsyncCallback onPauseCallBack;
final AsyncCallback inactiveCallBack;
LifecycleEventHandler(
{required this.resumeCallBack,
required this.suspendingCallBack,
required this.onPauseCallBack,
required this.inactiveCallBack});
@override
Future<void> didChangeAppLifecycleState(AppLifecycleState state) async {
switch (state) {
case AppLifecycleState.resumed:
await resumeCallBack();
break;
case AppLifecycleState.inactive:
await inactiveCallBack();
break;
case AppLifecycleState.paused:
await onPauseCallBack();
break;
case AppLifecycleState.detached:
await suspendingCallBack();
break;
case AppLifecycleState.hidden:
// TODO: Handle this case.
}
}
}