26 lines
608 B
Plaintext
26 lines
608 B
Plaintext
{{>common/file_header}}
|
|
|
|
import 'package:freezed_annotation/freezed_annotation.dart';
|
|
|
|
part '{{partFile}}.freezed.dart';
|
|
part '{{partFile}}.g.dart';
|
|
|
|
{{#hasImports}}
|
|
{{>common/imports}}
|
|
|
|
{{/hasImports}}
|
|
{{#docLines}}
|
|
/// {{.}}
|
|
{{/docLines}}
|
|
@freezed
|
|
class {{className}} with _${{className}} {
|
|
const factory {{className}}({
|
|
{{#properties}}
|
|
{{#jsonKey}}@JsonKey({{.}}) {{/jsonKey}}{{#required}}required {{/required}}{{type}}{{#nullable}}?{{/nullable}} {{name}},
|
|
{{/properties}}
|
|
}) = _{{className}};
|
|
|
|
factory {{className}}.fromJson(Map<String, dynamic> json) =>
|
|
_${{className}}FromJson(json);
|
|
}
|