londonappbrewery / Clima-Flutter-Completed

The completed code for the Clima Project - The Complete Flutter Development Bootcamp

Home Page:https://www.appbrewery.co/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use SetState ()

uj2208 opened this issue · comments

For dynamically changing the content of the location screen use set state() for getting weather details city wise

FlatButton(
onPressed: () async {
//WeatherModel modelx1 = WeatherModel();
var weatherData = await model.getlocationweather();
setState(() {
updateUI(weatherData);
});

                },
                child: Icon(
                  Icons.near_me,
                  size: 30.0,
                ),
              ),

Thanks for that. Also, you have to use the same construction with getCityWeatherData.