LCOV - code coverage report
Current view: top level - src/ui/editor/pages/helper_editor/font_editor/pickers/font_weight_picker - font_weight_picker_loader.dart (source / functions) Hit Total Coverage
Test: lcov.info Lines: 7 7 100.0 %
Date: 2020-12-04 18:41:24 Functions: 0 0 -

          Line data    Source code
       1             : import 'package:flutter/widgets.dart';
       2             : 
       3             : class FontWeightMapper {
       4          15 :   static Map<String, FontWeight> map = {
       5             :     'Thin': FontWeight.w100,
       6             :     'Extra-light': FontWeight.w200,
       7             :     'Light': FontWeight.w300,
       8             :     'Normal': FontWeight.w400,
       9             :     'Medium': FontWeight.w500,
      10             :     'Semi-bold': FontWeight.w600,
      11             :     'Bold': FontWeight.w700,
      12             :     'Extra-bold': FontWeight.w800,
      13             :     'Black': FontWeight.w900,
      14             :   };
      15             : 
      16           5 :   static String toFontKey(FontWeight fontWeight) {
      17             :     if (fontWeight == null) {
      18             :       return 'Normal';
      19             :     }
      20             : 
      21             :     String key;
      22           9 :     for (var entry in map.entries) {
      23           6 :       if (fontWeight == entry.value) {
      24           3 :         key = entry.key;
      25             :         break;
      26             :       }
      27             :     }
      28             :     return key;
      29             :   }
      30             : 
      31           3 :   static FontWeight toFontWeight(String key) {
      32           6 :     return map[key];
      33             :   }
      34             : }

Generated by: LCOV version 1.14