In this tutorial, we added a feature that allows you to mark your tasks as done. So before you continue with this tutorial, check out the previous one: TODO App Using HIVE

What is TypeAdapter?

Hive supports all primitive types such as List, Map, DateTime and Uint8List. If you want to store other objects, you must register a TypeAdapter that converts the object to and from binary form.

You can either write a TypeAdapter yourself or generate it. In most cases, the generated adapter will work just fine. Sometimes there are little things that you can improve with a manually written adapter.

Generate Adapter

The…


In this tutorial we will build a simple todo app, which features data persistence all with Hive in under 100 lines of code!

Setup

First we create a new Flutter project:

flutter create todo_app

Dependencies

We can then go ahead and add hive and hive_flutter to the pubspec.yaml file in the project folder:

Initialization

Inside the main() function, we initialize Hive and open up the box. We also call runApp() to allow Flutter to build our app.

MyApp Widget

Here’s the MyApp class that we call inside of runApp(). We have some undefined functions and variables but we’ll take care of those later.


NOT ALL HUMANS HAVE RELATIONSHIP, BUT DATABASES DO

Introduction

Today we continue our journey into the world of the Hive database. In this tutorial of the series, we will learn how to work with multiple objects that have relationships with each other.

HiveLists

HiveLists provide a simple way to solve the problem. They allow you to store a “link” to the actual object.

Let’s understand this with the example of a ToDo app, where we create tasks and assign them to a specific user.

Create a TypeAdapter for Task object

First, we create a Task object using HiveObject. …


Hive has no query language and only limited support for sorting, but this is not necessarily a disadvantage. Sorting and filtering is much faster if you do it yourself in Dart.

Introduction

Because key-value stores are very simple, the data can be modeled in a less complicated way than in SQLite. There is no schema, and you can store objects of different types in the same box. But there are a few things you should be aware of.

Key Order

All keys are sorted in lexicographic order by default. You can use this to get a “free” sort. For example, if you want…


Sometimes it is necessary to store data securely on disk. Hive supports AES-256 encryption out of the box.

Introduction

The only thing you need is a 256-bit (32-byte) encryption key. Hive provides a helper function to generate a secure encryption key using the random number generator called Fortuna.

Generate Secure Key

To secure data, we need to generate an encryption key. We store the encryption key using the flutter_secure_storage package, but you can use any package/method to securely store the encryption key.

Encrypted Box

Now we have generated an encryption key that we need to pass as a parameter encryptionCipher to the method Hive.openBox().

The End


One For All, All For One — Flutter v1.0

Google flutter v1.0, which was most and long awaited, has launched on 4th of December. This makes a rapid development link which helps you enable to bring together UI design over platforms when integrating with Android studio, visual studio code, XCode.

Flutter v1.0 runs easily as its utilization of Dart2.1 and the Skia graphics engine which intend to help jank free applications, even in conceivable future 120 Hz phone with native accumulations for both 32-bit and 64-bit ARM processors. …


Wordpress.org has launched WordPress 5.0 “Bebo” with the block-based editor, new themes and developer features. It brings huge upgrades to editors in Blog management tool. WordPress 5.0 is available in 37 languages.

WordPress is a content management system (CMS) which empowers more than 30% of the web.

Block editor is huge but is not enough. Some changes are included;

  • All the previous themes i.e. twenty ten to twenty eighteen are now upgraded to twenty nineteen, which shows off the power of editor. It also has the features like whitespace, sans-serif headlines and system font which increase loading speed.
  • The accessibility…

Bittu Patel

📣 Providing IT solutions & consultation 🚩 Empowering people to implement tech in business 💯 Full-stack developer ❤️ Co-Founder at AWADHTECH #kaizen

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store