1. Getting Started

Add dogs_core, dogs_generator and the serializers you want to use to your pubspec.yaml.

dependencies:
  dogs_core: <version> 
  dogs_yaml: <version>
  dogs_cbor: <version>
  dogs_toml: <version>
  
dev_dependencies:
  build_runner: <version>
  dogs_generator: <version>

JSON is included in dogs_core and therefore has no separate package

Run the build_runner once so the reactor file is generated

dart run build_runner build

Import and export the dogs.g.dart in your main class and run initialiseDogs()

import 'dogs.g.dart';
export 'dogs.g.dart';

void main() async {
  await initialiseDogs();
  [...]
}

Done! Dogs is now setup and ready to use!

Last updated