Skip to content

Commit 8948b16

Browse files
author
Atiqur Rahman
authored
refactor: removed unnecessary override method & fix example (#40)
1 parent 19246ed commit 8948b16

File tree

1 file changed

+13
-25
lines changed

1 file changed

+13
-25
lines changed

lib/domain/common/use_case.dart

Lines changed: 13 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,7 @@ abstract class OutputUseCase<Output> {
7979
/// ```
8080
///
8181
abstract class StreamOutputUseCase<Output>
82-
extends OutputUseCase<Stream<Output>> {
83-
@override
84-
Stream<Output> run();
85-
}
82+
extends OutputUseCase<Stream<Output>> {}
8683

8784
/// Stream output use case that would take in an [Input] and return [Output] as a [Stream].
8885
///
@@ -93,9 +90,9 @@ abstract class StreamOutputUseCase<Output>
9390
///
9491
/// ```dart
9592
/// class ObserveStoryPlayerStateFromStoryIdUseCase extends StreamUseCase<Query, StoryPlayerState> {
96-
/// ObserveStoryPlayerStateFromStoryIdUseCase({
97-
/// required this._storyPlayerPreferences,
98-
/// });
93+
/// ObserveStoryPlayerStateFromStoryIdUseCase(
94+
/// this._storyPlayerPreferences,
95+
/// );
9996
///
10097
/// final StoryPlayerPreferences _storyPlayerPreferences;
10198
///
@@ -117,10 +114,7 @@ abstract class StreamOutputUseCase<Output>
117114
/// ```
118115
///
119116
abstract class StreamUseCase<Input, Output>
120-
extends UseCase<Input, Stream<Output>> {
121-
@override
122-
Stream<Output> run(Input input);
123-
}
117+
extends UseCase<Input, Stream<Output>> {}
124118

125119
/// Future output use case that would take in an [Input] and return [Output] as a [Future].
126120
///
@@ -130,9 +124,9 @@ abstract class StreamUseCase<Input, Output>
130124
///
131125
/// ```dart
132126
/// class QueryStoriesUseCase extends FutureUseCase<Query, List<Story>> {
133-
/// QueryStoriesUseCase({
134-
/// required this._storiesService,
135-
/// });
127+
/// QueryStoriesUseCase(
128+
/// this._storiesService,
129+
/// );
136130
///
137131
/// final StoriesService _storiesService;
138132
///
@@ -152,10 +146,7 @@ abstract class StreamUseCase<Input, Output>
152146
/// ```
153147
///
154148
abstract class FutureUseCase<Input, Output>
155-
extends UseCase<Input, Future<Output>> {
156-
@override
157-
Future<Output> run(Input input);
158-
}
149+
extends UseCase<Input, Future<Output>> {}
159150

160151
/// Future output use case that would return [Output] as a [Future].
161152
///
@@ -165,9 +156,9 @@ abstract class FutureUseCase<Input, Output>
165156
///
166157
/// ```dart
167158
/// class GetAllStoriesUseCase extends FutureOutputUseCase<List<Story>> {
168-
/// GetAllStoriesUseCase({
169-
/// required this._storiesService,
170-
/// });
159+
/// GetAllStoriesUseCase(
160+
/// this._storiesService,
161+
/// );
171162
///
172163
/// final StoriesService _storiesService;
173164
///
@@ -179,7 +170,4 @@ abstract class FutureUseCase<Input, Output>
179170
/// ```
180171
///
181172
abstract class FutureOutputUseCase<Output>
182-
extends OutputUseCase<Future<Output>> {
183-
@override
184-
Future<Output> run();
185-
}
173+
extends OutputUseCase<Future<Output>> {}

0 commit comments

Comments
 (0)