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
Widget _getListCategory(){ | |
ListView listCategory = new ListView.builder( | |
itemCount: _categorys.length, | |
scrollDirection: Axis.horizontal, | |
itemBuilder: (context, index){ | |
return _buildCategoryItem(index); | |
} | |
); |
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
Navigator.push( | |
context, | |
MaterialPageRoute(builder: (context) => Screen1()), | |
); |
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
Navigator.of(context).pushNamed('/screen1'); |
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
return new MaterialApp( | |
title: 'Flutter News', | |
theme: new ThemeData( | |
primarySwatch: Colors.blue, | |
), | |
home: new NoticeList(), | |
routes: <String, WidgetBuilder> { | |
'/screen1': (BuildContext context) => new Screen1(), | |
'/screen2' : (BuildContext context) => new Screen2() | |
}, |
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 'dart:async'; | |
import 'dart:convert'; | |
import 'package:http/http.dart' as http; | |
class NewsApi{ | |
String url = "https://raw.githubusercontent.com/RafaelBarbosatec/tutorial_flutter_medium/master/api/news.json"; | |
Future <List> loadNews() async{ | |
// Make a HTTP GET request to the CoinMarketCap API. |
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 'Notice.dart'; | |
import 'NewsApi.dart'; | |
class NoticeList extends StatefulWidget{ | |
final state = new _NoticeListPageState(); | |
@override | |
_NoticeListPageState createState() => state; |