当键盘打开时底部导航栏上升

时间:2021-07-02 15:07:44

标签: flutter dart

当我打开键盘时,我的底部导航栏会上升,但我不想让它上升。

you can check it here

我尝试添加 resizeToAvoidBottomInset: false, 但没有成功。

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      resizeToAvoidBottomInset: false,
      body: _fields(),
      bottomNavigationBar: _finalizarButton(context),
    );
  }

  _finalizarButton(context) {
    return Padding(
      padding: const EdgeInsets.only(bottom: 8.0, right: 8, top: 5),
      child: ButtonTheme(
        height: 50,
        child: FractionallySizedBox(
          alignment: FractionalOffset.bottomRight,
          widthFactor: 0.50,
          child: RaisedButton(
            color: orangeSoftwar,
            child: Text(
              "FINALIZAR REQUISIÇÃO",
              style: TextStyle(color: Colors.white, fontSize: 13),
              maxLines: 1,
            ),
            onPressed: () {
              _onClickFinalizarRequisicao();
            },
          ),
        ),
      ),
    );
  }

  _fields() {
    return SingleChildScrollView(
      child: Column(
        children: [
          Padding(
            padding: const EdgeInsets.all(8.0),
            child: Column(
                crossAxisAlignment: CrossAxisAlignment.start,
                children: [
                  _head(),
                  SizedBox(height: 20),
                  _getMaterial(),
                  SizedBox(height: 15),
                  _rows(),
                  SizedBox(height: 15),
                ]),
          ),
        ],
      ),
    );
  }

我要添加 _fields 的其中一个孩子,它们都是一样的。

  _head() {
    return Container(
      child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
        Row(children: [
          LineIcon.building(size: 60, color: orangeSoftwar),
          Expanded(
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                Padding(
                  padding: const EdgeInsets.all(8.0),
                  child: Text(
                    "Obra",
                    style: TextStyle(color: Colors.grey, fontSize: 15),
                  ),
                ),
                Padding(
                  padding:
                      const EdgeInsets.only(bottom: 8.0, left: 8.0, right: 8.0),
                  child: Text(
                    "${widget.obraMaterial.codObra} - ${widget.obraMaterial.nomeObra}",
                    style: TextStyle(fontSize: 15),
                    overflow: TextOverflow.ellipsis,
                  ),
                ),
              ],
            ),
          ),
        ]),
        Padding(
          padding: const EdgeInsets.only(top: 8.0, left: 8.0, right: 8.0),
          child: Text(
            "Busque o Material e informe a quantidade",
            style: TextStyle(
              color: Colors.grey,
              fontSize: 15,
            ),
            textAlign: TextAlign.start,
          ),
        ),
      ]),
    );
  }

0 个答案:

没有答案
相关问题