Skip to content

Commit

Permalink
Added the infoPanel. Optimized other widgets.
Browse files Browse the repository at this point in the history
  • Loading branch information
MateusPedrosoSilva committed May 18, 2020
1 parent 4517142 commit 5a15818
Show file tree
Hide file tree
Showing 4 changed files with 106 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ This app is a case for study API consuming with Flutter.

Features:
- Show Worldwide data;
- Show Most affected countries

Data get from: [https://corona.lmao.ninja](https://corona.lmao.ninja)
3 changes: 3 additions & 0 deletions lib/homepage.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'dart:convert';

import 'package:covidapp/datasorce.dart';
import 'package:covidapp/panels/infoPanel.dart';
import 'package:covidapp/panels/mosteffectedcontries.dart';
import 'package:covidapp/panels/worldwidepanel.dart';
import 'package:flutter/material.dart';
Expand Down Expand Up @@ -112,6 +113,8 @@ class _HomePageState extends State<HomePage> {
countryData == null
? Container()
: MostAffectedPanel(countryData: countryData),
InfoPanel(),
SizedBox(height: 50),
],
),
),
Expand Down
98 changes: 98 additions & 0 deletions lib/panels/infoPanel.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
import 'package:covidapp/datasorce.dart';
import 'package:flutter/material.dart';

class InfoPanel extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
child: Column(
children: <Widget>[
Container(
padding: EdgeInsets.symmetric(
vertical: 12,
horizontal: 10,
),
margin: EdgeInsets.symmetric(
vertical: 5,
horizontal: 10,
),
color: primaryBlack,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Text(
'FAQS',
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 18,
),
),
Icon(
Icons.arrow_forward,
color: Colors.white,
),
],
),
),
Container(
padding: EdgeInsets.symmetric(
vertical: 12,
horizontal: 10,
),
margin: EdgeInsets.symmetric(
vertical: 5,
horizontal: 10,
),
color: primaryBlack,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Text(
'DONATE',
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 18,
),
),
Icon(
Icons.arrow_forward,
color: Colors.white,
),
],
),
),
Container(
padding: EdgeInsets.symmetric(
vertical: 12,
horizontal: 10,
),
margin: EdgeInsets.symmetric(
vertical: 5,
horizontal: 10,
),
color: primaryBlack,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Text(
'MYTH BUSTERS',
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 18,
),
),
Icon(
Icons.arrow_forward,
color: Colors.white,
),
],
),
),
],
),
);
}
}
7 changes: 4 additions & 3 deletions lib/panels/mosteffectedcontries.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,16 @@ class MostAffectedPanel extends StatelessWidget {
return Container(
child: ListView.builder(
shrinkWrap: true,
itemCount: 6,
itemCount: 5,
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, index) {
return Container(
margin: EdgeInsets.symmetric(horizontal: 10, vertical: 5),
margin: EdgeInsets.symmetric(horizontal: 10, vertical: 10),
child: Row(
children: <Widget>[
Image.network(
countryData[index]['countryInfo']['flag'],
height: 30,
height: 25,
),
SizedBox(width: 10),
Text(
Expand Down

0 comments on commit 5a15818

Please sign in to comment.