share_plus_dialog 1.0.1
share_plus_dialog: ^1.0.1 copied to clipboard
A package that improves sharing on desktop and web from the share_plus plugin with a sharing dialog
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:share_plus_dialog/share_plus_dialog.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(
colorSchemeSeed: Colors.blue,
brightness: Brightness.dark,
useMaterial3: true,
),
home: const HomePage(),
);
}
}
class HomePage extends StatelessWidget {
const HomePage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
ElevatedButton(
onPressed: () => ShareDialog.share(context, 'amazing text',
platforms: SharePlatform.defaults),
child: const Text('Share'),
),
],
)),
);
}
}