FontStyle.fromCode constructor

FontStyle.fromCode(
  1. int code
)

Returns the FontStyle matching the given ANSI code.

Throws StateError if the code is not recognized.

Implementation

factory FontStyle.fromCode(int code) {
  if (!_fromCode.containsKey(code)) {
    throw StateError('Unknown font style code: $code');
  }
  return _fromCode[code]!;
}