mirror of
https://github.com/Livinglist/Hacki.git
synced 2025-08-06 18:24:42 +08:00
29 lines
621 B
Dart
29 lines
621 B
Dart
enum Font {
|
|
roboto('Roboto'),
|
|
robotoSlab('Roboto Slab', isSerif: true),
|
|
ubuntu('Ubuntu'),
|
|
ubuntuMono('Ubuntu Mono'),
|
|
notoSerif('Noto Serif', isSerif: true);
|
|
|
|
const Font(this.uiLabel, {this.isSerif = false});
|
|
|
|
final String uiLabel;
|
|
final bool isSerif;
|
|
|
|
static Font fromString(String? val) {
|
|
switch (val) {
|
|
case 'robotoSlab':
|
|
return Font.robotoSlab;
|
|
case 'ubuntu':
|
|
return Font.ubuntu;
|
|
case 'ubuntuMono':
|
|
return Font.ubuntuMono;
|
|
case 'notoSerif':
|
|
return Font.notoSerif;
|
|
case 'roboto':
|
|
default:
|
|
return Font.roboto;
|
|
}
|
|
}
|
|
}
|