djangoflow_app_links 1.0.0 copy "djangoflow_app_links: ^1.0.0" to clipboard
djangoflow_app_links: ^1.0.0 copied to clipboard

A Djangoflow package that implements deep-link handling via app_links package.

Deep-link extraction and listening based on app_links and djangoflow_deep_link_interface. #

This package is a concrete implementation of the djangoflow_deep_link_interface package which provides abstract classes for handling app links. It uses the app_links package, which provides a simple way to handle links on both Android and iOS.

Getting started #

Install it via pub-web.flutter-io.cn

Usage #

To use the AppLinksRepository, you first need to create an instance of it:

final appLinksRepository = AppLinksRepository();

getInitialLink() This method returns the initial app link as a future that resolves to a Uri or null if it doesn't exist.

final initialLink = await appLinksRepository.getInitialLink();

getLinkStream() This method returns a stream of incoming app links as Uri.

final linkStream = appLinksRepository.getLinkStream();
linkStream.listen((link) => print(link));

This class provides the implementation for the abstract methods defined in DjangoflowDeepLinkRepositoryBase<Uri> so that the class can be used to create a cubit that can handle app links.

To use the DjangoflowAppLinksCubit, you first need to create an instance of it with a concrete repository and initial state:

final djangoflowAppLinksRepository = DjangoflowAppLinksRepository();
// Provide the DjangoflowAppLinksCubit
BlocProvider<DjangoflowAppLinksCubit>(
    create: (context) => DjangoflowAppLinksCubit(
        null,
        djangoflowAppLinksRepository,
    )..startListening(), // this will start listening to the upcoming deep links
),
// Listen to Uri changes
AppLinksCubitListener(
    listenWhen: (previous, current) =>
        current != null,
    listener: (context, appLink) {
        final path = appLink?.path;
        if (path != null) {
            // navigate to the path
        }
    },
    child: child,
)

Limitations #

  • This package is only applicable to mobile platforms(iOS and Android)
  • This package is dependent on app_links package, make sure to follow their setup instructions as well
0
likes
0
pub points
57%
popularity

Publisher

verified publisherapexive.com

A Djangoflow package that implements deep-link handling via app_links package.

Homepage
Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

app_links, djangoflow_deep_link_interface, flutter, flutter_bloc

More

Packages that depend on djangoflow_app_links