Update Saqel Platform: 2026-09-09 00:52:08
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import 'dart:convert';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import '../../data/models/user_model.dart';
|
||||
import '../utils/app_logger.dart';
|
||||
|
||||
@@ -30,6 +31,8 @@ class StorageService {
|
||||
|
||||
Future<void> _writeSafe(String key, String value) async {
|
||||
_volatileStore[key] = value;
|
||||
final preferences = await SharedPreferences.getInstance();
|
||||
await preferences.setString(key, value);
|
||||
try {
|
||||
await _secureStorage.write(key: key, value: value);
|
||||
} on PlatformException catch (e) {
|
||||
@@ -42,11 +45,14 @@ class StorageService {
|
||||
final val = await _secureStorage.read(key: key);
|
||||
if (val != null && val.isNotEmpty) return val;
|
||||
} catch (_) {}
|
||||
return _volatileStore[key];
|
||||
final preferences = await SharedPreferences.getInstance();
|
||||
return preferences.getString(key) ?? _volatileStore[key];
|
||||
}
|
||||
|
||||
Future<void> _deleteSafe(String key) async {
|
||||
_volatileStore.remove(key);
|
||||
final preferences = await SharedPreferences.getInstance();
|
||||
await preferences.remove(key);
|
||||
try {
|
||||
await _secureStorage.delete(key: key);
|
||||
} catch (_) {}
|
||||
|
||||
@@ -44,6 +44,7 @@ class TeacherLessonAuditModel {
|
||||
final decisionValue = json['decision']?.toString() ?? 'pending';
|
||||
|
||||
final ai = json['ai_analysis'] is Map ? Map<String, dynamic>.from(json['ai_analysis'] as Map) : null;
|
||||
final qa = ai != null && ai['quality_assessment'] is Map ? Map<String, dynamic>.from(ai['quality_assessment'] as Map) : null;
|
||||
final estimatedCp = (durationSeconds / 600).clamp(1, 4).toInt();
|
||||
final cpCount = (ai?['checkpoints_count'] as num?)?.toInt() ??
|
||||
(json['socratic_stops_count'] as num?)?.toInt() ??
|
||||
|
||||
Reference in New Issue
Block a user