Skip to content

Commit

Permalink
Add riverpod provider template
Browse files Browse the repository at this point in the history
  • Loading branch information
mono0926 committed Nov 6, 2020
1 parent cf0afb3 commit 0024f05
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Dart.xml
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,17 @@
<option name="DART_TOPLEVEL" value="true" />
</context>
</template>
<template name="frzentity" value="@freezed&#10;abstract class $DataClass$ with _$$$DataClass$ {&#10; const factory $DataClass$($END$) = _$DataClass$;&#10; factory $DataClass$.fromJson(Map&lt;String, dynamic&gt; json) =&gt; _$$$DataClass$FromJson(json);&#10;}" description="Freezed Data Class" toReformat="false" toShortenFQNames="true">
<variable name="DataClass" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="DART_TOPLEVEL" value="true" />
</context>
</template>
<template name="prvdr" value="import 'package:hooks_riverpod/hooks_riverpod.dart';&#10;&#10;final $NAME$ = Provider$END$((ref) =&gt; $NAME_CAPITALIZED$(ref.read));&#10;&#10;class $NAME_CAPITALIZED$ {&#10; $NAME_CAPITALIZED$(this._read);&#10; final Reader _read;&#10;}" description="" toReformat="false" toShortenFQNames="true">
<variable name="NAME" expression="underscoresToCamelCase(fileNameWithoutExtension())" defaultValue="" alwaysStopAt="true" />
<variable name="NAME_CAPITALIZED" expression="capitalize(NAME)" defaultValue="" alwaysStopAt="false" />
<context>
<option name="DART_TOPLEVEL" value="true" />
</context>
</template>
</templateSet>

0 comments on commit 0024f05

Please sign in to comment.