appwrite_offline 0.0.5 copy "appwrite_offline: ^0.0.5" to clipboard
appwrite_offline: ^0.0.5 copied to clipboard

A Flutter Data adapter for Appwrite that provides offline support, real-time updates, and seamless integration with Flutter Data's powerful features.

example/lib/main.dart

import 'package:appwrite_offline_example/main.data.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:appwrite_offline/appwrite_offline.dart';
import 'config.dart';
import 'screens/products_screen.dart';

void main() {
  // Initialize Appwrite Offline
  AppwriteOffline.initialize(
    projectId: Config.projectId,
    databaseId: Config.databaseId,
    endpoint: Config.endpoint,
  );

  runApp(
    ProviderScope(
      overrides: [configureRepositoryLocalStorage()],
      child: MyApp(),
    ),
  );
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Appwrite Offline Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
        useMaterial3: true,
      ),
      home: const RepositoryInitializer(
        child: ProductsScreen(),
      ),
    );
  }
}

// Add a splash screen while repositories initialize
class RepositoryInitializer extends ConsumerWidget {
  final Widget child;

  const RepositoryInitializer({
    Key? key,
    required this.child,
  }) : super(key: key);

  @override
  Widget build(BuildContext context, WidgetRef ref) {
    return ref.watch(repositoryInitializerProvider).when(
          error: (error, stack) => Center(
            child: Text('Error: $error'),
          ),
          loading: () => const Center(
            child: CircularProgressIndicator(),
          ),
          data: (_) => child,
        );
  }
}
4
likes
140
points
311
downloads

Publisher

verified publishercybroid.com

Weekly Downloads

A Flutter Data adapter for Appwrite that provides offline support, real-time updates, and seamless integration with Flutter Data's powerful features.

Repository (GitHub)
View/report issues

Topics

#appwrite #offline #database #flutter-data

Documentation

Documentation
API reference

License

MIT (license)

Dependencies

appwrite, flutter, flutter_data, get_it

More

Packages that depend on appwrite_offline