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

feat: deep link support proposal #67

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

orestesgaolin
Copy link
Contributor

Status

IN DEVELOPMENT

Breaking Changes

Description

This PR shows potential way to introduce deep link support with usage of MaterialApp.router(). The main problem is that FlowBuilder does not expose a way to notify about popping the page. Thus, I used NavigatorObserver to check if the popped route is related to the deep link that was added to the state of NavigationCubit. If FlowBuilder would allow to pass callback to modify the state when the deep linked page is pushed, then it would be even simpler, e.g.:

    return FlowBuilder<NavigationState>(
      state: state,
      onGeneratePages: onGeneratePages,
      onPop: (page) {
        context.read<NavigationCubit>().clearRoute(page);
      },
      key: navigatorKey,
    );

How to test:

# iOS
xcrun simctl openurl booted com.example.example://myapp/room/999

# Android
adb shell am start -a android.intent.action.VIEW -c android.intent.category.BROWSABLE -d "com.example.example://myapp/room/999" com.example.example
CleanShot.2021-10-15.at.17.23.48.mp4

Type of Change

  • ✨ New feature (non-breaking change which adds functionality)
  • 🛠️ Bug fix (non-breaking change which fixes an issue)
  • ❌ Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 Code refactor
  • ✅ Build configuration change
  • 📝 Documentation
  • 🗑️ Chore
  • 🧪 Testing

@filly82
Copy link

filly82 commented Jan 25, 2022

looks good. any ETA on this?

@orestesgaolin orestesgaolin marked this pull request as draft April 15, 2022 07:52
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.

2 participants