platform/packages/serialize/serialize_generator/test/models/subclass.dart

23 lines
356 B
Dart
Raw Normal View History

import 'package:protevus_serialize/protevus_serialize.dart';
2019-07-04 18:30:45 +00:00
part 'subclass.g.dart';
@serializable
class _Animal {
@notNull
2021-05-02 06:02:08 +00:00
String? genus;
2019-07-04 18:30:45 +00:00
@notNull
2021-05-02 06:02:08 +00:00
String? species;
2019-07-04 18:30:45 +00:00
}
@serializable
class _Bird extends _Animal {
@DefaultsTo(false)
2021-05-02 06:02:08 +00:00
bool? isSparrow;
2019-07-04 18:30:45 +00:00
}
var saxaulSparrow = Bird(
genus: 'Passer',
species: 'ammodendri',
isSparrow: true,
);