From df3eee1b0622da99a0f97e6e5c3aa64e7e54a31c Mon Sep 17 00:00:00 2001 From: Monica Abreu Date: Mon, 22 Mar 2021 08:57:52 +0000 Subject: [PATCH 01/12] chore: fix logger dependency --- pubspec.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pubspec.yaml b/pubspec.yaml index 3e9a109..edeb897 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -9,7 +9,6 @@ environment: sdk: ">=2.7.0 <3.0.0" dependencies: - logger: ^0.9.4 flutter: sdk: flutter cupertino_icons: ^1.0.0 @@ -17,11 +16,11 @@ dependencies: intl: ^0.16.1 provider: ^4.3.3 location: ^3.0.0 + logger: ^0.9.4 supercharged: ^1.12.0 flutter_weather_icons: ^1.0.2 smooth_page_indicator: ^0.2.0 simple_animations: ^2.5.1 - dev_dependencies: flutter_test: From cccfb4febe52ded545d2e9b85ce48affd46eb8b8 Mon Sep 17 00:00:00 2001 From: Monica Abreu Date: Mon, 22 Mar 2021 08:59:28 +0000 Subject: [PATCH 02/12] chore: fix ios settings --- ios/Runner.xcodeproj/project.pbxproj | 68 +++++++++++++++++++ .../contents.xcworkspacedata | 3 + ios/Runner/Info.plist | 6 ++ 3 files changed, 77 insertions(+) diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index a85ce4c..5d1943e 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -13,6 +13,7 @@ 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; + 9985CEAEBE16AE0D25737B44 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 63D9C26AEF524410E483D1D5 /* Pods_Runner.framework */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -29,9 +30,11 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 0EC74BF8ED8859F82C674713 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 63D9C26AEF524410E483D1D5 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; @@ -42,6 +45,8 @@ 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + AD262D8317B0459D8DDC94B0 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; + E7EB12E104E98696079B1A19 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -49,12 +54,32 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 9985CEAEBE16AE0D25737B44 /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 3003D846E30BD3C7B0CD8E4B /* Frameworks */ = { + isa = PBXGroup; + children = ( + 63D9C26AEF524410E483D1D5 /* Pods_Runner.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 52E43011FD2E054158EF61CE /* Pods */ = { + isa = PBXGroup; + children = ( + AD262D8317B0459D8DDC94B0 /* Pods-Runner.debug.xcconfig */, + E7EB12E104E98696079B1A19 /* Pods-Runner.release.xcconfig */, + 0EC74BF8ED8859F82C674713 /* Pods-Runner.profile.xcconfig */, + ); + name = Pods; + path = Pods; + sourceTree = ""; + }; 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( @@ -72,6 +97,8 @@ 9740EEB11CF90186004384FC /* Flutter */, 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, + 52E43011FD2E054158EF61CE /* Pods */, + 3003D846E30BD3C7B0CD8E4B /* Frameworks */, ); sourceTree = ""; }; @@ -105,12 +132,14 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( + 2BC1B98943CABA2040336670 /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + 1AF5985B47F0AA2BFEF5ED2C /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -169,6 +198,45 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ + 1AF5985B47F0AA2BFEF5ED2C /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + 2BC1B98943CABA2040336670 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; diff --git a/ios/Runner.xcworkspace/contents.xcworkspacedata b/ios/Runner.xcworkspace/contents.xcworkspacedata index 1d526a1..21a3cc1 100644 --- a/ios/Runner.xcworkspace/contents.xcworkspacedata +++ b/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -4,4 +4,7 @@ + + diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index 38d7f6c..fdbdacc 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -22,6 +22,12 @@ $(FLUTTER_BUILD_NUMBER) LSRequiresIPhoneOS + NSLocationWhenInUseUsageDescription + This app needs access to location in the background. + NSLocationAlwaysUsageDescription + This app needs access to location when in the background. + NSLocationAlwaysAndWhenInUseUsageDescription + This app needs access to location when open and in the background. UILaunchStoryboardName LaunchScreen UIMainStoryboardFile From a6d92c825712e66dd28c3c6db441a45dc1a48800 Mon Sep 17 00:00:00 2001 From: Monica Abreu Date: Mon, 22 Mar 2021 09:01:23 +0000 Subject: [PATCH 03/12] chore: fix gradle settings --- android/settings.gradle | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/android/settings.gradle b/android/settings.gradle index 44e62bc..5a2f14f 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -1,11 +1,15 @@ include ':app' -def localPropertiesFile = new File(rootProject.projectDir, "local.properties") -def properties = new Properties() +def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() -assert localPropertiesFile.exists() -localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } +def plugins = new Properties() +def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') +if (pluginsFile.exists()) { + pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } +} -def flutterSdkPath = properties.getProperty("flutter.sdk") -assert flutterSdkPath != null, "flutter.sdk not set in local.properties" -apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" +plugins.each { name, path -> + def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() + include ":$name" + project(":$name").projectDir = pluginDirectory +} From b947c424671ff16905a5bd43752ba529eadfdd61 Mon Sep 17 00:00:00 2001 From: Monica Abreu Date: Mon, 22 Mar 2021 19:04:13 +0000 Subject: [PATCH 04/12] chore: key updated --- lib/main.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/main.dart b/lib/main.dart index 636ac8b..78d1dd2 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -10,7 +10,7 @@ import 'package:logger/logger.dart'; var logger = Logger(); var config = { - 'OpenWeatherApiKey': 'fdb61777bda2658e2b20d16554abc84a', + 'OpenWeatherApiKey': 'ea43c1109bc0f41d9bc4859aa2090a30', }; void main() { From 865d210def203992cf64e13f5e00337e5db23426 Mon Sep 17 00:00:00 2001 From: Monica Abreu Date: Mon, 22 Mar 2021 19:07:33 +0000 Subject: [PATCH 05/12] fix: call getData in order to get weather data --- lib/Screens/homeScreen.dart | 12 ++---------- lib/provider/weatherProvider.dart | 2 +- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/lib/Screens/homeScreen.dart b/lib/Screens/homeScreen.dart index 57a850f..4691fa3 100644 --- a/lib/Screens/homeScreen.dart +++ b/lib/Screens/homeScreen.dart @@ -21,11 +21,11 @@ class HomeScreen extends StatefulWidget { class _HomeScreenState extends State { PageController _pageController = PageController(); - bool _isLoading; @override void initState() { super.initState(); + _getData(); } @override @@ -35,10 +35,8 @@ class _HomeScreenState extends State { } Future _getData() async { - _isLoading = true; final weatherData = Provider.of(context, listen: false); weatherData.getWeatherData(); - _isLoading = false; } Future _refreshData(BuildContext context) async { @@ -53,13 +51,7 @@ class _HomeScreenState extends State { return SafeArea( child: Scaffold( - body: true - ? Center( - child: CircularProgressIndicator( - backgroundColor: myContext.primaryColor, - ), - ) - : weatherData.loading + body: weatherData.loading ? Center( child: CircularProgressIndicator( backgroundColor: myContext.primaryColor, diff --git a/lib/provider/weatherProvider.dart b/lib/provider/weatherProvider.dart index 28258c7..48d306d 100644 --- a/lib/provider/weatherProvider.dart +++ b/lib/provider/weatherProvider.dart @@ -16,7 +16,7 @@ class WeatherProvider with ChangeNotifier { List hourly24Weather = []; List fiveDayWeather = []; List sevenDayWeather = []; - bool loading; + bool loading = true; bool isRequestError = false; bool isLocationError = false; From 1abf06fdecc0d31059b60b1dcfb935bf2750d2f4 Mon Sep 17 00:00:00 2001 From: Monica Abreu Date: Mon, 22 Mar 2021 19:09:21 +0000 Subject: [PATCH 06/12] fix: from json weather --- lib/models/weather.dart | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/models/weather.dart b/lib/models/weather.dart index b442a25..0835c3b 100644 --- a/lib/models/weather.dart +++ b/lib/models/weather.dart @@ -30,7 +30,6 @@ class Weather with ChangeNotifier { }); factory Weather.fromJson(Map json) { - return Weather(); return Weather( temp: json['main']['temp'], tempMax: json['main']['temp_max'], From 32a1d63937d121ef2830c87263f1260ede4eef1d Mon Sep 17 00:00:00 2001 From: Monica Abreu Date: Mon, 22 Mar 2021 19:10:50 +0000 Subject: [PATCH 07/12] fix: replace Stack by Column --- lib/Screens/homeScreen.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Screens/homeScreen.dart b/lib/Screens/homeScreen.dart index 4691fa3..ca3720f 100644 --- a/lib/Screens/homeScreen.dart +++ b/lib/Screens/homeScreen.dart @@ -59,7 +59,7 @@ class _HomeScreenState extends State { ) : weatherData.isLocationError ? LocationError() - : Stack( + : Column( children: [ SearchBar(), SmoothPageIndicator( From 6dee08b8a6cd849cd6ac54f26e6044eef17484ad Mon Sep 17 00:00:00 2001 From: Monica Abreu Date: Mon, 22 Mar 2021 19:15:04 +0000 Subject: [PATCH 08/12] fix: replace green by blue color --- lib/Screens/homeScreen.dart | 2 +- lib/main.dart | 2 +- lib/widgets/WeatherInfo.dart | 7 +++++-- lib/widgets/hourlyForecast.dart | 4 +++- lib/widgets/weatherDetail.dart | 13 +++++++------ 5 files changed, 17 insertions(+), 11 deletions(-) diff --git a/lib/Screens/homeScreen.dart b/lib/Screens/homeScreen.dart index ca3720f..2cf8e66 100644 --- a/lib/Screens/homeScreen.dart +++ b/lib/Screens/homeScreen.dart @@ -83,7 +83,7 @@ class _HomeScreenState extends State { child: RefreshIndicator( onRefresh: () => _refreshData(context), - backgroundColor: Colors.blue, + backgroundColor: myContext.primaryColor, child: ListView( children: [ FadeIn( diff --git a/lib/main.dart b/lib/main.dart index 78d1dd2..1981cff 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -35,7 +35,7 @@ class MyApp extends StatelessWidget { elevation: 0, ), scaffoldBackgroundColor: Colors.white, - primaryColor: Colors.green, + primaryColor: Colors.blue, accentColor: Colors.white, visualDensity: VisualDensity.adaptivePlatformDensity, ), diff --git a/lib/widgets/WeatherInfo.dart b/lib/widgets/WeatherInfo.dart index 7254455..a79c556 100644 --- a/lib/widgets/WeatherInfo.dart +++ b/lib/widgets/WeatherInfo.dart @@ -7,7 +7,7 @@ class WeatherInfo extends StatelessWidget { WeatherInfo({this.wData}); Widget _weatherInfoBuilder(String header, String body, IconData icon, - double rightPad, double iconSize) { + double rightPad, double iconSize, Color color) { return Container( padding: EdgeInsets.symmetric(horizontal: 15), child: Row( @@ -17,7 +17,7 @@ class WeatherInfo extends StatelessWidget { padding: EdgeInsets.only(bottom: 15, right: rightPad), child: Icon( icon, - color: Colors.green, + color: color, size: iconSize, ), ), @@ -46,6 +46,7 @@ class WeatherInfo extends StatelessWidget { @override Widget build(BuildContext context) { + final myContext = Theme.of(context); return Container( padding: EdgeInsets.symmetric(horizontal: 15, vertical: 20), height: MediaQuery.of(context).size.height / 6, @@ -71,6 +72,7 @@ class WeatherInfo extends StatelessWidget { WeatherIcons.wiRaindrops, 0, 50, + myContext.primaryColor ), ), VerticalDivider( @@ -85,6 +87,7 @@ class WeatherInfo extends StatelessWidget { WeatherIcons.wiDaySunny, 15, 30, + myContext.primaryColor ), ), ], diff --git a/lib/widgets/hourlyForecast.dart b/lib/widgets/hourlyForecast.dart index 8a51eee..8ab0f64 100644 --- a/lib/widgets/hourlyForecast.dart +++ b/lib/widgets/hourlyForecast.dart @@ -71,6 +71,8 @@ class HourlyForecast extends StatelessWidget { @override Widget build(BuildContext context) { + final myContext = Theme.of(context); + return Container( margin: EdgeInsets.symmetric(horizontal: 15), width: MediaQuery.of(context).size.width, @@ -93,7 +95,7 @@ class HourlyForecast extends StatelessWidget { TextButton( child: Text( 'See More', - style: TextStyle(color: Colors.green), + style: TextStyle(color: myContext.primaryColor), ), onPressed: () { Navigator.of(context).pushNamed(HourlyScreen.routeName); diff --git a/lib/widgets/weatherDetail.dart b/lib/widgets/weatherDetail.dart index 92fc40b..070dff1 100644 --- a/lib/widgets/weatherDetail.dart +++ b/lib/widgets/weatherDetail.dart @@ -6,7 +6,7 @@ class WeatherDetail extends StatelessWidget { WeatherDetail({this.wData}); - Widget _gridWeatherBuilder(String header, String body, IconData icon) { + Widget _gridWeatherBuilder(String header, String body, IconData icon, Color color) { return Container( decoration: BoxDecoration( borderRadius: BorderRadius.circular(15), @@ -28,7 +28,7 @@ class WeatherDetail extends StatelessWidget { padding: const EdgeInsets.only(bottom: 15, right: 5), child: Icon( icon, - color: Colors.green, + color: color, size: 35, ), ), @@ -61,6 +61,7 @@ class WeatherDetail extends StatelessWidget { @override Widget build(BuildContext context) { + final myContext = Theme.of(context); return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -87,15 +88,15 @@ class WeatherDetail extends StatelessWidget { ), children: [ _gridWeatherBuilder('${wData.weather.humidity}%', 'Humidity', - WeatherIcons.wiRaindrop), + WeatherIcons.wiRaindrop, myContext.primaryColor), _gridWeatherBuilder('${wData.weather.windSpeed} km/h', 'Wind', - WeatherIcons.wiStrongWind), + WeatherIcons.wiStrongWind, myContext.primaryColor), _gridWeatherBuilder( '${wData.weather.feelsLike.toStringAsFixed(1)}°C', 'Feels Like', - WeatherIcons.wiCelsius), + WeatherIcons.wiCelsius, myContext.primaryColor), _gridWeatherBuilder('${wData.weather.pressure} hPa', 'Pressure', - WeatherIcons.wiBarometer), + WeatherIcons.wiBarometer, myContext.primaryColor), ], ), ), From f480d95286a6d02e25e37f7c460050df3210a7fd Mon Sep 17 00:00:00 2001 From: Monica Abreu Date: Mon, 22 Mar 2021 19:30:23 +0000 Subject: [PATCH 09/12] fix: scrollDirection of ListView to horizontal --- lib/widgets/sevenDayForecast.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/widgets/sevenDayForecast.dart b/lib/widgets/sevenDayForecast.dart index 34c4b5f..a3a30d3 100644 --- a/lib/widgets/sevenDayForecast.dart +++ b/lib/widgets/sevenDayForecast.dart @@ -106,7 +106,7 @@ class SevenDayForecast extends StatelessWidget { SizedBox(height: 15), Expanded( child: ListView( - scrollDirection: Axis.vertical, + scrollDirection: Axis.horizontal, children: [ Row( children: dWeather From c3d90d7c04f4738e3d99417b9712793810646384 Mon Sep 17 00:00:00 2001 From: Monica Abreu Date: Mon, 22 Mar 2021 19:34:51 +0000 Subject: [PATCH 10/12] fix: dailyWidget layout --- lib/Screens/hourlyWeatherScreen.dart | 53 +++++++++++++++++----------- 1 file changed, 33 insertions(+), 20 deletions(-) diff --git a/lib/Screens/hourlyWeatherScreen.dart b/lib/Screens/hourlyWeatherScreen.dart index 21d3468..4137cef 100644 --- a/lib/Screens/hourlyWeatherScreen.dart +++ b/lib/Screens/hourlyWeatherScreen.dart @@ -25,28 +25,41 @@ class HourlyScreen extends StatelessWidget { ), ], ), - child: Row( - children: [ - Text( - hours ?? '', - style: TextStyle( - color: Colors.black, - fontSize: 20, - fontWeight: FontWeight.w400, + child: Padding( + padding: const EdgeInsets.all(15), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Text( + hours ?? '', + style: TextStyle( + color: Colors.black, + fontSize: 20, + fontWeight: FontWeight.w400, + ), + ), ), - ), - Text( - '${weather.dailyTemp.toStringAsFixed(1)}°', - style: TextStyle( - fontSize: 20, - fontWeight: FontWeight.w400, + Expanded( + child: Container( + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Text( + '${weather.dailyTemp.toStringAsFixed(1)}°', + style: TextStyle( + fontSize: 20, + fontWeight: FontWeight.w400, + ), + ), + MapString.mapStringToIcon(weather.condition, context, 35), + ], + ), + ), ), - ), - Padding( - padding: const EdgeInsets.only(left: 15, bottom: 15), - child: MapString.mapStringToIcon(weather.condition, context, 25), - ), - ], + ], + ), ), ); } From 1ede79f80286afac4661ce870d497670b4a5010d Mon Sep 17 00:00:00 2001 From: Monica Abreu Date: Mon, 22 Mar 2021 22:25:35 +0000 Subject: [PATCH 11/12] fix: hourly weather layout --- lib/Screens/hourlyWeatherScreen.dart | 51 ++++++++++++---------------- 1 file changed, 22 insertions(+), 29 deletions(-) diff --git a/lib/Screens/hourlyWeatherScreen.dart b/lib/Screens/hourlyWeatherScreen.dart index 4137cef..aa5a5b7 100644 --- a/lib/Screens/hourlyWeatherScreen.dart +++ b/lib/Screens/hourlyWeatherScreen.dart @@ -25,41 +25,34 @@ class HourlyScreen extends StatelessWidget { ), ], ), - child: Padding( - padding: const EdgeInsets.all(15), - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - child: Text( - hours ?? '', + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + hours ?? '', + style: TextStyle( + color: Colors.black, + fontSize: 20, + fontWeight: FontWeight.w400, + ), + ), + Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Text( + '${weather.dailyTemp.toStringAsFixed(1)}°', style: TextStyle( - color: Colors.black, fontSize: 20, fontWeight: FontWeight.w400, ), ), - ), - Expanded( - child: Container( - child: Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Text( - '${weather.dailyTemp.toStringAsFixed(1)}°', - style: TextStyle( - fontSize: 20, - fontWeight: FontWeight.w400, - ), - ), - MapString.mapStringToIcon(weather.condition, context, 35), - ], - ), + Padding( + padding: const EdgeInsets.only(left: 15, bottom: 15), + child: MapString.mapStringToIcon(weather.condition, context, 35), ), - ), - ], - ), + ], + ), + ], ), ); } From d1abd7f9bbc0b138a2eea76cd60e7d8b7def0e03 Mon Sep 17 00:00:00 2001 From: Monica Abreu Date: Mon, 22 Mar 2021 22:28:32 +0000 Subject: [PATCH 12/12] fix: remove main axis alignment --- lib/Screens/hourlyWeatherScreen.dart | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/Screens/hourlyWeatherScreen.dart b/lib/Screens/hourlyWeatherScreen.dart index aa5a5b7..9b0f49b 100644 --- a/lib/Screens/hourlyWeatherScreen.dart +++ b/lib/Screens/hourlyWeatherScreen.dart @@ -37,7 +37,6 @@ class HourlyScreen extends StatelessWidget { ), ), Row( - mainAxisAlignment: MainAxisAlignment.end, children: [ Text( '${weather.dailyTemp.toStringAsFixed(1)}°',