mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-01-15 16:28:40 +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<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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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,
|
||||||
|
|
|
||||||
|
|
@ -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,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue