Skip to content

Commit

Permalink
UI fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
arafaysaleem committed Jul 6, 2020
1 parent ecb498a commit 55cdcb1
Show file tree
Hide file tree
Showing 11 changed files with 168 additions and 99 deletions.
117 changes: 60 additions & 57 deletions lib/screens/credits_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class CreditsScreen extends StatelessWidget {
color: Colors.black,
),
maxFontSize: 21,
maxLines: 1,
),
),
],
Expand All @@ -71,72 +72,74 @@ class CreditsScreen extends StatelessWidget {
top: 70,
child: Align(
alignment: Alignment.center,
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Image(
width: 180,
height: 180,
image: AssetImage("assets/corona_virus.png"),
),
child: LayoutBuilder(
builder: (ctx,constraint)=>Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Image(
width: constraint.maxHeight*0.31,
height: constraint.maxHeight*0.31,
image: AssetImage("assets/corona_virus.png"),
),

SizedBox(height: 20),
SizedBox(height: 20),

//App Name
AutoSizeText(
"Covid Tracker",
style: TextStyle(
fontSize: 25,
fontFamily: "Montserrat",
fontWeight: FontWeight.w600,
color: Colors.black,
//App Name
AutoSizeText(
"Covid Tracker",
style: TextStyle(
fontSize: 25,
fontFamily: "Montserrat",
fontWeight: FontWeight.w600,
color: Colors.black,
),
maxLines: 1,
maxFontSize: 25,
),
maxLines: 1,
maxFontSize: 25,
),

//Version number
AutoSizeText(
"Version 1.0.0",
style: TextStyle(
fontSize: 18,
letterSpacing: 0.5,
fontFamily: "Montserrat",
fontWeight: FontWeight.w600,
color: Color(0xff009a88),
//Version number
AutoSizeText(
"Version 1.0.0",
style: TextStyle(
fontSize: 18,
letterSpacing: 0.5,
fontFamily: "Montserrat",
fontWeight: FontWeight.w600,
color: Color(0xff009a88),
),
maxFontSize: 18,
maxLines: 1,
),
maxFontSize: 18,
maxLines: 1,
),

SizedBox(height: 10),
SizedBox(height: 10),

//License Button
MaterialButton(
elevation: 10,
onPressed: () {},
child: Container(
decoration: BoxDecoration(
color: Color(0xff009a88),
border: Border.all(color: Color(0xff009a88), width: 2),
borderRadius: BorderRadius.circular(5),
),
padding:
EdgeInsets.symmetric(horizontal: 25, vertical: 8),
child: AutoSizeText(
"License",
style: TextStyle(
fontSize: 18,
fontFamily: "Montserrat",
fontWeight: FontWeight.w600,
color: Colors.white,
//License Button
MaterialButton(
elevation: 10,
onPressed: () {},
child: Container(
decoration: BoxDecoration(
color: Color(0xff009a88),
border: Border.all(color: Color(0xff009a88), width: 2),
borderRadius: BorderRadius.circular(5),
),
padding:
EdgeInsets.symmetric(horizontal: 25, vertical: 8),
child: AutoSizeText(
"License",
style: TextStyle(
fontSize: 18,
fontFamily: "Montserrat",
fontWeight: FontWeight.w600,
color: Colors.white,
),
maxFontSize: 18,
maxLines: 1,
),
maxFontSize: 18,
maxLines: 1,
),
),
)
],
)
],
),
),
),
),
Expand Down
1 change: 1 addition & 0 deletions lib/screens/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class _HomeScreenState extends State<HomeScreen> {
),
minFontSize: 14,
stepGranularity: 2,
maxLines: 1,
),
),
body: HomeCategories(),
Expand Down
44 changes: 26 additions & 18 deletions lib/screens/myths_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -175,31 +175,39 @@ class MythsScreen extends StatelessWidget {
builder: (ctx, constraint) => Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
Image(
image: AssetImage(
"${myths[index]["imgPath"]}"),
height: 100.0,
LimitedBox(
maxHeight: constraint.maxHeight*0.27,
child: Image(
image: AssetImage(
"${myths[index]["imgPath"]}"),
height: 100.0,
),
),
SizedBox(
height: 40,
height: constraint.maxHeight*0.11,
),
AutoSizeText(
"${myths[index]["myth"]}",
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 19,
height: 1.1,
fontFamily: "Montserrat",
color: Colors.black,
fontWeight: FontWeight.w600,
LimitedBox(
maxHeight: constraint.maxHeight*0.17,
child: AutoSizeText(
"${myths[index]["myth"]}",
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 19,
height: 1.1,
fontFamily: "Montserrat",
color: Colors.black,
fontWeight: FontWeight.w600,
),
maxFontSize: 20,
stepGranularity: 2,
maxLines: 3,
),
maxFontSize: 20,
stepGranularity: 2,
),
SizedBox(
height: 13,
),
Expanded(
LimitedBox(
maxHeight: constraint.maxHeight*0.45,
child: AutoSizeText(
"${myths[index]['desc']}",
textAlign: TextAlign.center,
Expand All @@ -212,9 +220,9 @@ class MythsScreen extends StatelessWidget {
),
maxFontSize: 16.5,
stepGranularity: 1.5,
maxLines: 6,
),
),
SizedBox(height: 55),
],
),
),
Expand Down
3 changes: 2 additions & 1 deletion lib/screens/stats_dashboard_screens/global_stat.dart
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ class _GlobalStatScreenState extends State<GlobalStatScreen> {
SizedBox(
width: MediaQuery.of(context).size.width > 360.0
? 55.0
: 40.0,
: MediaQuery.of(context).size.width > 340.0? 40 :30,
),

//Text
Expand All @@ -155,6 +155,7 @@ class _GlobalStatScreenState extends State<GlobalStatScreen> {
fontWeight: FontWeight.w600,
),
maxFontSize: 21,
maxLines: 1,
),
],
),
Expand Down
15 changes: 11 additions & 4 deletions lib/screens/updates_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ class _UpdatesScreenState extends State<UpdatesScreen> {
@override
Widget build(BuildContext context) {
return Scaffold(
resizeToAvoidBottomInset: false,
resizeToAvoidBottomPadding: false,
appBar: AppBar(
title: AutoSizeText(
"Covid-19 Updates",
Expand All @@ -61,6 +63,8 @@ class _UpdatesScreenState extends State<UpdatesScreen> {
),
stepGranularity: 2,
maxFontSize: 20,
minFontSize: 14,
maxLines: 1,
),
leading: IconButton(
onPressed: () => Navigator.of(context).pop(),
Expand Down Expand Up @@ -115,8 +119,8 @@ class _UpdatesScreenState extends State<UpdatesScreen> {
//Sort by
Padding(
padding: MediaQuery.of(context).size.width>360.0? EdgeInsets.only(left: 20):EdgeInsets.only(left: 0),
child: SizedBox(
width: 68,
child: LimitedBox(
maxWidth: 68,
child: AutoSizeText(
"Sort By",
style: TextStyle(
Expand All @@ -128,19 +132,20 @@ class _UpdatesScreenState extends State<UpdatesScreen> {
stepGranularity: 2,
maxFontSize: 18,
maxLines: 1,
textAlign: TextAlign.center,
),
),
),

SizedBox(width: 10),
SizedBox(width: MediaQuery.of(context).size.width > 340.0?10:7),

Expanded(child: const Icon(Icons.filter_list,size: 26,)),

SizedBox(width: 10),

//DropDown
Container(
width: constraint.maxWidth*0.675,
width: constraint.maxWidth*0.63,
padding: const EdgeInsets.only(left: 15, right: 10),
decoration: BoxDecoration(
color: Colors.black,
Expand Down Expand Up @@ -180,6 +185,7 @@ class _UpdatesScreenState extends State<UpdatesScreen> {
),
stepGranularity: 1,
maxFontSize: 17,
maxLines: 1,
),
),
),
Expand All @@ -197,6 +203,7 @@ class _UpdatesScreenState extends State<UpdatesScreen> {
),
stepGranularity: 1,
maxFontSize: 17,
maxLines: 1,
),
),
),
Expand Down
3 changes: 2 additions & 1 deletion lib/widgets/news_widgets/news_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class NewsTile extends StatelessWidget {
article["description"] == null
? "Read More for Details"
: "${article["description"]}",
maxLines: 4,
maxLines: MediaQuery.of(context).size.width > 340.0?4:3,
style: TextStyle(
fontFamily: "Montserrat",
fontSize: 11.8,
Expand All @@ -110,6 +110,7 @@ class NewsTile extends StatelessWidget {
stepGranularity: 0.2,
maxFontSize: 11.8,
minFontSize: 11.8,
overflow: TextOverflow.ellipsis,
),
),
),
Expand Down
Loading

0 comments on commit 55cdcb1

Please sign in to comment.