🐛 Fix file upload
This commit is contained in:
@@ -78,6 +78,7 @@ class EditPublisherScreen extends HookConsumerWidget {
|
||||
result = await cropImage(
|
||||
context,
|
||||
image: result,
|
||||
replacePath: true,
|
||||
allowedAspectRatios: [
|
||||
if (position == 'background')
|
||||
CropAspectRatio(height: 7, width: 16)
|
||||
|
@@ -17,7 +17,7 @@ Future<XFile?> cropImage(
|
||||
BuildContext context, {
|
||||
required XFile image,
|
||||
List<CropAspectRatio?>? allowedAspectRatios,
|
||||
bool replacePath = false,
|
||||
bool replacePath = true,
|
||||
}) async {
|
||||
final result = await showMaterialImageCropper(
|
||||
context,
|
||||
@@ -211,8 +211,9 @@ Completer<SnCloudFile?> _processUpload(
|
||||
getTemporaryDirectory()
|
||||
.then((tempDir) {
|
||||
final tempFile = File('${tempDir.path}/temp_upload_$actualFilename');
|
||||
tempFile
|
||||
.writeAsBytes(byteData!)
|
||||
file
|
||||
.readAsBytes()
|
||||
.then((bytes) => tempFile.writeAsBytes(bytes))
|
||||
.then((_) {
|
||||
fileObj = tempFile;
|
||||
// Call progress start
|
||||
|
Reference in New Issue
Block a user