// import 'package:flutter/material.dart'; import 'package:flutter/material.dart'; class CanvasStyle { static double fontSizeFallback = 18; static double qrSizeFallback = 82; static Map fontSizeMap = { 1: 18, 2: 25, 3: 31.5, 4: 37, 5: 43, 6: 50, 7: 57, 8: 63.5, 9: 70 }; static Map qrSizeMap = { 1: 82, 2: 124, 3: 164, 4: 204, 5: 248, 6: 286, 7: 330, 8: 370, 9: 412 }; static double getFontSize(int elmFontSize) { return fontSizeMap[elmFontSize] ?? fontSizeFallback; } static TextStyle getTextStyle(int elmFontSize, [bool? isVariable]) { return TextStyle( fontFamily: 'RobotoCondensed', fontSize: CanvasStyle.getFontSize(elmFontSize), letterSpacing: 0, color: isVariable != null ? Color(0xFF547190) : null ); } static double getQrSize(int elmQrScale) { return qrSizeMap[elmQrScale] ?? qrSizeFallback; } } // void main() { // int elmFontSize = 2; // print(CanvasStyle.fontSizeMap[elmFontSize]); // elmFontSize -= 1; // print(CanvasStyle.fontSizeMap[elmFontSize]); // if (CanvasStyle.fontSizeMap.containsKey(elmFontSize)) { // print('resize'); // } else { // print('cant resize'); // } // }