戴余标 2 years ago
commit b3ed14b1dd

@ -22,23 +22,47 @@ 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();
//
WidgetsBinding.instance.addObserver(this);
_listenForPermissionStatus(); _listenForPermissionStatus();
setState(() { setState(() {});
}
}); @override
void dispose(){
super.dispose();
//
WidgetsBinding.instance.removeObserver(this);
} }
Future<void> _listenForPermissionStatus() async { Future<void> _listenForPermissionStatus() async {
sms=await Permission.sms.request().isGranted; sms=await Permission.sms.request().isGranted;
plone =await Permission.phone.request().isGranted; plone =await Permission.phone.request().isGranted;
setState(() {}); 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 @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
@ -71,13 +95,13 @@ class _HomePageState extends State<HomePage> {
)); ));
} }
bool _getPermissions() { // bool _getPermissions() {
if(sms && plone){ // if(sms && plone){
return true; // return true;
}else{ // }else{
return false; // return false;
} // }
} // }
_warning() { _warning() {
return Offstage(offstage: (sms && plone) ,child: return Offstage(offstage: (sms && plone) ,child:
GestureDetector( GestureDetector(

@ -29,10 +29,16 @@ class _LoadingState extends State<Loading> {
// //
return Scaffold( return Scaffold(
backgroundColor: Colors.white, backgroundColor: Colors.white,
body:Padding(padding: EdgeInsets.only(left: 148.w,top:1318.w ),child: Image.asset( body:Stack(
Assets.images.Start.path,width:434.sp,height:148.sp , fit: BoxFit.fill),) 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( appBar: AppBar(
elevation: 0, elevation: 0,
title: Text( title: Text(
'编辑短信标签', '编辑短信标签1',
style: TextStyle( style: TextStyle(
fontSize: BaseStyle.fontSize34, fontSize: BaseStyle.fontSize34,
color: BaseStyle.color333333, color: BaseStyle.color333333,

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

Loading…
Cancel
Save