refactor(client): 授权信息卡从「关于我们」迁至 设置→授权管理,替换授权到期时间卡
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JJ1g8XV1YhhmHRzhwWEW7o
This commit is contained in:
@@ -6,7 +6,6 @@
|
||||
import 'package:file_picker/file_picker.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:lucide_icons_flutter/lucide_icons.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
@@ -16,11 +15,9 @@ import '../../core/responsive/responsive.dart';
|
||||
import '../../core/theme/app_dims.g.dart';
|
||||
import '../../core/theme/context_tokens.dart';
|
||||
import '../../core/update/app_updater.dart';
|
||||
import '../../core/utils/clock.dart';
|
||||
import '../../core/utils/dialog_util.dart';
|
||||
import '../../providers/changelog_provider.dart';
|
||||
import '../../providers/feedback_provider.dart';
|
||||
import '../../providers/license_provider.dart';
|
||||
import '../../providers/update_provider.dart';
|
||||
import '../../core/theme/app_fonts.dart';
|
||||
import '../../widgets/brand_mark.dart';
|
||||
@@ -55,7 +52,6 @@ class _AboutScreenState extends ConsumerState<AboutScreen> {
|
||||
children: [
|
||||
_heroCard(t),
|
||||
_productCard(t),
|
||||
_licenseCard(t),
|
||||
_changelogCard(t),
|
||||
// 页脚
|
||||
Padding(
|
||||
@@ -372,72 +368,8 @@ class _AboutScreenState extends ConsumerState<AboutScreen> {
|
||||
}
|
||||
}
|
||||
|
||||
// ── 卡3:授权信息(3 cell)─────────────────────────────────
|
||||
Widget _licenseCard(dynamic t) {
|
||||
final lic = ref.watch(licenseProvider).valueOrNull;
|
||||
final expires = lic?.expiresAt != null
|
||||
? DateFormat('yyyy-MM-dd').format(lic!.expiresAt!)
|
||||
: '—';
|
||||
// 状态/剩余天数走可注入时钟(golden 确定化)
|
||||
final active = lic?.isActive == true &&
|
||||
(lic?.expiresAt == null || lic!.expiresAt!.isAfter(appNow()));
|
||||
final days = lic?.expiresAt != null
|
||||
? lic!.expiresAt!.difference(appNow()).inDays.clamp(0, 99999)
|
||||
: null;
|
||||
final mobile = context.isMobile;
|
||||
final cells = [
|
||||
_licCell(t, '授权状态', active ? '已授权' : '未授权',
|
||||
color: active ? t.success : t.warn),
|
||||
_licCell(t, '到期日', expires),
|
||||
_licCell(t, '剩余天数', days != null ? '$days 天' : '—'),
|
||||
];
|
||||
return _card(
|
||||
t,
|
||||
Column(crossAxisAlignment: CrossAxisAlignment.stretch, children: [
|
||||
_cardH(t, LucideIcons.shieldCheck, '授权信息'),
|
||||
if (mobile)
|
||||
Column(children: [
|
||||
for (final c in cells)
|
||||
Padding(padding: const EdgeInsets.only(bottom: 10), child: c),
|
||||
])
|
||||
else
|
||||
Row(children: [
|
||||
for (var i = 0; i < cells.length; i++) ...[
|
||||
if (i > 0) const SizedBox(width: 14),
|
||||
Expanded(child: cells[i]),
|
||||
],
|
||||
]),
|
||||
]),
|
||||
);
|
||||
}
|
||||
|
||||
/// 原型 .lic-cell:lk 11 muted + lv 17/700/mono。
|
||||
Widget _licCell(dynamic t, String label, String value, {Color? color}) =>
|
||||
Container(
|
||||
padding: const EdgeInsets.fromLTRB(16, 14, 16, 14),
|
||||
decoration: BoxDecoration(
|
||||
color: t.bg,
|
||||
border: Border.all(color: t.borderSubtle),
|
||||
borderRadius: BorderRadius.circular(AppDims.rMd),
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(label,
|
||||
style: TextStyle(fontSize: AppDims.fsXs, color: t.muted)),
|
||||
const SizedBox(height: 6),
|
||||
Text(value,
|
||||
style: TextStyle(
|
||||
fontSize: AppDims.fsH2,
|
||||
fontWeight: FontWeight.w700,
|
||||
fontFamily: AppFonts.mono,
|
||||
fontFamilyFallback: AppFonts.monoFallback,
|
||||
color: color ?? t.heading)),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
// ── 卡4:更新日志(timeline,默认 2 条 + 展开)───────────────
|
||||
// ── 卡3:更新日志(timeline,默认 2 条 + 展开)───────────────
|
||||
// (原授权信息卡已迁至 设置 → 授权管理)
|
||||
Widget _changelogCard(dynamic t) {
|
||||
final appVersion = ref.watch(appVersionProvider).valueOrNull ?? '';
|
||||
final entries = ref.watch(changelogProvider).valueOrNull ?? const [];
|
||||
|
||||
Reference in New Issue
Block a user