我正在我的第一个副项目中工作,我对如何根据设备屏幕处理小部件的大小有疑问。
在 iPhone 11 中看起来很棒,但是当我在 Nexus 5 中模拟它时,所有的东西都变得巨大......排版、输入、按钮...... :(
您认为始终拥有漂亮 UI 的最有效方式是什么(在大多数情况下都可以)?
谢谢 !
编辑:这是主页的代码:)
Widget build(BuildContext context) {
return Scaffold(
body: Container(
color: Theme.of(context).backgroundColor,
child: SafeArea(
child: Container(
padding: EdgeInsets.all(30),
child: Flex(
direction: Axis.vertical,
children: <Widget>[
Flexible(
flex: 2,
child: BounceInDown(
from: 10,
child: Container(
alignment: Alignment.topLeft,
child: Container(
child: SvgPicture.asset(
'assets/svg/twiger-face.svg',
color: Theme.of(context).accentColor,
alignment: Alignment.topLeft,
width: 100,
height: 100
)
)
),
),
),
Flexible(
flex: 6,
child: Column(
children: <Widget>[
FadeInDown(
from: 10,
child: _createTitle(AppLocalizations.of(context).translate("home_title"))
),
SizedBox(height: …Run Code Online (Sandbox Code Playgroud) flutter ×1