#15 support: select font

This commit is contained in:
lollipopkit
2023-03-21 13:15:36 +08:00
parent 89050daf4e
commit 27e7653587
16 changed files with 101 additions and 42 deletions

View File

@@ -99,6 +99,7 @@ class _SettingPageState extends State<SettingPage> {
_buildAppColorPreview(),
_buildLaunchPage(),
_buildCheckUpdate(),
_buildFont(),
];
if (isIOS) {
children.add(_buildPushToken());
@@ -445,4 +446,20 @@ class _SettingPageState extends State<SettingPage> {
),
);
}
Widget _buildFont() {
return ListTile(
title: Text(_s.chooseFontFile),
subtitle: Text(getFileName(_setting.fontPath.fetch()) ?? _s.notSelected),
trailing: TextButton(
onPressed: () async {
final path = await pickOneFile();
if (path != null) {
_setting.fontPath.put(path);
setState(() {});
}
},
child: Text(_s.pickFile)),
);
}
}