Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.5k views
in Technique[技术] by (71.8m points)

Flutter top and bottom scroll margins too big

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),
            ),
          ],
        ),
      ),
    );
  }

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...