p-hatan/ mirror

pub repository

mirror.p-hatan.ir

android_intent_plus

3.1.1+1

Flutter plugin for launching Android Intents. Not supported on iOS.

Download archive

Readme

Android Intent Plugin for Flutter

Flutter Community: android_intent_plus

pub package android_intent_plus

This plugin allows Flutter apps to launch arbitrary intents when the platform is Android. If the plugin is invoked on iOS, it will crash your app. In checked mode, we assert that the platform should be Android.

Use it by specifying action, category, data and extra arguments for the intent. It does not support returning the result of the launched activity. Sample usage:

if (platform.isAndroid) {
  AndroidIntent intent = AndroidIntent(
      action: 'action_view',
      data: 'https://play.google.com/store/apps/details?'
          'id=com.google.android.apps.myapp',
      arguments: {'authAccount': currentUserEmail},
  );
  await intent.launch();
}

See documentation on the AndroidIntent class for details on each parameter.

Action parameter can be any action including a custom class name to be invoked. If a standard android action is required, the recommendation is to add support for it in the plugin and use an action constant to refer to it. For instance:

'action_view' translates to android.os.Intent.ACTION_VIEW

'action_location_source_settings' translates to android.settings.LOCATION_SOURCE_SETTINGS

'action_application_details_settings' translates to android.settings.ACTION_APPLICATION_DETAILS_SETTINGS

if (platform.isAndroid) {
  final AndroidIntent intent = AndroidIntent(
    action: 'action_application_details_settings',
    data: 'package:com.example.app', // replace com.example.app with your applicationId
  );
  await intent.launch();
}

Feel free to add support for additional Android intents.

The Dart values supported for the arguments parameter, and their corresponding Android values, are listed here. On the Android side, the arguments are used to populate an Android Bundle instance. This process currently restricts the use of lists to homogeneous lists of integers or strings.

Note that a similar method does not currently exist for iOS. Instead, the url_launcher plugin can be used for deep linking. Url launcher can also be used for creating ACTION_VIEW intents for Android, however this intent plugin also allows clients to set extra parameters for the intent.

Platform Support

Android
✔️

Check out our documentation website to learn more. Plus plugins documentation

Important: As of January 2021, the Flutter team is no longer accepting non-critical PRs for the original set of plugins in flutter/plugins, and instead they should be submitted in this project. You can read more about this announcement here. as well as in the Flutter 2 announcement blog post.

Changelog

3.1.1+1

  • Add issue_tracker link.

3.1.1

  • Fix embedding issue in example
  • Update Platform dependency to not use deprecated function

3.1.0

  • Added arrayArguments to explicitly pass array values to an intent

3.0.2

  • Fixed the buildIntent method to do not set the pacakage to null if it's not resolvable
  • Updated the example of resolving intent with explicitly defined package name

3.0.1

  • Upgrade dependencies and Android compile version
  • Remove some leftover code of Android v1 embedding

3.0.0

  • Remove deprecated method registerWith (of Android v1 embedding)

2.1.0

  • migrate integration_test to flutter sdk

2.0.0

  • increase flutter SDK version to 1.20.0

1.0.3

  • clean up ios folder
  • rename channel name to dev.fluttercommunity.plus in java tests

1.0.2

  • Android: migrate to mavenCentral

1.0.1

  • Improve documentation

1.0.0

  • Null safety support.

0.4.2

  • Add launchChooser method, which uses Intent.createChooser internally.
  • Add sendBroadcast method, which uses context.sendBroadcast() internally.

0.4.1

  • Renamed Method Channel and changed Java package to avoid collision with android_intent

0.4.0

  • Transfer to plus-plugins monorepo

0.3.8

  • Transfer package to Flutter Community under new name android_intent_plus.

0.3.7+2

0.3.7+1

  • Fix CocoaPods podspec lint warnings.

0.3.7

  • Add a Future<bool> canResolveActivity method to the AndroidIntent class. It can be used to determine whether a device supports a particular intent or has an app installed that can resolve it. It is based on PackageManager resolveActivity.

0.3.6+1

  • Bump the minimum Flutter version to 1.12.13+hotfix.5.
  • Bump the minimum Dart version to 2.3.0.
  • Uses Darts spread operator to build plugin arguments internally.
  • Remove deprecated API usage warning in AndroidIntentPlugin.java.
  • Migrates the Android example to V2 embedding.

0.3.6

  • Marks the action parameter as optional
  • Adds an assertion to ensure the intent receives an action, component or both.

0.3.5+1

  • Make the pedantic dev_dependency explicit.

0.3.5

0.3.4+8

  • Remove the deprecated author: field from pubspec.yaml
  • Migrate the plugin to the pubspec platforms manifest.
  • Require Flutter SDK 1.10.0 or greater.

0.3.4+7

  • Fix pedantic linter errors.

0.3.4+6

  • Add missing DartDocs for public members.

0.3.4+5

  • Remove AndroidX warning.

0.3.4+4

  • Include lifecycle dependency as a compileOnly one on Android to resolve potential version conflicts with other transitive libraries.

