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),
SizedBox(
width: 70,
width: 52,
height: 34,
child: TextField(
controller: _quantityController,
@@ -2765,102 +2765,91 @@ class _BoxingPageState extends State<BoxingPage> with WidgetsBindingObserver {
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
// Left half: quantity label + input + confirm
Expanded(
flex: 1,
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
'数量',
style: TextStyle(
fontSize: 11,
fontWeight: FontWeight.w600,
color: hasScan ? Colors.black54 : Colors.grey.shade400,
Text(
'数量',
style: TextStyle(
fontSize: 11,
fontWeight: FontWeight.w600,
color: hasScan ? Colors.black54 : Colors.grey.shade400,
),
),
const SizedBox(width: 6),
SizedBox(
width: 52,
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),
Expanded(
child: SizedBox(
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,
),
),
),
disabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(6),
borderSide: BorderSide(color: Colors.grey.shade200),
),
const SizedBox(width: 8),
SizedBox(
height: 34,
child: ElevatedButton(
onPressed: _canSubmit ? _submit : null,
style: ElevatedButton.styleFrom(
backgroundColor: _canSubmit
? Theme.of(context).colorScheme.primary
: Colors.grey.shade200,
foregroundColor: _canSubmit
? Colors.white
: Colors.grey.shade400,
padding: const EdgeInsets.symmetric(horizontal: 18),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(6),
),
),
child: _isSubmitting
? const SizedBox(
width: 18,
height: 18,
child: CircularProgressIndicator(
strokeWidth: 2,
color: Colors.white,
),
)
: const Text(
'确认',
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w700,
),
),
),
),
],
filled: !hasScan,
fillColor: Colors.grey.shade100,
),
style: const TextStyle(
fontSize: 15,
fontWeight: FontWeight.w600,
),
),
),
const SizedBox(width: 8),
SizedBox(
height: 34,
child: ElevatedButton(
onPressed: _canSubmit ? _submit : null,
style: ElevatedButton.styleFrom(
backgroundColor: _canSubmit
? Theme.of(context).colorScheme.primary
: Colors.grey.shade200,
foregroundColor: _canSubmit
? Colors.white
: Colors.grey.shade400,
padding: const EdgeInsets.symmetric(horizontal: 18),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(6),
),
),
child: _isSubmitting
? const SizedBox(
width: 18,
height: 18,
child: CircularProgressIndicator(
strokeWidth: 2,
color: Colors.white,
),
)
: const Text(
'确认',
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w700,
),
),
),
),
const SizedBox(width: 8),
// Right half: 完成本箱
Expanded(
flex: 1,
child: SizedBox(
height: 34,
child: OutlinedButton(