Skip to content

Commit e2a0306

Browse files
author
minh.tran
committed
update 1.1.2
1 parent 35903e8 commit e2a0306

File tree

6 files changed

+67
-12
lines changed

6 files changed

+67
-12
lines changed

CHANGELOG.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,14 @@
22

33
# flutter Generator Snippets Changelog
44

5-
## 1.1
5+
## 1.1.2
6+
7+
- just for test ci/cd
8+
9+
## 1.1.1
610

711
- required since-build 202.5103.13<br>
812

9-
## 1.0
13+
## 1.0.0
1014

1115
- First release

README.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,7 @@
99
- [ ] Review the [Legal Agreements](https://plugins.jetbrains.com/docs/marketplace/legal-agreements.html).
1010

1111
<!-- Plugin description -->
12-
This Fancy IntelliJ Platform Plugin is going to be your implementation of the brilliant ideas that you have.
13-
14-
This specific section is a source for the [plugin.xml](/src/main/resources/META-INF/plugin.xml) file which will be extracted by the [Gradle](/build.gradle.kts) during the build process.
15-
16-
To keep everything working, do not remove `<!-- ... -->` sections.
12+
This plugin help you to write generator's template quickly
1713
<!-- Plugin description end -->
1814

1915
## Installation
@@ -47,4 +43,4 @@ freezed
4743
![json-inside](demo/freezed.png)
4844
## Requirements
4945

50-
IntelliJ based: since-build: 202.5103.13 [learn more](https://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/build_number_ranges.html)
46+
IntelliJ based: since-build: 202 [learn more](https://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/build_number_ranges.html)

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
pluginGroup = com.github.tbm98.fluttergeneratorsnippets
55
pluginName_ = flutter_generator_snippets
6-
pluginVersion = 0.0.1
6+
pluginVersion = 1.1.2
77
pluginSinceBuild = 202
88
pluginUntilBuild = 203.*
99
# Plugin Verifier integration -> https://github.com/JetBrains/gradle-intellij-plugin#plugin-verifier-dsl
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package com.github.tbm98.fluttergeneratorsnippets
2+
3+
import com.intellij.codeInsight.template.TemplateActionContext
4+
import com.intellij.codeInsight.template.TemplateContextType
5+
6+
class FlutterContext private constructor() :
7+
TemplateContextType("FLUTTER_GENERATOR_SNIPPETS", "Flutter generator snippets") {
8+
override fun isInContext(templateActionContext: TemplateActionContext): Boolean {
9+
return templateActionContext.file.name.endsWith(".dart")
10+
}
11+
}

src/main/resources/META-INF/plugin.xml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<idea-plugin>
2-
<id>com.github.tbm98.fluttergeneratorsnippets</id>
3-
<name>flutter_generator_snippets</name>
4-
<vendor>tbm98</vendor>
2+
<id>io.github.tbm98.flutter_generator_snippets</id>
3+
<name>Flutter Generator Snippets</name>
4+
<vendor email="[email protected]" url="https://tbm98.dev">tbm98</vendor>
55

66
<!-- Product and plugin compatibility requirements -->
77
<!-- https://plugins.jetbrains.com/docs/intellij/plugin-compatibility.html -->
@@ -10,6 +10,8 @@
1010
<extensions defaultExtensionNs="com.intellij">
1111
<applicationService serviceImplementation="com.github.tbm98.fluttergeneratorsnippets.services.MyApplicationService"/>
1212
<projectService serviceImplementation="com.github.tbm98.fluttergeneratorsnippets.services.MyProjectService"/>
13+
<defaultLiveTemplates file="/liveTemplates/Flutter_generator_snippets.xml"/>
14+
<liveTemplateContext implementation="com.github.tbm98.fluttergeneratorsnippets.FlutterContext" />
1315
</extensions>
1416

1517
<applicationListeners>
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<templateSet group="Flutter generator snippets">
2+
<template name="freezed" value="import 'package:flutter/foundation.dart';&#10;import 'package:freezed_annotation/freezed_annotation.dart';&#10;&#10;part '$fileName$.freezed.dart';&#10;part '$fileName$.g.dart';&#10;&#10;@freezed&#10;abstract class $ClassName$ with _$$$ClassName$ {&#10; const factory $ClassName$($Params$) = _$ClassName$;&#10; &#10; $code$&#10;&#10; factory $ClassName$.fromJson(Map&lt;String, dynamic&gt; json) =&gt;&#10; _$$$ClassName$FromJson(json);&#10;}" description="Create feezed template" toReformat="false" toShortenFQNames="true">
3+
<variable name="fileName" expression="fileNameWithoutExtension()" defaultValue="" alwaysStopAt="true" />
4+
<variable name="ClassName" expression="dartClassName()" defaultValue="" alwaysStopAt="true" />
5+
<variable name="Params" expression="dartSuggestVariableName()" defaultValue="" alwaysStopAt="true" />
6+
<variable name="code" expression="" defaultValue="" alwaysStopAt="true" />
7+
<context>
8+
<option name="DART_TOPLEVEL" value="true" />
9+
</context>
10+
</template>
11+
<template name="freezedWithoutImport" value="@freezed&#10;abstract class $ClassName$ with _$$$ClassName$ {&#10; const factory $ClassName$($Params$) = _$ClassName$;&#10; &#10; $code$&#10;&#10; factory $ClassName$.fromJson(Map&lt;String, dynamic&gt; json) =&gt;&#10; _$$$ClassName$FromJson(json);&#10;}" description="Create freezed template without import" toReformat="false" toShortenFQNames="true">
12+
<variable name="ClassName" expression="" defaultValue="" alwaysStopAt="true" />
13+
<variable name="Params" expression="" defaultValue="" alwaysStopAt="true" />
14+
<variable name="code" expression="" defaultValue="" alwaysStopAt="true" />
15+
<context>
16+
<option name="DART_TOPLEVEL" value="true" />
17+
</context>
18+
</template>
19+
<template name="jsonSerializable" value="import 'package:json_annotation/json_annotation.dart';&#10;&#10;part '$file_name$.g.dart';&#10;&#10;@JsonSerializable()&#10;class $class_name$ {&#10; $class_name$();&#10; &#10; $code$&#10; &#10; factory $class_name$.fromJson(Map&lt;String, dynamic&gt; json) {&#10; return _$$$class_name$FromJson(json);&#10; }&#10;&#10; Map&lt;String, dynamic&gt; toJson() =&gt; _$$$class_name$ToJson(this);&#10;}" description="Create JsonSerializable template" toReformat="false" toShortenFQNames="true">
20+
<variable name="file_name" expression="fileNameWithoutExtension()" defaultValue="" alwaysStopAt="true" />
21+
<variable name="class_name" expression="" defaultValue="" alwaysStopAt="true" />
22+
<variable name="code" expression="" defaultValue="" alwaysStopAt="true" />
23+
<context>
24+
<option name="DART_TOPLEVEL" value="true" />
25+
</context>
26+
</template>
27+
<template name="jsonSerializableWithoutImport" value="@JsonSerializable()&#10;class $class_name$ {&#10; $class_name$();&#10; &#10; $code$&#10; &#10; factory $class_name$.fromJson(Map&lt;String, dynamic&gt; json) {&#10; return _$$$class_name$FromJson(json);&#10; }&#10;&#10; Map&lt;String, dynamic&gt; toJson() =&gt; _$$$class_name$ToJson(this);&#10;}" description="Create JsonSerializable without import" toReformat="false" toShortenFQNames="true">
28+
<variable name="class_name" expression="" defaultValue="" alwaysStopAt="true" />
29+
<variable name="code" expression="" defaultValue="" alwaysStopAt="true" />
30+
<context>
31+
<option name="DART_TOPLEVEL" value="true" />
32+
</context>
33+
</template>
34+
<template name="json" value="factory $class_name$.fromJson(Map&lt;String, dynamic&gt; json) {&#10; return _$$$class_name$FromJson(json);&#10; }&#10;&#10;Map&lt;String, dynamic&gt; toJson() =&gt; _$$$class_name$ToJson(this);" description="Create fromJson/toJson templatee" toReformat="false" toShortenFQNames="true">
35+
<variable name="class_name" expression="dartClassName()" defaultValue="" alwaysStopAt="true" />
36+
<context>
37+
<option name="DART" value="true" />
38+
<option name="DART_STATEMENT" value="false" />
39+
<option name="DART_TOPLEVEL" value="false" />
40+
</context>
41+
</template>
42+
</templateSet>

0 commit comments

Comments
 (0)