Updated the app's color scheme to implement a new "Slate" theme with refined dark and light variants. Changed background colors from #0A0E14 to #0B1120 for dark mode and updated surface layer colors to follow Material Design 3 specifications. Modified text colors and outline variants for better contrast and accessibility. Updated font sizes in transaction details screen from 11px to 12px for improved readability.
125 lines
3.2 KiB
Dart
125 lines
3.2 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:google_fonts/google_fonts.dart';
|
|
import 'package:shadcn_ui/shadcn_ui.dart';
|
|
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(
|
|
padding: const EdgeInsets.symmetric(vertical: 16, horizontal: 8),
|
|
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,
|
|
borderRadius: BorderRadius.circular(10),
|
|
),
|
|
alignment: Alignment.center,
|
|
child: Icon(
|
|
icon,
|
|
size: 18,
|
|
color: colorScheme.onSurfaceVariant,
|
|
),
|
|
),
|
|
const SizedBox(height: 6),
|
|
Text(
|
|
label,
|
|
style: GoogleFonts.inter(
|
|
fontSize: 11,
|
|
fontWeight: FontWeight.w500,
|
|
color: colorScheme.onSurfaceVariant,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|