-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(intellij): generate sealed classes (#4104)
- Loading branch information
Showing
16 changed files
with
58 additions
and
56 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
2 changes: 0 additions & 2 deletions
2
...llij/intellij_generator_plugin/src/main/resources/templates/bloc_basic/bloc.dart.template
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
import 'dart:async'; | ||
|
||
import 'package:bloc/bloc.dart'; | ||
import 'package:meta/meta.dart'; | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
...ntellij_generator_plugin/src/main/resources/templates/bloc_basic/bloc_event.dart.template
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
part of '{{bloc_snake_case}}_bloc.dart'; | ||
|
||
@immutable | ||
abstract class {{bloc_pascal_case}}Event {} | ||
sealed class {{bloc_pascal_case}}Event {} |
4 changes: 2 additions & 2 deletions
4
...ntellij_generator_plugin/src/main/resources/templates/bloc_basic/bloc_state.dart.template
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
part of '{{bloc_snake_case}}_bloc.dart'; | ||
|
||
@immutable | ||
abstract class {{bloc_pascal_case}}State {} | ||
sealed class {{bloc_pascal_case}}State {} | ||
|
||
class {{bloc_pascal_case}}Initial extends {{bloc_pascal_case}}State {} | ||
final class {{bloc_pascal_case}}Initial extends {{bloc_pascal_case}}State {} |
2 changes: 0 additions & 2 deletions
2
.../intellij_generator_plugin/src/main/resources/templates/bloc_equatable/bloc.dart.template
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
import 'dart:async'; | ||
|
||
import 'package:bloc/bloc.dart'; | ||
import 'package:equatable/equatable.dart'; | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
...lij_generator_plugin/src/main/resources/templates/bloc_equatable/bloc_event.dart.template
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
part of '{{bloc_snake_case}}_bloc.dart'; | ||
|
||
abstract class {{bloc_pascal_case}}Event extends Equatable { | ||
sealed class {{bloc_pascal_case}}Event extends Equatable { | ||
const {{bloc_pascal_case}}Event(); | ||
} |
4 changes: 2 additions & 2 deletions
4
...lij_generator_plugin/src/main/resources/templates/bloc_equatable/bloc_state.dart.template
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
part of '{{bloc_snake_case}}_bloc.dart'; | ||
|
||
abstract class {{bloc_pascal_case}}State extends Equatable { | ||
sealed class {{bloc_pascal_case}}State extends Equatable { | ||
const {{bloc_pascal_case}}State(); | ||
} | ||
|
||
class {{bloc_pascal_case}}Initial extends {{bloc_pascal_case}}State { | ||
final class {{bloc_pascal_case}}Initial extends {{bloc_pascal_case}}State { | ||
@override | ||
List<Object> get props => []; | ||
} |
4 changes: 2 additions & 2 deletions
4
...ellij_generator_plugin/src/main/resources/templates/cubit_basic/cubit_state.dart.template
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
part of '{{cubit_snake_case}}_cubit.dart'; | ||
|
||
@immutable | ||
abstract class {{cubit_pascal_case}}State {} | ||
sealed class {{cubit_pascal_case}}State {} | ||
|
||
class {{cubit_pascal_case}}Initial extends {{cubit_pascal_case}}State {} | ||
final class {{cubit_pascal_case}}Initial extends {{cubit_pascal_case}}State {} |
4 changes: 2 additions & 2 deletions
4
...j_generator_plugin/src/main/resources/templates/cubit_equatable/cubit_state.dart.template
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
part of '{{cubit_snake_case}}_cubit.dart'; | ||
|
||
abstract class {{cubit_pascal_case}}State extends Equatable { | ||
sealed class {{cubit_pascal_case}}State extends Equatable { | ||
const {{cubit_pascal_case}}State(); | ||
} | ||
|
||
class {{cubit_pascal_case}}Initial extends {{cubit_pascal_case}}State { | ||
final class {{cubit_pascal_case}}Initial extends {{cubit_pascal_case}}State { | ||
@override | ||
List<Object> get props => []; | ||
} |