dartlangeditorflutterflutter-appsflutter-examplesflutter-packageflutter-widgetquillquill-deltaquilljsreactquillrich-textrich-text-editorwysiwygwysiwyg-editor
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.
18 lines
357 B
18 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!; |
|
}
|
|
|