所以我试图重新创建一个 UI 模板。这是代码。我试图通过调用最近查看()添加另一个水平 GridView,但在重新加载时无法呈现。我不知道渲染这个的方法。我曾尝试使用扩展的小部件和灵活的但都不起作用
return Scaffold(
backgroundColor: Colors.white,
appBar: AppBar(
backgroundColor: Colors.blueGrey[50],
centerTitle: true,
title: Text(
'Engagement Rings',
style: TextStyle(
fontWeight: FontWeight.bold,
),
),
),
resizeToAvoidBottomPadding: false,
body: SingleChildScrollView(
child: Column(
children: <Widget>[
//Padding
new Padding(padding: const EdgeInsets.all(8.0),),
//Horizontal List
picSlides(),
//Padding
SizedBox(height: 10.0),
//Grid View
Container(
height: 100.0,
child: Column(
children: <Widget>[
Align(
alignment: Alignment.topLeft,
child: Text(
'Engagement Rings',
textAlign: TextAlign.left,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 20.0,
),
),
),
Align(
alignment: Alignment.centerLeft,
child: Text(
'bhjbsdbskjksbdknbsdnbbskdbbsdk',
textAlign: TextAlign.left,
), …Run Code Online (Sandbox Code Playgroud) 所以我正在尝试创建这样的布局。我有 2 个水平文本字段,但将其排成一行。但是,重新加载后,不会显示任何文本字段:
然而,通过此代码,重新加载后不会出现以下情况:
Column(
children: <Widget>[
SizedBox(height: 10.0),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
TextField(
decoration: InputDecoration(
labelText: 'Name',
labelStyle: TextStyle(
color: Colors.grey[400]
)
),
),
SizedBox(width: 10.0),
TextField(
decoration: InputDecoration(
labelText: 'Name',
labelStyle: TextStyle(
color: Colors.grey[400]
)
),
),
],
),
SizedBox(height: 10.0),
TextField(
decoration: InputDecoration(
labelText: 'Email/Mobile Number',
labelStyle: TextStyle(
color: Colors.grey[400],
)
),
),
SizedBox(height: 10.0),
TextField(
decoration: InputDecoration(
labelText: 'Password',
labelStyle: TextStyle(
color: Colors.grey[400],
)
),
),
],
)
Run Code Online (Sandbox Code Playgroud) dart android-studio flutter flutter-dependencies flutter-layout