Issue I got a flutter error A value of type ‘Iterable<HospitalListModel>’ can’t be assigned to a variable of type ‘List<HospitalListModel>’. This is my model: List<HospitalListModel> hospitalListModelFromJson(String str) => List<HospitalListModel>.from(json.decode(str).map((x) => HospitalListModel.fromJson(x))); String hospitalListModelToJson(List<HospitalListModel> data) => json.encode(List<dynamic>.from(data.map((x) => x.toJson()))); class HospitalListModel
Continue readingTag: bloc
My boolean bloc state variable stops changing after the first reassignment
Issue I am relatively new at flutter. I am creating a timer app using bloc. In the timer you are supposed to have a session, then a break and so on and so forth. To track which type of session
Continue readingHow to fix an error in cubits state(Too many positional arguments: 0 expected, but 1 found)?
Issue I am trying to find out how to use bloc/cubits in flutter but I’ve met a problem with state arguments. Also I use freezed and freezed_annotation for models in auth This is my cubits file: import ‘package:equatable/equatable.dart’; import ‘package:flutter_bloc/flutter_bloc.dart’;
Continue readingWhy state is not updating in cubits?
Issue I am new at flutter ant trying to use bloc/cubit I have a state inside cubit file and when I try to emit state… state is not changing and I don’t understand why This is my cubit file: //auth_cubit.dart
Continue readingRadio button with stateless widget or using BLoC Pattern in Flutter
Issue I need to create a group of radio buttons without using the stateful widget. I want a BLoC Pattern in flutter to create a group of radio buttons. How to create it? I have only tried using the regular
Continue readingChange & animate a text color between two values using Bloc
Issue I’d like to animate a text between two colors using BlocBuilder instead of a Stateful Widget This is how I am doing it using a Stateful widget class MyApp extends StatefulWidget { @override MyAppState createState() { return MyAppState(); }
Continue readinghydrated_bloc: The parameter 'storageDirectory' is required
Issue I updated hydrated_bloc from 6.1.0 to the latest 7.0.1 and I got a warning in: HydratedBloc.storage = await HydratedStorage.build(); The parameter ‘storageDirectory’ is required. When I changed to what the new documentation suggested HydratedBloc.storage = await HydratedStorage.build( storageDirectory: await
Continue readingBloc widgets reftech data (rebuild) when navigating to another pageView or any View altogether
Issue Context: I have an App that has a PageView to navigate between five screens using BottomNavigationBar, One page is making use of the Bloc Pattern (almost all of the pages will use Bloc in future releases) these Blocs are
Continue readingI use Stateless Widget alongside BLoC almost everytime. Am I wrong?
Issue I am having a hard time understanding how to deal with states in some specific situations with Flutter. For example, say I need a page where the click of a button fetches data from an API. Such a request
Continue readingWhy Do we Use Bloc In projects?
Issue I’ve been coding with dart and flutter for over a month now, one thing that I was recommended to do by my friend is to learn Bloc as it would be helpful for big projects for businesses. From watching
Continue reading