fix: unify input field widths and fix button spacing in boxing page

- Unify all input fields (box number and quantity) to width 52 in both
  single-code and multi-code boxing modes
- Flatten nested Row layout in multi-code submit row to ensure equal
  8px spacing between quantity input, confirm button, and complete-box
  button

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Misaka_Company
2026-05-20 18:58:50 +08:00
parent b17e0e7e62
commit 0ae4017eee

View File

@@ -2164,7 +2164,7 @@ class _BoxingPageState extends State<BoxingPage> with WidgetsBindingObserver {
), ),
const SizedBox(width: 4), const SizedBox(width: 4),
SizedBox( SizedBox(
width: 70, width: 52,
height: 34, height: 34,
child: TextField( child: TextField(
controller: _quantityController, controller: _quantityController,
@@ -2765,102 +2765,91 @@ class _BoxingPageState extends State<BoxingPage> with WidgetsBindingObserver {
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
// Left half: quantity label + input + confirm Text(
Expanded( '数量',
flex: 1, style: TextStyle(
child: Row( fontSize: 11,
crossAxisAlignment: CrossAxisAlignment.center, fontWeight: FontWeight.w600,
children: [ color: hasScan ? Colors.black54 : Colors.grey.shade400,
Text( ),
'数量', ),
style: TextStyle( const SizedBox(width: 6),
fontSize: 11, SizedBox(
fontWeight: FontWeight.w600, width: 52,
color: hasScan ? Colors.black54 : Colors.grey.shade400, height: 34,
child: TextField(
controller: _quantityController,
focusNode: _quantityFocusNode,
enabled: hasScan && !_isSubmitting,
keyboardType: TextInputType.none,
inputFormatters: [FilteringTextInputFormatter.digitsOnly],
textAlign: TextAlign.center,
onChanged: (_) => setState(() {}),
onEditingComplete: () {},
onSubmitted: (_) => _submitFromKeyboard(),
decoration: InputDecoration(
contentPadding: EdgeInsets.zero,
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(6),
),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(6),
borderSide: BorderSide(
color: _quantityTooHigh
? Colors.red
: Colors.grey.shade300,
), ),
), ),
const SizedBox(width: 6), disabledBorder: OutlineInputBorder(
Expanded( borderRadius: BorderRadius.circular(6),
child: SizedBox( borderSide: BorderSide(color: Colors.grey.shade200),
height: 34,
child: TextField(
controller: _quantityController,
focusNode: _quantityFocusNode,
enabled: hasScan && !_isSubmitting,
keyboardType: TextInputType.none,
inputFormatters: [FilteringTextInputFormatter.digitsOnly],
onChanged: (_) => setState(() {}),
onEditingComplete: () {},
onSubmitted: (_) => _submitFromKeyboard(),
decoration: InputDecoration(
contentPadding: const EdgeInsets.symmetric(horizontal: 10),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(6),
),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(6),
borderSide: BorderSide(
color: _quantityTooHigh
? Colors.red
: Colors.grey.shade300,
),
),
disabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(6),
borderSide: BorderSide(color: Colors.grey.shade200),
),
filled: !hasScan,
fillColor: Colors.grey.shade100,
),
style: const TextStyle(
fontSize: 15,
fontWeight: FontWeight.w600,
),
),
),
), ),
const SizedBox(width: 8), filled: !hasScan,
SizedBox( fillColor: Colors.grey.shade100,
height: 34, ),
child: ElevatedButton( style: const TextStyle(
onPressed: _canSubmit ? _submit : null, fontSize: 15,
style: ElevatedButton.styleFrom( fontWeight: FontWeight.w600,
backgroundColor: _canSubmit ),
? Theme.of(context).colorScheme.primary ),
: Colors.grey.shade200, ),
foregroundColor: _canSubmit const SizedBox(width: 8),
? Colors.white SizedBox(
: Colors.grey.shade400, height: 34,
padding: const EdgeInsets.symmetric(horizontal: 18), child: ElevatedButton(
shape: RoundedRectangleBorder( onPressed: _canSubmit ? _submit : null,
borderRadius: BorderRadius.circular(6), style: ElevatedButton.styleFrom(
), backgroundColor: _canSubmit
), ? Theme.of(context).colorScheme.primary
child: _isSubmitting : Colors.grey.shade200,
? const SizedBox( foregroundColor: _canSubmit
width: 18, ? Colors.white
height: 18, : Colors.grey.shade400,
child: CircularProgressIndicator( padding: const EdgeInsets.symmetric(horizontal: 18),
strokeWidth: 2, shape: RoundedRectangleBorder(
color: Colors.white, borderRadius: BorderRadius.circular(6),
), ),
) ),
: const Text( child: _isSubmitting
'确认', ? const SizedBox(
style: TextStyle( width: 18,
fontSize: 14, height: 18,
fontWeight: FontWeight.w700, child: CircularProgressIndicator(
), strokeWidth: 2,
), color: Colors.white,
), ),
), )
], : const Text(
'确认',
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w700,
),
),
), ),
), ),
const SizedBox(width: 8), const SizedBox(width: 8),
// Right half: 完成本箱
Expanded( Expanded(
flex: 1,
child: SizedBox( child: SizedBox(
height: 34, height: 34,
child: OutlinedButton( child: OutlinedButton(