import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import '../../../common/main_card.dart'; class OrderShowCard extends StatefulWidget { final int index; final String orderNo; final String matnr; final String maktx; final double count; const OrderShowCard({super.key,required this.index, required this.orderNo, required this.matnr, required this.maktx, required this.count}); @override State createState() => _OrderShowCardState(); } class _OrderShowCardState extends State { @override Widget build(BuildContext context) { return MainCard( isPadding: true, child: Column( children: [ Row( children: [ Text(widget.orderNo, style: TextStyle(fontSize: 12, color: Colors.black54)), Spacer(), Container( padding: const EdgeInsets.all(1), constraints: BoxConstraints(minWidth: 18, minHeight: 18), decoration: BoxDecoration( shape: BoxShape.circle, color: Colors.blue, ), child: Center( child: Text(widget.index.toString(), style: TextStyle(fontSize: 9, color: Colors.white)), ), ), ], ), Divider( height: 10, color: Colors.black12, ), Row( children: [ Expanded( child: Text(widget.maktx, style: TextStyle( fontSize: 16, color: Colors.black, fontWeight: FontWeight.bold), softWrap: true, overflow: TextOverflow.ellipsis, maxLines: 3), ), ], ), Row( children: [ Container( decoration: BoxDecoration( border: Border.all(color: Colors.black12, width: 0.5), color: Colors.grey[100], borderRadius: BorderRadius.circular(3), ), padding: const EdgeInsets.only(left: 5, right: 5), child: Text('ID:${widget.matnr}', style: TextStyle(fontSize: 12, color: Colors.black26)), ), ], ), Row( crossAxisAlignment: CrossAxisAlignment.end, children: [ Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( children: [ Text('批号: 24090010', style: TextStyle(fontSize: 12, color: Colors.black54)) ], ), Row( children: [ Text('批号: 24090010', style: TextStyle(fontSize: 12, color: Colors.black54)) ], ), Row( children: [ Expanded( // 对长文本使用 Expanded child: Text( '批号: W/HiTouch_PressGestureDetector(32540): Touch pointer move a lot. The moving distance of X is: 10.0, limit is: 40. The moving distance of Y is: 57.0, limit is: 40', style: TextStyle(fontSize: 12, color: Colors.black54), softWrap: true, overflow: TextOverflow.ellipsis, maxLines: 3, ), ), ], ), ], ), ), SizedBox(width: 20), Row( children: [ Baseline( baseline: 15.0, // 可以自定义这个值来调整对齐位置 baselineType: TextBaseline.alphabetic, child: Text( '数量:', style: TextStyle(fontSize: 12, color: Colors.black54), ), ), Text(widget.count.toString(), style: TextStyle( fontSize: 18, color: Colors.orange, fontWeight: FontWeight.bold)), ], ), ], ), ], ), ); } }