Skip to content

Instantly share code, notes, and snippets.

View RafaelBarbosatec's full-sized avatar

Rafael Almeida Barbosa RafaelBarbosatec

View GitHub Profile
class NoticeList extends StatefulWidget{
final state = new _NoticeListPageState();
@override
_NoticeListPageState createState() => state;
}
class _NoticeListPageState extends State<NoticeList>{
[
{
"id":"23658",
"tittle":"Tite recebe convocados nesta segunda e tem 27 dias de preparação para estreia",
"description":"As ausências certas são de Casemiro e Marcelo, do Real Madrid, e Roberto Firmino, do Liverpool, que disputarão a final da Liga dos Campeões",
"url_img":"http://104.131.18.84/notice/uploads/news/1fd055d2a109fe18af4414bf87293575.jpg",
"link":"https://www.otempo.com.br/superfc/tite-recebe-convocados-nesta-segunda-e-tem-27-dias-de-prepara%C3%A7%C3%A3o-para-estreia-1.1789078",
"origin":"Otempo.com.br",
"category":"sports",
"date":"2018-05-21 11:37:50"
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) {
import 'dart:async';
import 'dart:convert';
class NewsApi{
Future <List> loadNews() async{
String json = "[ \n" +
" { \n" +
class NoticeList extends StatefulWidget{
final state = new _NoticeListPageState();
@override
_NoticeListPageState createState() => state;
}
class _NoticeListPageState extends State<NoticeList>{
new Material(
borderRadius: new BorderRadius.circular(6.0),
elevation: 2.0,
child: new Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
//Adicionamos aqui FadeInImage que é uma variande do widget Image. Ela nos possibilita carregar image de uma URL
new FadeInImage.assetNetwork(
placeholder: '',
image: _img,
class Notice extends StatelessWidget{
var _img;
var _title;
var _date;
var _description;
Notice(this._img,this._title,this._date,this._description);
BuildContext _context;
import 'package:flutter/material.dart';
import 'Notice.dart';
import 'NewsApi.dart';
class NoticeList extends StatefulWidget{
final state = new _NoticeListPageState();
@override
_NoticeListPageState createState() => state;
Widget _getBottomNavigationBa() {
return new BottomNavigationBar(
onTap: onTabTapped, // new
currentIndex: _currentIndex, // new
items: [
new BottomNavigationBarItem(
icon: const Icon(Icons.home),
title: Text('Recentes'),
backgroundColor: Colors.blue
void onTabTapped(int index) {
setState(() {
_currentIndex = index;
});
}