PropertiesPatterns extension

Adds pattern-matching-related methods to Properties.

on

Methods

map<TResult extends Object?>({required TResult unknown(Unknown value), required TResult video(Video value), required TResult image(Image value), required TResult vr(Model3D value), required TResult audio(Audio value), required TResult html(Html value)}) → TResult

Available on Properties, provided by the PropertiesPatterns extension

A switch-like method, using callbacks.
mapOrNull<TResult extends Object?>({TResult? unknown(Unknown value)?, TResult? video(Video value)?, TResult? image(Image value)?, TResult? vr(Model3D value)?, TResult? audio(Audio value)?, TResult? html(Html value)?}) → TResult?

Available on Properties, provided by the PropertiesPatterns extension

A variant of map that fallback to returning null.
maybeMap<TResult extends Object?>({TResult unknown(Unknown value)?, TResult video(Video value)?, TResult image(Image value)?, TResult vr(Model3D value)?, TResult audio(Audio value)?, TResult html(Html value)?, required TResult orElse()}) → TResult

Available on Properties, provided by the PropertiesPatterns extension

A variant of map that fallback to returning orElse.
maybeWhen<TResult extends Object?>({TResult unknown()?, TResult video(List<File> files)?, TResult image(List<File> files)?, TResult vr(List<File> files)?, TResult audio(List<File> files)?, TResult html(List<File> files)?, required TResult orElse()}) → TResult

Available on Properties, provided by the PropertiesPatterns extension

A variant of when that fallback to an orElse callback.
when<TResult extends Object?>({required TResult unknown(), required TResult video(List<File> files), required TResult image(List<File> files), required TResult vr(List<File> files), required TResult audio(List<File> files), required TResult html(List<File> files)}) → TResult

Available on Properties, provided by the PropertiesPatterns extension

A switch-like method, using callbacks.
whenOrNull<TResult extends Object?>({TResult? unknown()?, TResult? video(List<File> files)?, TResult? image(List<File> files)?, TResult? vr(List<File> files)?, TResult? audio(List<File> files)?, TResult? html(List<File> files)?}) → TResult?

Available on Properties, provided by the PropertiesPatterns extension

A variant of when that fallback to returning null