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

ความคิดเห็น • 91

  • @fathimashafana4881
    @fathimashafana4881 3 ปีที่แล้ว +3

    Indian youtubers rock seriously. Indian videos are 1000 times better than foreign ones.

  • @Becoder15604
    @Becoder15604 ปีที่แล้ว

    That's how to teach thank u sir for such amazing and benifical video

  • @bcnghia
    @bcnghia 2 หลายเดือนก่อน

    thanks sir

  • @user-cs7vp9cn2d
    @user-cs7vp9cn2d 3 ปีที่แล้ว +1

    Hello man! Its best video - you are very cool !!!!)))) its works super!!!!

    • @DevStack
      @DevStack  3 ปีที่แล้ว

      Thanks man keep watching and keep sharing the video 😊

  • @joeysupply
    @joeysupply 2 ปีที่แล้ว

    Thank you sir. for your video.

  • @shadmannehalkhan6845
    @shadmannehalkhan6845 ปีที่แล้ว

    thanks

  • @fahadmustafa650
    @fahadmustafa650 3 ปีที่แล้ว

    Love you Sir! I thought there is no FileImage in backgrounImage. Thanks for introducing me

  • @fathimashafana4881
    @fathimashafana4881 3 ปีที่แล้ว +1

    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 ;)

  • @pradyumanpareek2972
    @pradyumanpareek2972 3 ปีที่แล้ว +1

    Thank You!!!!

  • @saadsaleem3331
    @saadsaleem3331 3 ปีที่แล้ว +1

    thank you for making this good video

  • @ilmemaab3171
    @ilmemaab3171 2 ปีที่แล้ว

    Thanks a lot!!! it really helped me !

  • @mustafaninyolu
    @mustafaninyolu 3 ปีที่แล้ว +1

    thanks again!

  • @hunter85070
    @hunter85070 3 ปีที่แล้ว +1

    I LOVE YAAAAAAAA!!! THAAAAAAANKS!

    • @hunter85070
      @hunter85070 3 ปีที่แล้ว +1

      excuse me i got a problem, the app crash when i deny permissions

    • @DevStack
      @DevStack  3 ปีที่แล้ว

      Just follow the all video 😊😊😊maybe I have fixed the issue in other videos

  • @josueguessennd51
    @josueguessennd51 4 ปีที่แล้ว +1

    Awesome

    • @DevStack
      @DevStack  4 ปีที่แล้ว +1

      I am glad that you are liking this series :)

  • @chind0na
    @chind0na 3 ปีที่แล้ว

    6:40 Starts talking about the onPress to set the image

  • @saadsaleem3331
    @saadsaleem3331 3 ปีที่แล้ว +1

    good work bro

  • @TYNEPUNK
    @TYNEPUNK 3 ปีที่แล้ว

    great stuff

  • @ankitaumredkar8368
    @ankitaumredkar8368 2 ปีที่แล้ว +1

    Sir I get am error that getImage is undefined how should i resolve

  • @johnhabibpour8375
    @johnhabibpour8375 2 ปีที่แล้ว +4

    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

    • @leirbagleu
      @leirbagleu 2 ปีที่แล้ว +3

      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)),
      ),

    • @neeraj2626
      @neeraj2626 2 ปีที่แล้ว

      Hi, were you able to resolve this, if yes then please suggest the fix.

    • @thanhmai1132
      @thanhmai1132 2 ปีที่แล้ว

      @@leirbagleu I work around with your suggestion and when click into camera or gallery, the app went out. :( dont know why

  • @saileshverma1942
    @saileshverma1942 3 ปีที่แล้ว +3

    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!!

    • @DevStack
      @DevStack  3 ปีที่แล้ว

      Are you using the setState?

    • @saileshverma1942
      @saileshverma1942 3 ปีที่แล้ว

      @@DevStack yes

    • @DevStack
      @DevStack  3 ปีที่แล้ว

      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...

    • @saileshverma1942
      @saileshverma1942 3 ปีที่แล้ว

      @@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.

    • @DevStack
      @DevStack  3 ปีที่แล้ว

      In that case you will need the proper state management thing. Without seeing the code snippet no one will able to help you 😅😅😅.

  • @SAGskills
    @SAGskills 3 ปีที่แล้ว

    how to validate profile pic if user not select profile image? a message should display "please select picture" how to to that validation

  • @sajeevvasudevan6301
    @sajeevvasudevan6301 ปีที่แล้ว

    i get an error lateInitializatationError Filed _imagefile@27144298 has not been initialized , how it solve please help me sir

  • @saileshverma7353
    @saileshverma7353 3 ปีที่แล้ว

    Why im not able to import "dart:io"
    While converting pickedimage type to file type
    Pls Help!!!!!!!!!

  • @XO_GG
    @XO_GG 9 หลายเดือนก่อน

    Where is i can download the app?

  • @sumantrkurse1518
    @sumantrkurse1518 ปีที่แล้ว

    How can we do with Camera plugin package?

  • @ibrahimtaramsah4450
    @ibrahimtaramsah4450 3 ปีที่แล้ว

    Thanks, But how can i add multiple image in form

  • @cristianduran4676
    @cristianduran4676 2 ปีที่แล้ว

    Can u do this with null safety, please?

  • @DevStack
    @DevStack  3 ปีที่แล้ว +1

    Can you guys help me to get 3k please 🙏🙏🙏🙏

  • @tracoolgaming4829
    @tracoolgaming4829 4 ปีที่แล้ว +1

    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

    • @tracoolgaming4829
      @tracoolgaming4829 4 ปีที่แล้ว +1

      sorry i got my answers i was implementing the code in a stateless widget rather than a statefull widget

    • @DevStack
      @DevStack  4 ปีที่แล้ว +1

      Ohh great you fixed your problem 😀

    • @tracoolgaming4829
      @tracoolgaming4829 4 ปีที่แล้ว +1

      @@DevStack i want to talk about some features of app can i have your email

    • @DevStack
      @DevStack  4 ปีที่แล้ว

      devstackin@gmail.com ✌✌

    • @nerminhussein2634
      @nerminhussein2634 3 ปีที่แล้ว

      how solve this problem please?

  • @nerminhussein2634
    @nerminhussein2634 3 ปีที่แล้ว +1

    I have a proble in line : File(imagefile.path) how solve it please?

  • @pragatsharma1580
    @pragatsharma1580 ปีที่แล้ว

    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

    • @amuchand47
      @amuchand47 ปีที่แล้ว

      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
      .

  • @arbajansari3052
    @arbajansari3052 3 ปีที่แล้ว +1

    can i get source code? plz

  • @ccarnagee7867
    @ccarnagee7867 4 ปีที่แล้ว +1

    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...

    • @DevStack
      @DevStack  4 ปีที่แล้ว +1

      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 :)

    • @ccarnagee7867
      @ccarnagee7867 4 ปีที่แล้ว

      Did you test ur app in release mode?

    • @DevStack
      @DevStack  4 ปีที่แล้ว +1

      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

    • @yhoinermorales2584
      @yhoinermorales2584 3 ปีที่แล้ว

      I had the same problem in other projet, you need modify the file AndroidManifest.xml
      Medium have one tutorial for solve this.

  • @lyleverything1767
    @lyleverything1767 3 ปีที่แล้ว +1

    where is the link for the github repo for this ?

    • @DevStack
      @DevStack  3 ปีที่แล้ว

      You can find it on one of the video bro 🙌🙌

  • @ShivamGupta-sx4lk
    @ShivamGupta-sx4lk 3 ปีที่แล้ว +3

    backgroundImage: _imageFile == null
    ? AssetImage("assets/blank.png")
    : FileImage(File(_imageFile.path)),
    This line is giving error please tell me how to solve it

    • @bylkaminou517
      @bylkaminou517 3 ปีที่แล้ว

      did you find a solution??

    • @ShivamGupta-sx4lk
      @ShivamGupta-sx4lk 3 ปีที่แล้ว +2

      @@bylkaminou517 yes

    • @bylkaminou517
      @bylkaminou517 3 ปีที่แล้ว +1

      @@ShivamGupta-sx4lk can you show me how to fix the problem

    • @heliaha9705
      @heliaha9705 3 ปีที่แล้ว

      I have the same error!

    • @bylkaminou517
      @bylkaminou517 3 ปีที่แล้ว

      @@heliaha9705 I did not find a solution :(

  • @areebafarooq2694
    @areebafarooq2694 2 ปีที่แล้ว

    is this emulator or you are using real device ???

  • @sajeevvasudevan6301
    @sajeevvasudevan6301 ปีที่แล้ว

    void takephoto(ImageSource source)async{
    final pickedFile=await picker.pickImage(
    source:source,
    );
    setState(() {
    _imagefile=pickedFile as PickedFile;
    }); this my code

  • @LoveIsLifeTurkishIndia
    @LoveIsLifeTurkishIndia 3 ปีที่แล้ว

    Can you share the source code please..

  • @zareenharoon4287
    @zareenharoon4287 2 ปีที่แล้ว +1

    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()),
    );

  • @yashratnaparkhi4529
    @yashratnaparkhi4529 3 ปีที่แล้ว +1

    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

    • @DevStack
      @DevStack  3 ปีที่แล้ว

      We are storing it on a back-end bro 😄😄😄 you can find it in next video
      Please make sure to share the video 😄😄

    • @yashratnaparkhi4529
      @yashratnaparkhi4529 3 ปีที่แล้ว

      Please suggest me

    • @yashratnaparkhi4529
      @yashratnaparkhi4529 3 ปีที่แล้ว

      @@DevStack brother please share me the link for it.

    • @user-xf7mu7ub9d
      @user-xf7mu7ub9d 3 ปีที่แล้ว

      here the full playlist:
      th-cam.com/play/PLtIU0BH0pkKpitsp5jzt-yDAoXAFBkcPb.html

  • @zohairmoufakkir9501
    @zohairmoufakkir9501 4 ปีที่แล้ว +1

    please give me the code source

    • @DevStack
      @DevStack  4 ปีที่แล้ว

      You can get a link of the GitHub repo from the description :) ✌✌✌✌✌
      #like #subscribe and do #share to grow this channel

  • @bylkaminou517
    @bylkaminou517 3 ปีที่แล้ว

    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 !!!

    • @neeraj2626
      @neeraj2626 2 ปีที่แล้ว

      Hi, were you able to resolve this, if yes then please suggest the fix.

    • @shubhamprajapati8504
      @shubhamprajapati8504 2 ปีที่แล้ว +1

      ya same error here how to solved this...

  • @GuyNChai
    @GuyNChai 2 ปีที่แล้ว

    Dude get a mic, i have to tur of captions to listen o what you are saying 😶

  • @neeraj2626
    @neeraj2626 2 ปีที่แล้ว

    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")

    • @neeraj2626
      @neeraj2626 2 ปีที่แล้ว +2

      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)),

    • @luckyugwu
      @luckyugwu 2 ปีที่แล้ว +1

      @@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.

    • @neeraj2626
      @neeraj2626 2 ปีที่แล้ว +1

      @@luckyugwu I will try to upload my code tomorrow morning on github and will share the url.

    • @luckyugwu
      @luckyugwu 2 ปีที่แล้ว

      @@neeraj2626 I would really appreciate that.

  • @hectorprx
    @hectorprx 4 ปีที่แล้ว +1

    Thanks

    • @DevStack
      @DevStack  3 ปีที่แล้ว

      Welcome :)