forked from pinchbv/floor
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(refactor) Remove duplicated and unused code in insert/update/delete …
…method and processor
- Loading branch information
Showing
12 changed files
with
107 additions
and
168 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
28 changes: 28 additions & 0 deletions
28
floor_generator/lib/processor/error/change_method_processor_error.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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import 'package:analyzer/dart/element/element.dart'; | ||
import 'package:floor_generator/processor/error/processor_error.dart'; | ||
|
||
class ChangeMethodProcessorError { | ||
final MethodElement _methodElement; | ||
|
||
const ChangeMethodProcessorError(final MethodElement methodElement) | ||
: _methodElement = methodElement; | ||
|
||
ProcessorError changeMustReturnIntOrVoidFuture(String type) { | ||
return ProcessorError( | ||
message: '$type methods have to return a Future of either void or int.', | ||
todo: | ||
'Give the method a return type of either `Future<void>` or `Future<int>`.', | ||
element: _methodElement, | ||
); | ||
} | ||
|
||
ProcessorError get insertMustReturnIntOrVoidFutureList { | ||
return ProcessorError( | ||
message: | ||
'Insertion methods have to return a Future of either void or int or List<int>.', | ||
todo: | ||
'Give the method a return type of either `Future<void>`, `Future<int>` or `Future<List<int>>`.', | ||
element: _methodElement, | ||
); | ||
} | ||
} |
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
Oops, something went wrong.