Rich text editor for Flutter
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
357 B

double getFontSize(dynamic sizeValue) {
if (sizeValue.value is double) {
return sizeValue;
}
if (sizeValue is int) {
return sizeValue.toDouble();
}
double? fontSize;
if (sizeValue is String) {
fontSize = double.tryParse(sizeValue);
if (fontSize == null) {
throw 'Invalid size $sizeValue';
}
}
return fontSize!;
}