Created
July 31, 2020 07:43
-
-
Save bkhezry/61c6a1f92779f865c6d47d8a49d64a59 to your computer and use it in GitHub Desktop.
Half screen with two listview
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
class _MyHomePageState extends State<MyHomePage> { | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar( | |
title: Text(widget.title), | |
), | |
body: Center( | |
child: Column( | |
mainAxisAlignment: MainAxisAlignment.center, | |
children: <Widget>[ | |
Expanded( | |
child: ListView.separated( | |
itemCount: 100, | |
itemBuilder: (context, index) { | |
return ListTile( | |
title: Text('$index sheep'), | |
); | |
}, | |
separatorBuilder: (context, index) { | |
return Divider(); | |
}, | |
), | |
), | |
Container( | |
width: MediaQuery.of(context).size.width, | |
decoration: BoxDecoration( | |
color: Colors.red.withOpacity(0.5), | |
), | |
child: Padding( | |
padding: EdgeInsets.all(8.0), | |
child: Text( | |
'Separator', | |
style: TextStyle( | |
color: Colors.white, | |
fontWeight: FontWeight.w900, | |
), | |
), | |
), | |
), | |
Expanded( | |
child: ListView.separated( | |
itemCount: 100, | |
itemBuilder: (context, index) { | |
return ListTile( | |
title: Text('$index sheep'), | |
); | |
}, | |
separatorBuilder: (context, index) { | |
return Divider(); | |
}, | |
), | |
), | |
], | |
), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment