feat(platform): 添加桌面端平台能力降级适配
- 新增 PlatformCapabilities 平台能力判断类,统一检测移动端原生插件可用性 - 地图、定位、扫码、相册、拨号、通话录制等入口在桌面端降级为提示 - 系统 UI 配置与 moveTaskToBack 在桌面端跳过,避免插件异常 - 设备信息工具新增 Windows 平台支持,返回 computerName - 百度地图 SDK 初始化增加平台判断,桌面端不再调用 - 新增个人资料编辑页面及路由,从「我的」页头部入口跳转 - 国际化添加 featureUnsupported 提示文案
This commit is contained in:
1 parent
5947fa1f53
commit
5f84a64c3e
18 files changed
+342
-73
No files matched your search
@@ -4,6 +4,7 @@ import 'package:go_router/go_router.dart';
|
||||
import 'package:ttstd_family_care/app/theme/dark_mode.dart';
|
||||
import 'package:ttstd_family_care/core/widgets/app_page_scaffold.dart';
|
||||
|
||||
import '../../../core/platform/platform_capabilities.dart';
|
||||
import '../../../core/widgets/feature_ui.dart';
|
||||
import '../../../core/widgets/settings_ui.dart';
|
||||
import '../../../l10n/app_localizations.dart';
|
||||
@@ -137,6 +138,11 @@ class _DeviceBindPageState extends ConsumerState<DeviceBindPage> {
|
||||
|
||||
/// 打开扫码页;扫描成功后把 SN 回填输入框。
|
||||
Future<void> _openScanner(AppLocalizations l10n) async {
|
||||
// 相机扫码插件无桌面端实现,入口降级为提示。
|
||||
if (!PlatformCapabilities.scanner) {
|
||||
await PlatformCapabilities.showUnsupported(context);
|
||||
return;
|
||||
}
|
||||
final code = await context.push<String>('/device/scan');
|
||||
if (code == null || code.isEmpty || !mounted) return;
|
||||
setState(() => _snController.text = code);
|
||||
|
||||
Reference in new issue
Block a user