Site icon Flutter Packages | Pub dev Packages – Flutter Mobile App World

A flutter search engine based on MediaWiki with caching

Table of contents

Project Description

Working

App Architecture

Application logic flow :

  1. When initiated either by a function call or initState, cubit receives this request.
  2. Then the cubit calls the repositories which further makes an API call to fetch this data.
  3. This data is stored in the cubit and once successful the cubit emits a suitable state and UI changes accordingly.
  4. If the data was fetched successfully it is cached using HiveDB.
  5. The UI is displayed according to these states.

BLoC/Cubit Pattern

BLoC is a state management solution for flutter. In this project, we have used cubit pattern.
Below is a diagramatic representation of how cubit pattern works :

To know more about BLoC: https://github.com/felangel/bloc

Caching using HiveDB

Caching is used to improve the app’s performance in terms of UX, caching in this app was implemented using HiveDB.

Hive – Hive is a lightweight and blazing fast key-value database written in pure Dart.
Hive is a NoSQL database which has really great performance in terms of both write and read operations.

Data we are caching in this application:

  1. Search history (whatever keywords the user searched for).
  2. List of wiki articles that are being fetched from the MediaWiki API.

App UI

Project Setup

The basic steps you need to follow to get started with this project.

Requirements :

Step 1: Clone this repo

git clone https://github.com/Shashwat-Joshi/WikiSearch.git

Step 2: Run these commands in the project directory to download the required packages

flutter clean
flutter pub get

Step 3: To run the project in release

flutter run --release

To-Do

Download wikisearch source code on GitHub

https://github.com/Shashwat-Joshi/WikiSearch

Exit mobile version