1

我刚刚在 GooglePlay 上发布了我的 Flutter 应用程序的测试版。它在我的设备中运行良好,但在其他设备中我遇到了一些问题,我不知道为什么......我从来没有从我的代码中调用 tabLabel(),但我创建了一个 TabBar。

这是错误的屏幕截图: 实际的

应该是这样的: 期望的

导致错误的代码是:其中 Language 是 LocalizationsDelegate 类

@override
  Widget build(BuildContext context) {
    return DefaultTabController(
      length: 3,
      child: new Scaffold(
        appBar: new AppBar(
          bottom: new TabBar(
            tabs: [
              new Tab(icon: new Icon(Icons.notifications)),
              new Tab(icon: new Icon(Icons.account_balance)),
              new Tab(icon: new Icon(Icons.dashboard)),
            ],
          ),
          title: new Text(Language.of(context).comune),
          actions: <Widget>[
            new IconButton(
              icon: new Icon(Icons.info_outline, color: Colors.white),
              onPressed: () {
                Navigator.of(context).push(
                  new MaterialPageRoute(
                    builder: (context) {
                      return new Scaffold(
                          appBar: new AppBar(
                            title: new Text("Info"),
                          ),
                          body: Stack(fit: StackFit.expand, children: <Widget>[
                            Column(
                              mainAxisAlignment: MainAxisAlignment.start,
                              children: <Widget>[
                                Expanded(
                                  flex: 2,
                                  child: Container(
                                    child: Column(
                                      mainAxisAlignment:MainAxisAlignment.center,
                                      children: <Widget>[
                                        new Image.asset("images/iobii.png",
                                            height: 100.0, width: 400.0),
                                        new Row(
                                            crossAxisAlignment: CrossAxisAlignment.center,mainAxisSize: MainAxisSize.max,
                                            mainAxisAlignment: MainAxisAlignment.center,
                                            children: <Widget>[new Image.asset("images/comune.png",
                                            height: 100.0, width: 100.0),
                                        new Image.asset("images/indara.png",height: 100.0,width: 100.0,)]),
                                        Padding(
                                          padding: EdgeInsets.only(top: 10.0),
                                        ),
                                        Text(
                                          "App Sviluppata da iobii.com per il comune di " +
                                              Language.of(context).comune+", in collaborazione con l'Associazione Indàra.",
                                          textAlign: TextAlign.center,
                                          style: TextStyle(
                                              color: Colors.black,
                                              fontWeight: FontWeight.normal,
                                              fontStyle: FontStyle.italic,
                                              fontSize: 20.0),
                                        )
                                      ],
                                    ),
                                  ),
                                ),
                              ],
                            )
                          ]));
                    },
                  ),
                );
              },
            ),
          ],
        ),
        body: new TabBarView(
          children: [
            new PostView(cookie: widget.cookie),
            new monumentaView(cookie: widget.cookie),
            new ServicesView(cookie: widget.cookie),
          ],
        ),
      ),
    );
4

0 回答 0