Hive is a lightweight NoSQL key-value database designed for Flutter and Dart applications, ideal for local data storage and offline access. It features fast performance, strong typing with type adapters, and cross-platform compatibility. The document outlines the steps to integrate Hive into a Flutter project, including adding dependencies, creating classes, and performing basic data operations.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
34 views13 pages
Flutter Hive Chapter 8
Hive is a lightweight NoSQL key-value database designed for Flutter and Dart applications, ideal for local data storage and offline access. It features fast performance, strong typing with type adapters, and cross-platform compatibility. The document outlines the steps to integrate Hive into a Flutter project, including adding dependencies, creating classes, and performing basic data operations.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 13
1
Eyad Alshareef - Flutter and Dart
Hive : Store Data locally EYAD ALSHAREEF 2 Hive in Flutter
Hive refers to a Hive is a fast and lightweight
lightweight and efficient key-value database. NoSQL database that is It is a great choice for storing designed specifically for small amounts of data locally, such as user preferences, game Flutter and Dart scores, or shopping carts. applications. Hive is also a good option for apps that need to be able to work offline. Eyad Alshareef - Flutter and Dart 3 Hive in Flutter- Key Properties
• Key-Value Store: Hive stores data as key-value pairs, similar to a dictionary or
map. • NoSQL: It's a NoSQL database, meaning it doesn't use traditional relational database structures like tables and SQL. • Local Storage: Hive stores data locally on the device, making it ideal for offline access and quick data retrieval. • Fast and Efficient: Hive is designed for speed and efficiency, making it suitable for even complex Flutter applications. • Strongly Typed: Hive uses type adapters to ensure type safety, preventing common data corruption issues. • Cross-Platform: Works on various platforms supported by Flutter (iOS, Android, Web, Desktop). Eyad Alshareef - Flutter and Dart 4 Hive in Flutter- Key Properties
Eyad Alshareef - Flutter and Dart
5 Hive in Flutter- steps
1- Add Dependencies: Add the
hive and hive_flutter packages to your pubspec.yaml file:
Run flutter pub get to install
the packages.
Eyad Alshareef - Flutter and Dart
6 Hive in Flutter- steps
2- Create Class [Box-Table]
and generate adapter New file with the same as class name that represent the Box[table]
Eyad Alshareef - Flutter and Dart
7 Hive in Flutter- steps
3- Auto generate the class.g:
in terminal Run the command Run flutter packages pub run build_runner build to create the class