简体   繁体   中英

Flutter why do I get an appBar even though i didn't put any appBar command in my scaffold

Is there a way to modify the appbar that I get from pushedName or is there a way that I can remove the appbar? I've been searching for around 2 hours already and I can't find any answer relate of it. Some of question suggest to use the appBar command. Tried it already but for me they give me more appbar now. and they become double after I putting the appbar in my scaffold widget. This is the pic of the app bar now. (I even can't change my icon color in that app bar)

class _seller_profile_screenState extends State<seller_profile_screen> {
  double tp = 0;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Stack(
        children: [
          CustomScrollView(
            physics: const BouncingScrollPhysics(
              parent: AlwaysScrollableScrollPhysics(),
            ),
            slivers: [
              SliverAppBar(
                  pinned: true,
                  stretch: true,
                  expandedHeight: 200,
                  flexibleSpace: LayoutBuilder(builder: (ctx, cons) {
                    tp = cons.biggest.height;
                    return FlexibleSpaceBar(
                      centerTitle: true,
                      background: Stack(
                        fit: StackFit.expand,
                        children: [
                          Image.asset(
                            'assets/images/cloud_background.jpg',
                            fit: BoxFit.cover,
                          ),
                          SafeArea(
                            child: Padding(
                              padding: const EdgeInsets.all(10),
                              child: Column(children: [
                                // 
                              ]),
                            ),
                          )
                        ],
                      ),
                    );
                  })),
            ],
          )
        ],
      ),
    );
  }
}

在此处输入图像描述

This is due to screen hierarchy. There was one screen before this so you get back button by default when you use snackbar. If you want to remove this then do like this:

Scaffold(
 appBar:AppBar(
   ...
   automaticallyImplyLeading: false,
  ),
 body:...);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM