0

我的下拉按钮显示异常大的文本,并且有这个奇怪的双下划线。我之前做了一些谷歌搜索,人们说要确保你的材料是根。我已经进行了此调整,但似乎并没有解决问题。知道可能是什么问题吗?

在此处输入图像描述?

class FormsPage extends StatefulWidget {
  @override
  _FormsPageState createState() => _FormsPageState();
}

class _FormsPageState extends State<FormsPage> {
  WebViewController _controller;
  FormUrls _selectedForm;

  @override
  Widget build(BuildContext context) {
    return Material(
      child: WillPopScope(
        onWillPop: () async => false,
        child: Scaffold(
          appBar: AppBar(
            title: Text("Forms"),
            actions: <Widget>[
              Theme(
                data: Theme.of(context).copyWith(
                  canvasColor: MobileColors.lightBlue,
                ),
                child: _buildDropDown(),
              ),
            ],
          ),
          drawer: AwesomeDrawer(context, "FormsPage"),
          body: _buildWebView(),
        ),
      ),
    );
  }

  _buildDropDown() {
    return DropdownButton<FormUrls>(
      underline: Container(),
      value: _selectedForm,
      hint: Text(
        'Cycle through forms',
        style: TextStyle(color: Colors.white),
      ),
      icon: Icon(
        Icons.arrow_downward,
        color: Colors.white,
      ),
      iconSize: 24,
      elevation: 16,
      style: TextStyle(color: Colors.black),
      onChanged: (newForm) {
        setState(() {
          _selectedForm = newForm;
        });
        setState(() {
          _controller.loadUrl(_selectedForm.formUrl);
        });
      },
      items: Client.formUrls.map<DropdownMenuItem<FormUrls>>((value) {
        return DropdownMenuItem<FormUrls>(
          value: value,
          child: Text(
            value.title,
            style: TextStyle(color: Colors.white),
          ),
        );
      }).toList(),
    );
  }
}
4

0 回答 0