mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-01-15 14:48:41 +00:00
fix #204
This commit is contained in:
parent
b979f3c8d2
commit
27cd92f17f
3 changed files with 13 additions and 3 deletions
|
|
@ -269,7 +269,8 @@ class _CameraPreviewViewState extends State<CameraPreviewView> {
|
|||
}
|
||||
|
||||
Future<bool> pushMediaEditor(
|
||||
Future<Uint8List?>? imageBytes, File? videoFilePath) async {
|
||||
Future<Uint8List?>? imageBytes, File? videoFilePath,
|
||||
{bool sharedFromGallery = false}) async {
|
||||
bool? shouldReturn = await Navigator.push(
|
||||
context,
|
||||
PageRouteBuilder(
|
||||
|
|
@ -277,6 +278,7 @@ class _CameraPreviewViewState extends State<CameraPreviewView> {
|
|||
pageBuilder: (context, a1, a2) => ShareImageEditorView(
|
||||
videoFilePath: videoFilePath,
|
||||
imageBytes: imageBytes,
|
||||
sharedFromGallery: sharedFromGallery,
|
||||
sendTo: widget.sendTo,
|
||||
mirrorVideo: isFront && Platform.isAndroid,
|
||||
useHighQuality: useHighQuality,
|
||||
|
|
@ -339,7 +341,11 @@ class _CameraPreviewViewState extends State<CameraPreviewView> {
|
|||
|
||||
if (pickedFile != null) {
|
||||
File imageFile = File(pickedFile.path);
|
||||
if (await pushMediaEditor(imageFile.readAsBytes(), null)) {
|
||||
if (await pushMediaEditor(
|
||||
imageFile.readAsBytes(),
|
||||
null,
|
||||
sharedFromGallery: true,
|
||||
)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,12 +41,14 @@ class ShareImageEditorView extends StatefulWidget {
|
|||
this.videoFilePath,
|
||||
required this.mirrorVideo,
|
||||
required this.useHighQuality,
|
||||
required this.sharedFromGallery,
|
||||
});
|
||||
final Future<Uint8List?>? imageBytes;
|
||||
final File? videoFilePath;
|
||||
final Contact? sendTo;
|
||||
final bool mirrorVideo;
|
||||
final bool useHighQuality;
|
||||
final bool sharedFromGallery;
|
||||
@override
|
||||
State<ShareImageEditorView> createState() => _ShareImageEditorView();
|
||||
}
|
||||
|
|
@ -453,7 +455,8 @@ class _ShareImageEditorView extends State<ShareImageEditorView> {
|
|||
}
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.white.withAlpha(0),
|
||||
backgroundColor:
|
||||
widget.sharedFromGallery ? null : Colors.white.withAlpha(0),
|
||||
resizeToAvoidBottomInset: false,
|
||||
body: Stack(
|
||||
fit: StackFit.expand,
|
||||
|
|
|
|||
|
|
@ -129,6 +129,7 @@ class _MemoriesPhotoSliderViewState extends State<MemoriesPhotoSliderView> {
|
|||
.galleryItems[currentIndex].imagePath
|
||||
?.readAsBytes(),
|
||||
mirrorVideo: false,
|
||||
sharedFromGallery: true,
|
||||
useHighQuality: true,
|
||||
),
|
||||
),
|
||||
|
|
|
|||
Loading…
Reference in a new issue