From 70bf0a20c8474236b150870c123c5a354d04c70e Mon Sep 17 00:00:00 2001 From: Jganenokk Date: Sat, 15 Aug 2026 16:12:08 +0700 Subject: [PATCH] =?UTF-8?q?fix:=20=D0=B0=D0=B4=D0=B0=D0=BF=D1=82=D0=B0?= =?UTF-8?q?=D1=86=D0=B8=D1=8F=20PR=20#60=20=D0=BF=D0=BE=D0=B4=20=D1=82?= =?UTF-8?q?=D0=B5=D0=BA=D1=83=D1=89=D0=B8=D0=B9=20feature/FullStack?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/core/media/gallery_source.dart | 30 ---------------- lib/frontend/screens/chats/chat_screen.dart | 34 ++++++++++--------- .../widgets/attachment/attachment_sheet.dart | 3 +- lib/l10n/app_en.arb | 1 - lib/l10n/app_localizations.dart | 6 ---- lib/l10n/app_localizations_en.dart | 3 -- lib/l10n/app_localizations_ru.dart | 3 -- lib/l10n/app_ru.arb | 1 - 8 files changed, 19 insertions(+), 62 deletions(-) diff --git a/lib/core/media/gallery_source.dart b/lib/core/media/gallery_source.dart index a334cdf..1bede28 100644 --- a/lib/core/media/gallery_source.dart +++ b/lib/core/media/gallery_source.dart @@ -32,35 +32,6 @@ class PickedPhoto { const PickedPhoto({required this.item, this.editedFile}); } -class CameraGalleryItem implements GalleryItem { - final File file; - (int, int)? _dimensions; - - CameraGalleryItem(this.file); - - @override - String get id => file.path; - - @override - bool get isVideo => false; - - @override - Duration? get duration => null; - - @override - File? get localFile => file; - - @override - Future thumbnail(int size) => file.readAsBytes(); - - @override - Future originFile() async => file; - - @override - Future<(int, int)?> dimensions() async => - _dimensions ??= await imageFileDimensions(file); -} - Future<(int, int)?> imageFileDimensions(File file) async { ui.ImmutableBuffer? buffer; ui.ImageDescriptor? descriptor; @@ -197,7 +168,6 @@ bool isVideoPath(String path) => kGalleryVideoExtensions.contains(_fileExtension(path)); class _DesktopGallerySource implements GallerySource { - @override Future ensurePermission() async => GalleryPermission.granted; diff --git a/lib/frontend/screens/chats/chat_screen.dart b/lib/frontend/screens/chats/chat_screen.dart index b074087..45d80bc 100644 --- a/lib/frontend/screens/chats/chat_screen.dart +++ b/lib/frontend/screens/chats/chat_screen.dart @@ -2812,21 +2812,22 @@ class _ChatScreenState extends State Future _startEditMessage(CachedMessage message) async { final cs = Theme.of(context).colorScheme; - final content = await showModalBottomSheet< - ({String text, List> elements}) - >( - context: context, - isScrollControlled: true, - backgroundColor: cs.surfaceContainerHigh, - shape: const RoundedRectangleBorder( - borderRadius: BorderRadius.vertical(top: Radius.circular(24)), - ), - builder: (sheetContext) => _EditMessageSheet( - text: message.text ?? '', - formatRanges: message.formatRanges, - contextMenuBuilder: _formatContextMenu, - ), - ); + final content = + await showModalBottomSheet< + ({String text, List> elements}) + >( + context: context, + isScrollControlled: true, + backgroundColor: cs.surfaceContainerHigh, + shape: const RoundedRectangleBorder( + borderRadius: BorderRadius.vertical(top: Radius.circular(24)), + ), + builder: (sheetContext) => _EditMessageSheet( + text: message.text ?? '', + formatRanges: message.formatRanges, + contextMenuBuilder: _formatContextMenu, + ), + ); if (content == null || !mounted) return; @@ -7621,7 +7622,8 @@ class _EditMessageSheetState extends State<_EditMessageSheet> { ), const SizedBox(height: 20), FilledButton( - onPressed: () => Navigator.of(context).pop(_controller.buildContent()), + onPressed: () => + Navigator.of(context).pop(_controller.buildContent()), child: const Text('Сохранить'), ), ], diff --git a/lib/frontend/widgets/attachment/attachment_sheet.dart b/lib/frontend/widgets/attachment/attachment_sheet.dart index 9e448ed..385f26f 100644 --- a/lib/frontend/widgets/attachment/attachment_sheet.dart +++ b/lib/frontend/widgets/attachment/attachment_sheet.dart @@ -212,7 +212,7 @@ class _AttachmentSheetState extends State { return; } if (shot == null || !mounted) return; - _openPreview(CameraGalleryItem(File(shot.path))); + _openPreview(GalleryItem.fromFile(File(shot.path))); } void _sendSelection({GalleryItem? fallback}) { @@ -937,7 +937,6 @@ class _CameraTileState extends State<_CameraTile> with WidgetsBindingObserver { } setState(() => _controller = controller); } catch (_) { - // keep the fallback tile } finally { _starting = false; } diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb index 626d8e8..34db243 100644 --- a/lib/l10n/app_en.arb +++ b/lib/l10n/app_en.arb @@ -955,7 +955,6 @@ "digitalIdDocChildOms": "Child's health insurance policy (OMS)", "attachSheetGallery": "Gallery", "attachSheetPoll": "Poll", - "attachSheetCameraComingSoon": "Camera is coming soon", "attachSheetCameraError": "Couldn't open the camera", "attachSheetSendFileTitle": "Send a file", "attachSheetSendFileSubtitle": "A document, archive, or any other file", diff --git a/lib/l10n/app_localizations.dart b/lib/l10n/app_localizations.dart index 330d0aa..59ce38d 100644 --- a/lib/l10n/app_localizations.dart +++ b/lib/l10n/app_localizations.dart @@ -4268,12 +4268,6 @@ abstract class AppLocalizations { /// **'Poll'** String get attachSheetPoll; - /// No description provided for @attachSheetCameraComingSoon. - /// - /// In en, this message translates to: - /// **'Camera is coming soon'** - String get attachSheetCameraComingSoon; - /// No description provided for @attachSheetCameraError. /// /// In en, this message translates to: diff --git a/lib/l10n/app_localizations_en.dart b/lib/l10n/app_localizations_en.dart index 7c29b40..d00aad1 100644 --- a/lib/l10n/app_localizations_en.dart +++ b/lib/l10n/app_localizations_en.dart @@ -2219,9 +2219,6 @@ class AppLocalizationsEn extends AppLocalizations { @override String get attachSheetPoll => 'Poll'; - @override - String get attachSheetCameraComingSoon => 'Camera is coming soon'; - @override String get attachSheetCameraError => 'Couldn\'t open the camera'; diff --git a/lib/l10n/app_localizations_ru.dart b/lib/l10n/app_localizations_ru.dart index 646e519..1add0db 100644 --- a/lib/l10n/app_localizations_ru.dart +++ b/lib/l10n/app_localizations_ru.dart @@ -2232,9 +2232,6 @@ class AppLocalizationsRu extends AppLocalizations { @override String get attachSheetPoll => 'Опрос'; - @override - String get attachSheetCameraComingSoon => 'Камера скоро появится'; - @override String get attachSheetCameraError => 'Не удалось открыть камеру'; diff --git a/lib/l10n/app_ru.arb b/lib/l10n/app_ru.arb index b278fb1..6aad57e 100644 --- a/lib/l10n/app_ru.arb +++ b/lib/l10n/app_ru.arb @@ -720,7 +720,6 @@ "digitalIdDocChildOms": "Полис ОМС ребёнка", "attachSheetGallery": "Галерея", "attachSheetPoll": "Опрос", - "attachSheetCameraComingSoon": "Камера скоро появится", "attachSheetCameraError": "Не удалось открыть камеру", "attachSheetSendFileTitle": "Отправить файл", "attachSheetSendFileSubtitle": "Документ, архив или любой другой файл",