fix(client): 商品公开页加载后更新浏览器标题为商品名称
Deploy / build-linux-web (push) Successful in 49s
Deploy / build-windows (push) Successful in 1m43s
Deploy / build-macos (push) Successful in 1m26s
Deploy / build-android (push) Successful in 58s
Deploy / build-ios (push) Successful in 7s
Deploy / release-deploy (push) Successful in 1m46s
Deploy / build-linux-web (push) Successful in 49s
Deploy / build-windows (push) Successful in 1m43s
Deploy / build-macos (push) Successful in 1m26s
Deploy / build-android (push) Successful in 58s
Deploy / build-ios (push) Successful in 7s
Deploy / release-deploy (push) Successful in 1m46s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2,6 +2,7 @@ import 'dart:math' as math;
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
import '../../core/config/app_config.dart';
|
||||
@@ -54,6 +55,13 @@ class _PublicProductScreenState extends State<PublicProductScreen> {
|
||||
);
|
||||
final data = (resp.data as Map<String, dynamic>)['data'] as Map<String, dynamic>;
|
||||
setState(() { _data = data; _loading = false; });
|
||||
// 更新浏览器标签标题(Flutter Web 会写 document.title)
|
||||
final name = data['name'] as String? ?? '';
|
||||
if (name.isNotEmpty) {
|
||||
SystemChrome.setApplicationSwitcherDescription(
|
||||
ApplicationSwitcherDescription(label: name, primaryColor: 0xFF8B2331),
|
||||
);
|
||||
}
|
||||
} catch (e) {
|
||||
setState(() { _error = e.toString(); _loading = false; });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user