fix: improve parity between shelf and flutter #983
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR aims to make modules written with
modular_core
to work in shelf and flutter.Also has #963 merged.
Routing Mechanism Improvements:
shelf_modular/lib/src/presenter/extensions/route_manage_extension.dart
: Added aname
parameter to theresource
method to allow named routes.shelf_modular/lib/src/presenter/models/route.dart
: Updated theRoute.resource
factory to include aname
parameter and utilize theRouteManager
for managing child routes.shelf_modular/lib/src/presenter/resources/resource.dart
: Changed theroutes
method in theResource
class to accept aRouteManager
parameter instead of returning a list of routes.Class Enhancements:
modular_core/lib/src/route/route.dart
: Added atoString
method to theModularKey
class for better debugging and logging.shelf_modular/lib/src/presenter/modular_base.dart
: Added a check to return an empty map if the request data is empty in theModularBase
class.These changes collectively enhance the routing capabilities, ensure compatibility with the latest dependencies, and improve the overall code quality and maintainability.
Checklist
fix:
,feat:
,docs:
etc).docs
and added dartdoc comments with///
.examples
.Breaking Change
shelf_modular
now uses the same builder methods for binds instead of a getter.Related Issues
#963
#968