SceneTextStyle.fromValues constructor

SceneTextStyle.fromValues(
  1. Map<String, Object?> v
)

A style from the table's own names — what a reader builds when it has values by name rather than by field, and the inverse of values.

Hand-written for the same reason copyWith is: a const object cannot build itself out of a map, so this is the constructor the table cannot derive and scene_props_test.dart pins instead.

Implementation

factory SceneTextStyle.fromValues(Map<String, Object?> v) => SceneTextStyle(
  fontFamily: v['fontFamily'] as String?,
  fontSize: v['fontSize'] as double?,
  weight: v['weight'] as SceneFontWeight?,
  italic: v['italic'] as bool?,
  letterSpacing: v['letterSpacing'] as double?,
  wordSpacing: v['wordSpacing'] as double?,
  lineHeight: v['lineHeight'] as double?,
  color: v['color'] as SceneColor?,
  textCase: v['textCase'] as SceneTextCase?,
  decoration: v['decoration'] as SceneTextDecoration?,
  decorationColor: v['decorationColor'] as SceneColor?,
  decorationThickness: v['decorationThickness'] as double?,
  decorationStyle: v['decorationStyle'] as SceneTextDecorationStyle?,
  layers: (v['layers'] as List?)?.cast<TextLayer>(),
  axes: (v['axes'] as Map?)?.cast<String, double>(),
);