界面功能优化

This commit is contained in:
DelLevin-Home
2026-08-12 13:14:35 +08:00
parent 05c3eaeed5
commit 432c14462f
4 changed files with 207 additions and 277 deletions

View File

@@ -1506,12 +1506,38 @@ class _ProfilePageState extends State<ProfilePage> with RouteAware {
provider.notes.where((n) => !n.isDeleted).toList());
}
if (!context.mounted) return;
ToastUtil.show(context, '已导出到 ${file.path}');
_showExportResult(context, true, '已导出到 ${file.path}');
} catch (e) {
if (!context.mounted) return;
ToastUtil.show(context, '导出失败:$e');
_showExportResult(context, false, '导出失败:$e');
}
}
void _showExportResult(BuildContext context, bool success, String message) {
final colors = Theme.of(context).colorScheme;
showDialog(
context: context,
builder: (ctx) => AlertDialog(
icon: Icon(
success ? Icons.check_circle_outline : Icons.error_outline,
color: success ? colors.primary : colors.error,
size: 32,
),
content: Text(
message,
textAlign: TextAlign.center,
style: TextStyle(fontSize: 14, color: colors.onSurface),
),
actionsAlignment: MainAxisAlignment.center,
actions: [
FilledButton(
onPressed: () => Navigator.pop(ctx),
child: const Text('确定'),
),
],
),
);
}
}
class _WatchlistItem {