Files
lab-app/lib/core/api/pocketbase_client.dart
T
Emre Emir 8bbc9dbff2 Initial commit: DLS - Dental Lab System
- Flutter + PocketBase dental lab management system
- Clinic & lab dashboards, job tracking, patient management
- Product catalog, finance tracking, multi-language support
- AI assistant integration, realtime notifications
- Windows installer (Inno Setup) included
- Developed by kovakyazilim.com
2026-06-11 15:57:31 +03:00

26 lines
711 B
Dart

import 'package:pocketbase/pocketbase.dart';
import 'package:shared_preferences/shared_preferences.dart';
const _kAuthKey = 'pb_auth';
class PocketBaseClient {
PocketBaseClient._({required this.pb});
static PocketBaseClient? _instance;
static PocketBaseClient get instance => _instance!;
final PocketBase pb;
static Future<void> init() async {
final prefs = await SharedPreferences.getInstance();
final stored = prefs.getString(_kAuthKey);
final store = AsyncAuthStore(
save: (String data) => prefs.setString(_kAuthKey, data),
initial: stored,
);
_instance = PocketBaseClient._(
pb: PocketBase('https://pocket.kovaksoft.com', authStore: store),
);
}
}