feat: 充值/提现页面改为独立全屏页面,优化Toast提示
This commit is contained in:
@@ -6,12 +6,13 @@ import '../../../core/theme/app_theme.dart';
|
||||
import '../../../core/event/app_event_bus.dart';
|
||||
import '../../../providers/asset_provider.dart';
|
||||
import 'components/action_buttons_row.dart';
|
||||
import 'components/asset_dialogs.dart';
|
||||
import 'components/balance_card.dart';
|
||||
import 'components/holdings_section.dart';
|
||||
import 'components/records_link_row.dart';
|
||||
import '../orders/fund_orders_page.dart';
|
||||
import 'deposit_page.dart';
|
||||
import 'transfer_page.dart';
|
||||
import 'withdraw_page.dart';
|
||||
|
||||
/// 資產頁面 - Matching .pen design spec (CMcqs)
|
||||
class AssetPage extends StatefulWidget {
|
||||
@@ -104,8 +105,8 @@ class _AssetPageState extends State<AssetPage> with AutomaticKeepAliveClientMixi
|
||||
const SizedBox(height: AppSpacing.md),
|
||||
// Action buttons row — matching .pen pIpHe (gap 12)
|
||||
ActionButtonsRow(
|
||||
onDeposit: () => showDepositDialog(context),
|
||||
onWithdraw: () => showWithdrawDialog(context, provider.fundAccount?.balance),
|
||||
onDeposit: () => _navigateToDeposit(context),
|
||||
onWithdraw: () => _navigateToWithdraw(context, provider.fundAccount?.balance),
|
||||
onTransfer: () => _navigateToTransfer(context),
|
||||
),
|
||||
const SizedBox(height: AppSpacing.md),
|
||||
@@ -145,4 +146,24 @@ class _AssetPageState extends State<AssetPage> with AutomaticKeepAliveClientMixi
|
||||
context.read<AssetProvider>().refreshAll(force: true);
|
||||
}
|
||||
}
|
||||
|
||||
void _navigateToDeposit(BuildContext context) async {
|
||||
final result = await Navigator.push<bool>(
|
||||
context,
|
||||
MaterialPageRoute(builder: (_) => const DepositPage()),
|
||||
);
|
||||
if (result == true && context.mounted) {
|
||||
context.read<AssetProvider>().refreshAll(force: true);
|
||||
}
|
||||
}
|
||||
|
||||
void _navigateToWithdraw(BuildContext context, String? balance) async {
|
||||
final result = await Navigator.push<bool>(
|
||||
context,
|
||||
MaterialPageRoute(builder: (_) => WithdrawPage(balance: balance)),
|
||||
);
|
||||
if (result == true && context.mounted) {
|
||||
context.read<AssetProvider>().refreshAll(force: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user