launchify 1.0.0 copy "launchify: ^1.0.0" to clipboard
launchify: ^1.0.0 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",
                ),
                const LaunchLink(
                  type: LaunchType.phone,
                  value: "123456789",
                  label: "Call Support",
                  style: LaunchStyle(backgroundColor: Colors.green),
                ),
                const LaunchLink(
                  type: LaunchType.email,
                  value: "hello@example.com",
                  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: "support@launchify.io",
                    ),
                    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, "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,
      ),
    );
  }
}
1
likes
160
points
0
downloads

Publisher

verified publishergreelogix.com

Weekly Downloads

A powerful Flutter UI package to launch WhatsApp, Email, Phone, Maps, and URLs with customizable Action Buttons and Link Rows.

Repository (GitHub)
View/report issues

Topics

#ui #widget #url-launcher #whatsapp #email

Documentation

API reference

License

MIT (license)

Dependencies

cupertino_icons, flutter, url_launcher

More

Packages that depend on launchify