Flutter Shopping Cart With Provider with null safety Part - 5 || Add To Cart, Update Count And Price

Поділитися
Вставка
  • Опубліковано 16 вер 2024

КОМЕНТАРІ • 96

  • @Saansh6462
    @Saansh6462 2 роки тому +1

    great videos .... useful video ... and properly define ... thanks again

    • @thetechbrotherss
      @thetechbrotherss  2 роки тому

      Glad you liked it!, please do subscribe and share within your friend circle.

  • @muhammadanus8416
    @muhammadanus8416 2 роки тому +2

    Thanks it's help me in my mysql grocery project but i have 0 experienced with sqflite any big reason you used sqflite instead of mysql? & please make CRUD Tutorial in sqflite for beginners

    • @thetechbrotherss
      @thetechbrotherss  2 роки тому +2

      Both are same mysql and sql so you can go ahead with this. You can also watch my flutter notes app tutorial with sql.

    • @muhammadanus8416
      @muhammadanus8416 2 роки тому

      @@thetechbrotherss Ok, thanks🥰

  • @abdulrafay4450
    @abdulrafay4450 2 роки тому +2

    Can you upload a tutorial of get api of e-commerce using provider and shared preferences as local storage instead of sqlite.

    • @thetechbrotherss
      @thetechbrotherss  2 роки тому

      You can watch my tutorials about sql on with notes app on this channel.
      In future i will do that.

  • @sameerali9613
    @sameerali9613 Рік тому

    Thanks Bro Very Nice Explained Videos

  • @sudhanshujha1902
    @sudhanshujha1902 Рік тому +3

    Github link provide kr do iska plz

  • @enamulhaque9731
    @enamulhaque9731 2 роки тому +1

    Grete and thanks. but i have an error "Error: Could not find the correct Provider above this", please help me to fixing this error

  • @Saansh6462
    @Saansh6462 2 роки тому +1

    thanks dear

    • @thetechbrotherss
      @thetechbrotherss  2 роки тому

      Welcome 😊, do subscribe and share with your friends

  • @usmanspeaks8411
    @usmanspeaks8411 2 роки тому +1

    sir y wla project gibhub s download n hra r m code same to same yhi likh cka hn jb run krta hon products cart m add n hty r app run menu m build hti jati ha

    • @thetechbrotherss
      @thetechbrotherss  2 роки тому

      Koi issue hoga apko sode par bro it’s working find

    • @usmanspeaks8411
      @usmanspeaks8411 2 роки тому

      @@thetechbrotherss sir jb add to cart kro to ata ha null check operator use on a null value y smj n ari mjhy

  • @javalanguage9365
    @javalanguage9365 2 роки тому +2

    Brother In this videos when you add item to cart for the first time it says Null check operator used on a null value and do not add item to cart then second time it added and again if you restart the project and add item it gives same error you have not solved this util your 9th (Last video)

    • @thetechbrotherss
      @thetechbrotherss  2 роки тому

      This didn't happen to me while i was creating the video and i have done same way in many projects. I didn't face any issue like this.

    • @MoniSingha-r6c
      @MoniSingha-r6c 2 роки тому

      App first time run create db then problem solve

    • @snopcatdeveloper653
      @snopcatdeveloper653 2 роки тому

      check db_helper.dart file await dbClient?.insert() ------------- add ? mark

    • @sudhanshujha1902
      @sudhanshujha1902 Рік тому

      Cart provider wali file ko check kro may be because of some writing error in mapping error aarha ho

    • @ashhadahmed72
      @ashhadahmed72 23 дні тому

      NULL CHECK OPERATOR USED ON A NULL VALUE
      when you click for the first time on Add to cart button it will show - "Null check operator used on a null value". But for the second time it will work fine.
      to solve this update getter _db as follows
      Future get db async {
      if (_db != null) {
      return _db;
      }
      _db = await initDatabase();
      return _db;
      }

  • @tanveersyed9999
    @tanveersyed9999 Рік тому

    sir badge to by default ab araha hai lakin ab es ko consumer ki saat kesy wrap krengi plz help

  • @Hamza-dw4iw
    @Hamza-dw4iw 11 місяців тому

    what if we dont make the variables like "counter" private, will it make any difference?

  • @mascoder.8923
    @mascoder.8923 2 роки тому +1

    brother when um click first time add to cart it's don't added to cart and showing error (Null check operator used on a null value)...but 2nd time it's ok,,,,please check it may be you missed it

    • @thetechbrotherss
      @thetechbrotherss  2 роки тому +1

      It’s something you are doing wrong 😑 it works fine you can check the source code on github check description

    • @mascoder.8923
      @mascoder.8923 2 роки тому

      @@thetechbrotherss in your tutorial doing same thing

    • @mascoder.8923
      @mascoder.8923 2 роки тому

      Brother um check every single line code...
      In this video 27.05 min very first click add to cart button showing error (null check operator used on a null value) in log..mean cart is already added..But second time it has work..successfully added..except that everything is ok....
      Please check it brother...It's kill me,, trying to solve

    • @ashhadahmed72
      @ashhadahmed72 23 дні тому

      NULL CHECK OPERATOR USED ON A NULL VALUE
      when you click for the first time on the Add to cart button it will show - "Null check operator used on a null value". But for the second time it will work fine.
      to solve this update getter _db as follows
      Future get db async {
      if (_db != null) {
      return _db;
      }
      _db = await initDatabase();
      return _db;
      }

  • @rajatmehra4496
    @rajatmehra4496 10 місяців тому

    The method 'insert' isn't defined for the type 'DBHelper'. (Documentation) Try correcting the name to the name of an existing method, or defining a method named 'insert'.

  • @UsmanAsghar-yf1yz
    @UsmanAsghar-yf1yz Рік тому

    Bro Its good that you have make video but no properly explained code just typing the code from seeing somewhere.

    • @thetechbrotherss
      @thetechbrotherss  Рік тому

      I do agree, at that' time i used to not to into depth.

  • @PureMotiva-rt2dn
    @PureMotiva-rt2dn 2 місяці тому

    Bro am facing a fetal error in dbhelper.insert(Cart()) in product list file and the error is
    ("The expression doesn't evaluate to a function, so it can't be invoked.") plz suggest me solution for it

    • @thetechbrotherss
      @thetechbrotherss  2 місяці тому +1

      You must be doing something wrong, please check the code on my github to match the code

    • @PureMotiva-rt2dn
      @PureMotiva-rt2dn 2 місяці тому

      @thetechbrotherss OK Bro I'll take code from your git hub.
      But I were thinking that flutter is upgrading day by day so the error am facing is can be due to Updated version of flutter ?
      And plz make a separate tutorial on topic of "updation of flutter effect you code "?

  • @mujahidshah2870
    @mujahidshah2870 Рік тому +1

    (1) table cart has no column named intialPrice
    I/flutter (19653): DatabaseException(table cart has no column named intialPrice (code 1 SQLITE_ERROR): , while compiling: INSERT INTO cart (id, productId, productName, intialPrice, ProductPrice, quantity, unitTag, image) VALUES (?, ?, ?, ?, ?, ?, ?, ?)) sql 'INSERT INTO cart (id, productId, productName, intialPrice, ProductPrice, quantity, unitTag, image) VALUES (?, ?, ?, ?, ?, ?, ?, ?)' args [2, 2, Grapes, 30, 30, 1, KG, how to solve this and not add product to badge

  • @snopcatdeveloper653
    @snopcatdeveloper653 2 роки тому +1

    errors are this video and fixed to add ======>>>> await dbClient?.insert('cart', cart.toMap(),
    conflictAlgorithm: ConflictAlgorithm.replace);
    **remember cart is table

    • @thetechbrotherss
      @thetechbrotherss  2 роки тому +2

      bhai error ni ha please watch full video and your error will be solved

    • @snopcatdeveloper653
      @snopcatdeveloper653 2 роки тому

      @@thetechbrotherss wo apke version wala hai aur az ke din dependency version update huwa ho ga bhai

    • @snopcatdeveloper653
      @snopcatdeveloper653 2 роки тому +1

      @@thetechbrotherss problem ye hai ki multiple product unit add nai kar sakte

    • @thetechbrotherss
      @thetechbrotherss  2 роки тому +1

      Bhai new version k sath bhi yeah code kam kry ga.

    • @snopcatdeveloper653
      @snopcatdeveloper653 2 роки тому +1

      @@thetechbrotherss hn

  • @mujahidshah2870
    @mujahidshah2870 Рік тому +1

    Because shoppingcart depends on sqflite >=2.0.4-dev.1 which requires SDK version >=2.18.0-0 =2.0.4-dev.1 which requires SDK version >=2.18.0-0

    • @thetechbrotherss
      @thetechbrotherss  Рік тому

      Add latest dependencies

    • @mujahidshah2870
      @mujahidshah2870 Рік тому

      @@thetechbrotherss sqflite >=2.0.4 version old. new version nahi he ab kya kare

  • @RashidAlii
    @RashidAlii 2 роки тому +1

    brother when i add item to cart its print "Stack Overflow" error how to resolve this

    • @thetechbrotherss
      @thetechbrotherss  2 роки тому

      that's insane

    • @RashidAlii
      @RashidAlii 2 роки тому

      @@thetechbrotherss kese resolve kro ye issue what you think kaha ghlto krha ho mey becaz mey product ke jo item usko bi aik model class sey le rha ho

    • @RashidAlii
      @RashidAlii 2 роки тому

      Kindly help me out i will be very thankful

  • @musiclovers..8941
    @musiclovers..8941 Рік тому

    cart icon not visible kya kru ki visible ho pls reply me🙏

    • @thetechbrotherss
      @thetechbrotherss  Рік тому

      please check code on my git, link in description. you must be doing something wrong

  • @naufilahmed6281
    @naufilahmed6281 2 роки тому

    sir mein DBHelper dbHelper = DBHelper(); lagta hon tho erroe deta hai sir please help kai kyun horaha hai

    • @thetechbrotherss
      @thetechbrotherss  2 роки тому

      Kya error atta ha ap project ko phr sy run kr lain.

    • @thetechbrotherss
      @thetechbrotherss  2 роки тому

      R videos please full dekhain mainy error fix kia thy

  • @3BkReNo0o
    @3BkReNo0o 2 роки тому

    Good job bro, but we need to update qty if product exists in cart not to show error that item already exists .. how we can ??

    • @thetechbrotherss
      @thetechbrotherss  2 роки тому

      Process remains same but now you need to store the products locally in sql and then need to load data from sql. After that you need to do the same process on adding the product to cart and updating them in product screen and cart screen..

    • @3BkReNo0o
      @3BkReNo0o 2 роки тому

      @@thetechbrotherss i try with db helper but i cant, can you help

    • @thetechbrotherss
      @thetechbrotherss  2 роки тому

      As i said you need to store the data of your product from api local database. Then you need to load the data from local database and display the product. After that perform the same function like i performed in cart.

  • @aamirali2011
    @aamirali2011 Рік тому

    brother i used the code step by step and it added to sqlite but unable to see any in cart still 0. please help

    • @thetechbrotherss
      @thetechbrotherss  Рік тому

      check source code my github, link in description

    • @aamirali2011
      @aamirali2011 Рік тому

      @@thetechbrotherss can I have your cell number??

  • @joymazumder-kr2og
    @joymazumder-kr2og 2 місяці тому

    class CartProvider with ChangeNotifier{
    DBHelper db = DBHelper() ;
    int _counter = 0 ;
    int get counter => _counter; // here why add this ........ I am following you , your video is so good but in this playlist, you didn't explain properly . You're writing code in a hurry, and it sounds like you're reading what you're writing, with no explanation. Like why it's used, what's the reason behind it, there's no explanation as to how it works which is why I honestly couldn't understand this playlist. Your previous playlists are much better than that. I hope I won't face this problem in the next playlist . but anyway, thank you for your hard work in making videos

    • @thetechbrotherss
      @thetechbrotherss  2 місяці тому +1

      I agree with you, i was new that time. Now my videos are much improved and focus on explaining code

    • @joymazumder-kr2og
      @joymazumder-kr2og 2 місяці тому

      @@thetechbrotherss Thank You

  • @MuhammadUzair-zs8vz
    @MuhammadUzair-zs8vz 4 місяці тому

    getting error null check operator used on a null value

    • @thetechbrotherss
      @thetechbrotherss  4 місяці тому

      checkout course on my github username axiftaj
      to correct your error

    • @MuhammadUzair-zs8vz
      @MuhammadUzair-zs8vz 3 місяці тому

      @@thetechbrotherss Thanks

    • @ashhadahmed72
      @ashhadahmed72 23 дні тому

      NULL CHECK OPERATOR USED ON A NULL VALUE
      when you click for the first time on Add to cart button it will show - "Null check operator used on a null value". But for the second time it will work fine.
      to solve this update getter _db as follows
      Future get db async {
      if (_db != null) {
      return _db;
      }
      _db = await initDatabase();
      return _db;
      }

  • @jasminthapa9324
    @jasminthapa9324 Рік тому

    Please solve this error: Cart( id:index, productId:index.toString(), productName:productName[index].toString(), initialPrice:productPrice[index], producPrice:productPrice[index], quantity:1, unitTag:productUnit[index].toString(), image:productImage[index].toString() ) this is the error:The argument type 'Cart (where Cart is defined in C:\Users\DELL\OneDrive\Documents\flutter\test2\test2\lib\Screens\cart.dart)' can't be assigned to the parameter type 'Cart (where Cart is defined in C:\Users\DELL\OneDrive\Documents\flutter\test2\test2\lib\Screens\cart_model.dart)'. The named parameter 'id' isn't defined.,The named parameter 'productId' isn't defined
    As the name Cart is similar for both

    • @thetechbrotherss
      @thetechbrotherss  Рік тому

      As error says add missing parameter.
      Follow tutorial carefully
      My code with working fine. Every time if you did a mistake make sure you delete the database and than try again.
      For now delete the app and install it again.

  • @nipunathalpage5673
    @nipunathalpage5673 Рік тому

    please do videos in English

  • @zafranhazarvi9196
    @zafranhazarvi9196 2 роки тому +1

    Bai mujay code ni mil raha ha github pay kindly link bata dyna

    • @thetechbrotherss
      @thetechbrotherss  2 роки тому +1

      Search kro mil jay ga

    • @zafranhazarvi9196
      @zafranhazarvi9196 2 роки тому

      @@thetechbrotherss Bai ak error araha ha *MissingPluginException* ya kaya error ha ?? kasy solve hoga??
      Jab ma Add to cart py click karta hu tab ya error dyta ha

  • @pydrive2870
    @pydrive2870 2 роки тому +1

    On addition of the very first item to the cart there is and error saying "Null check operator used on a null value". Anyone knows how can we solve this problem?

    • @binduaradhya3514
      @binduaradhya3514 2 роки тому

      Getting the same error... please help

    • @knowledgepoint2155
      @knowledgepoint2155 Рік тому

      When the value is null on the variable and when you are fetching the same null variable with null check operator it show this type of error.

    • @ashhadahmed72
      @ashhadahmed72 23 дні тому

      NULL CHECK OPERATOR USED ON A NULL VALUE
      when you click for the first time on Add to cart button it will show - "Null check operator used on a null value". But for the second time it will work fine.
      to solve this update getter _db as follows
      Future get db async {
      if (_db != null) {
      return _db;
      }
      _db = await initDatabase();
      return _db;
      }

  • @snowwhite1836
    @snowwhite1836 2 роки тому +1

    Future get db async {
    if (_db != null) {
    return _db!;
    }
    _db = await initDatabase();
    }
    database_helper.dart file,
    (db) is show error message;
    This function has a nullable return type of 'FutureOr', but ends without returning a value.
    Try adding a return statement, or if no value is ever returned, try changing the return type to 'void'.". please help!!

    • @thetechbrotherss
      @thetechbrotherss  2 роки тому

      Watch video carefully till end uninstall the app then reinstall it

    • @ashhadahmed72
      @ashhadahmed72 23 дні тому

      NULL CHECK OPERATOR USED ON A NULL VALUE
      when you click for the first time on Add to cart button it will show - "Null check operator used on a null value". But for the second time it will work fine.
      to solve this update getter _db as follows
      Future get db async {
      if (_db != null) {
      return _db;
      }
      _db = await initDatabase();
      return _db;
      }

  • @Ralphflowers
    @Ralphflowers 2 роки тому

    Manz can speak English but decides to speak his language 😭😭wish you knew how much we depend on Indian tutors on youtube you guys got no idea hey

    • @thetechbrotherss
      @thetechbrotherss  2 роки тому +1

      Oh mate i can feel you and promise i will try my best to make videos in English in future.

    • @Ralphflowers
      @Ralphflowers 2 роки тому

      @@thetechbrotherss thank you so much the first comment I was just angry. Not to spread hate but just disappointed since I looked forward to it