logo
đź”–

Offline first with Flutter

Created time
Jan 29, 2023 05:43 PM
Author
medium.com
URL
Status
Genre
Book Name
Offline first with Flutter
Modified
Last updated December 26, 2023
Summary
• Offline First with Flutter: This book provides an introduction to the concepts of building great offline-first applications with Flutter. It covers different topics such as building a fully offline application from scratch, enabling cloud synchronization, caching, and access to a local database. Additionally, the book discusses best practices for ensuring data consistency, performance, correctness, and security when working with offline-first applications. • As a UX Designer, reading this book may be beneficial as it allows for learning about features and solutions for building great user experiences for offline applications. Additionally, it covers the importance of data consistency when working with applications that require offline functionality. • Other books that may be of interest to UX Designers include Designing UX with Flutter, Understanding Offline-First Approaches: Processes and Best Practices, and UI/UX Design Patterns for Mobile Applications.

✏️ Highlights

All static assets should go to your pubspec.yaml file, the complete process is described here. Keep in mind that a static asset can be a picture, music or a text file (like JSON).
have a look at the cache manager package
moor is a nice package to assist you with offline first storage. Flutter package at a glance — local storage with Moor
Please do not use integers for primary keys, instead use UUID offered by this super simple package, otherwise you might find yourself in the unlucky case of creating integers in given ranges for given clients. UUID’s are always unique¹ Keep the exchanged data as small as possible, implement a change flag or last change date.
only send out data newer as the last sync
Store timestamps in UTC to don’t end up in the timezone hell. Consider saving them as plain numeric values, this works for any kind of backend
Make sure your content offers interaction, even if you end up with “Sorry, no network, try later”, you still get further as hiding parts of your app.
In case you can’t handle a request, please provide a meaningful error message. Messages like the ones below are useless: An error occurred Internal error No response Try something like: “Sorry, you seem to be offline.
All static assets should go to your pubspec.yaml file, the complete process is described here. Keep in mind that a static asset can be a picture, music or a text file (like JSON).
have a look at the cache manager package
moor is a nice package to assist you with offline first storage. Flutter package at a glance — local storage with Moor
Please do not use integers for primary keys, instead use UUID offered by this super simple package, otherwise you might find yourself in the unlucky case of creating integers in given ranges for given clients. UUID’s are always unique¹ Keep the exchanged data as small as possible, implement a change flag or last change date.
only send out data newer as the last sync
Store timestamps in UTC to don’t end up in the timezone hell. Consider saving them as plain numeric values, this works for any kind of backend
Make sure your content offers interaction, even if you end up with “Sorry, no network, try later”, you still get further as hiding parts of your app.
In case you can’t handle a request, please provide a meaningful error message. Messages like the ones below are useless: An error occurred Internal error No response Try something like: “Sorry, you seem to be offline.