refactored data providers with centralized cache resolution, unified UI using custom dialogs and bottom sheets, and enhanced network error handling for Dio and TLS errors
This commit is contained in:
@@ -81,7 +81,7 @@ class _DeferredPdfViewerState extends State<_DeferredPdfViewer> {
|
||||
}
|
||||
|
||||
class _FileViewerState extends State<FileViewer> {
|
||||
PhotoViewController photoViewController = PhotoViewController();
|
||||
final PhotoViewController photoViewController = PhotoViewController();
|
||||
|
||||
late SettingsCubit settings = context.read<SettingsCubit>();
|
||||
late bool openExternal;
|
||||
@@ -92,6 +92,12 @@ class _FileViewerState extends State<FileViewer> {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
photoViewController.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
AppBar appbar({List<Widget> actions = const []}) => AppBar(
|
||||
@@ -195,10 +201,8 @@ class _FileViewerState extends State<FileViewer> {
|
||||
OpenFilex.open(widget.path).then((result) {
|
||||
if (!context.mounted) return;
|
||||
Navigator.of(context).pop();
|
||||
if(result.type != ResultType.done) {
|
||||
showDialog(context: context, builder: (context) => AlertDialog(
|
||||
content: Text(result.message),
|
||||
));
|
||||
if (result.type != ResultType.done) {
|
||||
InfoDialog.show(context, result.message);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user