-
Notifications
You must be signed in to change notification settings - Fork 27.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[web] Allow the usage of url strategies without conditional imports #77103
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - are there ways to avoid copying the abstract classes? (I haven't used conditional imports much)
/// | ||
/// By default, the [HashUrlStrategy] subclass is used if the app doesn't | ||
/// specify one. | ||
abstract class UrlStrategy { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd recommend to export the common classes from another file, and only duplicate the things that really need a different implementation.
(PR triage): Are there still plans for this PR? |
@goderbauer yes, I'm planning to come back to this PR, address the review and land it. |
(PR triage): Are there still plans for this PR? |
483f916
to
409ce6a
Compare
|
packages/flutter_web_plugins/lib/src/navigation/url_strategy.dart
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM! (Maybe somebody from Flutter Rollers can assess how problematic is the internal change required?)
Today, users have to do conditional imports in their apps in order to customize URL strategy. @johnpryan suggested that we make it possible to use the package without having to do conditional imports. This PR is an attempt to achieve that.
Thanks @ditman for the help!
Fixes #81910