fix:按照shadcn_ui对着demo_shadcn对齐

This commit is contained in:
jingyun
2026-06-05 15:04:39 +08:00
parent 9727b906c6
commit c5288f397d
29 changed files with 1425 additions and 642 deletions
+25 -46
View File
@@ -1,27 +1,22 @@
import 'package:flutter/material.dart';
import 'package:shadcn_ui/shadcn_ui.dart';
import '../theme/wise_tokens.dart';
import 'app_buttons.dart';
import 'states.dart';
Future<void> showLoginSheet(BuildContext context, {String reason = '登录后保存当前动作'}) {
return showModalBottomSheet<void>(
Future<void> showLoginSheet(
BuildContext context, {
String reason = '登录后保存当前动作',
}) {
return showShadSheet<void>(
context: context,
showDragHandle: true,
backgroundColor: WiseColors.surface,
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(top: Radius.circular(WiseRadius.lg)),
),
builder: (context) => Padding(
padding: const EdgeInsets.fromLTRB(20, 4, 20, 28),
side: ShadSheetSide.bottom,
builder: (context) => ShadSheet(
title: const Text('登录研听'),
description: Text(reason),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('登录研听', style: Theme.of(context).textTheme.titleLarge),
const SizedBox(height: WiseSpacing.x2),
Text(reason, style: Theme.of(context).textTheme.bodyMedium),
const SizedBox(height: WiseSpacing.x4),
AppButton(
label: '使用手机号继续',
icon: Icons.phone_iphone,
@@ -31,7 +26,7 @@ Future<void> showLoginSheet(BuildContext context, {String reason = '登录后保
showAppToast(context, '登录接口待接入,已保留当前页面');
},
),
const SizedBox(height: WiseSpacing.x2),
const SizedBox(height: 8),
AppButton(
label: '微信 / Apple 登录占位',
icon: Icons.account_circle_outlined,
@@ -49,37 +44,21 @@ Future<void> showLoginSheet(BuildContext context, {String reason = '登录后保
}
Future<void> showOutboundSheet(BuildContext context, {required String title}) {
return showModalBottomSheet<void>(
return showShadSheet<void>(
context: context,
showDragHandle: true,
backgroundColor: WiseColors.surface,
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(top: Radius.circular(WiseRadius.lg)),
),
builder: (context) => Padding(
padding: const EdgeInsets.fromLTRB(20, 4, 20, 28),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('即将打开外部服务', style: Theme.of(context).textTheme.titleLarge),
const SizedBox(height: WiseSpacing.x2),
Text(
'$title\n外跳仅用于了解原文或相关服务,本内容不构成投资建议。',
style: Theme.of(context).textTheme.bodyMedium,
),
const SizedBox(height: WiseSpacing.x4),
AppButton(
label: '确认并记录占位事件',
icon: Icons.open_in_new,
kind: AppButtonKind.accent,
expand: true,
onPressed: () {
Navigator.pop(context);
showAppToast(context, '外跳事件接口待接入');
},
),
],
side: ShadSheetSide.bottom,
builder: (context) => ShadSheet(
title: const Text('即将打开外部服务'),
description: Text('$title\n外跳仅用于了解原文或相关服务,本内容不构成投资建议。'),
child: AppButton(
label: '确认并记录占位事件',
icon: Icons.open_in_new,
kind: AppButtonKind.accent,
expand: true,
onPressed: () {
Navigator.pop(context);
showAppToast(context, '外跳事件接口待接入');
},
),
),
);