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 'dart:async'; | |
import 'dart:convert'; | |
class NewsApi{ | |
Future <List> loadNews() async{ | |
String json = "[ \n" + | |
" { \n" + |
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 'widgets/home.dart'; | |
import 'NoticeList.dart' | |
void main() => runApp(new NewsApp()); | |
class NewsApp extends StatelessWidget { | |
// This widget is the root of your application. | |
@override | |
Widget build(BuildContext context) { |