Skip to content

Instantly share code, notes, and snippets.

@RafaelBarbosatec
Last active May 21, 2018 17:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RafaelBarbosatec/1561b90d812e4fa33ad9e9019a8baf55 to your computer and use it in GitHub Desktop.
Save RafaelBarbosatec/1561b90d812e4fa33ad9e9019a8baf55 to your computer and use it in GitHub Desktop.
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;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment