|
|
|
@ -22,7 +22,7 @@ bool plone=false;
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
|
|
|
|
|
class _HomePageState extends State<HomePage> {
|
|
|
|
|
class _HomePageState extends State<HomePage> with WidgetsBindingObserver{
|
|
|
|
|
@override
|
|
|
|
|
void initState() {
|
|
|
|
|
super.initState();
|
|
|
|
@ -38,7 +38,23 @@ class _HomePageState extends State<HomePage> {
|
|
|
|
|
plone =await Permission.phone.request().isGranted;
|
|
|
|
|
setState(() {});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void didChangeAppLifecycleState(AppLifecycleState state){
|
|
|
|
|
super.didChangeAppLifecycleState(state);
|
|
|
|
|
switch (state){
|
|
|
|
|
case AppLifecycleState.inactive:
|
|
|
|
|
print("1");
|
|
|
|
|
break;
|
|
|
|
|
case AppLifecycleState.resumed:
|
|
|
|
|
print("2");
|
|
|
|
|
break;
|
|
|
|
|
case AppLifecycleState.paused:
|
|
|
|
|
print("3");
|
|
|
|
|
break;
|
|
|
|
|
case AppLifecycleState.detached:
|
|
|
|
|
print("4");
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return Scaffold(
|
|
|
|
|