From 57d3c7f40d5c43d3b64a16e223f6a64b9f8637e7 Mon Sep 17 00:00:00 2001 From: Temitope Ajiboye Date: Tue, 17 Mar 2020 13:21:01 +0100 Subject: [PATCH] Fix RenderFlex overflow --- android/app/src/main/AndroidManifest.xml | 1 + lib/pages/screens/home_screen.dart | 5 ++- lib/pages/widgets/information_title_card.dart | 32 ++++++++++--------- 3 files changed, 20 insertions(+), 18 deletions(-) diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index d000697..8f10d83 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -27,4 +27,5 @@ android:name="flutterEmbedding" android:value="2" /> + diff --git a/lib/pages/screens/home_screen.dart b/lib/pages/screens/home_screen.dart index 7acc431..2ed592a 100644 --- a/lib/pages/screens/home_screen.dart +++ b/lib/pages/screens/home_screen.dart @@ -78,9 +78,8 @@ class _HomeScreenState extends State { currentData.totalRecovered - firstData.totalRecovered, percentChange: calculateGrowthPercentage( currentData.totalRecovered, firstData.totalRecovered), - icon: showGrowthIcon( - currentData.totalRecovered, firstData.totalRecovered), - color: Colors.red, + icon: Icon(Icons.arrow_upward, color: Colors.green,), + color: Colors.green, ), SizedBox(height: hp(3)), GlobalSituationCard( diff --git a/lib/pages/widgets/information_title_card.dart b/lib/pages/widgets/information_title_card.dart index 97d31fe..4e5bb83 100644 --- a/lib/pages/widgets/information_title_card.dart +++ b/lib/pages/widgets/information_title_card.dart @@ -34,21 +34,23 @@ class InformationTitleCard extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center, children: [ - Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Icon(icon, size: 50, color: iconColor,), - SizedBox(width: wp(5)), - Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text(title, style: AppTheme.h2Style.copyWith(color: LightColor.darkgrey, fontWeight: FontWeight.bold, fontSize: 16)), - SizedBox(height: hp(1)), - Text(subTitle, style: AppTheme.h2Style.copyWith(color: LightColor.darkgrey.withOpacity(0.5), fontSize: 16)) - ], - ) - ] + Expanded( + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Icon(icon, size: 50, color: iconColor,), + SizedBox(width: wp(5)), + Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(title, style: AppTheme.h2Style.copyWith(color: LightColor.darkgrey, fontWeight: FontWeight.bold, fontSize: 16)), + SizedBox(height: hp(1)), + Text(subTitle, style: AppTheme.h2Style.copyWith(color: LightColor.darkgrey.withOpacity(0.5), fontSize: 16)) + ], + ) + ] + ), ) ] ),