Created
December 18, 2021 19:16
-
-
Save 8thgencore/03cbb5813193ac50b1caee91fc1ef97f to your computer and use it in GitHub Desktop.
add to C:\Users\User\AppData\Roaming\Google\AndroidStudio[version]\templates
This file contains hidden or 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
| <templateSet group="Dart"> | |
| <template name="json_class" value="import 'package:json_annotation/json_annotation.dart'; part '$class_name_snake_case$.g.dart'; @JsonSerializable(fieldRename: FieldRename.snake) class $ClassName$ { factory $ClassName$.fromJson(final Map<String, dynamic> json) => _$$$ClassName$FromJson(json); Map<String, dynamic> toJson() => _$$$ClassName$ToJson(this); }" description="Create new JsonSerializable model class" toReformat="false" toShortenFQNames="true"> | |
| <variable name="ClassName" expression="" defaultValue="" alwaysStopAt="true" /> | |
| <variable name="class_name_snake_case" expression="snakeCase(ClassName)" defaultValue="" alwaysStopAt="false" /> | |
| <context> | |
| <option name="DART_TOPLEVEL" value="true" /> | |
| </context> | |
| </template> | |
| <template name="scon" value="static $ClassName$? _instance; factory $ClassName$.getInstance() => _instance ?? $ClassName$._internal(); $ClassName$._internal();" toReformat="false" toShortenFQNames="true"> | |
| <variable name="ClassName" expression="" defaultValue="" alwaysStopAt="true" /> | |
| <context> | |
| <option name="DART" value="true" /> | |
| <option name="DART_STATEMENT" value="false" /> | |
| </context> | |
| </template> | |
| </templateSet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment