横幅广告重叠的颤振问题

时间:2018-12-24 03:07:39

标签: flutter flutter-layout

我已将以下行添加到我的sacffold中 resizeToAvoidBottomPadding: false, 即使我的横幅广告与主屏幕重叠。

Screen with banner ad

Expected result

return Scaffold(
  resizeToAvoidBottomPadding: false,
  appBar: AppBar(
    title: Text('1st Year Results'),
  ),
  body: Center(
    child: Container(
      margin: new EdgeInsets.all(18.0),
      child: Column(
        children: <Widget>[
          Image.asset('assets/MBAW.png'),
          Container(
            padding: EdgeInsets.all(10.0),
            child: Row(
              mainAxisAlignment: MainAxisAlignment.spaceEvenly,
              children: <Widget>[
                Flexible(
                    child: Container(
                  width: 150.0,
                  margin: EdgeInsets.all(15.0),
                  child: new TextField(
                    keyboardType: TextInputType.number,
                    decoration: const InputDecoration(
                      hintText: 'Enter a roll number',
                      helperText: 'Roll Number',
                    ),
                    onChanged: (v) => setState(() {
                          _rolls = int.tryParse(v);
                        }),
                  ),
                )),
                new RaisedButton(
                    key: null,
                    padding: EdgeInsets.all(10.0),
                    onPressed: buttonPressed,
                    color: Colors.black26,
                    child: new Text(
                      "Request",
                      style: new TextStyle(
                        fontSize: 18.0,
                        color: Colors.white,
                        fontWeight: FontWeight.bold,
                      ),
                    )),
              ],
            ),
          ),
          Expanded(
            child: createList(_allNumbs),
          ),
          Divider(),
          (_allNumbs == null || _allNumbs.length <= 0)
              ? Container()
              : SizedBox(
            width: 400,
            height: 50.0,
            child: Row(
              crossAxisAlignment: CrossAxisAlignment.center,
              mainAxisAlignment: MainAxisAlignment.spaceEvenly,
              children: <Widget>[
                new InkWell(
                  child: new Text(
                    'Clear',
                    style: TextStyle(
                        fontWeight: FontWeight.bold,
                        fontSize: 25,
                        color: Colors.blue),
                  ),
                  onTap: () {
                    setState(() {
                      _allNumbs = null;
                    });
                  },
                ),
                VerticalDivider(),
                new InkWell(
                    child: Text(
                      "Share",
                      style: TextStyle(
                          fontWeight: FontWeight.bold,
                          fontSize: 25,
                          color: Colors.blue),
                    ),
                    onTap: () {
                      if (_allNumbs != null) {
                        final RenderBox box =
                        context.findRenderObject();
                        var shareMe = _createSharableText();
                        Share.share(shareMe,
                            sharePositionOrigin:
                            box.localToGlobal(Offset.zero) &
                            box.size);
                      }
                    }),
              ],
            ),
          ),
        ],
      ),
    ),
  ),
);

1 个答案:

答案 0 :(得分:1)

有很多解决方法。您可能要尝试使用此trick。您还可以从此post阅读一些答案。

相关问题