fromDynamic static method

TestRunnerThemeData? fromDynamic(
  1. dynamic map
)

Creates a theme data object from a JSON compatible map. This expects the JSON to follow the format:

{
  "runnerOverlayColor": <Color>,
  "showRunnerStatus": <bool>,
  "showStepText": <bool>,
  "statusAlignment": <TestStatusAlignment>,
  "statusBackgroundColor": <Color>,
  "statusErrorColor": <Color>,
  "statusOpacity": <double>,
  "statusProgressColor": <Color>,
  "statusSuccessColor": <Color>,
  "statusTextColor": <Color>
}

See also:

Implementation

static TestRunnerThemeData? fromDynamic(dynamic map) {
  TestRunnerThemeData? result;

  if (map != null) {
    result = TestRunnerThemeData(
      runnerOverlayColor:
          ThemeDecoder.decodeColor(map['runnerOverlayColor'])!,
      showRunnerStatus: JsonClass.parseBool(map['showRunnerStatus']),
      showStepText: JsonClass.parseBool(map['showStepText']),
      statusAlignment: TestStatusAlignment.fromString(map['statusAlignment']),
      statusBackgroundColor:
          ThemeDecoder.decodeColor(map['statusBackgroundColor'])!,
      statusErrorColor: ThemeDecoder.decodeColor(map['statusErrorColor'])!,
      statusOpacity: JsonClass.parseDouble(map['statusOpacity'])!,
      statusProgressColor:
          ThemeDecoder.decodeColor(map['statusProgressColor'])!,
      statusSuccessColor:
          ThemeDecoder.decodeColor(map['statusSuccessColor'])!,
      statusTextColor: ThemeDecoder.decodeColor(map['statusTextColor'])!,
    );
  }

  return result;
}