29 lines
1 KiB
Markdown
29 lines
1 KiB
Markdown
# Protevus Serialize Generator
|
|
|
|

|
|
[](https://dart.dev/null-safety)
|
|
[](https://discord.gg/3X6bxTUdCM)
|
|
[](https://github.com/dart-backend/protevus/tree/master/packages/serialize/angel_serialize_generator/LICENSE)
|
|
|
|
The builder for Protevus serialization.
|
|
|
|
## Usage
|
|
|
|
1. Create a model class in `todo.dart` and annotate it with `@serializable`
|
|
|
|
```dart
|
|
import 'package:protevus_serialize/protevus_serialize.dart';
|
|
part 'todo.g.dart';
|
|
|
|
@serializable
|
|
class _Todo {
|
|
String? text;
|
|
bool? completed;
|
|
}
|
|
```
|
|
|
|
2. Run the following command to generate the associated `todo.g.dart` file for serialization.
|
|
|
|
```bash
|
|
dart run build_runner build
|
|
```
|