Launchify 🚀

A powerful Flutter UI package built on top of url_launcher that provides ready-to-use, customizable UI widgets for launching URLs with an excellent developer experience.

✨ Features

  • 📱 Multiple Launch Types: WhatsApp, Email, Phone, SMS, Website, Map, and Custom URLs.
  • 🎨 Two Display Modes:
    • Action Button Mode: Clean CTA buttons with hidden URLs.
    • Link Row Mode: Visible URLs/text with icons for settings or info screens.
  • 🌍 RTL/LTR Support: Automatically respects system directionality and flips layouts accordingly.
  • 🛡️ Safe Launching: Built-in validation and security checks using canLaunchUrl.
  • 💅 Highly Customizable: Full control over colors, icons, borders, padding, and more.
  • 🛠️ Smart URL Builders: Automatically formats phone numbers, creates mailto queries, and more.

📦 Installation

Add launchify to your pubspec.yaml:

dependencies:
  launchify: ^1.0.0

Platform Configuration

Since this package uses url_launcher, you must follow its configuration steps for each platform:

Android

Add the following to your AndroidManifest.xml (inside <queries>):

<queries>
  <intent>
    <action android:name="android.intent.action.VIEW" />
    <data android:scheme="https" />
  </intent>
  <intent>
    <action android:name="android.intent.action.DIAL" />
  </intent>
  <intent>
    <action android:name="android.intent.action.SENDTO" />
    <data android:scheme="mailto" />
  </intent>
  <intent>
    <action android:name="android.intent.action.VIEW" />
    <data android:scheme="sms" />
  </intent>
</queries>

iOS

Add the schemes you want to support to your Info.plist:

<key>LSApplicationQueriesSchemes</key>
<array>
  <string>https</string>
  <string>tel</string>
  <string>mailto</string>
  <string>sms</string>
  <string>whatsapp</string>
</array>

🚀 Usage

Simple Action Button

LaunchLink(
  type: LaunchType.whatsapp,
  value: "+923001234567",
  label: "Chat with Us",
)
LaunchLink(
  mode: LaunchDisplayMode.linkRow,
  type: LaunchType.email,
  value: "[email protected]",
)

Custom Styling

LaunchLink(
  type: LaunchType.website,
  value: "https://flutter.dev",
  style: LaunchStyle(
    backgroundColor: Colors.deepPurple,
    borderRadius: 20,
    isOutlined: true,
  ),
)

🛠️ Components

The main unified widget. It automatically generates the correct URI based on the LaunchType.

Property Description
mode actionButton or linkRow
type whatsapp, phone, email, sms, website, map, custom
value The primary data (phone number, email address, or URL)
label Text for action button mode
visibleText Text for link row mode
style LaunchStyle for customization
onResult Callback that returns true if launch succeeded

LaunchStyle

Provides deep customization for the widgets.

Property Default (Action Button)
backgroundColor Theme Primary Color
textColor White
borderRadius 8.0
isOutlined false

🌍 RTL Support

Launchify is designed for global apps. It automatically detects Directionality.of(context) and:

  1. Position icons correctly relative to text.
  2. Aligns rows based on LTR/RTL settings.
  3. Supports Arabic, Urdu, Hebrew, and other RTL languages out of the box.

🔒 Security

  • Always uses canLaunchUrl before attempting a launch.
  • Supports allowedSchemes to restrict which URLs can be opened.
  • Parses and validates URIs internally before hand-off to the OS.

📝 License

MIT License.