smart_deep_links 1.0.0
smart_deep_links: ^1.0.0 copied to clipboard
A comprehensive Flutter package for handling standard and deferred deep links with custom backend integration and fingerprinting support.
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:smart_deep_links/smart_deep_links.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
// Initialize the singleton
await SmartDeepLinks().initialize(
baseUrl: 'https://your-saas-domain.com',
paymentToken: 'your-payment-token',
onLink: (uri, isDeferred) {
debugPrint('Deep Link Received: $uri (Deferred: $isDeferred)');
// Handle navigation here
},
onError: (message) {
debugPrint('Deep Link Error: $message');
},
);
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: const Text('Smart Deep Links Example')),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
ElevatedButton(
onPressed: () async {
await SmartDeepLinks().createAndShareLink(
targetPath: '/product/123',
title: 'Check out this product!',
);
},
child: const Text('Share Product Link'),
),
const SizedBox(height: 20),
ElevatedButton(
onPressed: () async {
await SmartDeepLinks().createAndShareQRCode(
targetPath: '/invite/friend',
title: 'Scan to Join!',
);
},
child: const Text('Share QR Code'),
),
],
),
),
),
);
}
}