Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class NoticeList extends StatefulWidget{
- final state = new _NoticeListPageState();
- @override
- _NoticeListPageState createState() => state;
- }
- class _NoticeListPageState extends State<NoticeList>{
- List _news = new List();
- var repository = new NewsApi();
- @override
- Widget build(BuildContext context) {
- return new Scaffold(
- appBar: new AppBar(),
- body: new Container(
- child: _getListViewWidget(),
- ),
- );
- }
- Widget _getListViewWidget(){
- var list = new ListView.builder(
- itemCount: _news.length,
- padding: new EdgeInsets.only(top: 5.0),
- itemBuilder: (context, index){
- return _news[index];
- }
- );
- return list;
- }
- }
Add Comment
Please, Sign In to add comment