Skip to content
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

Renames Router to ModularRouter to avoid conflicts with Flutter #223

Merged
merged 2 commits into from Aug 21, 2020

Conversation

phackwer
Copy link

@phackwer phackwer commented Aug 21, 2020

Renaming the Router from Modular to ModularRouter seems to be a better and more definitive strategy than hiding the official Flutter Router from Modular package. Eventually a project may be using both classes or add a package that uses the official one for adding routes and this could cause a bigger problem in the long term or create resistance from other developers to use Modular package as it has internal conflicts with naming from official Flutter.

After this change, the only code adjustment that had to be done in projects using modular package was to replace matching case the class Router by ModularRouter. Code worked without any further changes.

Command bellow replaces all Router calls by ModularRouter easily:

egrep -lRZ 'Router' . | xargs -0 -l sed -i -e 's/Router/ModularRouter/g'

Pubspec change to test it:

  flutter_modular:
    git:
      url: https://github.com/4CME/modular
      path: flutter_modular

Since this is an API change and I also would recommend a new version release as defined in the semver.org standard.

@jacobaraujo7 jacobaraujo7 merged commit c9f4a7b into Flutterando:master Aug 21, 2020
@Leanndrosouza Leanndrosouza mentioned this pull request Feb 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error: 'Router' is imported After upgrade to flutter 1.21.0-8.0.pre.110
3 participants