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

后端 未结 9 1453
滥情空心
滥情空心 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:13

    None of these seem to work for me, mine went something like this:

    return Scaffold(
      extendBodyBehindAppBar: true,
      appBar: AppBar(
        backgroundColor: Colors.transparent,
        iconTheme: IconThemeData(color: Colors.white),
        elevation: 0.0,
        brightness: Brightness.dark,
      ),
      body: Stack(
        children: [
          Container(
            decoration: BoxDecoration(
              image: DecorationImage(
                image: NetworkImage(
                    'https://images.unsplash.com/photo-1517030330234-94c4fb948ebc?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1275&q=80'),
                fit: BoxFit.cover,
              ),
            ),
            child: Padding(
              padding: const EdgeInsets.fromLTRB(0, 100, 0, 0),
              child:
              // Column of widgets here...
            ),
           ),
         ],
       ),
     );
    

提交回复
热议问题