Skip to content

Instantly share code, notes, and snippets.

@votruk
Created July 28, 2021 10:42
Show Gist options
  • Select an option

  • Save votruk/db5461fca8bfdfb8de853fa8c63dc95b to your computer and use it in GitHub Desktop.

Select an option

Save votruk/db5461fca8bfdfb8de853fa8c63dc95b to your computer and use it in GitHub Desktop.
<template name="js" value="import 'package:json_annotation/json_annotation.dart';&#10;&#10;part '$class_name_snake_case$.g.dart';&#10;&#10;@JsonSerializable(fieldRename: FieldRename.snake)&#10;class $ClassName$ {&#10;&#10; factory $ClassName$.fromJson(final Map&lt;String, dynamic&gt; json) =&gt; _$$$ClassName$FromJson(json);&#10; &#10; Map&lt;String, dynamic&gt; toJson() =&gt; _$$$ClassName$ToJson(this);&#10; &#10;}" 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment