LDK Documentation¶
Welcome to the comprehensive documentation for the Lazy Development Kit (LDK) - a powerful Flutter SDK for Strapi integration with advanced features like GraphQL support, real-time updates, intelligent caching, and offline capabilities.
🚀 What is LDK?¶
LDK (Lazy Development Kit) is a comprehensive Flutter SDK that simplifies Strapi integration by providing:
- 🔐 Advanced Authentication - JWT, biometric auth, token refresh, security monitoring
- ⚡ Real-time Updates - WebSocket-based live data synchronization
- 🧠 Intelligent Caching - Multi-strategy caching with automatic invalidation
- 📱 Offline Support - Full offline-first capabilities with automatic sync
- 🔍 Advanced Querying - GraphQL support, aggregations, full-text search
- ⚡ Optimistic Updates - Instant UI updates with automatic rollback
- 🔄 Transaction Support - Multi-operation atomic transactions
🎯 Quick Start¶
Get up and running in just a few minutes:
1. Installation¶
2. Initialize¶
import 'package:ldk/ldk.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await LDK.initialize(
baseUrl: 'https://your-strapi-server.com',
);
runApp(MyApp());
}
3. Use Collections¶
// Get posts with intelligent caching
final posts = LDK.collection('posts');
final response = await posts.get();
// Real-time updates
posts.subscribeToUpdates().listen((event) {
print('Post updated: ${event.data}');
});
📚 Documentation Sections¶
-
Getting Started
Everything you need to get LDK up and running in your Flutter project.
-
API Reference
Complete API documentation with examples for all LDK classes and methods.
-
Feature Guides
In-depth guides for all LDK features with real-world examples.
-
Examples
Complete working examples including a real-time chat application.
-
Advanced Topics
Best practices, performance optimization, and troubleshooting guides.
-
Support
Get help with common issues and debugging techniques.
✨ Key Features¶
🔄 Real-time Everything¶
WebSocket-based real-time updates for collections, entries, and custom events. Perfect for chat applications, live dashboards, and collaborative tools.
🧠 Intelligent Caching¶
Multi-strategy caching (LRU, LFU, FIFO, LIFO) with automatic invalidation, background refresh, and tag-based cache management.
📱 Offline-First¶
Full offline support with automatic synchronization, optimistic updates, and conflict resolution.
🔒 Enhanced Security¶
Advanced authentication with biometric support, automatic token refresh, security event monitoring, and session management.
⚡ Performance Optimized¶
Optimistic updates, intelligent prefetching, virtual scrolling support, and performance monitoring built-in.
🆕 What's New in v2.0.0¶
Major Release
LDK v2.0.0 introduces powerful new features while maintaining full backward compatibility with v1.x applications.
- Real-time Updates: WebSocket-based live data synchronization
- Intelligent Caching: Multi-strategy caching with automatic invalidation
- Offline Support: Full offline-first capabilities with sync
- Enhanced Security: Biometric auth, token refresh, security monitoring
- Advanced Querying: GraphQL support, aggregations, full-text search
- Optimistic Updates: Instant UI updates with automatic rollback
- Transaction Support: Multi-operation atomic transactions
🎯 Popular Use Cases¶
Real-time Chat Applications¶
Build WhatsApp-like chat apps with typing indicators, presence status, and message synchronization.
// Subscribe to real-time messages
LDK.collection('messages').subscribeToUpdates().listen((event) {
if (event.type == CollectionEventType.created) {
_addMessage(Message.fromJson(event.data));
}
});
Offline-First Mobile Apps¶
Create apps that work seamlessly offline with automatic data synchronization.
// Optimistic updates work offline
await LDK.collection('posts').create(
{'title': 'New Post', 'content': 'Content'},
optimistic: true, // Updates UI immediately
);
E-commerce Applications¶
Build shopping carts with real-time inventory updates and offline order queuing.
// Real-time inventory updates
LDK.collection('products').subscribeToEntry(productId).listen((event) {
_updateProductStock(Product.fromJson(event.data));
});
🤝 Community & Support¶
-
GitHub
Source code, issues, and discussions
-
pub.dev
Official package on pub.dev
-
Discussions
Community discussions and Q&A
-
Issues
Report bugs and request features
📄 License¶
LDK is released under the MIT License.
Ready to get started? Follow our Quick Start Guide and build your first LDK-powered app in minutes!