|
|
@ -22,7 +22,7 @@ bool plone=false;
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
|
|
|
|
|
|
|
|
class _HomePageState extends State<HomePage> {
|
|
|
|
class _HomePageState extends State<HomePage> with WidgetsBindingObserver{
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
void initState() {
|
|
|
|
super.initState();
|
|
|
|
super.initState();
|
|
|
@ -38,7 +38,23 @@ class _HomePageState extends State<HomePage> {
|
|
|
|
plone =await Permission.phone.request().isGranted;
|
|
|
|
plone =await Permission.phone.request().isGranted;
|
|
|
|
setState(() {});
|
|
|
|
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
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Scaffold(
|
|
|
|
return Scaffold(
|
|
|
|