|
|
|
|
@ -1,4 +1,5 @@
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:test_sa/models/lookup.dart';
|
|
|
|
|
|
|
|
|
|
import '../../../controllers/localization/localization.dart';
|
|
|
|
|
import '../../../models/service_request/search_work_order.dart';
|
|
|
|
|
@ -8,7 +9,9 @@ import '../../app_style/sizing.dart';
|
|
|
|
|
|
|
|
|
|
class WorkOrderDetails extends StatelessWidget {
|
|
|
|
|
final SearchWorkOrder item;
|
|
|
|
|
WorkOrderDetails({@required this.item,Key key}) : super(key: key);
|
|
|
|
|
Lookup assetType;
|
|
|
|
|
|
|
|
|
|
WorkOrderDetails({@required this.item, this.assetType, Key key}) : super(key: key);
|
|
|
|
|
Subtitle _subtitle;
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
@ -30,15 +33,15 @@ class WorkOrderDetails extends StatelessWidget {
|
|
|
|
|
),
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
_buildRow(_subtitle.callId, item.callRequest?.id?.toString()??"", context),
|
|
|
|
|
_buildRow(_subtitle.assetNumber, item.callRequest?.asset?.assetNumber??"", context),
|
|
|
|
|
_buildRow(_subtitle.callId, item.callRequest?.id?.toString() ?? "", context),
|
|
|
|
|
_buildRow(_subtitle.assetNumber, item.callRequest?.asset?.assetNumber ?? "", context),
|
|
|
|
|
_buildRow("WO No", item.workOrderNo, context),
|
|
|
|
|
_buildRow(_subtitle.assetName, item.callRequest?.asset?.assetNumber??'', context),
|
|
|
|
|
_buildRow(_subtitle.department, item.callRequest?.asset?.department??'', context),
|
|
|
|
|
_buildRow(_subtitle.assetSN, item.callRequest?.asset?.assetSerialNo??'', context),
|
|
|
|
|
_buildRow(_subtitle.model, item.callRequest?.asset?.modelDefinition?.modelName??"", context),
|
|
|
|
|
_buildRow("Manufacturer", item.callRequest?.asset?.modelDefinition?.manufacturerName??"", context),
|
|
|
|
|
_buildRow(_subtitle.site, item.callRequest?.asset?.site?.custName??"", context),
|
|
|
|
|
_buildRow(_subtitle.assetName, item.callRequest?.asset?.assetNumber ?? '', context),
|
|
|
|
|
_buildRow(_subtitle.department, item.callRequest?.asset?.department ?? '', context),
|
|
|
|
|
_buildRow(_subtitle.assetSN, item.callRequest?.asset?.assetSerialNo ?? '', context),
|
|
|
|
|
_buildRow(_subtitle.model, item.callRequest?.asset?.modelDefinition?.modelName ?? "", context),
|
|
|
|
|
_buildRow("Manufacturer", item.callRequest?.asset?.modelDefinition?.manufacturerName ?? "", context),
|
|
|
|
|
_buildRow(_subtitle.site, item.callRequest?.asset?.site?.custName ?? "", context),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
@ -53,16 +56,18 @@ class WorkOrderDetails extends StatelessWidget {
|
|
|
|
|
),
|
|
|
|
|
borderRadius: BorderRadius.circular(AppStyle.borderRadius * AppStyle.getScaleFactor(context)),
|
|
|
|
|
),
|
|
|
|
|
child: _buildRow("Asset Type", item.assetType?.name??"", context),)
|
|
|
|
|
child: _buildRow("Asset Type", assetType?.name ?? (item.assetType?.name ?? ""), context),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
Widget _buildRow(String title, String value, BuildContext context){
|
|
|
|
|
|
|
|
|
|
Widget _buildRow(String title, String value, BuildContext context) {
|
|
|
|
|
return Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Text(
|
|
|
|
|
title+" : ",
|
|
|
|
|
title + " : ",
|
|
|
|
|
style: Theme.of(context).textTheme.subtitle2.copyWith(fontWeight: FontWeight.bold),
|
|
|
|
|
),
|
|
|
|
|
//if (item.clientName != null)
|
|
|
|
|
|