【问题标题】:Flutter - Scrollable layout (Form with map)Flutter - 可滚动布局(带地图的表单)
【发布时间】:2019-04-17 07:45:33
【问题描述】:

我想用地图创建一个简单的表单。此Layout 需要可滚动以显示地图(灵活 元素,忽略 Google Play 服务提醒)。我尝试使用 SingleChildScrollViewSlivers 但我不明白具体是如何工作的。

 return Scaffold(
            key: scaffoldKey,
            resizeToAvoidBottomPadding: false,
            body: orientation == Orientation.landscape
                ? new Row(children: <Widget>[map])
                : new Column(
                    children: <Widget>[
                      new ListView(
                        padding: EdgeInsets.all(15.0),
                        shrinkWrap: true,
                        children: <Widget>[
                          new SafeArea(child: instalationDropdown),
                          alias,
                          new Divider(color: Colors.transparent),
                          SizedBox(height: 12.0),
                          new Text(
                              DemoLocalizations.of(context).trans('datameter'),
                              textAlign: TextAlign.center,
                              style: TextStyle(
                                  fontSize: 16, fontWeight: FontWeight.bold)),
                          datameter,
                          new Divider(color: Colors.transparent),
                          SizedBox(height: 12.0),
                          new Text(DemoLocalizations.of(context).trans('meter'),
                              textAlign: TextAlign.center,
                              style: TextStyle(
                                  fontSize: 16, fontWeight: FontWeight.bold)),
                          contador,
                          makerDropdown,
                          modeloDropdown,
                          other,
                          new Divider(color: Colors.transparent),
                          next,
                        ],
                      ),
                      map
                    ],
                  ),

所以问题是:¿如何将此布局转换为可滚动的?如果地图是固定元素并且只有表单具有滚动功能,它也很有用。

更新 2

如果我使用 SingleChildScrollView,则返回 blank view

【问题讨论】:

    标签: dictionary flutter scrollable


    【解决方案1】:

    尝试使用 Expand Wiedget 实现地图功能

    【讨论】:

      【解决方案2】:

      Column 包裹在SingleChildScrollView 小部件中。

      SingleChildScrollView (
              child: Column(
                      children: <Widget>[
                               ...
                        ]),
                 )
      

      【讨论】:

        猜你喜欢
        • 2021-06-27
        • 1970-01-01
        • 2013-11-25
        • 2012-10-25
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多