platformLazyValue<T> method

T platformLazyValue<T>({
  1. required ValueGetter<T> material,
  2. required ValueGetter<T> cupertino,
})

Returns the platform-appropriate value of type T, lazily evaluated.

Only the getter for the current platform is invoked, avoiding unnecessary computation for the other platform.

Implementation

T platformLazyValue<T>({required ValueGetter<T> material, required ValueGetter<T> cupertino}) =>
    _valueProvider(material: material, cupertino: cupertino).call();