Flutter & Data Storage
Flutter
Asynchronous code in Dart & Flutter
You must have encountered keywords like async, await and Future till now. These are very important blocks that one should comprehend.
Get this concept with this video created by Google developers themselves
Storing data locally
Persisting Key-Value based data using SharedPreferences
There are a lot of options for storing data locally. The most basic one is using the shared_preferences plugin.
Here is a video explaining the shared_preferences plugin
or you can read this tutorial
Although key-value storage is easy and convenient to use, it has limitations:
- Only primitive types can be used: int, double, bool, string, and stringList.
- It’s not designed to store a lot of data.
sqflite plugin overcomes these limitations.
Persist and Query data locally on the device with SQLite.
What is SQLite?
Before moving any forward, you must know what exactly is SQLite. The following tutorial gives you a brief overview of the same.
What is SQLite? Top SQLite Features You Should Know
sqflite package Flutter
Creating a local SQLite database usingHere comes the Flutter part.
There are a bunch of packages available to store data locally on the device, but the one recommended by Flutter is the "sqflite" package which is an SQLite plugin for Flutter.
Here is a short video by Flutter team explaining the sqflite package
Now, let's read and learn about the sqflite plugin!
or if you are more of a video person
The sqflite Alternative
sqflite is all you need for storing structured data locally therefore, explore this section only when you are done with sqflite.
Hive
Hive is a key-value (NoSQL) based database that is much faster than sqflite.
A beginners tutorial to Hive
Challenge and Submission
This Blog is a part of CSoC'21 Dev Frontend.
Remember, deadline for this task is June 21st, 2021 23:59.
So much for learning, here is your next Assignment
All the details of the task are provided in the README.md file.
Just like last task you have to create your own repo and then make a PR in above repo to add your entry into [Flutter.md](http://flutter.md)
with apk link and repo link only