redd4ford / iot-flutter_hw-5

this repository holds my fifth homework for the Flutter course by Leobit. this is a weather app that fetches data from the API based on the BLoC pattern.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Lab #5 review

igor-leshkevych opened this issue · comments

commented

@redd4ford good job, I like how you structured your app. The only thing I would change is to merge Theme bloc and Weather bloc: your Theme depends entirely on weather (weather changes -> theme changes) which is clearly visible in code:

child: BlocConsumer<WeatherBloc, WeatherState>(
            listener: (context, weatherState) {

//------> when weather changes
          if (weatherState is WeatherStateSuccess) {
//------> theme changes
           BlocProvider.of<ThemeBloc>(context).add(ThemeEventWeatherChanged(
                weatherCondition: weatherState.weather.weatherCondition));
            _completer?.complete();
            _completer = Completer();
          }

Your score is 20/20 👍