Questions tagged [freezed]

148 questions
0
votes
1 answer

BLoC state + freezed library with multiple fields

I created bloc with "on" handler where I request topics from API. I can control loading and error. I add the second "on" handler in bloc where I request top selected topic, and I want to work with the same bloc with topics to save this top selected…
0
votes
1 answer

Flutter: freezed custom operator == does not work as I accept

I am using freezed and I have list of object, I override my freezer class like this: @override bool operator ==(Object other) => other is _ServiceItemModel && id == other.id && product.id == other.product.id && …
Cyrus the Great
  • 5,145
  • 5
  • 68
  • 149
0
votes
1 answer

How to use HydratedBloc with Freezed in Flutter

I want to ask a question that is about a hydrated bloc with Freezed. Firstly, I know that the we use freezed package to gain a time. We do not create all the necessary codes like creating copyWith method etc. So, If I check the generated file, I can…
alperefesahin
  • 604
  • 6
  • 22
0
votes
0 answers

Flutter: How do I implement sign up with a profile picture using flutter_bloc and freezed in DDD?

I am trying to implement sign up feature for an app using the Domain Driven Design and I am having issues emitting the state for the profile image. I am using the image_picker plugin. The image gets picked successfully but the bloc fails to emit the…
0
votes
0 answers

How to preserve non-serialized properties using freezed package in dart?

Consider the following dart class using freezed: @freezed class Example with _$Example { const factory Example( {String? fieldA, int? fieldB}) = _Example; factory Example.fromJson(Map json) =>…
Ozaner Hansha
  • 101
  • 1
  • 2
0
votes
1 answer

Use Freezed union types with some implemented fields

I'm trying to use Freezed "Mixins and Interfaces for individual classes for union types" by following the documentation, but I'm struggling with one thing. The doc examples are pretty simples and the interfaces do not define any fields. However in…
Pom12
  • 7,622
  • 5
  • 50
  • 69
0
votes
0 answers

Webpage gets stuck when I scroll down and try to scroll up

I am building this WordPress website. It works fine, but it gets stuck on Android phones (pixel 5 | Chrome) when I scroll down and then try to scroll up. This is the site https://elink2022.elinkstaging.com/ I am expecting to scroll up smoothly
oliver
  • 1
  • 1
0
votes
1 answer

freezed package can not generate toJson code for nested object anymore

We've discovered an issue in our monorepo that prevents us from generating .g.dart files for our models. Most of the models are deeply nested and need fromJson/toJson methods to communicate with our backend. Three weeks ago we updated freezed and…
0
votes
0 answers

Adding freezed to state file in bloc

I'am trying to add freezed in my State file in order to write a test. Can somebody help me to do so? I'll appreciate any help! part of 'exchange_cubit.dart'; @immutable class ExchangeState { const ExchangeState( {this.model, this.status =…
asiak1999
  • 13
  • 3
0
votes
1 answer

How do i use Flutter Freezed package?

How do I use the freezed 2.2 package in my flutter app?
daniel
  • 1
0
votes
1 answer

How to get data from API with freezed and bloc in Flutter

I am trying to work with flutter_bloc and freezed package. I have written simple request to API to get data from that, also generated JSON responce with freezed package, and now trying to put data to UI, so I wrote cod like this: This is my state…
inkwelll075
  • 494
  • 4
  • 19
0
votes
1 answer

Freezed class with generic type and fromJson, toJson

I'm trying to make a Freezed class with a generic type that has toJson and fromJson: import 'package:freezed_annotation/freezed_annotation.dart'; part 'option.freezed.dart'; part 'option.g.dart'; @Freezed(genericArgumentFactories: true) class…
BeniaminoBaggins
  • 11,202
  • 41
  • 152
  • 287
0
votes
0 answers

How to use position in @Freezed Flutter?

how do you use positions in Flutter's Freezed library? I tried the line of code below but it doesn't work. @Default(LatLng(0,0)) LatLng position; Thanks for your help :)
0
votes
0 answers

Use object setters dynamically with dart

Objective Create a method that sets value to the object created above. This method could be used like below. setValueToUser(userPropertyName, value); Given A mutable model made with freezed. import…
HPanda
  • 23
  • 4
0
votes
1 answer

'(TypleClass) => String' is not a subtype of type '(dynamic) => String'

First of all, I´ve already submitted an [issue][1] on Flutter's team repository since to me this is an issue on Flutter/Dart but maybe I´m wrong. Steps to Reproduce Execute flutter run on the code sample There are two type of flows that behaves in…