-
-
Save asavchuk/61021f7f78d5e71af1eba8f7b4a96b8d to your computer and use it in GitHub Desktop.
This file contains hidden or 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'; | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp(title: 'Flutter Demo', home: MyListView()); | |
} | |
} | |
class MyListView extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar( | |
title: const Text('AppBar'), | |
), | |
body: ListView( | |
children: <Widget>[ | |
ListView( | |
physics: const NeverScrollableScrollPhysics(), | |
shrinkWrap: true, | |
children: <Widget>[ | |
ListTile( | |
title: Container( | |
height: 30, | |
color: Colors.black45, | |
child: Row( | |
children: const <Widget>[ | |
Expanded(child: Text('Some header')), | |
], | |
), | |
), | |
), | |
], | |
), | |
RapportList(), | |
], | |
), | |
); | |
} | |
} | |
class RapportList extends StatefulWidget { | |
@override | |
_RapportListState createState() => _RapportListState(); | |
} | |
class _RapportListState extends State<RapportList> { | |
@override | |
Widget build(BuildContext context) { | |
return ListView.separated( | |
physics: const ScrollPhysics(), | |
shrinkWrap: true, | |
itemCount: 100, | |
itemBuilder: (context, index) { | |
return ListTile( | |
title: Row( | |
children: <Widget>[ | |
Expanded(child: Text('$index')), | |
], | |
), | |
); | |
}, | |
separatorBuilder: (context, index) { | |
return const Divider(); | |
}, | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment