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

69 lines
2.6 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/device_transfer.dart';
import 'package:test_sa/new_views/app_style/app_color.dart';
import '../../../extensions/text_extensions.dart';
class DeviceTransferItem extends StatelessWidget {
final int index;
final DeviceTransfer item;
final Function(DeviceTransfer) onPressed;
const DeviceTransferItem({Key? key,required this.item,required this.onPressed,required this.index}) : super(key: key);
@override
Widget build(BuildContext context) {
return Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
context.translation.deviceTransferRequest.heading5(context),
'${context.translation.from} : ${item.senderAssignedEmployeeName}'.bodyText(context),
'${context.translation.to} : ${item.receiverAssignedEmployeeName}'.bodyText(context),
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: context.isDark ? AppColor.neutral10 : const Color(0xFF3B3D4A))),
],
),
],
).toShadowContainer(context).paddingOnly(bottom: 8);
}
}