Refactor document editing functionality to use document viewer; remove legacy editor implementation and streamline user experience.
This commit is contained in:
@@ -22,7 +22,6 @@ import '../models/file_item.dart';
|
|||||||
import '../theme/app_theme.dart';
|
import '../theme/app_theme.dart';
|
||||||
import '../theme/modern_glass_button.dart';
|
import '../theme/modern_glass_button.dart';
|
||||||
import 'document_viewer.dart';
|
import 'document_viewer.dart';
|
||||||
import 'editor_page.dart';
|
|
||||||
import 'video_viewer.dart';
|
import 'video_viewer.dart';
|
||||||
import '../injection.dart';
|
import '../injection.dart';
|
||||||
import '../services/file_service.dart';
|
import '../services/file_service.dart';
|
||||||
@@ -336,8 +335,8 @@ class _FileExplorerState extends State<FileExplorer> {
|
|||||||
LoadDirectory(orgId: widget.orgId, path: currentPath),
|
LoadDirectory(orgId: widget.orgId, path: currentPath),
|
||||||
);
|
);
|
||||||
|
|
||||||
// Open editor with the new document
|
// Open document viewer/editor with the new document
|
||||||
_showDocumentEditor(widget.orgId, fileId);
|
_showDocumentViewer(widget.orgId, fileId);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
snackController.close();
|
snackController.close();
|
||||||
@@ -1572,57 +1571,11 @@ class _FileExplorerState extends State<FileExplorer> {
|
|||||||
child: DocumentViewerModal(
|
child: DocumentViewerModal(
|
||||||
orgId: orgId,
|
orgId: orgId,
|
||||||
fileId: fileId,
|
fileId: fileId,
|
||||||
|
onClose: () => Navigator.of(context).pop(),
|
||||||
onEdit: () {
|
onEdit: () {
|
||||||
Navigator.of(context).pop();
|
// Document is already in edit mode in Collabora
|
||||||
_showDocumentEditor(orgId, fileId);
|
// No additional action needed
|
||||||
},
|
},
|
||||||
onClose: () => Navigator.of(context).pop(),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
void _showDocumentEditor(String orgId, String fileId) {
|
|
||||||
showDialog(
|
|
||||||
context: context,
|
|
||||||
barrierDismissible: false,
|
|
||||||
barrierColor: Colors.transparent,
|
|
||||||
builder: (BuildContext context) {
|
|
||||||
return BackdropFilter(
|
|
||||||
filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10),
|
|
||||||
child: Dialog(
|
|
||||||
backgroundColor: Colors.transparent,
|
|
||||||
insetPadding: const EdgeInsets.all(16),
|
|
||||||
child: Container(
|
|
||||||
constraints: BoxConstraints(
|
|
||||||
maxWidth: MediaQuery.of(context).size.width * 0.9,
|
|
||||||
maxHeight: MediaQuery.of(context).size.height * 0.9,
|
|
||||||
),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: AppTheme.primaryBackground,
|
|
||||||
borderRadius: BorderRadius.circular(16),
|
|
||||||
border: Border.all(
|
|
||||||
color: AppTheme.accentColor.withValues(alpha: 0.3),
|
|
||||||
width: 2,
|
|
||||||
),
|
|
||||||
boxShadow: [
|
|
||||||
BoxShadow(
|
|
||||||
color: Colors.black.withValues(alpha: 0.5),
|
|
||||||
blurRadius: 20,
|
|
||||||
spreadRadius: 5,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
child: ClipRRect(
|
|
||||||
borderRadius: BorderRadius.circular(14),
|
|
||||||
child: EditorPageModal(
|
|
||||||
orgId: orgId,
|
|
||||||
fileId: fileId,
|
|
||||||
onClose: () => Navigator.of(context).pop(),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user