This commit is contained in:
otsmr 2025-06-12 22:16:56 +02:00
parent b979f3c8d2
commit 27cd92f17f
3 changed files with 13 additions and 3 deletions

View file

@ -269,7 +269,8 @@ class _CameraPreviewViewState extends State<CameraPreviewView> {
} }
Future<bool> pushMediaEditor( Future<bool> pushMediaEditor(
Future<Uint8List?>? imageBytes, File? videoFilePath) async { Future<Uint8List?>? imageBytes, File? videoFilePath,
{bool sharedFromGallery = false}) async {
bool? shouldReturn = await Navigator.push( bool? shouldReturn = await Navigator.push(
context, context,
PageRouteBuilder( PageRouteBuilder(
@ -277,6 +278,7 @@ class _CameraPreviewViewState extends State<CameraPreviewView> {
pageBuilder: (context, a1, a2) => ShareImageEditorView( pageBuilder: (context, a1, a2) => ShareImageEditorView(
videoFilePath: videoFilePath, videoFilePath: videoFilePath,
imageBytes: imageBytes, imageBytes: imageBytes,
sharedFromGallery: sharedFromGallery,
sendTo: widget.sendTo, sendTo: widget.sendTo,
mirrorVideo: isFront && Platform.isAndroid, mirrorVideo: isFront && Platform.isAndroid,
useHighQuality: useHighQuality, useHighQuality: useHighQuality,
@ -339,7 +341,11 @@ class _CameraPreviewViewState extends State<CameraPreviewView> {
if (pickedFile != null) { if (pickedFile != null) {
File imageFile = File(pickedFile.path); File imageFile = File(pickedFile.path);
if (await pushMediaEditor(imageFile.readAsBytes(), null)) { if (await pushMediaEditor(
imageFile.readAsBytes(),
null,
sharedFromGallery: true,
)) {
return; return;
} }
} }

View file

@ -41,12 +41,14 @@ class ShareImageEditorView extends StatefulWidget {
this.videoFilePath, this.videoFilePath,
required this.mirrorVideo, required this.mirrorVideo,
required this.useHighQuality, required this.useHighQuality,
required this.sharedFromGallery,
}); });
final Future<Uint8List?>? imageBytes; final Future<Uint8List?>? imageBytes;
final File? videoFilePath; final File? videoFilePath;
final Contact? sendTo; final Contact? sendTo;
final bool mirrorVideo; final bool mirrorVideo;
final bool useHighQuality; final bool useHighQuality;
final bool sharedFromGallery;
@override @override
State<ShareImageEditorView> createState() => _ShareImageEditorView(); State<ShareImageEditorView> createState() => _ShareImageEditorView();
} }
@ -453,7 +455,8 @@ class _ShareImageEditorView extends State<ShareImageEditorView> {
} }
return Scaffold( return Scaffold(
backgroundColor: Colors.white.withAlpha(0), backgroundColor:
widget.sharedFromGallery ? null : Colors.white.withAlpha(0),
resizeToAvoidBottomInset: false, resizeToAvoidBottomInset: false,
body: Stack( body: Stack(
fit: StackFit.expand, fit: StackFit.expand,

View file

@ -129,6 +129,7 @@ class _MemoriesPhotoSliderViewState extends State<MemoriesPhotoSliderView> {
.galleryItems[currentIndex].imagePath .galleryItems[currentIndex].imagePath
?.readAsBytes(), ?.readAsBytes(),
mirrorVideo: false, mirrorVideo: false,
sharedFromGallery: true,
useHighQuality: true, useHighQuality: true,
), ),
), ),