import 'dart:convert'; import 'package:get/get.dart'; import 'package:ertl_filament_verwaltung/services/get_storage_services.dart'; class MemoryStorageService extends GetxService implements GetStorageService { final tables = >>{}; bool failWrites = false; @override dynamic noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); @override List> getModelList(String key) => (jsonDecode(jsonEncode(tables[key] ?? [])) as List) .map((item) => Map.from(item as Map)) .toList(); @override Future saveModelList( String key, List> items, ) async { if (failWrites) throw StateError('Storage unavailable'); tables[key] = items; } }