Skip to content
pubscout

whatsapp_unilink

2.1.0, released 4 years ago by dartside.dev

Dart package helping your app interact with WhatsApp via HTTP links (universal links).

WASM-ready
$ flutter pub add whatsapp_unilink
Source repository

What it does

The whatsapp_unilink package helps you build HTTP links for WhatsApp by converting phone numbers into the expected format and handling encoding details. It supports both string and Uri representations, allowing you to easily open WhatsApp chats with pre-filled phone numbers and text.

AI-written summary of version 2.1.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to generate WhatsApp universal links with optional phone numbers and pre-filled text.
  • You want a simple utility to format phone numbers correctly for WhatsApp interactions.

Skip it when

  • You need to convert local phone numbers to international formats based on the device's locale.
  • You require an in-app chat interface rather than launching external WhatsApp links.

Strengths

  • Hides encoding and link building details.
  • Supports converting WhatsAppUnilink instances to both String and Uri.
  • Works on all Dart projects without any Flutter-specific dependency.

Weaknesses

  • Does not convert local phone numbers to international format automatically.
  • Relies on external packages like url_launcher to actually open the links in a Flutter app.

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
0

No special native setup or permissions required by this package itself, though url_launcher may require platform-specific configuration to launch external URLs.

import 'package:whatsapp_unilink/whatsapp_unilink.dart';
import 'package:url_launcher/url_launcher.dart';

launchWhatsAppUri() async {
  final link = WhatsAppUnilink(
    phoneNumber: '+001-(555)1234567',
    text: "Hey! I'm inquiring about the apartment listing",
  );
  await launch(link.asUri());
}

Alternatives

Packages that do the same job and could replace whatsapp_unilink.

  • deeplink_x

    Type-safe external deeplinks into apps with automatic store and web fallbacks

  • mailto

    Create mailto URIs with support for multiple to, cc, bcc, subject, and body fields with encoding.

  • whatsapp_share2

    Share text, links or files to a specific WhatsApp contact from Flutter.

  • whatsapp_share

    Share text, links or files to a specific WhatsApp contact from Flutter.