1

你好我的页面代码是这样的。我需要滚动应用栏下方的部分。

_sheetController =
    _scaffoldKey.currentState.showBottomSheet<void>((BuildContext context) {
  return
  DecoratedBox(
    decoration: BoxDecoration(color: Theme.of(context).canvasColor),
    child: ClipRRect(
      borderRadius: BorderRadius.only(
          topLeft: Radius.circular(40.0), topRight: Radius.circular(40.0)),
      child:

      Container(
        child:
        ListView(
          children: <Widget>[
            Container(
              child: Stack(
                children: <Widget>[
                  Positioned(
                    left: 10,
                    top: 10,
                    child: IconButton(
                      onPressed: () {
                        _loading = false;
                        Navigator.of(context).pop();
                      },
                      icon: Icon(
                        Icons.close,
                        size: 30.0,
                        color: Theme.of(context).primaryColor,
                      ),
                    ),
                  )
                ],
              ),
              height: 50,
              width: 50,
            ),
                Form(
              key: _formKey,
              autovalidate: _autoValidate,
              child:SingleChildScrollView(child:

              Column(
                children: <Widget>[
                  Container(
                    width: MediaQuery.of(context).size.width,
                    height: 140,
                    child: Stack(
                      children: <Widget>[
                        Positioned(
                          child: Align(
                            child: Container(
                              width: 130,
                              height: 130,
                              decoration: BoxDecoration(
                                  shape: BoxShape.circle,
                                  color: Theme.of(context).primaryColor),
                            ),
                            alignment: Alignment.center,
                          ),
                        ),
                        Positioned(
                          child: Container(
                            child: AutoSizeText(
                              "LOGIN",
                              maxLines: 1,
                              minFontSize: 
                              MediaQuery.of(context).size.width/10.0,
                              maxFontSize: 
                              MediaQuery.of(context).size.width/5.0,

                              style: TextStyle(
                                fontWeight: FontWeight.bold,
                                color: Colors.white,
                              ),
                            ),
                            alignment: Alignment.center,

                          ),
                        ),
                      ],
                    ),
                  ),
                  Padding(
                      padding: EdgeInsets.only(bottom: 20, top: 60),
                      child: CustomTextField(
                        onSaved: (input) {
                          _Email = input;

                        },
                        keyboardType: TextInputType.emailAddress,
                        validator: emailValidator,
                        icon: Icon(Icons.email),
                        hint: "EMAIL",
                      )),
                  CustomTextField(
                    icon: Icon(Icons.lock),
                    obsecure: true,
                    onSaved: (input) => _Password = input,
                    validator: (input) =>
                        input.isEmpty ? "*Required" : null,
                    hint: "PASSWORD",
                  ),
                  Padding(
                    padding: EdgeInsets.only(right:  
                    MediaQuery.of(context).size.width/1.96),
                    child: Container(
                      width: MediaQuery.of(context).size.width/2.310160428,
                        height: 40.0,
                        child:
                        FlatButton(
                        onPressed: resetSheet,
                        child: AutoSizeText("FORGOT PASWORD !" ,maxFontSize: 
                        20.0,minFontSize: 10.0,maxLines: 1,),
                      ),

                    )
                  ),
                  SizedBox(
                    height: 10,
                  ),
                  Padding(
                    padding: EdgeInsets.only(
                        left: 20,
                        right: 20,
                        bottom: MediaQuery.of(context).viewInsets.bottom),
                    child: _loading == true
                        ? CircularProgressIndicator(
                            valueColor: new AlwaysStoppedAnimation<Color>(
                                Theme.of(context).primaryColor),
                          )
                        : Container(
                            child: filledButton(
                                "LOGIN",
                                Colors.white,
                                Theme.of(context).primaryColor,
                                Theme.of(context).primaryColor,
                                Colors.white,
                                _validateLoginInput),
                            height: 50,
                            width: MediaQuery.of(context).size.width,
                          ),
                  ),
                  SizedBox(
                    height: 20,
                  ),
                ],
              ),
             ),
            ),
          ],
        ),

        height: MediaQuery.of(context).size.height / 1.1,
        width: MediaQuery.of(context).size.width,
        color: Colors.white,
      ),



      ),
      );

});

我的页面代码是这样的。我需要滚动应用栏下方的部分。

@override
  Widget build(BuildContext context) {
    return new Scaffold(
      appBar: new AppBar(... ),
      body: new Stack(
        children: <Widget>[
          new Container(
            decoration: BoxDecoration(
                image: DecorationImage(...),
          new Column(children: [
            new Container(...),
            new Container(...... ),
            new Padding(
              child: SizedBox(
                child: RaisedButton(..),
            ),
            new Divider(),
            new Column(
              children: <Widget>[
                new Container(
                  child: new Row(
                    children: <Widget>[
                      new Expanded(
                        child: new Text(  ),
                      ),
                      new IconButton(
                        icon: IconButton(..),
                        onPressed: () {
                          _changed(true, "type");
                        },
                      ),
                    ],
                  ),
                ),
                visibilityPropertyType
                    ? new Container(
                        margin: EdgeInsets.all(24.0),
                        child: new Column(
                          children: <Widget>[
                            new Row(
                              children: <Widget>[
                                new Expanded(... ),
                                new RaisedButton(..)
                              ],
                            ),
                            new Padding(
                              padding: const EdgeInsets.only(top: 10.0),
                              child: new Row(
                                mainAxisAlignment:
                                    MainAxisAlignment.spaceEvenly,
                                children: <Widget>[
                                  new Column(
                                    children: <Widget>[
                                      new Row(  
                                        children: <Widget>[.. ]),
                                      new Row(
                                        children: <Widget>[]),
                                      new Row(
                                        children: <Widget>[]),
                                      new Row(
                                        children: <Widget>[],
                                  ),
                                  new Column(
                                    children: <Widget>[
                                      new Row(
                                        children: <Widget>[],
                                      ),
                                    ],
                                  ),
                                ],
                              ),
                            ),
                          ],
                        ))
                    : new Container(),
              ],
            ),
            new Divider(
              color: Colors.white,
            )
          ])
        ],
      ),
    );
  }

我需要使身体部分可滚动。我怎样才能实现那个滚动。

我认为 SingleChildScrollView 必须在这里工作,但我的代码中可能没有问题,我尝试了很多次以查找错误但没有任何帮助?

4

0 回答 0