NotificationAction class abstract

A platform-neutral notification action.

id is intentionally not an enum: applications can add action types without changing this package.

Available extensions
Annotations
  • @freezed

Constructors

NotificationAction({required String id, required String title, String? icon, @Default.new(false) bool destructive, @Default.new(true) bool showsUserInterface, @Default.new(false) bool input, String? inputLabel, @Default.new(ActionExecutionMode.any) ActionExecutionMode executionMode, @Default.new(<String, Object?>{}) Map<String, Object?> metadata})
const
factory
NotificationAction.fromJson(Map<String, Object?> json)
factory

Properties

copyWith → $NotificationActionCopyWith<NotificationAction>
Create a copy of NotificationAction with the given fields replaced by the non-null parameter values.
no setterinherited
destructive → bool
no setterinherited
executionMode → ActionExecutionMode
no setterinherited
hashCode → int
The hash code for this object.
no setterinherited
icon → String?
no setterinherited
id → String
no setterinherited
input → bool
no setterinherited
inputLabel → String?
no setterinherited
metadata → Map<String, Object?>
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
showsUserInterface → bool
no setterinherited
title → String
no setterinherited

Methods

map<TResult extends Object?>(TResult $default(_NotificationAction value)) → TResult

Available on NotificationAction, provided by the NotificationActionPatterns extension

A switch-like method, using callbacks.
mapOrNull<TResult extends Object?>(TResult? $default(_NotificationAction value)?) → TResult?

Available on NotificationAction, provided by the NotificationActionPatterns extension

A variant of map that fallback to returning null.
maybeMap<TResult extends Object?>(TResult $default(_NotificationAction value)?, {required TResult orElse()}) → TResult

Available on NotificationAction, provided by the NotificationActionPatterns extension

A variant of map that fallback to returning orElse.
maybeWhen<TResult extends Object?>(TResult $default(String id, String title, String? icon, bool destructive, bool showsUserInterface, bool input, String? inputLabel, ActionExecutionMode executionMode, Map<String, Object?> metadata)?, {required TResult orElse()}) → TResult

Available on NotificationAction, provided by the NotificationActionPatterns extension

A variant of when that fallback to an orElse callback.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
Serializes this NotificationAction to a JSON map.
inherited
toString() → String
A string representation of this object.
inherited
when<TResult extends Object?>(TResult $default(String id, String title, String? icon, bool destructive, bool showsUserInterface, bool input, String? inputLabel, ActionExecutionMode executionMode, Map<String, Object?> metadata)) → TResult

Available on NotificationAction, provided by the NotificationActionPatterns extension

A switch-like method, using callbacks.
whenOrNull<TResult extends Object?>(TResult? $default(String id, String title, String? icon, bool destructive, bool showsUserInterface, bool input, String? inputLabel, ActionExecutionMode executionMode, Map<String, Object?> metadata)?) → TResult?

Available on NotificationAction, provided by the NotificationActionPatterns extension

A variant of when that fallback to returning null

Operators

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