fontWeightTW function

FontWeight? fontWeightTW(
  1. List<String> params
)

Implementation

FontWeight? fontWeightTW(List<String> params) {
  Map<String, FontWeight> fontWeightsTW = {
    'font-thin': FontWeight.w100,
    'font-extralight': FontWeight.w200,
    'font-light': FontWeight.w300,
    'font-normal': FontWeight.w400,
    'font-medium': FontWeight.w500,
    'font-semibold': FontWeight.w600,
    'font-bold': FontWeight.w700,
    'font-extrabold': FontWeight.w800,
    'font-black': FontWeight.w900,
  };

  if (params.toSet().intersection(fontWeightsTW.keys.toSet()).isEmpty) {
    return null;
  }

  return fontWeightsTW[
      params.toSet().intersection(fontWeightsTW.keys.toSet()).first];
}