freezed Questions

2

Solved

Feature for deserializing Generic Classes was introduced to freeze a few months back. I am trying to follow the documentation, but I am facing a compile time error: The argument type 'NameOfClass F...
Obsequies asked 30/9, 2022 at 6:56

4

I have a freezed class that takes an enum in its constructor, but when trying to perform the jsonEncode method on this class, it fails with the following error: The following JsonUnsupportedObjectE...

2

My app was running ok but after pub upgrade --major-versions I am getting problems on all models. Example model: import 'package:app_220/models/Leads/LeadFieldModel.dart'; import 'package:flutter/f...
Major asked 29/10, 2021 at 19:2

3

Solved

We are trying to create a generic Category class. At the time being, we are unsure whether category will have integer or UUID as key. Hence, we need the id to be generic for now. All works fine. Ho...
Surly asked 4/3, 2022 at 6:45

4

Solved

I'm using Freezed to generate data-class on my flutter project. I did everything exactly like mentioned in the package readme: import 'package:freezed_annotation/freezed_annotation.dart'; part 'ac...
Fleisig asked 24/8, 2022 at 11:14

2

I am trying to use freezed on my application, So I added environment: sdk: ">=2.7.0<3.0.0" freezed: ^0.14.0 freezed_annotation: ^0.14.0 to my dependencies. dev_dependencies: f...
Stylograph asked 7/9, 2021 at 13:47

2

Solved

I am trying to create a build_extensions rule in build.yaml for builders freezed and json_serializable to output all generated models in the directory lib/generated/model, irrespective of their ori...
Estheresthesia asked 22/12, 2022 at 13:58

3

I have a freezed class that looks like this: @freezed abstract class GiftGiver with _$GiftGiver { const factory GiftGiver({ String? id, String? uid, String? imageUrl, String? giftDetails, Str...
Klehm asked 11/5, 2021 at 9:53

1

I'm using Freezed to generate sealed data classes in my Flutter app. I need to test it and I don't know how to do so. Any idea? This is the state: @freezed abstract class LoginState with _$LoginSta...
Cello asked 22/11, 2020 at 19:3

2

Solved

I have a User class which contains a Purchase class. I want to make it non-nullable, but not required. So this means that I would need to set a default value. I have no required fields in the sub-c...
Messily asked 19/5, 2021 at 19:55

1

Solved

I have a class which I am trying to use with Freezed, Json Serializable, and Hive. After running dart run build_runner build and generating the necessary classes, my compiler gives me the following...
Avilla asked 17/3, 2022 at 16:10

1

I created two model classes with freezed. One class is having parameter of other class inside it. The problem started when I try to send data to firestore. This following error appears. E/flutter (...

2

Solved

I want to add a custom converter to a freezed class like in this answer. I tried it with this code: @freezed class NewsPost with _$NewsPost { factory NewsPost({ @JsonKey(name: "date") @...
Complementary asked 18/4, 2021 at 16:12

3

Solved

I'm trying to programme to an interface with Freezed. I want to be able to specify all over my app, the type IUserRegistrationEntity; My interface: abstract class IUserRegistrationEntity { String ...
Klug asked 12/12, 2020 at 4:6

2

Solved

How do I make a Freezed object take a generic type? I want to do this: import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:vepo/src/entity_types/option_entity.dart'; part ...
Retinue asked 6/6, 2021 at 6:59

1

I'm quite new to Flutter (and even more to the Freezed package...) So I hope that the question is relevant. So, here is my usecase: a User can be Member of differents groups. A User class shares . ...
Specialist asked 24/10, 2020 at 15:52
1

© 2022 - 2024 — McMap. All rights reserved.