Make AppBar transparent and show background image which is set to whole screen

后端 未结 9 1457
滥情空心
滥情空心 2020-12-28 12:42

I have added AppBar in my flutter application. My screen already have a background image, where i don\'t want to set appBar color or don\'t want set separat

9条回答
  •  感动是毒
    2020-12-28 13:21

    use stack

    • set background image
      • Another Scaffold()
        • set background color transperant
        • set custom appbar
        • use column with singleChildScrollView or ListView

    @override   Widget build(BuildContext context) {
            return Scaffold(
              body: Stack(
                children: [
                  backgroundBGContainer(),
                  Scaffold(
                    backgroundColor: Colors.transparent,
                    appBar: appBarWidgetCustomTitle(context: context, titleParam: ""),
                    body: SingleChildScrollView(
                      child: Column(
                        children: [
                          _spaceWdgt(),
                          Center(
                            child: Stack(
                              children: [
                                new Image.asset(
                                  "assets/images/user_icon.png",
                                  width: 117,
                                  height: 97,
                                ),
                              ],
                            ),
                          ),
    
    
    
    
      Widget backgroundBGContainer() {
          return Container(
            decoration: new BoxDecoration(
                image: new DecorationImage(
                  image: new AssetImage("assets/images/ground_bg_image.png"),
                  fit: BoxFit.cover,
                ),
                color: MyColor().groundBackColor),
          );
        }
    

提交回复
热议问题