I am coming from Java and designing my first Flutter application.
The functionality is okay, but I am having an issue with the layout: When you touch the screen and scroll it down, the top margin can be pulled down to well below the half of the screen, what looks kind of odd.
Can the scroll margin size be adjusted?
Below is my code:
class RegisterForm extends StatelessWidget {
@override
Widget build(BuildContext context) {
return CupertinoApp(
home: MyHomePage(),
);
}
}
class MyHomePage extends StatefulWidget {
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Form(
key: _formKey,
child: ListView(
children: [
SizedBox(height: 5),
// Title text
Container(
... ),
SizedBox(height: 5),
// Segmented Control
Container(
child: CupertinoSegmentedControl(
children: {
'a': Container(
....
),
'b': Container(
.....
),
},
onValueChanged: (value) {
setState(() {
......
});
},
),
),
SizedBox(height: 15),
// Name
Container(
....
),
Container(
.....
),
Container(
....
),
Container(
....
),
// Submit buttton
Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
buttonAddData(),
],
),
padding: EdgeInsets.fromLTRB(25, 15, 40, 100),
),
],
),
),
);
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…