-
Hi I'm new to Flutter/Dart coming from dotnet, first hiccup I ran into is json requiring a lot of work compared to C# JSON.net. Your plugin looks like the best option. Followed the documentation and ran this: import 'package:dart_json_mapper/dart_json_mapper.dart';
import 'main.mapper.g.dart';
@jsonSerializable
class MyTestClass{
String? name;
int? age;
}
void main() {
var myTestObj = MyTestClass();
myTestObj.name = "Jesse Doe";
myTestObj.age = 20;
String serialized = JsonMapper.serialize(myTestObj);
} And it throws this:
|
Beta Was this translation helpful? Give feedback.
Answered by
k-paxian
Oct 27, 2022
Replies: 1 comment
-
It seems you are missing this part from your code |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
seanocali
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It seems you are missing this part from your code
https://github.com/k-paxian/dart-json-mapper#basic-setup