BE Offline and Sync BPR - Flutter

By pjain      Published May 10, 2020, 11:23 p.m. in blog Programming   

OFFLINE PRD

  • The whole internet allowed access to backend data, real time data that is searchable and beyond capabilities of mobile or desktops!
  • However BE is vital for BM$ subscription, finding, marketplaces, etc.

OFFLINE Data management Use Case

OFFLINE is lot beyond - not just raw RESTful api

  • Offline can be critical for apps
  • The biggest need that it's solved for me is the inclusion of offline support built-in .. eg in rural areas or work in buildings where cell service is spotty, so being able to use the app as if it's online, with no interruptions, is critical.

We've all been through the process of heavy boilerplate, PITA - starting a new Flutter app - creating our models - creating some services to retrieve, parse - store your data locally - populate relationships - Wiring it all up using Provider or whatever state management solution you're using...

  • With this plugin, using a couple of annotations on your models and a few mixins, you basically get a fully functional REST client to access your API. It's productive out of the box, but if you need to customize, you can do so via adapters.

Use cases

My use case is a solution that would read & write from local storage and then in the background try to synchronize the changes with a remote API (send out local changes, periodically pull remote changes) , keeping track of synchronization status of the individual objects, retrying when needed. Is this possible with the package? If not, would it be easy to write an adapter like that?

What you describe is exactly what Flutter Data does. I’m working on the offline writes queue as we speak, so expect that to be out soon. Pulling remote changes is trivial (now that you mention, i’ll try to come up with a parameterizable adapter for that). If you’re happy to share more about your project feel free to DM me. - author of flutterdata

Examples

flutterdata.dev plugin

  • https://pub.dev/packages/flutter_data
  • by https://www.reddit.com/user/frank06_/
  • Used/referred by https://www.reddit.com/u/jdixon04/

Migrating from converters or interceptors is pretty straightforward (there are a bunch of examples in the docs/cookbook) but of course if you have any questions, let me know. -- author


0 comments

There are no comments yet

Add new comment

Similar posts

List++ Advanced Application Features

Interview Questions in Flutter

NAV: URL Launcher, Deep Links

NAV: Navigation Drawers