parserFontWeight static method

FontWeight? parserFontWeight(
  1. Object? source
)

Implementation

static FontWeight? parserFontWeight(Object? source) {
  try {
    return FontWeight.values.firstWhere((e) {
      if (e.index == source) return true;
      if (e.value == source) return true;
      if (e.toString() == source) return true;
      return false;
    });
  } catch (_) {
    return null;
  }
}