@ -1,16 +1,14 @@
import ' dart:developer ' ;
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/text_extensions.dart ' ;
import ' package:test_sa/extensions/widget_extensions.dart ' ;
import ' package:test_sa/models/all_requests_and_count_model.dart ' ;
import ' package:test_sa/models/new_models/dashboard_detail.dart ' ;
import ' package:test_sa/modules/internal_audit_module/pages/equipment_internal_audit/equipment_internal_audit_detail_page.dart ' ;
import ' package:test_sa/modules/internal_audit_module/pages/system_internal_audit/system_internal_audit_detail_page.dart ' ;
import ' package:test_sa/new_views/app_style/app_color.dart ' ;
import ' package:test_sa/views/widgets/item_views/info_date_widget.dart ' ;
import ' package:test_sa/views/widgets/item_views/info_header_widget.dart ' ;
import ' package:test_sa/views/widgets/item_views/info_text_widget.dart ' ;
import ' package:test_sa/views/widgets/requests/request_status.dart ' ;
class SystemInternalAuditItemView extends StatelessWidget {
@ -36,29 +34,12 @@ class SystemInternalAuditItemView extends StatelessWidget {
backgroundColor: AppColor . getRequestStatusColorByName ( context , requestData ! . statusName ! ) ,
) ,
1. width . expanded ,
Text (
requestData ! . transactionDate ? . toServiceRequestCardFormat ? ? " " ,
textAlign: TextAlign . end ,
style: AppTextStyles . tinyFont . copyWith ( color: context . isDark ? AppColor . neutral10 : AppColor . neutral50 ) ,
) ,
] ,
) ,
8. height ,
( requestData ? . typeTransaction ? ? " System Audit Request " ) . heading5 ( context ) ,
infoWidget ( label: context . translation . requestNo , value: requestData ! . requestNo , context: context ) ,
infoWidget ( label: context . translation . assetNumber , value: requestData ? . assetNumber , context: context ) ,
8. height ,
Row (
mainAxisSize: MainAxisSize . min ,
children: [
Text (
context . translation . viewDetails ,
style: AppTextStyles . bodyText . copyWith ( color: AppColor . blueStatus ( context ) ) ,
) ,
4. width ,
Icon ( Icons . arrow_forward , color: AppColor . blueStatus ( context ) , size: 14 )
InfoDateWidget ( requestData ! . transactionDate ? ? " " ) ,
] ,
) ,
InfoHeaderWidget ( requestData ? . typeTransaction ? ? " System Audit Request " ) ,
InfoTextWidget ( label: context . translation . requestNo , value: requestData ! . requestNo ) ,
InfoTextWidget ( label: context . translation . assetNumber , value: requestData ? . assetNumber , showArrow: true ) ,
] ,
) . toShadowContainer ( context , withShadow: showShadow ) . onPress ( ( ) async {
Navigator . push ( context , MaterialPageRoute ( builder: ( context ) = > SystemInternalAuditDetailPage ( auditId: requestData ! . id ! ) ) ) ;
@ -66,6 +47,7 @@ class SystemInternalAuditItemView extends StatelessWidget {
}
return Column (
crossAxisAlignment: CrossAxisAlignment . start ,
spacing: 1 ,
children: [
Row (
crossAxisAlignment: CrossAxisAlignment . start ,
@ -76,45 +58,19 @@ class SystemInternalAuditItemView extends StatelessWidget {
backgroundColor: AppColor . getRequestStatusColorByName ( context , requestDetails ? . status ! ) ,
) ,
1. width . expanded ,
Text (
requestDetails ! . date ? . toServiceRequestCardFormat ? ? " " ,
textAlign: TextAlign . end ,
style: AppTextStyles . tinyFont . copyWith ( color: context . isDark ? AppColor . neutral10 : AppColor . neutral50 ) ,
) ,
InfoDateWidget ( requestDetails ! . date ? ? " " ) ,
] ,
) ,
8. height ,
( requestDetails ? . nameOfType ? ? " Internal Audit Request " ) . heading5 ( context ) ,
infoWidget ( label: context . translation . requestNo , value: requestDetails ! . requestNo , context: context ) ,
infoWidget ( label: context . translation . assetNumber , value: requestDetails ! . assetNo , context: context ) ,
infoWidget ( label: context . translation . assetSN , value: requestDetails ! . assetSN , context: context ) ,
infoWidget ( label: context . translation . model , value: requestDetails ! . model , context: context ) ,
infoWidget ( label: context . translation . site , value: requestDetails ! . site , context: context ) ,
8. height ,
InfoHeaderWidget ( requestDetails ? . nameOfType ? ? " Internal Audit Request " ) ,
InfoTextWidget ( label: context . translation . requestNo , value: requestDetails ! . requestNo ) ,
InfoTextWidget ( label: context . translation . assetNumber , value: requestDetails ! . assetNo ) ,
InfoTextWidget ( label: context . translation . assetSN , value: requestDetails ! . assetSN ) ,
InfoTextWidget ( label: context . translation . model , value: requestDetails ! . model ) ,
InfoTextWidget ( label: context . translation . site , value: requestDetails ! . site , showArrow: true ) ,
/ / infoWidget ( label: context . translation . site , value: requestDetails ! . site , context: context ) ,
8. height ,
Row (
mainAxisSize: MainAxisSize . min ,
children: [
Text (
context . translation . viewDetails ,
style: AppTextStyles . bodyText . copyWith ( color: AppColor . blueStatus ( context ) ) ,
) ,
4. width ,
Icon ( Icons . arrow_forward , color: AppColor . blueStatus ( context ) , size: 14 )
] ,
) ,
] ,
) . toShadowContainer ( context , withShadow: showShadow ) . onPress ( ( ) async {
Navigator . push ( context , MaterialPageRoute ( builder: ( context ) = > SystemInternalAuditDetailPage ( auditId: requestDetails ! . id ! ) ) ) ;
} ) ;
}
Widget infoWidget ( { required String label , String ? value , required BuildContext context } ) {
if ( value ! = null & & value . isNotEmpty ) {
return ' $ label : $ value ' . bodyText ( context ) ;
}
return const SizedBox ( ) ;
}
}