无法将图像堆叠在脚手架小部件后面

时间:2020-06-25 08:35:03

标签: flutter flutter-layout

The UI I am trying to Implement我要添加图像背景。我的应用程序具有bottomNavigatorBar属性,并且背景不在那里。只是卡在身体上。我尝试堆叠两个Scafflod,但不起作用

    Stack(children: <Widget>[
      Scaffold(
              body: Image.asset('images/Opacity 80%.png',
        alignment: Alignment.bottomLeft,),
      ),Scaffold(
      extendBodyBehindAppBar: true,
      appBar: PreferredSize(
        preferredSize: Size.fromHeight(70.0),
        child: widget.pagenumber == 2
            ? InfoAppbar()
            : MyAppBar(_appBarlist[widget.pagenumber], controller, controller2),
      ),
      body: _children[widget.pagenumber],
      bottomNavigationBar: FancyBottomNavigation(
        initialSelection: widget.pagenumber,
        onTabChangedListener: onTapped,
        tabs: [
          TabData(
            iconData: Icons.gavel,
            title: 'Law',
          ),
          TabData(
            iconData: Icons.library_books,
            title: 'Handbook',
          ),
          TabData(iconData: Icons.info, title: 'Info'),
        ],
      ),
    ),
    ],);
  }

  void onTapped(int index) {
    setState(() {
      widget.pagenumber = index;
    });
  }}

1 个答案:

答案 0 :(得分:1)

data: Subscription;

you need to unsubscribe it ngOnDestroy method

}

这可能会解决您的问题。切勿使用2个脚手架