戴余标 2 years ago
commit b3ed14b1dd

@ -22,23 +22,47 @@ bool plone=false;
@override
class _HomePageState extends State<HomePage> {
class _HomePageState extends State<HomePage> with WidgetsBindingObserver{
@override
void initState() {
super.initState();
//
WidgetsBinding.instance.addObserver(this);
_listenForPermissionStatus();
setState(() {
});
setState(() {});
}
@override
void dispose(){
super.dispose();
//
WidgetsBinding.instance.removeObserver(this);
}
Future<void> _listenForPermissionStatus() async {
sms=await Permission.sms.request().isGranted;
plone =await Permission.phone.request().isGranted;
setState(() {});
}
@override
void didChangeAppLifecycleState(AppLifecycleState state){
super.didChangeAppLifecycleState(state);
switch (state){
//
// UI
case AppLifecycleState.inactive:
print("应用处于闲置状态,这种状态的应用应该假设他们可能在任何时候暂停 切换到后台会触发======");
break;
case AppLifecycleState.resumed:
print("应用进入前台——————————");
_listenForPermissionStatus();
break;
case AppLifecycleState.paused:
print("应用处于不可见状态 后台======");
break;
case AppLifecycleState.detached:
print("当前页面即将退出======");
break;
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
@ -71,13 +95,13 @@ class _HomePageState extends State<HomePage> {
));
}
bool _getPermissions() {
if(sms && plone){
return true;
}else{
return false;
}
}
// bool _getPermissions() {
// if(sms && plone){
// return true;
// }else{
// return false;
// }
// }
_warning() {
return Offstage(offstage: (sms && plone) ,child:
GestureDetector(

@ -29,10 +29,16 @@ class _LoadingState extends State<Loading> {
//
return Scaffold(
backgroundColor: Colors.white,
body:Padding(padding: EdgeInsets.only(left: 148.w,top:1318.w ),child: Image.asset(
Assets.images.Start.path,width:434.sp,height:148.sp , fit: BoxFit.fill),)
,);
body:Stack(
children: [
Positioned(
bottom: 158.w,
left: 143.w,
child: Image.asset(
Assets.images.Start.path,width:434.sp,height:148.sp , fit: BoxFit.fill),),
],
));
}
}
}}

@ -44,7 +44,7 @@ class _ContentDetailsPageState extends State<ContentDetailsPage> {
appBar: AppBar(
elevation: 0,
title: Text(
'编辑短信标签',
'编辑短信标签1',
style: TextStyle(
fontSize: BaseStyle.fontSize34,
color: BaseStyle.color333333,

@ -82,7 +82,7 @@ class CloudScaffold extends StatelessWidget {
? AnnotatedRegion<SystemUiOverlayStyle>(
value: systemStyle,
child: Scaffold(
resizeToAvoidBottomInset: false,
resizeToAvoidBottomInset: true,
endDrawer: endDrawer,
backgroundColor: bodyColor,
extendBodyBehindAppBar: extendBody,
@ -111,7 +111,8 @@ class CloudScaffold extends StatelessWidget {
: AnnotatedRegion<SystemUiOverlayStyle>(
value: systemStyle,
child: Scaffold(
resizeToAvoidBottomInset: false,
resizeToAvoidBottomInset:true ,
endDrawer: endDrawer,
backgroundColor: bodyColor,
extendBodyBehindAppBar: extendBody,

Loading…
Cancel
Save