Skip to content

This repository deals with offline data syncing when there is no internet , first saving the data in database when no internet and fetch the data from local database(sqflite) when internet is available

License

Notifications You must be signed in to change notification settings

chetan04012001/Sync-Offline

Repository files navigation

Sync offline data Plugin

A Flutter plugin for synchronizing data offline, including form submissions and other data transactions.

Features

  • Allows seamless synchronization of data offline and online.
  • Supports dynamic selection of database helper and API service.
  • Provides flexibility to specify a custom destination screen upon successful data submission.

Installation

Add sync_offline to your pubspec.yaml file:

dependencies:
  sync_offline: ^1.0.0

Usage
//Import the package in your Dart code:

import 'package:sync_offline/sync_offline.dart';
//Use the handleDataSync function to synchronize data:

handleDataSync(
  context: context,
  data: {
    'name': nameController.text,
    'email': emailController.text,
  },
  successSnackBar: SnackBar(
    content: Text('Data synchronized successfully'),
  ),
  isSyncing: ValueNotifier(false),
  dbHelper: DBHelper(),
  apiService: ApiService(),
  destinationScreen: CustomDataScreen(), // Specify your custom data screen here
);

About

This repository deals with offline data syncing when there is no internet , first saving the data in database when no internet and fetch the data from local database(sqflite) when internet is available

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published