Questions tagged [cubit]

153 questions
0
votes
1 answer

Should I start Cubit then later on refactor the code to Bloc?

For the past week I have been learning the Bloc pattern. From that, I understand that I have 2 choices to use Cubit and Bloc. Cubit is for simple state, and Bloc is for complex state (that's my understanding between the two). Should I implement…
Jai
  • 15
  • 4
0
votes
1 answer

Flutter bloc architecture design

This is less about a specific implementation, but more about good practice. I have the following structure in a flutter desktop project: DataProviders: read data from one of two different fileformats (locally) Repository: parses the data and…
snti
  • 35
  • 1
  • 6
0
votes
1 answer

parsing json into flutter List to Map

Hello I want to parse Json and I faced this issue what's wrong please help the error was 'List' is not a subtype of type 'Map' Model class CategoriesModel { CategoriesModel({ this.id, this.title, this.price, …
0
votes
1 answer

I am was creating async counter app in flutter with help of bloc (cubit) whet i am emitting a loading state every time counter return to 0

I am creating an async counter app in flutter using BLoC (cubit). When I emit a loading state, the counter is not incrementing but returns to 0. How to fix this problem? Code: import 'dart:async'; import 'package:bloc/bloc.dart'; import…
0
votes
1 answer

How to ignore state with cubit in flutter?

I'm using cubit to manage state of widgets, and I want to make widget updated only when specific type of state is emitted. part of 'TestData.dart'; @immutable abstract class TestState {} class TestInitial extends TestState {} class…
Mandarin Smell
  • 391
  • 2
  • 17
0
votes
1 answer

Dart / flutter widget test, Text Widgets are not found either by key nor by text

I implemented an app using WeatherAPI like in the ResoCoder example. I now want to test if every text widget is showing correct information but I already fail in finding the text widgets (I used this guide…
0
votes
1 answer

how can i transfer bloc provider

i want to transfer my bloc provider to other page but how can i do that ? I have a sign in page. If user can log in the app (with email and password) he goes to homePage. The program gives error, because sign in page has signInCubit, but homePage…
coldasspirit
  • 127
  • 1
  • 11
0
votes
1 answer

How to create a separate routing for a module in Flutter?

I have two pages: ConversationsListScreen (it displays list of conversations) and ConversationScreen (shows a particular conversation, user gets in here from ConversationsListScreen). These two pages should be wrapped into a separate module because…
Alex Verbitski
  • 499
  • 3
  • 12
0
votes
1 answer

How to keep the state of my bottomNavigationBar Cubit BLoc Flutter?

I have the problem that when I start the application my map appears one way and then on passing from the bottomnavigatioBar tab it gets completely redrawn when I return. I think it is a problem with the block and state map. I need to know what the…
0
votes
1 answer

Flutter is not updating cubit state

I am practicing BloC cubit and it is not updating state. here is my main file. I have use BlocProvider for creating instance and BlocBuilder to render state but whenever I click on increment and decrement it does not re render text widget. import…
Hammas Ali
  • 9
  • 1
  • 2
0
votes
1 answer

Flutter Bloc Cubit Navigator Problem BlocProvider.of() called with a context that does not contain a Bloc/Cubit of type CityCubit

I use Bloc (Cubit) for data management in my Flutter project. I get the following error in navigation operations. BlocProvider.of() called with a context that does not contain a Bloc/Cubit of type CityCubit. No ancestor could be found starting from…
Gurkan T
  • 198
  • 2
  • 14
0
votes
1 answer

stuck on cubit changing state to 2 widgets

I have my base code working for cubit to update a simple counter in a class that is in a row on my app listview. I want to update the counter of total items using bottomNavigationBar and a totalbagel field which is in a different class that my…
0
votes
0 answers

flutter listview card increment with bloc

I have finally made my bagel order test app. I can load bagels from json file. Building a list and display on screen. I have added cubit to mange the bagel total state All this works fine. But I new I would run into this next problem as I was…
0
votes
1 answer

placement of blocprovider for cbuit

New at flutter and cubit ... so .... my test app shows + 0 - widgets and i can get the cubit to increment and decrement this ok. but i am try to place this cubit code within my real app. which is building a listview of bagel names from a…
-1
votes
1 answer

The argument type 'Sound' can't be assigned to the parameter type 'Map'

I am trying to convert JSON to a dart list. I have this class class Sound { final int id; final String name; final String about; final List album; Sound( {required this.id, required this.name, required…
ANNABA Naruto
  • 11
  • 1
  • 3
1 2 3
10
11