launchify 1.0.1
launchify: ^1.0.1 copied to clipboard
A powerful Flutter UI package to launch WhatsApp, Email, Phone, Maps, and URLs with customizable Action Buttons and Link Rows.
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:launchify/launchify.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Launchify Demo',
debugShowCheckedModeBanner: false,
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.indigo),
useMaterial3: true,
),
home: const LaunchifyDemoScreen(),
);
}
}
class LaunchifyDemoScreen extends StatelessWidget {
const LaunchifyDemoScreen({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Launchify 🚀'),
centerTitle: true,
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
),
body: SingleChildScrollView(
padding: const EdgeInsets.all(20.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_buildSectionHeader(context, "ActionButton Mode (URL Hidden)"),
const SizedBox(height: 12),
Wrap(
spacing: 12,
runSpacing: 12,
children: [
const LaunchLink(
type: LaunchType.whatsapp,
value: "+923001234567",
label: "WhatsApp",
customIcon: LaunchIcon.fromNetwork(
"https://freepngimg.com/thumb/gmail/64774-computer-gmail-email-icons-png-image-high-quality.png",
),
style: LaunchStyle(
iconColor: Colors.white,
backgroundColor: Colors.red,
),
),
const LaunchLink(
type: LaunchType.phone,
value: "123456789",
label: "Call Support",
style: LaunchStyle(backgroundColor: Colors.green),
),
const LaunchLink(
type: LaunchType.email,
value: "[email protected]",
emailSubject: "Inquiry from App",
label: "Email Us",
style: LaunchStyle(backgroundColor: Colors.orange),
),
LaunchLink(
type: LaunchType.website,
value: "https://flutter.dev",
label: "Flutter Website",
style: LaunchStyle(
backgroundColor: Colors.blue.shade800,
borderRadius: 30,
),
),
const LaunchLink(
type: LaunchType.map,
value: "Googleplex",
label: "Find Us on Map",
style: LaunchStyle(
isOutlined: true,
textColor: Colors.indigo,
),
),
],
),
const SizedBox(height: 32),
_buildSectionHeader(context, "LinkRow Mode (URL Visible)"),
const SizedBox(height: 12),
Card(
elevation: 0,
color: Theme.of(
context,
).colorScheme.surfaceContainerHighest.withValues(alpha: 0.3),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
),
child: const Padding(
padding: EdgeInsets.all(8.0),
child: Column(
children: [
LaunchLink(
mode: LaunchDisplayMode.linkRow,
type: LaunchType.email,
value: "[email protected]",
),
Divider(indent: 40),
LaunchLink(
mode: LaunchDisplayMode.linkRow,
type: LaunchType.phone,
value: "+1 555 010 999",
visibleText: "+1 (555) 010-999 (Headquarters)",
),
Divider(indent: 40),
LaunchLink(
mode: LaunchDisplayMode.linkRow,
type: LaunchType.website,
value: "www.github.com",
visibleText: "View Source on GitHub",
icon: Icons.code,
),
],
),
),
),
const SizedBox(height: 32),
_buildSectionHeader(context, "Full Customization"),
const SizedBox(height: 12),
LaunchLink(
type: LaunchType.sms,
value: "555123",
smsBody: "Hello from Launchify!",
label: "SEND SECURE SMS",
style: LaunchStyle(
backgroundColor: Colors.black,
textColor: Colors.yellow,
iconColor: Colors.yellow,
fontSize: 18,
fontWeight: FontWeight.w900,
height: 60,
borderRadius: 0,
padding: const EdgeInsets.symmetric(horizontal: 40),
),
),
const SizedBox(height: 12),
LaunchLink(
type: LaunchType.website,
value: "https://pub.dev",
label: "VISIT PUB.DEV",
style: LaunchStyle(
isOutlined: true,
borderColor: Colors.red,
borderWidth: 2,
textColor: Colors.red,
borderRadius: 4,
),
),
const SizedBox(height: 32),
_buildSectionHeader(context, "Icon Customization"),
const SizedBox(height: 12),
const Wrap(
spacing: 12,
runSpacing: 12,
children: [
LaunchLink(
type: LaunchType.website,
value: "https://google.com",
label: "No Icon",
showIcon: false,
),
LaunchLink(
type: LaunchType.website,
value: "https://flutter.dev",
label: "Network SVG",
style: LaunchStyle(backgroundColor: Colors.blueGrey),
customIcon: LaunchIcon.fromNetwork(
'https://raw.githubusercontent.com/dnfield/flutter_svg/7d374d715c6f06b6f00c283626e9526e0b741005/example/assets/flutter_logo.svg',
),
),
],
),
const SizedBox(height: 32),
_buildSectionHeader(context, "RTL Support Preview"),
const SizedBox(height: 8),
const Text(
"Automatically flips icons and alignment in RTL locales (e.g., Arabic, Urdu).",
style: TextStyle(color: Colors.grey, fontSize: 13),
),
const SizedBox(height: 12),
Directionality(
textDirection: TextDirection.rtl,
child: LaunchLink(
mode: LaunchDisplayMode.linkRow,
type: LaunchType.whatsapp,
value: "+923001234567",
visibleText: "تواصل معنا عبر واتساب",
style: LaunchStyle(
iconColor: Colors.green,
textColor: Colors.green.shade900,
),
),
),
],
),
),
);
}
Widget _buildSectionHeader(BuildContext context, String title) {
return Text(
title,
style: Theme.of(context).textTheme.titleLarge?.copyWith(
fontWeight: FontWeight.bold,
color: Theme.of(context).colorScheme.primary,
),
);
}
}