Flutter应用程序未显示状态栏(PFA)。我不想全屏查看我的应用程序。有没有办法解决这个问题。
main.dart
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: '',
theme: ThemeData(
primarySwatch: Colors.purple,
fontFamily: 'FIRSNEUE'
),
home: SplashScreenFirst(),
routes: <String, WidgetBuilder> {
'/dashboard': (BuildContext context) => Dashboard(title: ''),
'/login': (BuildContext context) => Login(),
'/service-dashboard': (BuildContext context) => Service(),
'/service-exists': (BuildContext context) => ServiceExists(),
'/partnerOffers' : (BuildContext context) => Partner(),
'/visitorRequest' : (BuildContext context) => VisitorRequest(),
'/vistorRequestSuccess' : (BuildContext context) => VisitorRequestSuccess(),
'/mealPlan' : (BuildContext context) => MealPlan()
},
);
}
}
login.dart
return Scaffold(
key: _scaffoldKey,
body: ListView(
shrinkWrap: true,
padding: EdgeInsets.all(15.0),
children: <Widget>[
Center(
child: Container(
child: Column(
children: <Widget>[
Container(
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
width: double.infinity,
height: 720,
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
SizedBox(height: 65.0),
SizedBox(
height: 43.0,
width: 136,
child: Image.asset(
"images/logo.png",
fit: BoxFit.cover,
),
),
SizedBox(height: 45.0),
Text(
'Please login to continue',
style: TextStyle(
color: Color(0xffB13F8F),
fontSize: 16,
letterSpacing: 0.15),
),
SizedBox(height: 145.0),
emailField,
_error
? _phoneController.text.length > 0
? (SizedBox(
height: 1,
))
: Container(
padding: EdgeInsets.only(top: 20),
child: Text(
'Something went wrong. Please try again',
style: TextStyle(
color: Colors.redAccent,
fontSize: 16),
),
)
: (SizedBox(
height: 1,
)),
SizedBox(
height: 104.0,
),
_isLoading
? Center(child: CircularProgressIndicator())
: _isDisabled
? loginButtonDisabled
: loginButon,
SizedBox(
height: 15.0,
),
],
))
],
),
),
),
]));
}
5条答案
按热度按时间iaqfqrcu1#
请检查在创建flutter项目时创建的两个文件并注解掉或删除。
kiayqfof2#
**对于IOS:**请检查创建flutter项目时创建的两个文件,并将值从false更新为true。
./ios/Runner/Info.plist
yuvru6vn3#
只需使用SafeArea小部件包裹您的scaffold,您的顶部边缘不会接触状态栏
niwlg2el4#
只在android中添加两行-> app -> src -> main -> res -> values -> styles.xml
db2dz4w85#
我不知道你说的状态栏是不是指应用程序栏。如果你不使用
Scaffold
作为你的主部件,这可能就不存在了。将所有代码封装在: