You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cloudsolutions-atoms/lib/views/widgets/device_trancfer/device_transfer_item.dart

73 lines
2.7 KiB
Dart

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 '../../../extensions/text_extensions.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 Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
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,
)
],
).onPress(() => onPressed(item)),
],
).expanded,
Column(
crossAxisAlignment: CrossAxisAlignment.end,
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,
Text(item.createdOn != null ? item.createdOn.toServiceRequestCardFormat : "", textAlign: TextAlign.end, style: AppTextStyles.tinyFont.copyWith(color: const Color(0xFF3B3D4A))),
],
),
],
).toShadowContainer(context).paddingOnly(bottom: 8);
}
}