sojo_link 0.1.0 copy "sojo_link: ^0.1.0" to clipboard
sojo_link: ^0.1.0 copied to clipboard

An alternative to Firebase Dynamic Links which offers similar API and setup, enabling seamless migration with minimal code changes.

example/lib/main.dart

import 'dart:developer';

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

void main() {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  String deepLink = "";
  Map<String, dynamic> utmParam = {};

  @override
  void initState() {
    super.initState();
    SojoLink.instance.onLink.listen((pendingDynamicLink) {
      log("AppLink: ${pendingDynamicLink.link.toString()}");
      setState(() {
        deepLink = pendingDynamicLink.link.toString();
        utmParam = pendingDynamicLink.utmParameters;
      });
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
          appBar: AppBar(
            title: const Text('Plugin example app'),
          ),
          body: Center(
            child: Column(
              mainAxisAlignment: MainAxisAlignment.center,
              crossAxisAlignment: CrossAxisAlignment.center,
              children: [
                const Text(
                  "Here is the Link",
                  style: TextStyle(fontSize: 20),
                ),
                const SizedBox(
                  height: 15,
                ),
                Text(
                  deepLink,
                  style: const TextStyle(fontSize: 16),
                ),
                const SizedBox(
                  height: 15,
                ),
                Text(
                  "UtmParameters $utmParam",
                  style: const TextStyle(fontSize: 16),
                ),
                const SizedBox(
                  height: 15,
                ),
              ],
            ),
          )),
    );
  }
}
10
likes
150
points
152
downloads

Publisher

verified publishertruenary.com

Weekly Downloads

An alternative to Firebase Dynamic Links which offers similar API and setup, enabling seamless migration with minimal code changes.

Homepage
Repository (GitHub)

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on sojo_link