No video

Flutter SQFLite tutorial: CRUD Operation. Perform Insert, Fetch, Update and Delete Operation #4.7

  Рет қаралды 109,212

Smartherd

Smartherd

5 жыл бұрын

Access 7000+ courses for 60 days FREE: pluralsight.px...
Learn how to create an SQLite database in Flutter using Raw SQL statement and perform Insert, Fetch, Update and Delete operation.
Next Video: • Flutter SQFLITE Exampl...
Previous Video: • Flutter SQFLite tutori...
Video Code: bit.ly/2UrETH2
Source code files: bit.ly/2NINczC .
.
Please donate and support my work
(If you think my free tutorials are better than paid ones :)
- Patreon: bit.ly/patreon...
- Paypal/Payoneer: sriyank123@gmail.com
- UPI (only for India): smartherd@okaxis
:: If you want to develop a website or a mobile app, email me your requirement at sriyank.siddhartha@gmail.com :: Free demos provided beforehand ::
- Access my premium courses: bit.ly/sriyank...
Free Programming courses:
- Ruby Programming: bit.ly/smyt-r
- Dart Programming: bit.ly/smyt-d
- Kotlin Programming: bit.ly/smyt-k
- Java Programming: bit.ly/smyt-j
- Kotlin Coroutines: bit.ly/smyt-coru
Free Flutter course:
- Flutter App Development: bit.ly/2Rg7EFR
Free Android courses:
- Android using Kotlin: bit.ly/smyt-ka
- Android using Java: bit.ly/smyt-ja
- Android Material Design: bit.ly/2SMJqU6
- Android Jetpack Architecture: bit.ly/yt-j
- Android Multiple Screen Support: bit.ly/smyt-mss
- Android Retrofit: bit.ly/2Ee6GHn
More free programming courses:
- bit.ly/smy-list
Check out my website:
- bit.ly/smartherd
Let's get in touch! [Sriyank Siddhartha]
LinkedIn: bit.ly/sriyank...
Facebook: bit.ly/smarthe...
Instagram: bit.ly/sriyank...
Twitter: bit.ly/sriyank...
Github: bit.ly/smarthe...
--- Thank you for your love and support ---

