Skip to content

best-flutter/linker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

linker

A flutter plugin to link with other app or system function.

Getting Started

add


linker: 0.0.2

to your pubspec.yaml, and run flutter packages get

Usage

Android

Use action

try {
  ActivityResult result = await Linker.startActivityForResult(
      new Intent.fromAction("android.settings.SETTINGS"), 0);
  print(result);
} on PlatformException catch (e) {
  print("Open failed $e");
}

Open google map

try {
  await Linker.startActivity(new Intent.fromAction(
    "android.intent.action.VIEW",
    uri: Uri.parse(
        "http://ditu.google.cn/maps?hl=zh&mrt=loc&q=31.1198723,121.1099877(上海青浦大街100号)"),
  ));
} on PlatformException catch (e) {
  print("Open failed $e");
}

Open QQ

 try {
      await Linker.startActivity(new Intent.fromAction(Intent.ACTION_VIEW,
          uri: Uri.parse("mqqwpa://im/chat?chat_type=wpa&uin=123456")));
    } on PlatformException catch (e) {
      print("Open failed $e");
    }

Open Wechat

try {
  await Linker.startActivity(new Intent.callApp( packageName:  "com.tencent.mm",className: "com.tencent.mm.ui.LauncherUI"));
} on PlatformException catch (e) {
  print("Open failed $e");
}

ios

Open wechat

 try {
 await Linker.openURL("weixin://");
} on PlatformException catch (e) {
  print("Open failed $e");
}

Open Settings

try {
  await Linker.openURL("App-Prefs:root");
} on PlatformException catch (e) {
  print("Open failed $e");
}

Call 10086

 try {
  await Linker.openURL("tel:10086");
} on PlatformException catch (e) {
  print("Open failed $e");
}

About

A plugin for flutter to link with other app.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published