[英]Flutter padding issues on Android devices
我的Flutter应用程序中有以下小部件,该小部件非常基本,但是由于某些原因,该填充在某些附有屏幕截图和代码的Android设备上不起作用。
码:
Widget build(BuildContext context) {
return Scaffold(
appBar: new AppBar(
centerTitle: true,
title: Column(children: [
Text(
'register',
style: new TextStyle(
fontSize: 24.0,
color: Colors.white,
),
),
Text(
'Availability results',
style: new TextStyle(
fontSize: 18.0,
color: Colors.white,
),
),
]),
),
body: ListView(
children: <Widget>[
Column(
children: <Widget>[
Padding(
padding: EdgeInsets.only(top: 12.0, bottom: 6.0),
child: Text(
'Showing results for',
style: Theme.of(context).textTheme.headline,
),
),
Padding(
padding: EdgeInsets.only(bottom: 12.0),
child: Text(
'"${_availabilityRespose.query}"',
style: Theme.of(context).textTheme.title,
),
),
基本上是列表视图中的填充
而不是使用静态值,您应该将动态值与
MediaQuery.of(context).size.width
MediaQuery.of(context).size.height
这可能会解决您的问题,但这不是一个好的解决方案。 尝试与Flex一起使用Expanded
Expanded(flex: 1, child: yourChild())
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.