Flutter App Links – AndroidCoding.in

Flutter App Links :

Flutter app links is the concept where you can redirect users directly to your app and move them to a specific screen.

Now a days most of the apps send out push notifications regarding the offers, send ads though social media and various other ways which have a link in them.

Have you ever thought what this link is and clicking on which you will be directly landed into their app if app is not installed it will open you Play Store/ App Store where you can download their app and continue.

These app links play a key role in increasing sales and user engagement in app which will add’s up revenue.

So almost every popular app will surely implement these mechanisms to increase revenue.

In this tutorial let’s try to find out the way we can implement them in flutter app. You may go through our previous blogs on deep linking.

 

pubspec.yaml :

Here we will specify the go_router plugin. This plugin helps you to route through different screens in the app.

dependencies:
  flutter:
    sdk: flutter

  go_router:

 

main.dart :

Providing the full code for app links implementation.

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

void main() => runApp(MaterialApp.router(routerConfig: router));

final router = GoRouter(
  routes: [
    GoRoute(
      path: '/',
      builder: (_, __) => Scaffold(
        appBar: AppBar(title: const Text('Home Screen')),
      ),
      routes: [
        GoRoute(
          path: 'details',
          builder: (_, __) => Scaffold(
            appBar: AppBar(title: const Text('Details Screen')),
          ),
        ),
      ],
    ),
  ],
);

 

If you have any query’s in the implementation of flutter app links do let us know in the comment section below.For more interesting tutorials share and like us.

By