-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
54 changed files
with
816 additions
and
239 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
21 changes: 21 additions & 0 deletions
21
packages/un_model/lib/src/ungraph/json_spec/json_spec.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import 'package:freezed_annotation/freezed_annotation.dart'; | ||
import 'package:slugify/slugify.dart'; | ||
|
||
part 'json_spec.freezed.dart'; | ||
part 'json_spec.g.dart'; | ||
|
||
@freezed | ||
class JsonSpec with _$JsonSpec { | ||
const JsonSpec._(); | ||
|
||
const factory JsonSpec({ | ||
required String name, | ||
required String description, | ||
required String type, | ||
}) = _JsonSpec; | ||
|
||
String get slug => slugify(name, delimiter: '_'); | ||
|
||
factory JsonSpec.fromJson(Map<String, dynamic> json) => | ||
_$JsonSpecFromJson(json); | ||
} |
Oops, something went wrong.