setFontSize static method
setFontSize
This method will change the font size , between extra small and extra large. You can see the sizes below or in the enum file.
Implementation
static Future<void> setFontSize(SunmiFontSize size) async {
int fontSize = 24;
switch (size) {
case SunmiFontSize.XS:
fontSize = 14;
break;
case SunmiFontSize.SM:
fontSize = 18;
break;
case SunmiFontSize.MD:
fontSize = 24;
break;
case SunmiFontSize.LG:
fontSize = 36;
break;
case SunmiFontSize.XL:
fontSize = 42;
break;
}
Map<String, dynamic> arguments = <String, dynamic>{"size": fontSize};
await _channel.invokeMethod("FONT_SIZE", arguments);
}