offline_uploader 1.0.1 copy "offline_uploader: ^1.0.1" to clipboard
offline_uploader: ^1.0.1 copied to clipboard

A library to manage offline data and sync it with the server.

example/main.dart

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

void main() {
  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('Offline Uploader Example')),
        body: Center(
          child: ElevatedButton(
            onPressed: () async {
              final uploader = OfflineUploader();

              await uploader.initialize();

              await uploader.saveDataOffline('visits', {
                'name': 'Visit A',
                'timestamp': DateTime.now().toIso8601String(),
              });

              await uploader.tryUploadOfflineData();
            },
            child: const Text('Test Upload'),
          ),
        ),
      ),
    );
  }
}
8
likes
130
points
48
downloads

Publisher

unverified uploader

Weekly Downloads

A library to manage offline data and sync it with the server.

Repository (GitHub)

Documentation

API reference

License

unknown (license)

Dependencies

connectivity_plus, encrypt, flutter, flutter_local_notifications, path, shared_preferences, sqflite, sqflite_common_ffi

More

Packages that depend on offline_uploader