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.
68 lines
2.2 KiB
Dart
68 lines
2.2 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:provider/provider.dart';
|
|
import 'package:test_sa/controllers/localization/localization.dart';
|
|
import 'package:test_sa/models/device/device_transfer_info.dart';
|
|
import 'package:test_sa/views/app_style/colors.dart';
|
|
import 'package:test_sa/views/widgets/loaders/image_loader.dart';
|
|
import 'package:test_sa/views/widgets/requests/info_row.dart';
|
|
import 'package:test_sa/views/widgets/requests/request_status.dart';
|
|
|
|
import '../../../controllers/providers/api/user_provider.dart';
|
|
|
|
class DeviceTransferInfoSection extends StatelessWidget {
|
|
final DeviceTransferInfo info;
|
|
final VoidCallback onEdit;
|
|
const DeviceTransferInfoSection({Key key, this.info, this.onEdit}) : super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
UserProvider userProvider = Provider.of<UserProvider>(context);
|
|
final subtitle = AppLocalization.of(context).subtitle;
|
|
return Column(
|
|
children: [
|
|
RequestInfoRow(
|
|
title: subtitle.hospital,
|
|
info: info.client.name,
|
|
),
|
|
RequestInfoRow(
|
|
title: subtitle.department,
|
|
info: info.department.name,
|
|
),
|
|
RequestInfoRow(
|
|
title: subtitle.engineerName,
|
|
info: userProvider.user.username,
|
|
),
|
|
RequestInfoRow(
|
|
title: subtitle.workingHours,
|
|
info: info.workingHours,
|
|
),
|
|
RequestInfoRow(
|
|
title: subtitle.travelingHours,
|
|
info: info.travelingHours,
|
|
),
|
|
RequestInfoRow(
|
|
title: "Comment",
|
|
info: info.comment,
|
|
),
|
|
RequestInfoRow(
|
|
title: "Assigned FE",
|
|
info: info.assignedEmployeeName,
|
|
),
|
|
RequestInfoRow(
|
|
title: "Signature",
|
|
info: info.signature?.isEmpty != false ? subtitle.noDateFound : null,
|
|
contentWidget: info.signature?.isEmpty != false
|
|
? null
|
|
: ImageLoader(
|
|
url: info.signature,
|
|
),
|
|
),
|
|
RequestInfoRow(
|
|
title: subtitle.status,
|
|
infoWidget: StatusLabel(label: info.status?.name, color: AColors.getGasStatusColor(info.status?.id)),
|
|
),
|
|
],
|
|
);
|
|
}
|
|
}
|