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

A personal diary application written in Flutter

Diary Vault

A FOSS, offline first personal diary application written in Flutter

Key Features

  1. Rich text editor with support for images and videos
  2. Your data is securely preserved on your Google Drive / Dropbox account, ensuring complete ownership and privacy
  3. Sync data between multiple devices
  4. Fingerprint login on supported devices
  5. Multiple Themes

Libraries used

  1. Flutter bloc for state management
  2. FlutterQuill for rich text editor
  3. Flutter Local Auth Invisible for fingerprint login
  4. Dartz for functional programming
  5. SQFLite as local database

Screenshots

       

Motivation for building this app

As someone who enjoys writing in a diary, I’ve tried out many diary apps on Google Play. Through my own experiences and by reading what others have shared in their reviews, I’ve gained a better understanding of the issues that current diary apps face.

🌟 If you like what we’re building, please consider starring our repository on GitHub to show your support. It means a lot to us! ⭐

Feature Roadmap Table

Feature Timeline Issue
1. Support for tags Planned for October release #19
2. Support for customizable sort order Planned for October release #28
3. Auto save for every “x” seconds Planned for October release #29
4. Export data to text file Planned for October release #26
5. Support for daily reminders Planned for October release #24
6. Support for customizable fonts Planned for November release #31
7. Support for folder organization Planned for November release #30
8. Export data to PDF Planned for November release #25
9. Introduce “todos” within rich text editor Planned for December release #20
10. Add support for embedding audio files in rich text editor Planned for December release #21

Support

If you have any questions or doubts, join our Discord server.

Contributions

For local setup and contribution guidelines, please visit CONTRIBUTING.md.

Documentation

The entire project is structured in this way:

The features directory carries a folder for each of the major features.

These are the major features as of now:

1. Auth

DiaryVault is designed to work fully offline (internet connection is required during signup).

Signup: We only support username + password during signup. After a successful signup, the data is stored in firebase and then in local SQFlite table named Users.

Login: We support username+password and fingerprint login (if enabled).

  1. When a username+password login is attempted, it first gets validated with data stored in Users table. On success, user is logged in.
  2. If there is password mismatch in local Users table, firebase login would be attempted (because there is a possibility that password was changed from some other device and local data is stale). If firebase login is successful, data in local Users table is updated and user would be logged in.
  3. Fingerprint login is disabled by default, it can be enabled in app settings. We store the id of last logged in user in shared preferences. If fingerprint login is attempted and successful, user with lastLoggedInUserId would be logged in.

Login as Guest: Guest login will allow users to use the app without creating account. lastLoggedInUserId will be hardcoded to guest_user_id to distinguish guest user from an actual user. Set of functionality will be limited for guest user, as some features require user account to work.

Other features like forgot passwordreset email and reset password are supported with the help of Firebase.

2. Notes

Notes folder has the logic for CRUD operations for notes. FlutterQuill is used as rich text editor.

This is the schema of the notes entity:

Notes {
  final String id;
  final DateTime createdAt;
  final String title;
  final String body;
  final String hash;
  final DateTime lastModified;
  final String plainText;
  final List<NoteAsset> assetDependencies;
  final bool deleted;
  final String? authorId;
}

3. Sync

The Sync feature plays a pivotal role in ensuring that your diary app seamlessly integrates with Google Drive / Dropbox, allowing users to effortlessly manage their notes across multiple devices. Underpinning this functionality is a streamlined synchronization algorithm, which is a minimal version of syncing algorithms used in distributed systems.

Here’s an in-depth explanation of how it works:

1. Hash-Based Note Comparison

Each note within the app is associated with a unique hash value. The hash value is SHA1 hash of note’s title + note’s body + note’s created_at timestamp. This hash serves as a digital fingerprint, allowing us to quickly determine whether a note has been altered.

2. Initial Cloud Upload and Index File Creation

3. Ensuring Atomic Operations

All synchronization operations are designed to be atomic. This means that even if a user encounters a sudden loss of internet connectivity during the sync process, it will not result in an unstable or inconsistent state in either the local or cloud storage.

Theming

All of the theme related info can be found in this folder lib/app/themes. Currently we have three themes Coral Bubbles (light theme)Lush Green (light theme) and Cosmic (dark theme).

We are heavily using Flutter Theme Extensions as the color palette provided by standard ThemeData object is not sufficient.

In order to add a new theme, first step is to chose whether it’s a light theme or dark theme. Then create a file similar to lib/app/themes/coral_bubble_theme.dart. After that, generate a background image and pick a color palette in accordance to the background image. There are lot of properties used in ThemeData object, but most of them can be copy pasted either from coral_bubbles.dart for light themes or cosmic.dart for dark themes.

Download source code on GitHub

Exit mobile version