Last active
January 9, 2020 23:04
-
-
Save eseidelGoogle/f1f3e7a4317d098be0279da3abef33e4 to your computer and use it in GitHub Desktop.
gist for flutter/flutter#34354
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:flutter/rendering.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
title: 'Flutter Demo', | |
theme: ThemeData( | |
primarySwatch: Colors.blue, | |
), | |
home: MyHomePage() | |
); | |
} | |
} | |
class MyHomePage extends StatelessWidget { | |
MyHomePage({Key key, this.title}) : super(key: key); | |
final String title; | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
body: Stack( | |
children: <Widget>[ | |
ListView( | |
children: <Widget>[ | |
Container( | |
height: 4000, | |
decoration: BoxDecoration( | |
gradient: LinearGradient( | |
colors: [const Color (0xFF8E78FF) , const Color (0xFFBA7AC9), const Color (0xFF9D79ED), const Color (0xFFE97C91)], | |
begin: Alignment.topCenter, | |
end: Alignment(1,0), | |
stops: [1,0.3,0.7,0], | |
) | |
), | |
), | |
], | |
), | |
CustomScrollView( | |
slivers: <Widget>[ | |
SliverAppBar( | |
expandedHeight: 400, | |
floating: true, | |
centerTitle: true, | |
title: Text("lasagna"), | |
elevation: 0, | |
forceElevated: true, | |
backgroundColor: Colors.transparent, | |
), | |
SliverList( | |
delegate: SliverChildListDelegate( | |
[ | |
Material( | |
elevation: 4, | |
color: Colors.transparent, | |
child: Container( | |
height: 900, | |
color:Colors.white12, | |
), | |
), | |
Container( | |
height: 1000, | |
color:Colors.transparent | |
) | |
] | |
), | |
) | |
], | |
) | |
], | |
) | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment