Skip to content
Ravi Teja Gudapati edited this page Jun 10, 2018 · 6 revisions

Import jaguar_serializer

import 'package:jaguar_serializer/jaguar_serializer.dart';

Declare your model:

/// User model
class User {
  String name;
  int age;
}

Declare a Serializer for your model:

@GenSerializer()
class UserSerializer extends Serializer<User> with _$UserSerializer {
}

Generate the serializer:

pub run build_runner build

Include the generated serializer:

part 'user.jser.dart';