Flutter File Upload - Pick, Crop, and Save Images to the Cloud

Flutter File Upload - Pick, Crop, and Save Images to the Cloud

Fireship

5 лет назад

90,917 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@demojoe28
@demojoe28 - 29.09.2023 12:59

Hey Jeff, can you make a tutorial implementing JWT auth in Flutter with something like Laravel. Thank you.

Ответить
@akmalvideos9201
@akmalvideos9201 - 14.04.2022 02:39

Very good👍 nice video

Ответить
@Frittenfinger
@Frittenfinger - 16.11.2021 17:22

thank you!

Ответить
@suprayz5321
@suprayz5321 - 26.08.2021 20:57

dont work on flutter web

Ответить
@Noth3ng
@Noth3ng - 28.07.2021 10:41

Good video, but the code is deprecated, here is code bit for pulling and cropping image that works:

```
//* Get an image, crop and store
Future<void> _updateImage(ImageSource source) async {
//* Pull the img
File? img = await _pickImage(source);
//? Exn: bad img, clear state
if (img == null) return _setState();
//* Crop the image
File? croppedFile = await _cropImage(img);
_setState(img: croppedFile);
}

//* Helper to update the state variables
_setState({File? img}) {
setState(() => _imageFinal = img);
}

//* Pull image from given source using ImagePicker
Future<File?> _pickImage(ImageSource source) async {
ImagePicker _picker = ImagePicker();
XFile? img = await _picker.pickImage(source: source);
if (img == null) return null; //? Exn
return File(img.path);
}

//* Crops image
Future<File?> _cropImage(File img) async {
return await ImageCropper.cropImage(
sourcePath: img.path,
aspectRatioPresets: [
CropAspectRatioPreset.square,
CropAspectRatioPreset.original,
],
androidUiSettings: AndroidUiSettings(
toolbarTitle: 'Cropper',
toolbarColor: Colors.deepPurple,
toolbarWidgetColor: Colors.white,
initAspectRatio: CropAspectRatioPreset.original,
lockAspectRatio: false),
iosUiSettings: IOSUiSettings(
minimumAspectRatio: 1.0,
));
}
```

Ответить
@moazahmed5388
@moazahmed5388 - 11.07.2021 02:03

thanks for the video , what about Web ?

Ответить
@FocsTube
@FocsTube - 24.06.2021 19:25

is there a newer version of this video? this stuff is deprecated

Ответить
@karunsomasundarm9900
@karunsomasundarm9900 - 05.06.2021 11:41

I am getting an error "field _image must be initialized" and "field _image isnt used".
How can I solve this?

Ответить
@PaddyM708
@PaddyM708 - 27.05.2021 00:21

Hey could u update the code?
Some of the code don't work anymore..
AWESOME VIDEO :) !

Ответить
@Klazyo
@Klazyo - 11.05.2021 07:44

if (uploadTask.state == firebase_storage.TaskState.canceled)
and u can handle the rest

Ответить
@makemypetgamedevprocess6475
@makemypetgamedevprocess6475 - 04.05.2021 12:11

Awesome tutorial, keep it up 👍

Ответить
@ersanuysal5847
@ersanuysal5847 - 23.04.2021 13:46

I want to add a button action so that it can take a photo for my images and one of these images under listview. how can I do it?

Ответить
@faizansalam
@faizansalam - 11.04.2021 22:50

Is there any plugin to compress the size of image?

Ответить
@ahmedabed6652
@ahmedabed6652 - 25.03.2021 17:10

is there a way to pick a pdf file?

Ответить
@adityamiskin6569
@adityamiskin6569 - 13.03.2021 21:49

What's the editor font??

Ответить
@acarvey
@acarvey - 13.12.2020 05:46

This channel is seriously amazing. 👏

Ответить
@vacoder
@vacoder - 01.12.2020 04:02

Please tell how you copy paste things....!

Ответить
@fronkkunanonj.2912
@fronkkunanonj.2912 - 26.11.2020 06:06

that's awesome.for a little problem I can't launch the app on iPhone any help

Ответить
@rap143100
@rap143100 - 06.09.2020 22:48

shows error in all those codelines related to toolbar please any solution for that will be really helpful

Ответить
@fabriciohernandez3933
@fabriciohernandez3933 - 05.08.2020 19:51

Thanks for take time to teach this!

Ответить
@M4R0Zzz
@M4R0Zzz - 13.07.2020 22:49

Great video! One question: how, oh how, to change the color of AppBar in image_picker?? Please

Ответить
@akhan2501
@akhan2501 - 12.07.2020 07:17

If you are developing and you don't subscribe to this channel then are you even developing?

Ответить
@arpankaibartya4441
@arpankaibartya4441 - 23.06.2020 18:58

You helped me a lot!!!! love from India!! hoW CAN I UPLOAD TO ANY API?

Ответить
@seasonmaharjan9103
@seasonmaharjan9103 - 17.06.2020 11:39

i have done the same thing but the android app crashes at the croping part .. but works on ios ...do you have any idea?

Ответить
@raymondidu
@raymondidu - 05.06.2020 20:28

Hello, Please how did you deal with the ... error?

Ответить
@andresacm8453
@andresacm8453 - 26.05.2020 09:21

Awesome Tutorial.

Ответить
@MistaWu
@MistaWu - 24.05.2020 22:01

thanks alot, this saved me a huge deal of stress...

Ответить
@lokijay2036
@lokijay2036 - 22.05.2020 06:26

I love you

Ответить
@vinodYadav-cu8vs
@vinodYadav-cu8vs - 19.05.2020 19:00

plse share me code

Ответить
@kabagemark6502
@kabagemark6502 - 13.05.2020 17:57

Please remember that Image cropper in Android will not work without adding this in AndroidManifest.xml file . It will crash the app <activity
android:name="com.yalantis.ucrop.UCropActivity"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.Light.NoActionBar"/>

Ответить
@siddarthbhave8642
@siddarthbhave8642 - 11.05.2020 14:49

Use the latest version of the packages. That's very important!!!

Ответить
@enriqueortiz7251
@enriqueortiz7251 - 29.04.2020 19:50

Great and concise material, tons of functionality in a few lines of code!

Ответить
@nicolemanson8512
@nicolemanson8512 - 24.04.2020 00:30

Works great on iOS but I'm getting an app crash when saving or clearing the cropped image on Android. Any advice?

Ответить
@vrexperience8762
@vrexperience8762 - 11.04.2020 11:01

It seems once you close the App and re-open the app then the cropper does not work and shows No implementation found for cropper error. Anyone knows why?

Ответить
@aliabubakar6989
@aliabubakar6989 - 04.04.2020 23:27

i wrote the code but toobarColor , toolbarWidgetColor, toolbarTitle still showing an error please i need you help

Ответить
@mvn3949
@mvn3949 - 22.03.2020 10:48

And how do you delete these images? Looks like once you upload there is no way to delete, there are no tutorials on how to delete images from firebase storage in flutter.

Ответить
@lotfialmabree1107
@lotfialmabree1107 - 21.03.2020 09:56

source code

Ответить
@h3w45
@h3w45 - 08.03.2020 17:08

very cool and simple, thanks.

Ответить
@raphaeljaggerd3585
@raphaeljaggerd3585 - 13.02.2020 07:20

i wanted the uploaded images to be associated with a product e.g a thumbnail. How do i do that?

Ответить
@samario_torres
@samario_torres - 20.11.2019 00:54

anyone have any resources for downloading the same image back?

Ответить
@samario_torres
@samario_torres - 18.11.2019 23:01

Is it supposed to take a while for Xcode build to finish running? I am getting:
Launching lib/main.dart on iPhone 11 Pro Max in debug mode...
Xcode build done. 19.0s
path: satisfied (Path is satisfied), interface: en0
Configuring the default Firebase app...
* First throw call stack:
(
0 CoreFoundation 0x0000000107e2002e __exceptionPreprocess + 350
1 libobjc.A.dylib 0x0000000107c8db20 objc_exception_throw + 48
2 CoreFoundation 0x0000000107e1fe6c +[NSException raise:format:] + 188
3 Runner 0x0000000101e8882a +[FIRApp configure] + 138
4 Runner 0x00000001023863f6 -[FLTFirebaseStoragePlugin init] + 214
5 Runner 0x000000010238621d +[FLTFirebaseStoragePlugin registerWithRegistrar:] + 173
6 Runner 0x0000000101e83cd4 +[GeneratedPluginRegistrant registerWithRegistry:] + 212
7 Runner <…> and it just keeps running Xcode build...thanks

Ответить
@Ondal1
@Ondal1 - 28.10.2019 00:45

Just added everything here into our app to support profile pictures. Video was a great help :)

Ответить
@mavbcn1790
@mavbcn1790 - 15.10.2019 11:54

Great video!
How can I save locally the image I take to use later in the app?
thanks

Ответить
@habibbellia2607
@habibbellia2607 - 30.08.2019 15:58

How can i get download link ? please

Ответить
@matthiasgehrmann1573
@matthiasgehrmann1573 - 04.08.2019 05:22

wow !

Ответить
@firaskudsy
@firaskudsy - 01.08.2019 01:31

Amazing videos .. i was looking for some design patterns and best practices for javascript and u jumped into my head 🙂🙂 .. who would do such videos better than jeff !!! So i will be greedy and ask for that 😏 .. 🙏

Ответить