model_annotation 0.0.2 copy "model_annotation: ^0.0.2" to clipboard
model_annotation: ^0.0.2 copied to clipboard

Library used to generate code snippets for data extraction and conversion between Model and Entity

Usage #

run build_runner build --delete-conflicting-outputs

Configure #

import 'package:example/_model.dart';
import 'package:model_annotation/model_annotation.dart';

@ModelAnnotation()
class MyModel extends Model {
  @FieldAnnotation(parseJson: false)
  final int? id;
  final String? message;
  final DateTime? dateTime;

  MyModel(
    this.id, {
    required this.message,
    this.dateTime,
  });
}

File *.g.dart #

import 'package:example/_model.dart';
import 'package:model_annotation/model_annotation.dart';

@ModelAnnotation()
class MyModel extends Model {
  @FieldAnnotation(parseJson: false)
  final int? id;
  @FieldAnnotation()
  final String? message;
  final DateTime? dateTime;

  MyModel(
    this.id, {
    required this.message,
    this.dateTime,
  });
}
1
likes
0
points
50
downloads

Publisher

unverified uploader

Weekly Downloads

Library used to generate code snippets for data extraction and conversion between Model and Entity

Repository (GitHub)
View/report issues

Topics

#json #generation #annotation #model

Funding

Consider supporting this project:

github.com

License

unknown (license)

Dependencies

analyzer, build, flutter, meta, source_gen

More

Packages that depend on model_annotation