Skip to main content
Stack Overflow
  1. About
  2. For Teams
Filter by
Sorted by
Tagged with
2 votes
1 answer
40 views

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
74 views

I have a generic data model in Flutter using the JsonSerializable. I want to pass a custom parameter name (e.g., "statistics") instead of a fixed name in the fromJson and toJson methods. ...
1 vote
1 answer
86 views

Minimum reproducible code: // foo.dart import 'package:cloud_firestore/cloud_firestore.dart'; import 'package:cloud_firestore_odm/cloud_firestore_odm.dart'; import 'package:json_annotation/...
1 vote
1 answer
77 views

Suppose I have the following model (using freezed): @freezed class User with _$User { const factory User({ required UserID id, required List<String> categories, }) = _User; ...
0 votes
1 answer
139 views

I am new to flutter and have been developing a small api that would pull data from a local mock database I created. The database has a nested Json within it, and no matter what I did, I can't get it ...
0 votes
1 answer
196 views

I am currently using json_serializable with generic objects in Dart, where the generics should freezed classes (have toJson methos and fromJson constructor). I have a working implementation, but I'm ...
0 votes
1 answer
55 views

I am facing an issue in my code. I am sending an object "report" which has nested classes such as this one called 'non conformities'. Inside this I am sending some files. At moment I am ...
0 votes
2 answers
620 views

I am using the json_serializable package in Dart to convert my objects to JSON so I can then store them in a SQLite database. I am struggling in converting one particular property on my class because ...
0 votes
3 answers
2k views

The documentation of freezed is telling that we should just use the sealed classes made available in dart 3. However: it does not explain how to use it, especially in combination with fromJson. So I'm ...
0 votes
2 answers
169 views

I want to convert a Json with Freezed package in Dart/Flutter. my json: {"rates":{"btc":{"name":"Bitcoin","unit":"BTC","value":1.0,...
1 vote
1 answer
998 views

I have a class called Groups that has a property that contains a list of Members. To send this to Firebase, I have a GroupDto and MemberDto class that converts these values to and from the domain, and ...
0 votes
1 answer
89 views

I want to set a value to a field depending on another field of the same class. For example, I have classes Team and Project: class Team { String name; String curator; //etc. } class ...
0 votes
0 answers
296 views

So, this example from flutter docs import 'package:json_annotation/json_annotation.dart'; part 'address.g.dart'; @JsonSerializable() class Address { String street; String city; Address(this.street, ...
0 votes
1 answer
167 views

I'm using Freezed to create data classes, and to de-serialized them from a json (with the integration with JsonSerializable). But sometimes the json are incomplete, and the fromJson method do not ...
1 vote
2 answers
1k views

I am using Flutter Freezed package which in turn uses Dart json_serialize package. I have this Dart enhanced enum with 2 fields: enum WorkingMode { mix(type: 1, name: "mix"), parallel(...

15 30 50 per page
1
2 3 4 5
...
8

AltStyle によって変換されたページ (->オリジナル) /