OpenUrlAction class final

An action configuration for opening URLs in various ways.

Features:

  • In-app web view support
  • External app launching
  • Platform-specific behavior
  • URL validation
  • Error handling

Example:

// Open in in-app web view
final action = OpenUrlAction(
  url: 'https://example.com',
  mode: UrlLaunchMode.inApp,
);

// Open in external browser
final action = OpenUrlAction(
  url: 'https://example.com',
  mode: UrlLaunchMode.externalApp,
);

// Use platform default
final action = OpenUrlAction(
  url: 'https://example.com',
  mode: UrlLaunchMode.platformDefault,
);

The action will:

  • Validate the URL before launching
  • Check if the URL can be launched
  • Handle launch failures gracefully
  • Log debug information
Inheritance
  • Object
  • ActionConfiguration
  • OpenUrlAction
Annotations
  • @JsonSerializable()

Constructors

OpenUrlAction.new({String? title, String? url, UrlLaunchMode mode = UrlLaunchMode.platformDefault, bool? isAwaited})
OpenUrlAction.fromJson(Map<String, dynamic> json)
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
isAwaited bool?
Whether to await this configuration's execution.
finalinherited
mode UrlLaunchMode
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
schemaType String
The schema type of this configuration.
finalinherited
title String?
Optional title for this configuration.
finalinherited
url String?
final

Methods

execute(BuildContext context, {Map<String, dynamic>? arguments}) FutureOr<void>
Executes this configuration.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Properties

typeDescriptor → TypeDescriptor<OpenUrlAction>
final

Constants

schemaName → const String