refactor: 批量替换 shadcn_ui 为 Material Design 组件
## 样式主题重点优化 ### 颜色映射(注重主题一致性) - mutedForeground → onSurfaceVariant - border → outline - card → surfaceContainer - destructive → error - 保留所有 AppColorScheme 自定义颜色 ### 文本样式映射 - theme.textTheme.h1/muted/large → AppTextStyles.xxx(context) - 统一使用项目定义的文本样式系统 ### 组件替换(20个文件) - ShadApp → MaterialApp(移除 ShadThemeData) - ShadButton → ElevatedButton/OutlinedButton - ShadDialog → AlertDialog - ShadInputFormField → MaterialInput - ShadSelect → DropdownButtonFormField - ShadCard → Card - showShadDialog → showDialog ### 依赖变更 - 移除:shadcn_ui: ^0.52.1 - 添加:lucide_icons_flutter: ^2.0.0 ### 业务逻辑保护 ✅ 所有 onPressed/onChanged/validator 回调保持不变 ✅ 所有 controller/focusNode 数据绑定保持不变 ✅ 所有布局结构(Column/Row/Padding)保持不变 ✅ 仅替换 UI 组件层,业务逻辑完全保留
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import 'dart:typed_data';
|
||||
import 'package:flutter/foundation.dart' show kIsWeb;
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:shadcn_ui/shadcn_ui.dart';
|
||||
import 'package:lucide_icons_flutter/lucide_icons.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
import '../../../core/theme/app_color_scheme.dart';
|
||||
@@ -431,9 +431,9 @@ class _KycPageState extends State<KycPage> {
|
||||
if (!mounted) return;
|
||||
|
||||
if (response.success) {
|
||||
showShadDialog(
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (ctx) => ShadDialog.alert(
|
||||
builder: (ctx) => AlertDialog(
|
||||
title: Row(
|
||||
children: [
|
||||
NeonIcon(
|
||||
@@ -445,9 +445,9 @@ class _KycPageState extends State<KycPage> {
|
||||
const Text('認證成功'),
|
||||
],
|
||||
),
|
||||
description: const Text('您的實名認證已通過,現在可以進行提現操作'),
|
||||
content: const Text('您的實名認證已通過,現在可以進行提現操作'),
|
||||
actions: [
|
||||
ShadButton(
|
||||
TextButton(
|
||||
child: const Text('確定'),
|
||||
onPressed: () {
|
||||
Navigator.of(ctx).pop();
|
||||
@@ -458,13 +458,13 @@ class _KycPageState extends State<KycPage> {
|
||||
),
|
||||
);
|
||||
} else {
|
||||
showShadDialog(
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (ctx) => ShadDialog.alert(
|
||||
builder: (ctx) => AlertDialog(
|
||||
title: const Text('認證失敗'),
|
||||
description: Text(response.message ?? '請稍後重試'),
|
||||
content: Text(response.message ?? '請稍後重試'),
|
||||
actions: [
|
||||
ShadButton(
|
||||
TextButton(
|
||||
child: const Text('確定'),
|
||||
onPressed: () => Navigator.of(ctx).pop(),
|
||||
),
|
||||
@@ -474,13 +474,13 @@ class _KycPageState extends State<KycPage> {
|
||||
}
|
||||
} catch (e) {
|
||||
if (mounted) {
|
||||
showShadDialog(
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (ctx) => ShadDialog.alert(
|
||||
builder: (ctx) => AlertDialog(
|
||||
title: const Text('認證失敗'),
|
||||
description: Text(e.toString()),
|
||||
content: Text(e.toString()),
|
||||
actions: [
|
||||
ShadButton(
|
||||
TextButton(
|
||||
child: const Text('確定'),
|
||||
onPressed: () => Navigator.of(ctx).pop(),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user