mirror of
https://gitlab.com/comunic/comunicmobile
synced 2025-06-19 00:05:16 +00:00
Force square account image
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:image_cropper/image_cropper.dart';
|
||||
import 'package:path/path.dart' as path;
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
import 'package:random_string/random_string.dart';
|
||||
@ -15,12 +16,14 @@ import '../ui/dialogs/pick_file_dialog.dart';
|
||||
/// Ask the user to choose an image, either from the gallery or using the camera
|
||||
///
|
||||
/// Throws an exception null in case of failure
|
||||
Future<BytesFile> pickImage(BuildContext context) async {
|
||||
Future<BytesFile> pickImage(BuildContext context,
|
||||
{CropAspectRatio aspectRatio}) async {
|
||||
return await showPickFileDialog(
|
||||
context: context,
|
||||
allowedMimeTypes: ["image/png", "image/jpeg", "image/gif"],
|
||||
imageMaxHeight: 10000,
|
||||
imageMaxWidth: 10000,
|
||||
aspectRatio: aspectRatio,
|
||||
);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user