0.3.4+3

  • Android: Use android.arch.lifecycle instead of androidx.lifecycle:lifecycle in build.gradle to support apps that has not been migrated to AndroidX.

0.3.4+2

  • Fix resolveActivity not respecting the provided componentName.

0.3.4+1

  • Fix minor lints in the Java platform code.
  • Add smoke e2e tests for the V2 embedding.
  • Fully migrate the example app to AndroidX.

0.3.4

  • Migrate the plugin to use the V2 Android engine embedding. This shouldn't affect existing functionality. Plugin authors who use the V2 embedding can now instantiate the plugin and expect that it correctly responds to app lifecycle changes.

0.3.3+3

  • Define clang module for iOS.

0.3.3+2

  • Update and migrate iOS example project.

0.3.3+1

  • Added "action_application_details_settings" action to open application info settings .

0.3.3

  • Added "flags" option to call intent.addFlags(int) in native.

0.3.2

  • Added "action_location_source_settings" action to start Location Settings Activity.

0.3.1+1

  • Fix Gradle version.

0.3.1

  • Add a new componentName parameter to help the intent resolution.

0.3.0+2

  • Bump the minimum Flutter version to 1.2.0.
  • Add template type parameter to invokeMethod calls.

0.3.0+1

  • Log a more detailed warning at build time about the previous AndroidX migration.

0.3.0

  • Breaking change. Migrate from the deprecated original Android Support Library to AndroidX. This shouldn't result in any functional changes, but it requires any Android apps using this plugin to also migrate if they're using the original support library.

0.2.1

  • Updated Gradle tooling to match Android Studio 3.1.2.

0.2.0

  • Breaking change. Set SDK constraints to match the Flutter beta release.

0.1.1

  • Simplified and upgraded Android project template to Android SDK 27.
  • Updated package description.

0.1.0

  • Breaking change. Upgraded to Gradle 4.1 and Android Studio Gradle plugin 3.0.1. Older Flutter projects need to upgrade their Gradle setup as well in order to use this version of the plugin. Instructions can be found here.

0.0.3

  • Add FLT prefix to iOS types.

0.0.2

  • Add support for transferring structured Dart values into Android Intent instances as extra Bundle data.

0.0.1

  • Initial release

Installing

export PUB_HOSTED_URL=https://pub.mirror.p-hatan.ir
flutter pub add android_intent_plus
pubspec.yaml
name: android_intent_plus
description: Flutter plugin for launching Android Intents. Not supported on iOS.
version: 3.1.1+1
homepage: https://plus.fluttercommunity.dev/
repository: https://github.com/fluttercommunity/plus_plugins/tree/main/packages/
issue_tracker: https://github.com/fluttercommunity/plus_plugins/labels/android_intent_plus

environment:
  sdk: ">=2.12.0 <3.0.0"
  flutter: ">=1.20.0"

flutter:
  plugin:
    platforms:
      android:
        package: dev.fluttercommunity.plus.androidintent
        pluginClass: AndroidIntentPlugin

dependencies:
  flutter:
    sdk: flutter
  platform: ^3.1.0
  meta: ^1.3.0

dev_dependencies:
  flutter_test:
    sdk: flutter
  test: ^1.16.4
  mockito: ^5.0.0
  flutter_lints: ^1.0.4

Version history

