PlatformToggle class

A tri-state toggle modeling the YAML/JSON value of android / ios configuration keys, which historically accept a bool or a String.

  • A bool false (or absence / null) means the platform is disabled.
  • A bool true means the platform is enabled with the default icon name.
  • A non-empty String means the platform is enabled with a custom icon name (e.g. "ic_launcher_dev"), and the existing default icon is kept.

Constructors

PlatformToggle.disabled()
Disabled — no icons will be generated for this platform.
factory
PlatformToggle.enabled()
Enabled with the default icon name. The existing icon is overwritten.
factory
PlatformToggle.named(String iconName)
Enabled with a custom icon name. The existing icon is kept and a new icon with the given name is added.
factory

Properties

customIconName String?
The custom icon name if isCustom, otherwise null.
no setter
hashCode int
The hash code for this object.
no setteroverride
isCustom bool
Whether the user provided a custom icon name (and thus the existing default icon should be preserved).
no setter
isEnabled bool
Whether this platform should have icons generated.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Object
Returns the JSON-friendly serialized form: false, true, or a String for custom names. This mirrors the input grammar accepted by PlatformToggleConverter.
toString() String
A string representation of this object.
override

Operators

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