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",
)
Visible Link Row
LaunchLink(
mode: LaunchDisplayMode.linkRow,
type: LaunchType.email,
value: "support@example.com",
)
Custom Styling
LaunchLink(
type: LaunchType.website,
value: "https://flutter.dev",
style: LaunchStyle(
backgroundColor: Colors.deepPurple,
borderRadius: 20,
isOutlined: true,
),
)
🛠️ Components
LaunchLink
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 |
showIcon |
Whether to show an icon (default: true) |
icon |
IconData to override the default |
customIcon |
LaunchIcon for Assets, SVG, or Network images |
onResult |
Callback that returns true if launch succeeded |
🎨 Icon & Image Customization
Launchify supports much more than just Material Icons. You can use SVG, PNG, JPG files from your assets or even from a network URL.
Using Default Icons
By default, LaunchLink shows a context-relevant icon. To disable it:
LaunchLink(
type: LaunchType.phone,
value: "123456",
showIcon: false, // Removes the icon
)
Using SVG or Asset Images
To use a custom image (e.g., a branded WhatsApp logo):
LaunchLink(
type: LaunchType.whatsapp,
value: "+923001234567",
customIcon: LaunchIcon.fromAsset('assets/images/whatsapp_logo.svg'),
)
Using Network Images
LaunchLink(
type: LaunchType.website,
value: "https://example.com",
customIcon: LaunchIcon.fromNetwork('https://example.com/logo.png'),
)
LaunchStyle
Provides deep customization for the widgets.
| Property | Default (Action Button) |
|---|---|
backgroundColor |
Theme Primary Color |
textColor |
White |
borderRadius |
8.0 |
isOutlined |
false |
iconWidth |
Derived from fontSize |
iconHeight |
Derived from fontSize |
iconFit |
BoxFit.contain |
🌍 RTL Support
Launchify is designed for global apps. It automatically detects Directionality.of(context) and:
- Position icons correctly relative to text.
- Aligns rows based on LTR/RTL settings.
- Supports Arabic, Urdu, Hebrew, and other RTL languages out of the box.
🔒 Security
- Always uses
canLaunchUrlbefore attempting a launch. - Supports
allowedSchemesto restrict which URLs can be opened. - Parses and validates URIs internally before hand-off to the OS.
📝 License
MIT License.
Libraries
- launcher
- launchify
- A powerful Flutter UI package for launching URLs with ready-to-use widgets.
- models/display_mode
- models/launch_icon
- models/launch_type
- models/style_models
- utils/rtl_helper
- utils/url_builder
- utils/url_validator
- widgets/icon_viewer
- widgets/launch_link
- widgets/launch_link_row