-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #60 from wednesday-solutions/freezed_to_sealed
Update sealed classes, interfaces and bricks
- Loading branch information
Showing
53 changed files
with
143 additions
and
113 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
2 changes: 1 addition & 1 deletion
2
bricks/destination/__brick__/{{name.snakeCase()}}/{{name.snakeCase()}}_screen.dart
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
8 changes: 2 additions & 6 deletions
8
bricks/destination/__brick__/{{name.snakeCase()}}/{{name.snakeCase()}}_screen_intent.dart
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,9 +1,5 @@ | ||
import 'package:flutter_template/presentation/entity/intent/intent.dart'; | ||
import 'package:freezed_annotation/freezed_annotation.dart'; | ||
|
||
part '{{name.snakeCase()}}_screen_intent.freezed.dart'; | ||
|
||
@freezed | ||
class {{name.pascalCase()}}ScreenIntent with _${{name.pascalCase()}}ScreenIntent implements BaseIntent { | ||
factory {{name.pascalCase()}}ScreenIntent.newIntent() = _HomeScreenIntent_NewIntent; | ||
sealed class {{name.pascalCase()}}ScreenIntent extends BaseIntent { | ||
const {{name.pascalCase()}}ScreenIntent(); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
abstract class Mapper2<FROM1, FROM2, TO> { | ||
abstract interface class Mapper2<FROM1, FROM2, TO> { | ||
TO map(FROM1 from1, FROM2 from2); | ||
} |
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,3 +1,3 @@ | ||
abstract class Mapper3<FROM1, FROM2, FROM3, TO> { | ||
abstract interface class Mapper3<FROM1, FROM2, FROM3, TO> { | ||
TO map(FROM1 from1, FROM2 from2, FROM3 from3); | ||
} |
This file was deleted.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
abstract class HomeNavigator { | ||
abstract interface class HomeNavigator { | ||
void toSearchScreen(); | ||
} |
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,3 +1,3 @@ | ||
abstract class SearchNavigator { | ||
abstract interface class SearchNavigator { | ||
void back(); | ||
} |
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 @@ | ||
import 'package:flutter_template/presentation/entity/intent/intent.dart'; | ||
|
||
abstract class IntentHandler<T extends BaseIntent> { | ||
abstract interface class IntentHandler<T extends BaseIntent> { | ||
void onIntent(T intent); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,24 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_template/presentation/entity/intent/intent.dart'; | ||
import 'package:freezed_annotation/freezed_annotation.dart'; | ||
|
||
part 'theme_intent.freezed.dart'; | ||
sealed class ThemeIntent extends BaseIntent { | ||
const ThemeIntent(); | ||
} | ||
|
||
class SetThemeModeThemeIntent extends ThemeIntent { | ||
final ThemeMode mode; | ||
|
||
const SetThemeModeThemeIntent({required this.mode}); | ||
|
||
@override | ||
List<Object?> get props => [mode]; | ||
} | ||
|
||
class SetIsDynamicThemeIntent extends ThemeIntent { | ||
final bool isDynamic; | ||
|
||
const SetIsDynamicThemeIntent({required this.isDynamic}); | ||
|
||
@freezed | ||
class ThemeIntent with _$ThemeIntent implements BaseIntent { | ||
factory ThemeIntent.setThemeMode(ThemeMode mode) = _ThemeIntent_SetThemeMode; | ||
factory ThemeIntent.setIsDynamic(bool isDynamic) = _ThemeIntent_SetIsDynamic; | ||
@override | ||
List<Object?> get props => [isDynamic]; | ||
} |
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
13 changes: 8 additions & 5 deletions
13
lib/presentation/destinations/weather/home/home_screen_intent.dart
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,9 +1,12 @@ | ||
import 'package:flutter_template/presentation/entity/intent/intent.dart'; | ||
import 'package:freezed_annotation/freezed_annotation.dart'; | ||
|
||
part 'home_screen_intent.freezed.dart'; | ||
sealed class HomeScreenIntent extends BaseIntent { | ||
const HomeScreenIntent(); | ||
} | ||
|
||
class SearchHomeScreenIntent extends HomeScreenIntent { | ||
const SearchHomeScreenIntent(); | ||
|
||
@freezed | ||
class HomeScreenIntent with _$HomeScreenIntent implements BaseIntent { | ||
factory HomeScreenIntent.search() = _HomeScreenIntent_Search; | ||
@override | ||
List<Object?> get props => []; | ||
} |
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: 1 addition & 1 deletion
2
lib/presentation/destinations/weather/search/search_screen.dart
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
33 changes: 24 additions & 9 deletions
33
lib/presentation/destinations/weather/search/search_screen_intent.dart
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,16 +1,31 @@ | ||
import 'package:flutter_template/presentation/entity/intent/intent.dart'; | ||
import 'package:flutter_template/presentation/entity/weather/ui_city.dart'; | ||
import 'package:freezed_annotation/freezed_annotation.dart'; | ||
|
||
part 'search_screen_intent.freezed.dart'; | ||
sealed class SearchScreenIntent extends BaseIntent { | ||
const SearchScreenIntent(); | ||
} | ||
|
||
class BackSearchScreenIntent extends SearchScreenIntent { | ||
const BackSearchScreenIntent(); | ||
|
||
@override | ||
List<Object?> get props => []; | ||
} | ||
|
||
class SearchSearchScreenIntent extends SearchScreenIntent { | ||
final String searchTerm; | ||
|
||
const SearchSearchScreenIntent({required this.searchTerm}); | ||
|
||
@override | ||
List<Object?> get props => [searchTerm]; | ||
} | ||
|
||
@freezed | ||
class SearchScreenIntent with _$SearchScreenIntent implements BaseIntent { | ||
factory SearchScreenIntent.back() = _SearchScreenIntent_Back; | ||
class ToggleFavoriteSearchScreenIntent extends SearchScreenIntent { | ||
final UICity city; | ||
|
||
factory SearchScreenIntent.search({required String searchTerm}) = | ||
_SearchScreenIntent_Search; | ||
const ToggleFavoriteSearchScreenIntent({required this.city}); | ||
|
||
factory SearchScreenIntent.toggleFavorite({required UICity city}) = | ||
_SearchScreenIntent_Favorite; | ||
@override | ||
List<Object?> get props => [city]; | ||
} |
Oops, something went wrong.