EnhancedPlatformMenuIcon class sealed

EnhancedPlatformMenuIcon (sealed)

Lightweight, serializable icon model for EnhancedPlatformMenus with two variants:

  • SFSymbolIcon(String name): references an SF Symbol by its system name (macOS/iOS). Serializes as { 'symbol': name }. -> A collection of SF Symbol names can be found in sf_symbols.dart
  • AssetIcon(String path, {bool isMonochrome = true}): references a Flutter asset. Serializes as { 'asset': path, 'isMonochrome': true/false }. Assets can be PNG, JPG or PDF.

When to use

  • Attach icons to menu items where the host platform can render SF Symbols or app-provided assets. Use isMonochrome to hint platform-side tinting.

Example

final sfIcon = EnhancedPlatformMenuIcon.sfSymbol(SFSymbols.sfs_0_circle);
final assetIcon = EnhancedPlatformMenuIcon.asset('assets/icons/export.png', isMonochrome: false);
Implementers

Constructors

EnhancedPlatformMenuIcon.asset(String path, {bool isMonochrome})
const
factory
EnhancedPlatformMenuIcon.sfSymbol(String name)
const
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
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
serialize() Map<String, dynamic>
toString() String
A string representation of this object.
inherited

Operators

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