From ff5f5c4a9e933a655bdef7529cf769c3f76ce51c Mon Sep 17 00:00:00 2001 From: Mahdhi Rezvi <37553533+Mahdhir@users.noreply.github.com> Date: Thu, 26 Mar 2020 21:12:03 +0530 Subject: [PATCH] Fixing bug with location refresh Fixes bug when you change location via an emulator and click on update location. But the app does not reflect the changes. This is due to setState missing --- lib/screens/location_screen.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/screens/location_screen.dart b/lib/screens/location_screen.dart index 16f1561..bf6950b 100644 --- a/lib/screens/location_screen.dart +++ b/lib/screens/location_screen.dart @@ -68,7 +68,9 @@ class _LocationScreenState extends State { FlatButton( onPressed: () async { var weatherData = await weather.getLocationWeather(); - updateUI(weatherData); + setState(() { + updateUI(weatherData); + }); }, child: Icon( Icons.near_me,