Add font: own web file chooser, so a picked font is never dropped silently

file_picker's web picker treated the window regaining focus as a cancel when
the files arrived more than 500 ms later, so a real dialog could return an
empty pick and Add font did nothing. The web now uses its own file input that
completes only on change or cancel; mobile browsers get no accept filter.
Picker, check and save failures are shown in a dialog, and the row is busy
only after files were chosen.
This commit is contained in:
2026-11-04 20:47:43 +00:00
parent 1d025bebf3
commit 081ae0957d
8 changed files with 361 additions and 32 deletions
@@ -76,9 +76,15 @@ class _SettingsFontSectionState extends State<SettingsFontSection> {
}
Future<void> _add() async {
setState(() => _adding = true);
try {
await addCustomFont(context, widget.controller, widget.pickFiles);
await addCustomFont(
context,
widget.controller,
widget.pickFiles,
onPicked: () {
if (mounted) setState(() => _adding = true);
},
);
} finally {
if (mounted) setState(() => _adding = false);
}