diff --git a/lib/ui/actions/file/file_actions.dart b/lib/ui/actions/file/file_actions.dart index d64727f6a..d8465b228 100644 --- a/lib/ui/actions/file/file_actions.dart +++ b/lib/ui/actions/file/file_actions.dart @@ -1,9 +1,13 @@ import "package:flutter/cupertino.dart"; +import "package:modal_bottom_sheet/modal_bottom_sheet.dart"; import "package:photos/models/file.dart"; import "package:photos/models/file_type.dart"; +import "package:photos/theme/colors.dart"; +import "package:photos/theme/ente_theme.dart"; import "package:photos/ui/components/action_sheet_widget.dart"; import "package:photos/ui/components/button_widget.dart"; import "package:photos/ui/components/models/button_type.dart"; +import "package:photos/ui/viewer/file/file_info_widget.dart"; import "package:photos/utils/delete_file_util.dart"; import "package:photos/utils/dialog_util.dart"; import "package:photos/utils/toast_util.dart"; @@ -119,3 +123,21 @@ Future showSingleFileDeleteSheet( showGenericErrorDialog(context: context); } } + +Future showInfoSheet(BuildContext context, File file) async { + final colorScheme = getEnteColorScheme(context); + return showBarModalBottomSheet( + topControl: const SizedBox.shrink(), + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(0)), + backgroundColor: colorScheme.backgroundElevated, + barrierColor: backdropFaintDark, + context: context, + builder: (BuildContext context) { + return Padding( + padding: + EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom), + child: FileInfoWidget(file), + ); + }, + ); +} diff --git a/lib/ui/viewer/file/fading_bottom_bar.dart b/lib/ui/viewer/file/fading_bottom_bar.dart index 6820edebd..a089f1314 100644 --- a/lib/ui/viewer/file/fading_bottom_bar.dart +++ b/lib/ui/viewer/file/fading_bottom_bar.dart @@ -2,7 +2,6 @@ import 'dart:io'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:modal_bottom_sheet/modal_bottom_sheet.dart'; import 'package:photos/core/configuration.dart'; import 'package:photos/models/file.dart'; import 'package:photos/models/file_type.dart'; @@ -12,8 +11,8 @@ import 'package:photos/models/trash_file.dart'; import 'package:photos/services/collections_service.dart'; import 'package:photos/theme/colors.dart'; import 'package:photos/theme/ente_theme.dart'; +import "package:photos/ui/actions/file/file_actions.dart"; import 'package:photos/ui/create_collection_sheet.dart'; -import 'package:photos/ui/viewer/file/file_info_widget.dart'; import 'package:photos/utils/delete_file_util.dart'; import 'package:photos/utils/magic_util.dart'; import 'package:photos/utils/share_util.dart'; @@ -273,20 +272,6 @@ class FadingBottomBarState extends State { } Future _displayInfo(File file) async { - final colorScheme = getEnteColorScheme(context); - return showBarModalBottomSheet( - topControl: const SizedBox.shrink(), - shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(0)), - backgroundColor: colorScheme.backgroundElevated, - barrierColor: backdropFaintDark, - context: context, - builder: (BuildContext context) { - return Padding( - padding: - EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom), - child: FileInfoWidget(file), - ); - }, - ); + await showInfoSheet(context, file); } }