PlatformAdaptiveContextExtensions extension

Extensions on BuildContext for resolving platform-specific values.

Provides convenience methods to select between Material (Android) and Cupertino (iOS) values based on defaultTargetPlatform.

on

Properties

platformAdaptiveIcons PlatformAdaptiveIcons

Available on BuildContext, provided by the PlatformAdaptiveContextExtensions extension

Render either a Material or Cupertino icon based on the platform
no setter

Methods

platformIcon({required IconData material, required IconData cupertino}) IconData

Available on BuildContext, provided by the PlatformAdaptiveContextExtensions extension

Returns the platform-appropriate IconData.
platformLazyNullable<T>({ValueGetter<T>? material, ValueGetter<T>? cupertino}) → T?

Available on BuildContext, provided by the PlatformAdaptiveContextExtensions extension

Returns the platform-appropriate nullable value of type T, lazily evaluated.
platformLazyValue<T>({required ValueGetter<T> material, required ValueGetter<T> cupertino}) → T

Available on BuildContext, provided by the PlatformAdaptiveContextExtensions extension

Returns the platform-appropriate value of type T, lazily evaluated.
platformValue<T>({required T material, required T cupertino}) → T

Available on BuildContext, provided by the PlatformAdaptiveContextExtensions extension

Returns the platform-appropriate value of type T.
platformValueNullable<T>({T? material, T? cupertino}) → T?

Available on BuildContext, provided by the PlatformAdaptiveContextExtensions extension

Returns the platform-appropriate nullable value of type T.