Offline Support

This commit is contained in:
2026-04-27 06:20:39 +08:00
parent 7d8851a94a
commit 48cd3bcd60
121 changed files with 14798 additions and 2214 deletions
+1 -15
View File
@@ -1,27 +1,13 @@
import 'package:flutter_test/flutter_test.dart';
import 'package:supabase_flutter/supabase_flutter.dart';
import 'package:tasq/providers/realtime_controller.dart';
import 'package:tasq/providers/stream_recovery.dart';
// ---------------------------------------------------------------------------
// RealtimeController only accesses `_client.auth.onAuthStateChange` during
// `_init()`, which wraps the subscription in a try-catch. We use a minimal
// SupabaseClient pointed at localhost — the auth stream subscription will
// either return an empty stream or throw (caught internally), so no network
// activity occurs during tests.
// ---------------------------------------------------------------------------
void main() {
group('RealtimeController', () {
late RealtimeController controller;
setUp(() {
// SupabaseClient constructor does not connect eagerly; _init() catches
// any exception thrown when accessing auth.onAuthStateChange.
controller = RealtimeController(
SupabaseClient('http://localhost', 'test-anon-key',
authOptions: const AuthClientOptions(autoRefreshToken: false)),
);
controller = RealtimeController();
});
tearDown(() {