Пікірлер: 90
@adri_eu
@adri_eu 5 жыл бұрын
Thanks for your great tutorials. In your database helper class there is an error. The database directory on a real iPhone cannot be found. To solve this: - import package:path/path.dart - define your path as: String path = join(directory.path, 'databasename.db');
@smartherd
@smartherd 5 жыл бұрын
Thank you for pointing this. Hope this helps others
@shahalam4403
@shahalam4403 4 жыл бұрын
@@smartherd is it mandatory to use singleton for DatabaseHelper instance, or it will work without this approach?
@TechMaxedYT
@TechMaxedYT 4 жыл бұрын
Thanks but your import is wrong. It should be like this: import 'package:path/path.dart';
@sumitshukla6436
@sumitshukla6436 4 жыл бұрын
@@shahalam4403 It is a good practice to follow singleton approach.
@splitvillan7171
@splitvillan7171 3 жыл бұрын
sorry but doing as you said only leads to error to ( Directory directory = await getApplicationDocumentsDirectory();)
@juandalisay
@juandalisay 5 жыл бұрын
1:18 Create DatabaseHelper class 1:33 Create 'singleton' to store the DatabaseHelper instance 1:51 Define factory constructor to return the value of the DatabaseHelper instance 2:22 Turn DatabaseHelper on if it is off 2:40 Define 'singleton' database object and all columns with table name 3:00 Create the Database 3:30 Initialize the Database and set path for DB for opening 5:03 Set getters 5:30 Summary of method chaining 6:00 Define Fetch to get Note object from DB using rawQuery or query 8:00 Querying the db returns a Future MAP because of SQFlite 8:20 Insert but convert data to MAP first 8:50 Update with where to update 9:15 Delete using rawDelete 9:30 Get count of objects thru firstIntValue(x)
@thanishlos9059
@thanishlos9059 3 жыл бұрын
Thats helpfull
@infotration2225
@infotration2225 2 жыл бұрын
Bro what should I do when create helper it show me error, the non-nullable variable _databaseHelper must be initialize
@gulafshashaikh5799
@gulafshashaikh5799 Жыл бұрын
@@infotration2225 am also facing the same error
@OystaFX
@OystaFX Жыл бұрын
@@gulafshashaikh5799 bro, did you get this solved? And how please? Am facing same error
@OystaFX
@OystaFX Жыл бұрын
@@infotration2225 did you get this solved? And how please? Am facing same error
@manuelleonardovargastapia8489
@manuelleonardovargastapia8489 5 жыл бұрын
Thanks! Yout explanations are very clear and concise. Great work. I have to ask, could you make a video about managing multiple tables? I mean, how can we manipulate tables that relates each other? For example, what happens if you want to asociate the notes model with the currently logged in user?
@lankahelth4002
@lankahelth4002 3 жыл бұрын
your tutorials are very good and understandeable, please upload this video again in up to date, thank you.
@raul286162
@raul286162 5 жыл бұрын
-And how strong, dart represents data types? Future getNoteMapList() -OMG..
@aakashshrestha5211
@aakashshrestha5211 4 жыл бұрын
your video is really awesome i am just getting the whole concept from your video, a massive thank-you :)
@ayjahanashirova4001
@ayjahanashirova4001 3 жыл бұрын
Like man. finally I could solve my issue. thanks.
@bojidarkamenski3432
@bojidarkamenski3432 4 жыл бұрын
Hello, thank you for your tutorials they are so good and helpful, thank you for your work. Can I ask you guys what does this.etc mean, because I can't find it in the previous tutorials and I think this is importnant to know. Thank you and have a nice day!!!
@mufidrazmin8929
@mufidrazmin8929 5 жыл бұрын
Great videos. It would be great if you guys create a video where multiple tables are used and relations between them are showcased. Thanks in advance.
@Linhcua1527
@Linhcua1527 4 жыл бұрын
In case there are more than 1 table in the database (>=2), then how we will organize the DatabaseHelper class or!? I mean, if there are many tables, the DatabaseHelper class can be very long file, so any way to organize it !?
@mrutyunjayagiri982
@mrutyunjayagiri982 5 жыл бұрын
A great procedural video. I'm getting an error. NoSuchMethodError: Class 'MethodChannel' has no instance method 'invokeMethod' with matching arguments. Tried calling: invokeMethod("getApplicationDocumentsDirectory") E/flutter ( 5924): Found: invokeMethod(String, [dynamic]) => Future .
@RandalLSchwartz
@RandalLSchwartz 5 жыл бұрын
The raw sql queries are subject to SQL injection attacks. Best to use the placeholder versions.
@AlikhKhan
@AlikhKhan 3 жыл бұрын
Good Question. Let suppose I have installed Android or iOS App with MYSQL database on my phone. Now I will perform SQL injection on my on phone? To compromise my own data ?
@RandalLSchwartz
@RandalLSchwartz 3 жыл бұрын
@@AlikhKhan Might not be an issue for you and your code, but people doing this based on what they see might create injections. Best to never use interpolations, even for demos.
@user-ss4lc3dt4o
@user-ss4lc3dt4o 3 жыл бұрын
И смех и грех... Хоть я и не понял этот ломаный английский, но суть и логику выполнения понял идеально:)
@lcppb
@lcppb 2 жыл бұрын
Olá, tem como Atualizar este curso com as versões atuais do Dart e Flutter ???? ou não mudou nada na forma de fazer....????
@rikhiljain6889
@rikhiljain6889 4 жыл бұрын
Hello thanks for the great tutorial... as I am new to flutter I got idea about sqlite database.... BUT I have one query. I have prepared database with 500+ entries and I have to do CRUD operation. So where I should put my data in flutter app so it will work on both iOS and Android... and how to set path of database... in my case.. A word of reply will be highly appreciated. Thanks sir.
@palakurthisriraj4-yearb.te883
@palakurthisriraj4-yearb.te883 3 жыл бұрын
Wowww..Thats a great vedio..thanks a lot...
@RajA-me9cl
@RajA-me9cl 4 жыл бұрын
Settings for horizontal lines between codes like yours?
@odorlessflavorless
@odorlessflavorless 5 жыл бұрын
The part on the method chaining was a lot to gather ! Is there any prerequisite to understand the whole of it or should watching the video again and again let me get the hang of it?
@smartherd
@smartherd 5 жыл бұрын
It's just dart. If u know dart then watch this video again.
@skysea1068
@skysea1068 5 жыл бұрын
been waiting for this...tnx and more power..
@DeepakKumar-pz2sd
@DeepakKumar-pz2sd Жыл бұрын
Bro make videos on firebase with flutter as you made other videos
@Hasan-vu9hn
@Hasan-vu9hn 5 жыл бұрын
Please make a video about how to add backup & restore option n sql app.... I will need. this. please help me
@refreshing_morning
@refreshing_morning 5 жыл бұрын
Happy Diwali smarthead. Nice video.
@smartherd
@smartherd 5 жыл бұрын
Same. To u buddy
@shivamgangwar2773
@shivamgangwar2773 3 жыл бұрын
It's good n simple
@maheshpanday8792
@maheshpanday8792 4 жыл бұрын
Sir error is coming in whole code wherever Note is used somewhere saying it isn't a type can't be used as argument and in navigate detail undefined class Note and different errors in different places whereever Note is used
@cedric_ds
@cedric_ds 4 жыл бұрын
9:00 in the getNoteMapList() and insertNode() methods you stored db as a Database, in updateNote() you stored it as a var, does that make a difference?
@AnkitTiwari-dw9er
@AnkitTiwari-dw9er 4 жыл бұрын
The only difference is you can store an entirely different kind of object to the references declared as 'var' whereas you can only store Database objects in those declared via 'Database' class.
@lavakumar_techie
@lavakumar_techie 4 жыл бұрын
Hi Sir, How to pass table name from UI to database helper. So that I can create dynamic table name is it possible to create like that sir. Please explain how to approach
@mufidrazmin8929
@mufidrazmin8929 5 жыл бұрын
onCreate : _createDb This line is a bit confusing as _createDb requires 2 parameters but no parameters are passed. Have I missed anything? Please let me know.
@AnkitTiwari-dw9er
@AnkitTiwari-dw9er 4 жыл бұрын
I have the same doubt.
@owonubijobsunday4764
@owonubijobsunday4764 4 жыл бұрын
That is because of *{}* . It makes them optional
@PriyanshuRaj-oc4tk
@PriyanshuRaj-oc4tk 4 жыл бұрын
Why did you create the DatabaseHelper singleton object?
@user-gp8or6ik2k
@user-gp8or6ik2k 9 ай бұрын
Can I use this code to create multiple tables?
@aissoumonder3518
@aissoumonder3518 2 жыл бұрын
in the case I want to create many tables should I create DBHelper file for each table or can I add it in the same file ?
@razakhan3586
@razakhan3586 3 жыл бұрын
i am getting error on 4:59 min of video when you add database as type of future
@ravichudgar
@ravichudgar 4 жыл бұрын
how can i store the float value in flutter ?
@rushiprojects4852
@rushiprojects4852 3 жыл бұрын
use double datatype
@mdzaidansari6537
@mdzaidansari6537 4 жыл бұрын
at 4:35 you pass the _createDb function to the openDatabsae method..but it takes some parameters and you haven't provided any... how does this work? if anyone can explain please?
@mdzaidansari6537
@mdzaidansari6537 4 жыл бұрын
I mean like you've provided int newVersion in _createDb.. why is that necessary ? coz it's not working without it.
@learnthroughanimation6924
@learnthroughanimation6924 4 жыл бұрын
I'm confuse at one point. You didn't define _createInstance(); method.
@nandeeshkamath5208
@nandeeshkamath5208 4 жыл бұрын
It is named constructor.
@VinitDabhi
@VinitDabhi 4 жыл бұрын
Can I use firebase database with flutter? And if yes then which is best?
@viralgohil6616
@viralgohil6616 3 жыл бұрын
Sir how to get totalprice using helper function
@spotnuru83
@spotnuru83 3 жыл бұрын
firstly thank you so much for the tutorial, but data is not getting stored :( when i was trying to debug i was getting the following path /data/user/0/com.example.ui/app_flutternotes.db not sure why it is not getting created or what is happening in the back ground, also i am not getting any error strangely.
@spotnuru83
@spotnuru83 3 жыл бұрын
looks like data is getting inserted, but not showing the list ... as when i see print the result on inserting the number is increasing .. but not sure why the notes list is not showing them, still debugging
@spotnuru83
@spotnuru83 3 жыл бұрын
Notes are coming to ListView.builder also as per debugging, but items are not getting shown in the Notes List UI :( not sure why
@devpro834
@devpro834 5 жыл бұрын
Why at 2:53 ,you defined string notetable
@MOHYUDIN14
@MOHYUDIN14 4 жыл бұрын
I have the same question, I'm trying to separate it in a different file now.
@LarryWasHere
@LarryWasHere 5 жыл бұрын
I had a confusion about Async and Await vs Future and .then.. because i thought you use either one or the other yet the tutorial declares return type as Future and uses async, await. if you also got stuck on this, here is a link to Stack overflow for a similar question: stackoverflow.com/questions/56520364/when-do-i-need-to-state-the-return-type-of-an-async-function-as-a-future-object Also, your tutorials are amazing! thank you so much!
@platinum7919
@platinum7919 5 жыл бұрын
Can't get sqflite to import. Already declared in yml file..
@TechZikry
@TechZikry 4 жыл бұрын
how to relational data multi tables in sqlite?
@amansingh.h716
@amansingh.h716 4 жыл бұрын
why we need to create two constructor
@sanjaykumaryadav1887
@sanjaykumaryadav1887 4 жыл бұрын
where can we find our database after creating it ????
@LinuxForLife
@LinuxForLife 5 жыл бұрын
Database is ignored by my IDE. Where does this come from ? This type does not exist anywhere ... did I miss some import(s) ?
@LinuxForLife
@LinuxForLife 5 жыл бұрын
I have found my mistake: misspelling a word ... all seems OK now. Sorry for the noise.
@ahsanzulfiqar518
@ahsanzulfiqar518 4 жыл бұрын
Make a video about foreign key in flutter database.
@chetandaulani2954
@chetandaulani2954 3 жыл бұрын
There is no foreign key in android database he told in his previous videos
@shrn
@shrn 3 жыл бұрын
I dont understand why people take the same complex code and try to show it's how we should code. Beginners need to learn the working of sqlite and then it would be better to check alternate methods
@canzengin3691
@canzengin3691 4 жыл бұрын
Is it possible to connect mysql db in GoDaddy server
@ishanjain527
@ishanjain527 5 жыл бұрын
8:50 getting error when I am using where why so?
@yasharma2301
@yasharma2301 4 жыл бұрын
wtf I had a doubt and when I came to the comments section to post, I see that you just like the question and thats it. I mean if you don't want to answer why would you even like, this doesn't make any sense.
@smartherd
@smartherd 4 жыл бұрын
I read all comments but bit lazy to answer. I receive 100+ comments a day
@MdYousuf-gw2dn
@MdYousuf-gw2dn 3 жыл бұрын
too many functions and steps..and i am stuck :( :(
@_haptic_shorts
@_haptic_shorts 4 жыл бұрын
Sir, I think for a beginner it's really difficult to understand in once chance ..
@lakshandersagwal
@lakshandersagwal 4 жыл бұрын
bro, have you completed this app ?
@_haptic_shorts
@_haptic_shorts 4 жыл бұрын
@@lakshandersagwal no bro.. now I'm revised old lessons and explore all things and Widgets in flutter ... After that I'll try it once
@lakshandersagwal
@lakshandersagwal 4 жыл бұрын
@@_haptic_shorts okk bro, my mind is fucked up, i tried copying all his code from github, but it also shows so much errors
@_haptic_shorts
@_haptic_shorts 4 жыл бұрын
@@lakshandersagwal yes, because now flutter released his Stable version and, the coding is on beta testing.
@devpro834
@devpro834 5 жыл бұрын
Won't you should go slow
@fabriciomedeiros987
@fabriciomedeiros987 4 жыл бұрын
How to do if I have more tables ?
@ahsanzulfiqar518
@ahsanzulfiqar518 4 жыл бұрын
Are you know the answer of this question now???
@fabriciomedeiros987
@fabriciomedeiros987 4 жыл бұрын
Ahsan Zulfiqar yes
managed to catch #tiktok
00:16
Анастасия Тарасова
Рет қаралды 14 МЛН
Little brothers couldn't stay calm when they noticed a bin lorry #shorts
00:32
Fabiosa Best Lifehacks
Рет қаралды 17 МЛН
The Joker saves Harley Quinn from drowning!#joker  #shorts
00:34
Untitled Joker
Рет қаралды 55 МЛН
Google Pixel 9/Pro/Fold Impressions: They've Finally Done It?
13:25
Marques Brownlee
Рет қаралды 6 МЛН
Sqflite Tutorial | Flutter plugin for SQLite | CRUD
15:47
Learn Flutter with Me
Рет қаралды 51 М.
Brutally honest advice for new .NET Web Developers
7:19
Ed Andersen
Рет қаралды 137 М.
Flutter SQFLITE CRUD Operations
28:36
dbestech
Рет қаралды 66 М.
Flutter Local Database Using sqfLite
20:51
Coding Orbit
Рет қаралды 35 М.