external_app_launcher 3.1.0 copy "external_app_launcher: ^3.1.0" to clipboard
external_app_launcher: ^3.1.0 copied to clipboard

PlatformAndroidiOS
outdated

A Flutter plugin which helps you to open another app from your app

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:external_app_launcher/external_app_launcher.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
  }

  Color containerColor = Colors.red;

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: SizedBox(
            height: 200,
            width: 150,
            child: Column(
              children: [
                ElevatedButton(
                    style: ElevatedButton.styleFrom(
                      primary: Colors.blue,
                    ),
                    onPressed: () async {
                      var openAppResult = await LaunchApp.openApp(
                        androidPackageName: 'net.pulsesecure.pulsesecure',
                        iosUrlScheme: 'pulsesecure://',
                        appStoreLink:
                            'itms-apps://itunes.apple.com/us/app/pulse-secure/id945832041',
                        // openStore: false
                      );
                      print(
                          'openAppResult => $openAppResult ${openAppResult.runtimeType}');
                      // Enter thr package name of the App you want to open and for iOS add the URLscheme to the Info.plist file.
                      // The second arguments decide wether the app redirects PlayStore or AppStore.
                      // For testing purpose you can enter com.instagram.android
                    },
                    child: const Center(
                      child: Text(
                        "Open",
                        textAlign: TextAlign.center,
                      ),
                    )),
                ElevatedButton(
                    style: ElevatedButton.styleFrom(
                      primary: Colors.blue,
                    ),
                    onPressed: () async {
                      var isAppInstalledResult = await LaunchApp.isAppInstalled(
                        androidPackageName: 'net.pulsesecure.pulsesecure',
                        iosUrlScheme: 'pulsesecure://',
                        // openStore: false
                      );
                      print(
                          'isAppInstalledResult => $isAppInstalledResult ${isAppInstalledResult.runtimeType}');
                    },
                    child: const Center(
                      child: Text(
                        "Is app installed?",
                        textAlign: TextAlign.center,
                      ),
                    )),
              ],
            ),
          ),
        ),
      ),
    );
  }
}
330
likes
150
pub points
98%
popularity

Publisher

verified publishergeekyants.com

A Flutter plugin which helps you to open another app from your app

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter

More

Packages that depend on external_app_launcher