flutter_auto_sync 0.0.6 copy "flutter_auto_sync: ^0.0.6" to clipboard
flutter_auto_sync: ^0.0.6 copied to clipboard

A Flutter package for offline data storage and automatic API synchronization when internet connectivity is restored.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_auto_sync/flutter_auto_sync.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await AutoSyncManager.init();

  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: const Text("Auto Sync Example")),
        body: Center(
          child: ElevatedButton(
            onPressed: () async {
              await AutoSyncManager.addToQueue(
                endpoint: "https://api.example.com/data",
                data: {"name": "Roopa"},
              );
            },
            child: const Text("Add Sync Job"),
          ),
        ),
      ),
    );
  }
}
1
likes
0
points
193
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter package for offline data storage and automatic API synchronization when internet connectivity is restored.

Repository (GitHub)
View/report issues

Topics

#offline #sync #networking #storage

License

unknown (license)

Dependencies

connectivity_plus, flutter, flutter_secure_storage, hive, hive_flutter, http, uuid

More

Packages that depend on flutter_auto_sync