VersionPublishedArchiveSHA-256
0.0.12020-04-20T18:01:16.690994ZDownloadb7489ce2b3274f14a8d6257bf578e65c42bbaa2ae551a601d4e3437232b6b798
0.3.82020-07-19T16:42:46.681232ZDownloadf8192b874e5588422a4e87d6eb980f1ecebef2caf5961482cb1056b5cae8f475
0.4.02020-10-12T19:51:30.901536ZDownload807ad491d4d10a164cf973c067b6498285079364a8c8877eee4fcab6f538749b
0.4.12020-12-08T09:38:38.337860ZDownload5c82e1d7cecfe45365b73b1ff700c1e1ee36fd2b02c548bf3915b929a16d1e4a
0.4.22021-01-03T09:24:38.835830ZDownloadfe19cf4877d3c04f82e8ed7061eaba70d44390cc153bc56c3003b8a4c0fe32f0
0.5.0-nullsafety.12021-02-02T09:23:50.172542ZDownload414c5b5f7170d89d17a2082ba6850f39f925ee2218bf1b52e5da93a06a27b2a9
1.0.02021-03-02T11:04:38.268392ZDownload384782cd7ece906e3c1fcbf03d41d579698377962041dd60bdb28041c1a8b8ef
1.0.12021-04-28T18:06:09.764430ZDownload4337b1a91de952e77d66c6ddc114284a77a15dff25321256a572dd098d26c837
1.0.22021-06-15T09:12:48.788671ZDownloade49b4d9e26135dd7ef83606aac56bd3105345e8243de903939a15c5aa07cc0ec
2.0.02021-08-20T06:31:11.454923ZDownload04a637d52550321b9a080987e27dccf197740b4c653f7a600b053a0ff060782d
2.1.02021-10-01T18:34:57.312165ZDownload4ccbb7742de09159a0d22d57c3d59fa46806382a5c27dcfdb95e447ceb18a5a6
3.0.02021-10-05T08:31:25.864008ZDownloadca54790dde0cce7fbbfabce350e96a72a70adc7467cc064ddba22ff9f994c2c4
3.0.12021-10-05T15:36:16.001456ZDownloadd5f5bdb6565c998b8e4baf0d941fd9e46a8f6a0ef470eb6a661d917abbf9fb8a
3.0.22021-11-01T12:37:26.726627ZDownload0d0eeb73667714c692ca59e69cef66a1fbb9dd63d31cc0f6efeaf31277d380ed
3.1.02022-01-21T13:37:18.674035ZDownloada4152542ca450762cc3057d9873fee8a3483dd19203a69af614cb2fb46191d00
3.1.12022-02-16T10:47:53.350489ZDownloadd696e3909f41b1e89e3e361c7b06281bbf18694beb731e7669246bfdd2e56fff
3.1.1+12022-08-10T05:45:53.918201ZDownload7e99de047c050ef76ef81e6776de6afaf12a823e8c013845474f25357015e1f6
3.1.22022-10-03T08:18:23.530962ZDownloadac19c05a6489cbd592c136e0b656fc12870bacdb01f82955a023edcaeadfefc5
3.1.32022-10-07T06:14:54.834146ZDownload2218670da5af8acc20db5b809d4ebbf773ca80d07a623785664e496999e3298b
3.1.42022-10-10T14:37:21.185288ZDownload36d225cd050db0de62903acbe0661cb25f9e08fc02bec0b931c325e67f6e20b4
3.1.52022-10-18T05:59:26.140620ZDownloadebd110b60723334bdc6eeb373116d6c52e9bed8feb9dcbd9f034531f56636e31
3.1.62023-02-09T14:14:32.525240ZDownload54810cb33945c2c10742cd746ea994822c115e9dbe189919bc63cb436e45a6af
3.1.72023-04-10T19:36:05.420778ZDownload6bcdcd20461ac7a0c785f6298cdda96ad275d5bcbc1ecf28829cbe03ec6690be
3.1.82023-04-26T07:16:15.379539ZDownload28a665a6cd505a03ba480d78a36a1959c24de0c32083dd1e82766c99299cfca3
3.1.92023-04-27T15:05:27.871107ZDownload04cbc7c332a6f0bba88fed354de78813e9d24049c1800aaf10f449c7adc22603
4.0.02023-05-09T12:46:12.556606ZDownloadf79fbb8ccb64b5584d19caa9c3d15613bf21cfbd829a6ca7f089fb5dfd43f8aa
4.0.12023-05-19T06:36:27.568337ZDownload2c87d8330ba5deef5fe20e77f4d178190b3b24531dce08368030ab4be40a9d4e
4.0.22023-08-02T12:08:49.834430ZDownloadf72ae20bb37108694f442e7ae6acbd28b453ca62ce86842f6787b784355abfe6
4.0.32023-10-10T21:58:27.629255ZDownloade1c62bb41c90e15083b7fb84dc327fe90396cc9c1445b55ff1082144fabfb4d9
5.0.02023-10-09T08:41:41.713019ZDownloadbfb29839be3886fa48faa631aa0123cd8531205df1abb80ee804935c75dd3cdb
5.0.12024-03-20T11:16:30.612587ZDownloade92d14009f3f6ebafca6a601958aaebb793559fb03a1961fe3c5596db95af2cb
5.0.22024-04-08T19:52:58.267309ZDownload2bfdbee8d65e7c26f88b66f0a91f2863da4d3596d8a658b4162c8de5cf04b074
5.1.02024-07-29T10:41:30.623080ZDownload007703c1b2cac7ca98add3336b98cffa4baa11d5133cc463293dba9daa39cdf6
5.2.02024-10-17T14:48:38.739923ZDownload38921ec22ebb3b9a7eb678792cf6fab0b6f458b61b9d327688573449c9b47db3
5.2.12024-12-12T15:24:30.334352ZDownload53136214d506d3128c9f4e5bfce3d026abe7e8038958629811a8d3223b1757c1
5.2.22025-01-14T08:09:53.569921ZDownload884b01361fe3756c4abbb56a382a00b16a2519079794a585afa7019a73cc0add
5.3.02025-02-03T19:02:01.818249ZDownloaddfc1fd3a577205ae8f11e990fb4ece8c90cceabbee56fcf48e463ecf0bd6aae3
5.3.12025-08-11T20:20:33.808148ZDownload2329378af63f49b985cb2e110ac784d08374f1e2b1984be77ba9325b1c8cce11
6.0.02025-09-11T10:39:29.927362ZDownload14a9f94c5825a528e8c38ee89a33dbeba947efbbf76f066c174f4f3ae4f48feb
6.1.02026-07-23T21:33:07.172267ZDownload4d4bbd619d698cbee3c400ba89246ecb0f525146b0ae05389f62ede47abd5bec

Dependencies

flutter { "sdk": "flutter" }

meta "^1.3.0"

platform "^3.1.0"