174 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
-1
votes
1
answer
115
views
Best way to access nested attributes in JSON with Freezed in Flutter
I'm using Freezed and json_serializable in a Flutter project. My API returns a nested JSON like this:
{
"success": true,
"message": "Login successful",
"data&...
0
votes
0
answers
45
views
Build method is called twice and also when editing an application the value does not store in state
I'm using Riverpod 2.6.1 with code generation (@riverpod annotation). My provider's build method makes an API call, but it executes twice when the app starts, causing duplicate network requests. This ...
2
votes
1
answer
425
views
missing methods to override in Freezed Flutter [duplicate]
I am trying to use freeze with json_serializer . Response from Api is
{
"CustomData": {
"message": "OTP sent successfully",
"msisdn": "...
0
votes
1
answer
94
views
How to use freezed package in flutter?
How can I convert this data class so it will use freezed? I am in misunderstanding because some properties like dewpoints using different name in the json like dewpoints_2m and they are not in the ...
9
votes
2
answers
3k
views
"Missing concrete implementation of 'getter _$CounterState.count'. Try implementing the missing method, or make the class " flutter bloc with freezed
I got an error in using flutter bloc and freezed page using for state management I couldn't find solution
"Missing concrete implementation of 'getter _$CounterState.count'.
Try implementing the ...
3
votes
1
answer
1k
views
flutter freezed package missing when and map methods in generated file
I'm working on a Flutter project and using the freezed package. I created a generic ApiResult class like this:
import 'package:freezed_annotation/freezed_annotation.dart';
part 'api_result.freezed....
5
votes
1
answer
2k
views
Flutter Freezed 3.0.0 with riverpod
I recently upgraded my Freezed from 2.x.x to 3.x.x. After the upgrade, my Riverpod state file gave me an error, indicating that I need concrete getters. I couldn't find any information, as it has only ...
0
votes
1
answer
96
views
How to disable invalid_annotation_target warning?
Context
I released a package to pub.dev. The model classes were built with freezed. After release, I noticed that pana (the pub.dev's analysis tool) complaining about the following warnings and the ...
0
votes
2
answers
132
views
How to make Freezed respect JsonKey
I have the following:
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:mongo_dart/mongo_dart.dart';
import 'package:myapp_shared/src/converters/datetime_converter.dart';
...
1
vote
1
answer
32
views
How to handle fromList method incompatibility with the Freezed package?
I was working with the Freezed package in Flutter, and I needed a method to convert a List into a model. I implemented a fromList factory method within the Freezed class. However, when running the ...
1
vote
1
answer
201
views
flutter Bloc + Freezed is not emitting the same state twice. UI is not rebuilding
I'm trying to update state after creating an Object.
I've created ObjectsState using freezed package, so there is no sence to use Equatable, because it is already add by package.
class ObjectsState ...
1
vote
0
answers
72
views
How to use Bloc with Freezed package while running 2 api requests? What is best approach?
can someone explain what solution I can implement in this issue?
I have one screen, where I have two requests (later there will be more requests). I thought the best approach is to separate this two ...
0
votes
1
answer
302
views
Discrimination type Unions in Dart with freezed, with overloading constructors or related union values union
I would like to know if there is any good approach to the following problem in Flutter / Dart.
I would like to define a Result type as a discriminated union using the freezed package.
I'll present in ...
2
votes
1
answer
40
views
json_serializable: Selecting JsonConverter's at runtime
I'm looking for a solution on how I could switch what JsonConverter I am using at runtime with the package:json_serializable package. This will allow my app use DateTime objects but then convert these ...
0
votes
1
answer
344
views
Flutter and Freezed: Parse a json element from either string or int, "Null check operator used on a null value" on build runner
I'm working with Flutter and using Freezed for my data types and json deserialization. The database I'm working with will sometimes send the ID element as an int (without quotations) or as a string (...