feat: 充值、划转、提现页面改用 Material Design 3 输入框
- deposit_page.dart: 金额输入框改用 MaterialInput - transfer_page.dart: 金额输入框改用 MaterialInput - withdraw_page.dart: 金额、地址、联系方式输入框改用 MaterialInput - 保持所有业务逻辑和验证逻辑不变 - 统一视觉风格(圆角边框 + Focus 效果)
This commit is contained in:
@@ -6,6 +6,7 @@ import '../../../core/theme/app_theme.dart';
|
||||
import '../../../core/theme/app_spacing.dart';
|
||||
import '../../../providers/asset_provider.dart';
|
||||
import '../../../data/models/account_models.dart';
|
||||
import '../../components/material_input.dart';
|
||||
|
||||
/// 划转页面
|
||||
class TransferPage extends StatefulWidget {
|
||||
@@ -365,60 +366,25 @@ class _TransferPageState extends State<TransferPage> {
|
||||
const SizedBox(height: 12),
|
||||
|
||||
// 金额输入框
|
||||
Container(
|
||||
width: double.infinity,
|
||||
height: 52,
|
||||
decoration: BoxDecoration(
|
||||
color: colorScheme.surface,
|
||||
borderRadius: BorderRadius.circular(14),
|
||||
border: Border.all(
|
||||
color: _focusNode.hasFocus
|
||||
? colorScheme.secondary
|
||||
: colorScheme.outlineVariant.withValues(alpha: 0.5),
|
||||
width: 1,
|
||||
MaterialInput(
|
||||
controller: _amountController,
|
||||
focusNode: _focusNode,
|
||||
hintText: '0.00',
|
||||
keyboardType: const TextInputType.numberWithOptions(decimal: true),
|
||||
inputFormatters: [
|
||||
FilteringTextInputFormatter.allow(RegExp(r'^\d*\.?\d{0,8}')),
|
||||
],
|
||||
onChanged: (_) => setState(() {}),
|
||||
suffixIcon: Padding(
|
||||
padding: const EdgeInsets.only(right: AppSpacing.md),
|
||||
child: Text(
|
||||
'USDT',
|
||||
style: AppTextStyles.bodyMedium(context).copyWith(
|
||||
color: colorScheme.onSurfaceVariant,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: TextField(
|
||||
controller: _amountController,
|
||||
focusNode: _focusNode,
|
||||
keyboardType:
|
||||
const TextInputType.numberWithOptions(decimal: true),
|
||||
inputFormatters: [
|
||||
FilteringTextInputFormatter.allow(
|
||||
RegExp(r'^\d*\.?\d{0,8}')),
|
||||
],
|
||||
style: TextStyle(
|
||||
fontSize: 24,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: colorScheme.onSurface,
|
||||
),
|
||||
decoration: InputDecoration(
|
||||
hintText: '0.00',
|
||||
hintStyle: TextStyle(
|
||||
fontSize: 24,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: colorScheme.onSurfaceVariant.withValues(alpha: 0.3),
|
||||
),
|
||||
border: InputBorder.none,
|
||||
contentPadding: EdgeInsets.zero,
|
||||
isDense: true,
|
||||
),
|
||||
onChanged: (_) => setState(() {}),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'USDT',
|
||||
style: AppTextStyles.bodyMedium(context).copyWith(
|
||||
color: colorScheme.onSurfaceVariant,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user