Skip to content

Commit 9caa093

Browse files
Fawaz JosephFawaz Joseph
authored andcommitted
updated liveTemplates to freezed >= 3.0.0
1 parent 45f41c2 commit 9caa093

File tree

8 files changed

+75
-5
lines changed

8 files changed

+75
-5
lines changed
0 Bytes
Binary file not shown.
2.13 KB
Binary file not shown.

.gradle/file-system.probe

0 Bytes
Binary file not shown.

CHANGELOG.md

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

33
## Unreleased
44

5+
### Added
6+
- freezedSealedClass, freezedAbstractClass, freezedEmptyConst liveTemplates
7+
8+
### Changed
9+
- freezedConst now shows <3.0.0 to show it can't be used in >3.0.0 freezed instances
10+
511
## 1.0.9 - 2024-03-03
612

713
### Changed

DESCRIPTION.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,24 @@ Create boiler plate code faster so you can get to your bussiness logic
55

66
## Live Templates
77

8+
### freezedSealedClass
9+
~~Begin to~~ type __freezedSealedClass__ and press <kbd>Tab</kbd> to generate a freezed sealed class
10+
```dart
11+
@freezed
12+
sealed class Demo with _$Demo {
13+
}
14+
```
15+
16+
### freezedAbstractClass
17+
~~Begin to~~ type __freezedAbstractClass__ and press <kbd>Tab</kbd> to generate a freezed abstract class
18+
```dart
19+
@freezed
20+
abstract class Demo with _$Demo {
21+
}
22+
```
23+
824
### freezedClass
9-
~~Begin to~~ type __freezedClass__ and press <kbd>Tab</kbd> to generate a freezed class
25+
~~Begin to~~ type __freezedClass__ and press <kbd>Tab</kbd> to generate a freezed class (<3.0.0)
1026
```dart
1127
@freezed
1228
class Demo with _$Demo {
@@ -19,6 +35,12 @@ class Demo with _$Demo {
1935
const factory Demo() = _Demo;
2036
```
2137

38+
### freezedEmptyConst
39+
~~Begin to~~ type __freezedEmptyConst__ and press <kbd>Tab</kbd> to generate a empty constructor that can be extended/subclass
40+
```dart
41+
const factory Demo._() = _Demo;
42+
```
43+
2244
### freezedPart
2345
~~Begin to~~ type __freezedPart__ and press <kbd>Tab</kbd> to generate the part statement
2446
```dart

README.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,24 @@ There should be a Live Template Group called Freezed.
1818

1919
## Live Templates
2020

21+
### freezedSealedClass
22+
~~Begin to~~ type __freezedSealedClass__ and press <kbd>Tab</kbd> to generate a freezed sealed class
23+
```dart
24+
@freezed
25+
sealed class Demo with _$Demo {
26+
}
27+
```
28+
29+
### freezedAbstractClass
30+
~~Begin to~~ type __freezedAbstractClass__ and press <kbd>Tab</kbd> to generate a freezed abstract class
31+
```dart
32+
@freezed
33+
abstract class Demo with _$Demo {
34+
}
35+
```
36+
2137
### freezedClass
22-
~~Begin to~~ type __freezedClass__ and press <kbd>Tab</kbd> to generate a freezed class
38+
~~Begin to~~ type __freezedClass__ and press <kbd>Tab</kbd> to generate a freezed class (<3.0.0)
2339
```dart
2440
@freezed
2541
class Demo with _$Demo {
@@ -32,6 +48,12 @@ class Demo with _$Demo {
3248
const factory Demo() = _Demo;
3349
```
3450

51+
### freezedEmptyConst
52+
~~Begin to~~ type __freezedEmptyConst__ and press <kbd>Tab</kbd> to generate a empty constructor that can be extended/subclass
53+
```dart
54+
const factory Demo._() = _Demo;
55+
```
56+
3557
### freezedPart
3658
~~Begin to~~ type __freezedPart__ and press <kbd>Tab</kbd> to generate the part statement
3759
```dart

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ kotlin.code.style=official
44
# -> https://plugins.jetbrains.com/docs/intellij/intellij-artifacts.html
55
pluginGroup=com.github.fawaz.flutter-freezed-snippets
66
pluginName=flutter-freezed-snippets
7-
pluginVersion=1.0.9
7+
pluginVersion=1.1.0
88

99

1010
# See https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
1111
# for insight into build numbers and IntelliJ Platform versions.
12-
pluginSinceBuild = 232
12+
pluginSinceBuild = 233
1313
#pluginUntilBuild = 232.*
1414

1515
# IntelliJ Platform Properties -> https://github.com/JetBrains/gradle-intellij-plugin#intellij-platform-properties

src/main/resources/liveTemplates/Flutter.xml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
11
<templateSet group="Freezed">
2+
<template name="freezedSealedClass" value="@freezed&#10;sealed class $NAME$ with _$$$NAME$ {&#10;}" description="Create a freezed class with the keyword sealed" toReformat="true" toShortenFQNames="true">
3+
<variable name="NAME" expression="" defaultValue="" alwaysStopAt="true" />
4+
<context>
5+
<option name="DART_TOPLEVEL" value="true" />
6+
</context>
7+
</template>
8+
<template name="freezedAbstractClass" value="@freezed&#10;abstract class $NAME$ with _$$$NAME$ {&#10;}" description="Create a freezed class with the keyword abstract" toReformat="true" toShortenFQNames="true">
9+
<variable name="NAME" expression="" defaultValue="" alwaysStopAt="true" />
10+
<context>
11+
<option name="DART_TOPLEVEL" value="true" />
12+
</context>
13+
</template>
214
<template name="freezedClass" value="@freezed&#10;class $NAME$ with _$$$NAME$ {&#10;}" description="Create a freezed Class" toReformat="true" toShortenFQNames="true">
315
<variable name="NAME" expression="" defaultValue="" alwaysStopAt="true" />
416
<context>
@@ -25,7 +37,15 @@
2537
<option name="DART_TOPLEVEL" value="false" />
2638
</context>
2739
</template>
28-
<template name="freezedConst" value="const factory $NAME$() = _$NAME$;&#10;" description="Create a basic freezed constructor" toReformat="false" toShortenFQNames="true">
40+
<template name="freezedConst" value="const factory $NAME$() = _$NAME$;&#10;" description="Create a basic freezed constructor (&lt;3.0.0)" toReformat="false" toShortenFQNames="true">
41+
<variable name="NAME" expression="dartClassName()" defaultValue="" alwaysStopAt="false" />
42+
<context>
43+
<option name="DART" value="true" />
44+
<option name="DART_STATEMENT" value="false" />
45+
<option name="DART_TOPLEVEL" value="false" />
46+
</context>
47+
</template>
48+
<template name="freezeEmptyConst" value="const factory $NAME$._() = _$NAME$;&#10;" description="Create a freezed private constructor to enable generated code to extend/subclass the class" toReformat="false" toShortenFQNames="true">
2949
<variable name="NAME" expression="dartClassName()" defaultValue="" alwaysStopAt="false" />
3050
<context>
3151
<option name="DART" value="true" />

0 commit comments

Comments
 (0)