Skip to content

Instantly share code, notes, and snippets.

@littleironical
Last active December 2, 2020 09:31
Show Gist options
  • Save littleironical/a41c17327ab1bcd0ffd0b359462788b6 to your computer and use it in GitHub Desktop.
Save littleironical/a41c17327ab1bcd0ffd0b359462788b6 to your computer and use it in GitHub Desktop.
// TYPE1: This will show a provided color when pinned
flexibleSpace: FlexibleSpaceBar(
background: Image.network("https://wallpaperseven.com/wallpapers/Grey-Abstract-4k-Wallpaper-scaled.jpg", fit: BoxFit.cover,),
)
//TYPE2: This will show background image when pinned
flexibleSpace: Stack(
children: <Widget>[
Positioned.fill(
child: Image.network(
"https://wallpaperseven.com/wallpapers/Grey-Abstract-4k-Wallpaper-scaled.jpg",
fit: BoxFit.cover,
)
)
],
),
//TYPE3: This will hide the content of flexibleSpace when pinned
flexibleSpace: FlexibleSpaceBar(
background: Stack(
children: <Widget>[
Positioned.fill(
child: Image.asset(
"assets/banner.jpg",
fit: BoxFit.cover,
)
),
],
),
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment