Skip to content

Instantly share code, notes, and snippets.

@diegoveloper
Created July 10, 2018 13:38
Show Gist options
  • Save diegoveloper/d521309b047ef0f1c6f436d3cae7ddb1 to your computer and use it in GitHub Desktop.
Save diegoveloper/d521309b047ef0f1c6f436d3cae7ddb1 to your computer and use it in GitHub Desktop.
@override
Widget build(BuildContext context) {
return Scaffold(
body: NestedScrollView(
headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) {
return <Widget>[
SliverAppBar(
expandedHeight: 200.0,
floating: false,
pinned: true,
flexibleSpace: FlexibleSpaceBar(
centerTitle: true,
title: Text("Collapsing Toolbar",
style: TextStyle(
color: Colors.white,
fontSize: 16.0,
)),
background: Image.network(
"https://images.pexels.com/photos/396547/pexels-photo-396547.jpeg?auto=compress&cs=tinysrgb&h=350",
fit: BoxFit.cover,
)),
),
];
},
body: Center(
child: Text("Sample Text"),
),
),
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment