Flutter: Import profile images form Camera and Gallery || Image Picker || 25
ฝัง
- เผยแพร่เมื่อ 8 ก.ย. 2024
- Show your support and subscribe to the channel -: devstack.page....
#Flutter#ImagePicker#Gallery
In this video -:
1) We will create a Custom Image widget with camera Icon
2) Work with the Bottom Sheet (Modal)
3) Import Images from Gallery and camera using Image Picker
Resources-:
🤩 Last Video : • Flutter: Working on Cr...
🤩 GitHub Repo (Do give star) : github.com/Dev...
🤩 Rest API endpoint creation for Profile Page -: • NodeJs: Mongoose Schem...
🤩 Working with Images Endpoint-: • NodeJs: Rest-API End-P...
🔥🔥 Flutter Blog App : • Blog app backend and f...
🔥🔥 Flutter Chat App : • Flutter Chat-App (What...
🔥🔥 Flutter with Firebase : • Flutter with Firebase ...
🔥🔥 Flutter Model Class : • Flutter Model Classes ...
🔥🔥 Flutter Random : • Flutter Random Topics
👋 👋 Get the complete source code with some Cookies (You can support me) 🍪
😄 Patreon: / devstack06
😄 Buy me a Cofee: www.buymeacoff...
😄 DM me for UPI number
😋 😋 For more updates Join me on Social media 😋 😋
💻 💻 Twitter -: / devstack06
💻 💻 Instagram -: / devstack06
💻 💻 FB Page-: / devstack06
💻 💻 GitHub-: github.com/Dev...
PLEASE SUBSCRIBE AND SHARE THIS VIDEO!!! 😜 😜
THANKS FOR WATCHING!!! 😋
#Flutter #Firebase #PhoneAuth #Nodejs #Expressjs #TodoApp #flutterdev #fluttercommunity #flutterapp #flutterbygoogle #flutterApps #Camera #RestAPI #ImageUpload #RestAPIConnection #Http #NodeJs#ExpressJs #MongoDB#LikeIt#Subscribe#Share
Indian youtubers rock seriously. Indian videos are 1000 times better than foreign ones.
That's how to teach thank u sir for such amazing and benifical video
thanks sir
Hello man! Its best video - you are very cool !!!!)))) its works super!!!!
Thanks man keep watching and keep sharing the video 😊
Thank you sir. for your video.
thanks
Love you Sir! I thought there is no FileImage in backgrounImage. Thanks for introducing me
Wow such a awesome video. U r such a great teacher. I understood the way u explained!! Plz dont change the way u make videos. Its just perfect !! Thankyou so much for making this video. I followed ur video from start to end. but I dont kno what did i miss out. when clicking on camera and gallery icon nothing is happening and no error is also shown. what to do? btw I have liked and subscribed ;)
Thank You!!!!
thank you for making this good video
Thanks a lot!!! it really helped me !
thanks again!
I LOVE YAAAAAAAA!!! THAAAAAAANKS!
excuse me i got a problem, the app crash when i deny permissions
Just follow the all video 😊😊😊maybe I have fixed the issue in other videos
Awesome
I am glad that you are liking this series :)
6:40 Starts talking about the onPress to set the image
good work bro
great stuff
Sir I get am error that getImage is undefined how should i resolve
Hi Dev, Thanks for your awesome video, Can I ask you why my code gives error,
CircleAvatar(
radius: 80.0,
backgroundImage: _imageFile == null
? AssetImage('images/aran.jpg')
: FileImage(File(_imageFile.path)),
),
exactly last 3 lines has error,
Thanks
Try to change late PickedFile _imagefile; to PickedFile? _imagefile;
And change
backgroundImage: _imageFile == null
? AssetImage('images/aran.jpg')
: FileImage(File(_imageFile.path)),
),
to
backgroundImage: _imageFile == null
? null
: FileImage(File(_imageFile.path)),
),
Hi, were you able to resolve this, if yes then please suggest the fix.
@@leirbagleu I work around with your suggestion and when click into camera or gallery, the app went out. :( dont know why
when i m using form widget and the image picker i m not able to save the values of the textfield please resolve my problem SIR!!
Are you using the setState?
@@DevStack yes
So where you want to save the values , with help of setState you can maintain the state till you are that particular file or page...
@@DevStack i made a list of data and using the provider class and via form widget i want to get the data from the user and to save it into that list.
In that case you will need the proper state management thing. Without seeing the code snippet no one will able to help you 😅😅😅.
how to validate profile pic if user not select profile image? a message should display "please select picture" how to to that validation
i get an error lateInitializatationError Filed _imagefile@27144298 has not been initialized , how it solve please help me sir
Why im not able to import "dart:io"
While converting pickedimage type to file type
Pls Help!!!!!!!!!
Where is i can download the app?
How can we do with Camera plugin package?
Thanks, But how can i add multiple image in form
Can u do this with null safety, please?
Can you guys help me to get 3k please 🙏🙏🙏🙏
you should also show the imports also the setstate() was required to be defined as a separate function i think you missed it because is was producing as error in my code
sorry i got my answers i was implementing the code in a stateless widget rather than a statefull widget
Ohh great you fixed your problem 😀
@@DevStack i want to talk about some features of app can i have your email
devstackin@gmail.com ✌✌
how solve this problem please?
I have a proble in line : File(imagefile.path) how solve it please?
import "dart.io".. you must have mistakenly imported dart.html
Did you get a solution?
The non-nullable local variable '_imageFile' must be assigned before it can be used.
Try giving it an initializer expression, or ensure that it's assigned on every execution
it is giving this error how to fix
Create _imageFile as a variable type of PickedFile? _imageFile , and then use backgroundImage: _imageFile == null? const AssetImage("assets/profile.jpeg") : FileImage(File(_imageFile!.path)) as ImageProvider
.
can i get source code? plz
But when you build an APK the image picker doesn't work... Most of the time app doesn't open gallery or camera... In debug mode everything works fine...
The app is breaking at some point of time,
It's not the issue with my app please look onto the GitHub repo link for comparing the code :)
Did you test ur app in release mode?
This app is right now in development mode but I used image picker on 7 to 8 app and all are working fine :)
Please check your app is breaking in any point or not generally it stuck due to that....
Take help of provided GitHub repo
I had the same problem in other projet, you need modify the file AndroidManifest.xml
Medium have one tutorial for solve this.
where is the link for the github repo for this ?
You can find it on one of the video bro 🙌🙌
backgroundImage: _imageFile == null
? AssetImage("assets/blank.png")
: FileImage(File(_imageFile.path)),
This line is giving error please tell me how to solve it
did you find a solution??
@@bylkaminou517 yes
@@ShivamGupta-sx4lk can you show me how to fix the problem
I have the same error!
@@heliaha9705 I did not find a solution :(
is this emulator or you are using real device ???
void takephoto(ImageSource source)async{
final pickedFile=await picker.pickImage(
source:source,
);
setState(() {
_imagefile=pickedFile as PickedFile;
}); this my code
Can you share the source code please..
hello nice work..
please solve my problem..
i am getting eroor here
CircleAvatar(
radius: 80.0,
backgroundImage:
_imageFile == null
? AssetImage("images/Logo.jpg")
: FileImage(File(_imageFile.path)),
),
_image file not defined error not nullable instant field
also cotext error as wll. it says undefined name
child: InkWell(
onTap: () {
showModalBottomSheet(
context: context,
builder: ((builder) => bottomSheet()),
);
Is there any way to save the pic we selected as when I am starting my app again. It gets set to original state and not the one I selected
We are storing it on a back-end bro 😄😄😄 you can find it in next video
Please make sure to share the video 😄😄
Please suggest me
@@DevStack brother please share me the link for it.
here the full playlist:
th-cam.com/play/PLtIU0BH0pkKpitsp5jzt-yDAoXAFBkcPb.html
please give me the code source
You can get a link of the GitHub repo from the description :) ✌✌✌✌✌
#like #subscribe and do #share to grow this channel
Thanks for the tutorial
I have an error in this line
backgroundImage: _imageFile==null? AssetImage("assets/profilphoto.png") :FileImage(File(_imageFile.path)),
The argument type 'Object' can't be assigned to the parameter type 'ImageProvider?'.
could someone help me please !!!
Hi, were you able to resolve this, if yes then please suggest the fix.
ya same error here how to solved this...
Dude get a mic, i have to tur of captions to listen o what you are saying 😶
Hi, thanks for the greate video.
I'm very new to flutter, was following your video and getting this error.
Any suggestions? Thanks in advance!
Code:
late PickedFile _imageFile;
....
backgroundImage: _imageFile == null
? AssetImage("lib/assets/profile.png")
: FileImage(File(_imageFile.path)),
.....
Error:
Try correcting the name to the name of an existing method, or defining a method named 'File'.
: FileImage(File(_imageFile.path)),
^^^^
lib/pages/ProfilePage.dart:149:15: Error: The argument type 'Object' can't be assigned to the parameter type
'ImageProvider?'.
- 'Object' is from 'dart:core'.
- 'ImageProvider' is from 'package:flutter/src/painting/image_provider.dart'
('/C:/Program%20Files/flutter/packages/flutter/lib/src/painting/image_provider.dart').
? AssetImage("lib/assets/profile.png")
Nevermind I got it fixed by replacing 2 things from your code.
1. PickedFile _imageFile; to PickedFile? _imageFile;
2. backgroundImage: _imageFile == null
? null // added this line
// AssetImage("assets/images/profile.png") commented out
: FileImage(File(_imageFile!.path)),
@@neeraj2626 I tried doing this and the initial image is not displayed anymore. Also, I can't seem to choose a new image from the gallery or camera.
@@luckyugwu I will try to upload my code tomorrow morning on github and will share the url.
@@neeraj2626 I would really appreciate that.
Thanks
Welcome :)