2026-04-05 22:24:04 +08:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:shadcn_ui/shadcn_ui.dart';
|
2026-04-05 23:37:27 +08:00
|
|
|
import '../../../core/theme/app_theme.dart';
|
2026-04-05 22:24:04 +08:00
|
|
|
import '../../../core/theme/app_spacing.dart';
|
|
|
|
|
|
|
|
|
|
/// 首页快捷操作栏 - 充值/提现/划转/盈亏/账单
|
|
|
|
|
class QuickActionsRow extends StatelessWidget {
|
|
|
|
|
const QuickActionsRow({
|
|
|
|
|
super.key,
|
|
|
|
|
this.onDeposit,
|
|
|
|
|
this.onWithdraw,
|
|
|
|
|
this.onTransfer,
|
|
|
|
|
this.onProfit,
|
|
|
|
|
this.onBills,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
final VoidCallback? onDeposit;
|
|
|
|
|
final VoidCallback? onWithdraw;
|
|
|
|
|
final VoidCallback? onTransfer;
|
|
|
|
|
final VoidCallback? onProfit;
|
|
|
|
|
final VoidCallback? onBills;
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
final colorScheme = Theme.of(context).colorScheme;
|
|
|
|
|
|
|
|
|
|
return Container(
|
2026-04-05 23:37:27 +08:00
|
|
|
padding: const EdgeInsets.symmetric(vertical: AppSpacing.md, horizontal: AppSpacing.sm),
|
2026-04-05 22:24:04 +08:00
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: colorScheme.surfaceContainer,
|
|
|
|
|
border: Border.all(
|
|
|
|
|
color: colorScheme.outlineVariant,
|
|
|
|
|
width: 1,
|
|
|
|
|
),
|
|
|
|
|
borderRadius: BorderRadius.circular(AppRadius.xl),
|
|
|
|
|
),
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
|
|
|
|
children: [
|
|
|
|
|
_ActionItem(
|
|
|
|
|
icon: LucideIcons.arrowUpRight,
|
|
|
|
|
label: '充值',
|
|
|
|
|
colorScheme: colorScheme,
|
|
|
|
|
onTap: onDeposit,
|
|
|
|
|
),
|
|
|
|
|
_ActionItem(
|
|
|
|
|
icon: LucideIcons.arrowDownLeft,
|
|
|
|
|
label: '提现',
|
|
|
|
|
colorScheme: colorScheme,
|
|
|
|
|
onTap: onWithdraw,
|
|
|
|
|
),
|
|
|
|
|
_ActionItem(
|
|
|
|
|
icon: LucideIcons.repeat,
|
|
|
|
|
label: '划转',
|
|
|
|
|
colorScheme: colorScheme,
|
|
|
|
|
onTap: onTransfer,
|
|
|
|
|
),
|
|
|
|
|
_ActionItem(
|
|
|
|
|
icon: LucideIcons.chartPie,
|
|
|
|
|
label: '盈亏',
|
|
|
|
|
colorScheme: colorScheme,
|
|
|
|
|
onTap: onProfit,
|
|
|
|
|
),
|
|
|
|
|
_ActionItem(
|
|
|
|
|
icon: LucideIcons.fileText,
|
|
|
|
|
label: '账单',
|
|
|
|
|
colorScheme: colorScheme,
|
|
|
|
|
onTap: onBills,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class _ActionItem extends StatelessWidget {
|
|
|
|
|
const _ActionItem({
|
|
|
|
|
required this.icon,
|
|
|
|
|
required this.label,
|
|
|
|
|
required this.colorScheme,
|
|
|
|
|
required this.onTap,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
final IconData icon;
|
|
|
|
|
final String label;
|
|
|
|
|
final ColorScheme colorScheme;
|
|
|
|
|
final VoidCallback? onTap;
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return GestureDetector(
|
|
|
|
|
onTap: onTap,
|
|
|
|
|
behavior: HitTestBehavior.opaque,
|
|
|
|
|
child: Column(
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
width: 40,
|
|
|
|
|
height: 40,
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: colorScheme.surfaceContainerHigh,
|
2026-04-05 23:37:27 +08:00
|
|
|
borderRadius: BorderRadius.circular(AppRadius.md),
|
2026-04-05 22:24:04 +08:00
|
|
|
),
|
|
|
|
|
alignment: Alignment.center,
|
|
|
|
|
child: Icon(
|
|
|
|
|
icon,
|
|
|
|
|
size: 18,
|
|
|
|
|
color: colorScheme.onSurfaceVariant,
|
|
|
|
|
),
|
|
|
|
|
),
|
2026-04-05 23:37:27 +08:00
|
|
|
const SizedBox(height: AppSpacing.xs + 2),
|
2026-04-05 22:24:04 +08:00
|
|
|
Text(
|
|
|
|
|
label,
|
2026-04-05 23:37:27 +08:00
|
|
|
style: AppTextStyles.labelMedium(context),
|
2026-04-05 22:24:04 +08:00
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|