import 'package:flutter/material.dart'; import 'package:test_sa/extensions/context_extension.dart'; import 'package:test_sa/extensions/int_extensions.dart'; import 'package:test_sa/extensions/string_extensions.dart'; import 'package:test_sa/extensions/widget_extensions.dart'; import 'package:test_sa/models/device/asset_transfer.dart'; import 'package:test_sa/views/app_style/sizing.dart'; import '../../../extensions/text_extensions.dart'; import '../../app_style/colors.dart'; import '../requests/request_status.dart'; class DeviceTransferItem extends StatelessWidget { final int index; final AssetTransfer item; final Function(AssetTransfer) onPressed; const DeviceTransferItem({Key key, this.item, this.onPressed, this.index}) : super(key: key); @override Widget build(BuildContext context) { return Padding( padding: const EdgeInsets.symmetric(vertical: 4), child: ElevatedButton( style: ElevatedButton.styleFrom( elevation: 0, padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 8), backgroundColor: Colors.white, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(AppStyle.getBorderRadius(context)), ), ), onPressed: () { onPressed(item); }, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ /// TBD // StatusLabel( // label: '', // id: 0, // textColor: AColors.getPriorityStatusTextColor(0), // backgroundColor: AColors.getPriorityStatusColor(0)), 8.width, /// TBD //StatusLabel(label: '', textColor: AColors.getRequestStatusTextColor(0), backgroundColor: AColors.getRequestStatusColor(0)), 1.width.expanded, Text(item.createdOn != null ?item.createdOn.toServiceRequestCardFormat:"", textAlign: TextAlign.end, style: AppTextStyles.tinyFont.copyWith(color: const Color(0xFF3B3D4A))), ], ), 8.height, Text(context.translation.deviceTransferRequest, style: AppTextStyles.heading5.copyWith(color: const Color(0xFF3B3D4A))), Text( '${context.translation.from} : ${item.senderAssignedEmployeeName}', style: AppTextStyles.bodyText.copyWith(color: Color(0xFF757575)), ), Text( '${context.translation.to} : ${item.receiverAssignedEmployeeName}', style: AppTextStyles.bodyText.copyWith(color: Color(0xFF757575)), ), 8.height, Row( mainAxisSize: MainAxisSize.min, children: [ Text( context.translation.viewDetails, style: AppTextStyles.bodyText.copyWith(color: const Color(0xFF4A8DB7)), ), 4.width, const Icon( Icons.arrow_forward, color: Color(0xFF4A8DB7), size: 14, ) ], ), ], ) ), ); } }