-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clean up the codebase. Update the example project by the RawQuery sam…
…ple.
- Loading branch information
Showing
9 changed files
with
61 additions
and
147 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
36 changes: 36 additions & 0 deletions
36
floor_generator/lib/processor/error/base_query_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,36 @@ | ||
import 'package:analyzer/dart/element/element.dart'; | ||
import 'package:floor_generator/processor/error/processor_error.dart'; | ||
import 'package:source_gen/source_gen.dart'; | ||
|
||
class BaseQueryMethodProcessorError { | ||
final MethodElement _methodElement; | ||
|
||
BaseQueryMethodProcessorError(final MethodElement methodElement) | ||
: _methodElement = methodElement; | ||
|
||
InvalidGenerationSourceError get doesNotReturnFutureNorStream { | ||
return InvalidGenerationSourceError( | ||
'All queries have to return a Future or Stream.', | ||
todo: 'Define the return type as Future or Stream.', | ||
element: _methodElement, | ||
); | ||
} | ||
|
||
ProcessorError get doesNotReturnNullableStream { | ||
return ProcessorError( | ||
message: 'Queries returning streams of single elements might emit null.', | ||
todo: | ||
'Make the method return a Stream of a nullable type e.g. Stream<Person?>.', | ||
element: _methodElement, | ||
); | ||
} | ||
|
||
ProcessorError get doesNotReturnNullableFuture { | ||
return ProcessorError( | ||
message: 'Queries returning single elements might return null.', | ||
todo: | ||
'Make the method return a Future of a nullable type e.g. Future<Person?>.', | ||
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
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