direct_link 0.2.3 direct_link: ^0.2.3 copied to clipboard
Direct link extractor from URL to stream and download directly.
import 'package:direct_link/direct_link.dart';
import 'package:example/src/home/presentation/screens/home_screen.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
await DirectLink().init(
allowNotification: true,
androidInitializationSettings:
const AndroidInitializationSettings('launch_background'),
);
runApp(const ProviderScope(child: MyApp()));
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Direct Link',
darkTheme: ThemeData.dark(useMaterial3: true),
theme: ThemeData.light(useMaterial3: true),
debugShowCheckedModeBanner: false,
home: const HomeScreen(),
);
}
}