appwrite_offline 0.0.5
SDKflutter
Platformandroidioswindowslinuxmacosweb
A Flutter Data adapter for Appwrite that provides offline support, real-time updates, and seamless integration with Flutter Data's powerful features.
Appwrite Offline Example
This example demonstrates how to use the appwrite_offline package to add offline support to your Flutter app with Appwrite backend.
Getting Started
- Update the
config.dartfile with your Appwrite credentials:
class Config {
static const String projectId = 'your_project_id';
static const String databaseId = 'your_database_id';
static const String endpoint = 'https://your-appwrite-instance.com/v1';
}
-
Create two collections in your Appwrite database:
categorieswith the following attributes:- name (string, required)
productswith the following attributes:- name (string, required)
- price (double, required)
- description (string, required)
- category (relationship to categories)
-
Run the build runner to generate necessary files:
dart run build_runner build -d
- Run the app:
flutter run
Features Demonstrated
- Offline data persistence
- Real-time updates
- CRUD operations
- Relationships (BelongsTo)
- Error handling
- Loading states
- Permissions handling
Structure
lib/models/- Data modelslib/screens/- UI screensconfig.dart- Configurationmain.dart- App initialization
Additional Notes
This example uses Material Design 3 and demonstrates best practices for:
- State management with Riverpod
- Error handling
- Loading states
- Real-time updates
- Offline data synchronization