DecorationMix<T extends Decoration>.value constructor

DecorationMix<T extends Decoration>.value(
  1. Decoration decoration
)

Creates from Decoration.

Implementation

factory DecorationMix.value(Decoration decoration) {
  return switch (decoration) {
        BoxDecoration d => BoxDecorationMix.value(d),
        ShapeDecoration d => ShapeDecorationMix.value(d),
        _ => throw ArgumentError(
          'Unsupported Decoration type: ${decoration.runtimeType}',
        ),
      }
      as DecorationMix<T>;
}