Тёмный

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

Smartherd
Подписаться 136 тыс.
Просмотров 110 тыс.
50% 1

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

Опубликовано:

 

21 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 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 4 года назад
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 2 года назад
@@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 6 лет назад
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 4 года назад
your tutorials are very good and understandeable, please upload this video again in up to date, thank you.
@aakashshrestha5211
@aakashshrestha5211 5 лет назад
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.
@raul286162
@raul286162 5 лет назад
-And how strong, dart represents data types? Future getNoteMapList() -OMG..
@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 !?
@palakurthisriraj4-yearb.te883
@palakurthisriraj4-yearb.te883 3 года назад
Wowww..Thats a great vedio..thanks a lot...
@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.
@skysea1068
@skysea1068 6 лет назад
been waiting for this...tnx and more power..
@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.
@refreshing_morning
@refreshing_morning 6 лет назад
Happy Diwali smarthead. Nice video.
@smartherd
@smartherd 6 лет назад
Same. To u buddy
@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 .
@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....????
@RajA-me9cl
@RajA-me9cl 4 года назад
Settings for horizontal lines between codes like yours?
@aissoumonder3518
@aissoumonder3518 3 года назад
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 ?
@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.
@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.
@PriyanshuRaj-oc4tk
@PriyanshuRaj-oc4tk 4 года назад
Why did you create the DatabaseHelper singleton object?
@user-gp8or6ik2k
@user-gp8or6ik2k 11 месяцев назад
Can I use this code to create multiple tables?
@VinitDabhi
@VinitDabhi 4 года назад
Can I use firebase database with flutter? And if yes then which is best?
@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
@shivamgangwar2773
@shivamgangwar2773 3 года назад
It's good n simple
@razakhan3586
@razakhan3586 3 года назад
i am getting error on 4:59 min of video when you add database as type of future
@Hasan-vu9hn
@Hasan-vu9hn 6 лет назад
Please make a video about how to add backup & restore option n sql app.... I will need. this. please help me
@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
@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
@Мишаня-е4щ
@Мишаня-е4щ 3 года назад
И смех и грех... Хоть я и не понял этот ломаный английский, но суть и логику выполнения понял идеально:)
@learnthroughanimation6924
@learnthroughanimation6924 4 года назад
I'm confuse at one point. You didn't define _createInstance(); method.
@nandeeshkamath5208
@nandeeshkamath5208 4 года назад
It is named constructor.
@DeepakKumar-pz2sd
@DeepakKumar-pz2sd Год назад
Bro make videos on firebase with flutter as you made other videos
@ravichudgar
@ravichudgar 4 года назад
how can i store the float value in flutter ?
@rushiprojects4852
@rushiprojects4852 3 года назад
use double datatype
@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.
@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.
@viralgohil6616
@viralgohil6616 3 года назад
Sir how to get totalprice using helper function
@amansingh.h716
@amansingh.h716 4 года назад
why we need to create two constructor
@sanjaykumaryadav1887
@sanjaykumaryadav1887 4 года назад
where can we find our database after creating it ????
@spotnuru83
@spotnuru83 4 года назад
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 4 года назад
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 4 года назад
Notes are coming to ListView.builder also as per debugging, but items are not getting shown in the Notes List UI :( not sure why
@TechZikry
@TechZikry 4 года назад
how to relational data multi tables in sqlite?
@platinum7919
@platinum7919 5 лет назад
Can't get sqflite to import. Already declared in yml file..
@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
@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.
@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?
@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
@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
@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!
@_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.
@MdYousuf-gw2dn
@MdYousuf-gw2dn 3 года назад
too many functions and steps..and i am stuck :( :(
@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
@devpro834
@devpro834 5 лет назад
Won't you should go slow
Далее
Sqflite Tutorial | Flutter plugin for SQLite | CRUD
15:47
Solving one of PostgreSQL's biggest weaknesses.
17:12
Просмотров 205 тыс.
Flutter SQFLITE CRUD Operations
28:36
Просмотров 67 тыс.
Flutter Local Database Using sqfLite
20:51
Просмотров 36 тыс.