Preserve Flutter mirror-os codebase

This commit is contained in:
Chris
2026-07-11 21:51:34 -05:00
commit 27631ed108
142 changed files with 11896 additions and 0 deletions
@@ -0,0 +1,25 @@
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:mirror_core/mirror_core.dart';
final programsApiProvider = Provider<ProgramsApiClient>((ref) {
return ProgramsApiClient(baseUrl: 'http://192.168.86.172:8091');
});
final programsProvider =
AsyncNotifierProvider<ProgramsNotifier, List<Program>>(ProgramsNotifier.new);
class ProgramsNotifier extends AsyncNotifier<List<Program>> {
@override
Future<List<Program>> build() async {
final client = ref.read(programsApiProvider);
return client.fetchPrograms();
}
Future<void> refresh() async {
state = const AsyncValue.loading();
state = await AsyncValue.guard(() async {
final client = ref.read(programsApiProvider);
return client.fetchPrograms();
});
}
}