Ever came across a situation to store user data (or access tokens) securely in mobile app? Welcome to Hive…

We as an Application Developers, always arrive in a situation to cache user preference or access tokens for later usage in APIs. So, let’s take a look at Hive strategy.

Photo by Shelby Cohron on Unsplash

* Why Hive and not Shared Preferences?

It’s a very generous question as SharedPreferences is pretty simple and well-known but it doesn’t provide security as such and only works with primitive data types. With Hive, we’ve the ability to store any data within an encrypted box so the data is not accessible outside the app’s context. Also, Hive is written in Dart language purely, which removes the native platform dependency and hence can be used on any…


Let’s see how we can implement full-text search using ElasticSearch and Firestore.

Modern applications often require search functionality especially when apps have more textual content which cannot be presented to user in a single screen. The motivation of this article mainly comes from implementing search feature when using Firestore. Firebase doesn’t support String.contains() queries which can search for substrings inside text. But,

We’re programmers, we solve problems.

Photo by Marten Newhall on Unsplash

What this article covers:

  1. Setup ElasticSearch & Kibana locally
  2. Basics of ElasticSearch (indexes)
  3. Use SearchDelegates in Flutter with Elastic.

1. Setup ElasticSearch & Kibana Locally

You probably would have heard about ElasticSearch but what is Kibana? It’s just a visualization tool to easily work with your Elastic data. Let’s get to…


In this article, we’ll see how to unit test your precious code with firestore without using any external library for mocking firestore.

Before we begin

  • This article doesn’t use any libraries for firestore mocks. We’ll mock it manually to understand how Mockito works.
  • This article presumes that you’ve a beginner level understanding of Unit Tests in Flutter.
  • You must know firestore and it’s usage with Flutter.

Enough. Let’s,

Photo by Dayne Topkin on Unsplash

We will be creating mock classes for each of the firestore class. Remember, this article is to demonstrate how to create and use mocks in tests. If this seems very lengthy, you can always use predefined libraries for mocking. Let’s begin by adding dependencies for firestore and mockito packages. I’m assuming you’ve done that already.

Let’s create…

UtkarshKore

Application Developer

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