AndroidIntent class

Flutter plugin for launching arbitrary Android Intents.

See the official Android documentation for more information on how to use Intents.

Constructors

AndroidIntent({String? action, List<int>? flags, String? category, String? data, Map<String, dynamic>? arguments, Map<String, List>? arrayArguments, String? package, String? componentName, Platform? platform, String? type})
Builds an Android intent with the following parameters action refers to the action parameter of the intent. flags is the list of int that will be converted to native flags. category refers to the category of the intent, can be null. data refers to the string format of the URI that will be passed to intent. arguments is the map that will be converted into an extras bundle and passed to the intent. arrayArguments is a map that will be converted into an extra bundle as in an array and passed to the intent. package refers to the package parameter of the intent, can be null. componentName refers to the component name of the intent, can be null. If not null, then package but also be provided. type refers to the type of the intent, can be null.
const
AndroidIntent.private({Platform? platform, MethodChannel? channel, String? action, List<int>? flags, String? category, String? data, Map<String, dynamic>? arguments, Map<String, List>? arrayArguments, String? package, String? componentName, String? type})
This constructor is only exposed for unit testing. Do not rely on this in app code, it may break without warning.

Properties

action String?
This is the general verb that the intent should attempt to do. This includes constants like ACTION_VIEW.
final
arguments Map<String, dynamic>?
The equivalent of extras, a generic Bundle of data that the Intent can carry. This is a slot for extraneous data that the listener may use.
final
arrayArguments Map<String, List>?
Similar to arguments, but in this case the arguments are an array and will be added to the intent as in an array extra instead of of an array list.
final
category String?
An optional additional constant qualifying the given action.
final
componentName String?
Set the exact ComponentName that should handle the intent. If this is set package should also be non-null.
final
data String?
The Uri that the action is pointed towards.
final
flags List<int>?
Constants that can be set on an intent to tweak how it is finally handled. Some of the constants are mirrored to Dart via Flag.
final
hashCode int
The hash code for this object.
no setterinherited
package String?
Sets the data to only resolve within this given package.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type String?
Set an explicit MIME data type.
final

Methods

canResolveActivity() Future<bool?>
Check whether the intent can be resolved to an activity.
convertFlags(List<int> flags) int
This method is just visible for unit testing and should not be relied on. Its method signature may change at any time.
launch() Future<void>
Launch the intent.
launchChooser(String title) Future<void>
Launch the intent with 'createChooser(intent, title)'.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
sendBroadcast() Future<void>
Sends intent as broadcast.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited