feat(mobile): in-app locale switching
Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
@@ -10,6 +10,7 @@ import 'dart:convert';
|
||||
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:drift/drift.dart' show driftRuntimeOptions;
|
||||
import 'package:photo_live/app/locale_controller.dart';
|
||||
import 'package:photo_live/core/api_client.dart';
|
||||
import 'package:photo_live/core/session_store.dart';
|
||||
import 'package:photo_live/features/uploads/providers.dart';
|
||||
@@ -29,6 +30,24 @@ class FakeSessionStore implements SessionStore {
|
||||
Future<void> clear() async => session = null;
|
||||
}
|
||||
|
||||
/// 内存语言偏好存储(测试替身,P3 Task 10)。
|
||||
class FakeLocaleStore implements LocalePrefsStore {
|
||||
/// 当前持久值(read 返回);null = 未设置(跟随系统)。
|
||||
String? value;
|
||||
|
||||
/// 按序记录全部写入(断言持久化调用用)。
|
||||
final List<String> writes = <String>[];
|
||||
|
||||
@override
|
||||
Future<String?> read() async => value;
|
||||
|
||||
@override
|
||||
Future<void> write(String value) async {
|
||||
writes.add(value);
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// Widget 测试通用 overrides(P3 Task 9 起,登录页/主壳会触达
|
||||
/// sessionAccountProvider 与任务库 Provider——真实 flutter_secure_storage
|
||||
/// 与 path_provider 的平台通道在测试环境挂起,凡 pump 到相关页面均需
|
||||
|
||||
Reference in New Issue
Block a user