firebase_dynamic_links 0.0.4

  • Example
  • Installing
  • Versions
  • new50

Google Dynamic Links for Firebase

pub package

A Flutter plugin to use the Google Dynamic Links for Firebase API.

For Flutter plugins for other Firebase products, see

Note: This plugin is still under development, and some APIs might not be available yet. Feedback and Pull Requests are most welcome!


To use this plugin, add firebase_dynamic_links as a dependency in your pubspec.yaml file. You must also configure firebase dynamic links for each platform project: Android and iOS (see the example folder or for step by step details).

You can create short or long Dynamic Links with the Firebase Dynamic Links Builder API. This API accepts either a long Dynamic Link or an object containing Dynamic Link parameters, and returns a URL like the following example:

You can create a Dynamic Link programmatically by setting the following parameters and getting the DynamicLinkParameters.url parameter.

final DynamicLinkParameters components = new DynamicLinkParameters(
  domain: '',
  link: Uri.parse(''),
  androidParameters: new AndroidParameters(
      packageName: '',
      minimumVersion: 125,
  iosParameters: new IosParameters(
      bundleId: 'com.example.ios',
      minimumVersion: '1.0.1',
      appStoreId: '123456789',
  googleAnalyticsParameters: new GoogleAnalyticsParameters(
      campaign: 'example-promo',
      medium: 'social',
      source: 'orkut',
  itunesConnectAnalyticsParameters: new ItunesConnectAnalyticsParameters(
    providerToken: '123456',
    campaignToken: 'example-promo',
  socialMetaTagParameters:  new SocialMetaTagParameters(
    title: 'Example of a Dynamic Link',
    description: 'This link works whether app is installed or not!',

final Uri dynamicLink = await components.buildUrl();

To create a short Dynamic Link, build DynamicLinkParameters the same way, but use the DynamicLinkParameters.shortUrl parameter.

final ShortDynamicLink shortDynamicLink = await components.buildShortLink();
final Uri shortUrl = shortDynamicLink.shortUrl;

To shorten a long Dynamic Link, use the DynamicLinkParameters.shortenUrl method.

final ShortDynamicLink shortenedLink = await DynamicLinkParameters.shortenUrl(
  new DynamicLinkParametersOptions(ShortDynamicLinkPathLength.short),

final Uri shortUrl = shortenedLink.shortUrl;

Getting Started

See the example directory for a complete sample app using Google Dynamic Links for Firebase.


  • Fixed dynamic link dartdoc generation.


  • Fixed incorrect homepage link in pubspec.


  • Updated Gradle tooling to match Android Studio 3.1.2.


  • Initial release with api to create long or short dynamic links.


// Copyright 2018, the Flutter project authors.  Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import 'dart:async';

import 'package:flutter/material.dart';
import 'package:firebase_dynamic_links/firebase_dynamic_links.dart';

void main() => runApp(new MyApp());

class MyApp extends StatefulWidget {
  _MyAppState createState() => new _MyAppState();

class _MyAppState extends State<MyApp> {
  String _linkMessage;
  bool _isCreatingLink = false;

  Future<void> _createDynamicLink(bool short) async {
    setState(() {
      _isCreatingLink = true;

    final DynamicLinkParameters parameters = new DynamicLinkParameters(
      domain: '',
      link: Uri.parse(''),
      androidParameters: new AndroidParameters(
        packageName: 'io.flutter.plugins.firebasedynamiclinksexample',
      dynamicLinkParametersOptions: new DynamicLinkParametersOptions(
        shortDynamicLinkPathLength: ShortDynamicLinkPathLength.short,
      iosParameters: new IosParameters(
        bundleId: 'io.flutter.plugins.firebaseDynamicLinksExample',

    Uri url;
    if (short) {
      final ShortDynamicLink shortLink = await parameters.buildShortLink();
      url = shortLink.shortUrl;
    } else {
      url = await parameters.buildUrl();

    setState(() {
      _linkMessage = url.toString();
      _isCreatingLink = false;

  Widget build(BuildContext context) {
    return new MaterialApp(
      home: new Scaffold(
        appBar: new AppBar(
          title: const Text('Dynamic Links Example'),
        body: new Center(
          child: new Column(
            children: <Widget>[
              new ButtonBar(
                children: <Widget>[
                  new RaisedButton(
                    onPressed: !_isCreatingLink
                        ? () => _createDynamicLink(false)
                        : null,
                    child: const Text('Get Long Link'),
                  new RaisedButton(
                    onPressed: !_isCreatingLink
                        ? () => _createDynamicLink(true)
                        : null,
                    child: const Text('Get Short Link'),
              new Text(
                _linkMessage ?? '',

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  firebase_dynamic_links: "^0.0.4"

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter packages get

Alternatively, your editor might support flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

      import 'package:firebase_dynamic_links/firebase_dynamic_links.dart';
Version Uploaded Documentation Archive
0.0.4 Jun 6, 2018 Go to the documentation of firebase_dynamic_links 0.0.4 Download firebase_dynamic_links 0.0.4 archive
0.0.1 May 29, 2018 Go to the documentation of firebase_dynamic_links 0.0.1 Download firebase_dynamic_links 0.0.1 archive


We analyzed this package on Jun 19, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0-dev.63.0
  • pana: 0.11.3
  • Flutter: 0.5.4


Describes how popular the package is relative to other packages. [more]
0 / 100
Code health derived from static analysis. [more]
100 / 100
Reflects how tidy and up-to-date the package is. [more]
100 / 100
Overall score:
Weighted score of the above. [more]
Learn more about scoring.


Detected platforms: Flutter

References Flutter, and has no conflicting libraries.


  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.28.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.6 1.14.10
meta 1.1.5
sky_engine 0.0.99
typed_data 1.1.5
vector_math 2.0.6 2.0.7
Dev dependencies