///todo deleted // import 'package:flutter/material.dart'; // import 'package:test_sa/views/app_style/sizing.dart'; // import 'package:test_sa/views/widgets/buttons/app_icon_button2.dart'; // // import '../../../models/service_request/spare_parts.dart'; // // class PartItem extends StatefulWidget { // final SparePartsWorkOrders part; // final Function(SparePartsWorkOrders) onDelete; // final Function(int qty) onEdit; // // const PartItem({Key? key, this.part, this.onEdit, this.onDelete}) : super(key: key); // // @override // _PartItemState createState() => _PartItemState(); // } // // class _PartItemState extends State { // @override // Widget build(BuildContext context) { // return Column( // children: [ // const Divider(), // Row( // crossAxisAlignment: CrossAxisAlignment.start, // children: [ // Expanded( // child: Column( // crossAxisAlignment: CrossAxisAlignment.start, // children: [ // Row( // children: [ // Expanded( // child: Text( // widget?.part?.sparePart?.partNo ?? "", // style: Theme.of(context).textTheme.bodyText1.copyWith(fontSize: 12, fontWeight: FontWeight.bold), // ), // ), // AIconButton2( // iconData: Icons.add, // color: Theme.of(context).primaryColor, // onPressed: () { // if (widget.onEdit == null) { // ++widget.part.qty; // } else { // widget.onEdit(++widget.part.qty); // } // setState(() {}); // }, // ), // AIconButton2( // iconData: Icons.remove, // color: Theme.of(context).primaryColor, // onPressed: widget.part.qty < 2 // ? null // : () { // if (widget.onEdit == null) { // --widget.part.qty; // } else { // widget.onEdit(--widget.part.qty); // } // setState(() {}); // }, // ), // SizedBox( // width: 8 * AppStyle.getScaleFactor(context), // ), // Text( // widget.part.qty.toString(), // style: Theme.of(context).textTheme.headline6.copyWith( // //fontSize: 12, // //fontWeight: FontWeight.bold // ), // ), // SizedBox( // width: 8 * AppStyle.getScaleFactor(context), // ), // ], // ), // widget.part?.sparePart?.partName == null // ? const SizedBox.shrink() // : Text( // widget.part?.sparePart?.partName, // style: Theme.of(context).textTheme.caption.copyWith(fontSize: 11, fontWeight: FontWeight.bold), // maxLines: 1, // overflow: TextOverflow.ellipsis, // ), // // // Row(crossAxisAlignment: ,) // ], // ), // ), // AIconButton2( // iconData: Icons.close, // color: Colors.red, // onPressed: () { // widget.onDelete(widget.part); // }, // ), // ], // ), // ], // ); // } // }