|
|
|
|
@ -1,7 +1,10 @@
|
|
|
|
|
import 'dart:developer';
|
|
|
|
|
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
import 'package:test_sa/controllers/providers/api/user_provider.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/modules/site_request_module/models/site_request_model.dart';
|
|
|
|
|
@ -10,6 +13,7 @@ import 'package:test_sa/modules/site_request_module/screens/site_request_form_sc
|
|
|
|
|
import 'package:test_sa/new_views/app_style/app_color.dart';
|
|
|
|
|
import 'package:test_sa/new_views/app_style/app_text_styles.dart';
|
|
|
|
|
import 'package:test_sa/new_views/common_widgets/default_app_bar.dart';
|
|
|
|
|
import 'package:test_sa/views/widgets/loaders/app_loading.dart';
|
|
|
|
|
import 'package:test_sa/views/widgets/loaders/no_data_found.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';
|
|
|
|
|
@ -136,7 +140,7 @@ class _SiteRequestHistoryScreenState extends State<SiteRequestHistoryScreen> {
|
|
|
|
|
itemCount: _provider.requestHistory.length + (_provider.isLoadingMore ? 1 : 0),
|
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
|
if (index == _provider.requestHistory.length) {
|
|
|
|
|
return const Center(child: CircularProgressIndicator());
|
|
|
|
|
return const ALoading();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return _buildRequestCard(_provider.requestHistory[index]);
|
|
|
|
|
@ -197,17 +201,38 @@ class _SiteRequestHistoryScreenState extends State<SiteRequestHistoryScreen> {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget _buildUserInfo(SiteRequestModel request) {
|
|
|
|
|
log('return reason: ${request.returnReason}');
|
|
|
|
|
return Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
InfoTextWidget(label: "Full Name", value: request.fullName),
|
|
|
|
|
InfoTextWidget(label: "Employee ID", value: request.employeeId),
|
|
|
|
|
InfoTextWidget(label: "Email", value: request.emailAddress),
|
|
|
|
|
InfoTextWidget(
|
|
|
|
|
label: "Full Name",
|
|
|
|
|
value: request.fullName,
|
|
|
|
|
showEmptyValue: true,
|
|
|
|
|
),
|
|
|
|
|
InfoTextWidget(
|
|
|
|
|
label: "Employee ID",
|
|
|
|
|
value: request.employeeId,
|
|
|
|
|
showEmptyValue: true,
|
|
|
|
|
),
|
|
|
|
|
InfoTextWidget(
|
|
|
|
|
label: "Email",
|
|
|
|
|
value: request.emailAddress,
|
|
|
|
|
showEmptyValue: true,
|
|
|
|
|
),
|
|
|
|
|
InfoTextWidget(label: "Mobile", value: request.mobileNumber, showEmptyValue: true),
|
|
|
|
|
if (request.extensionNumber != null && request.extensionNumber!.isNotEmpty) ...[
|
|
|
|
|
InfoTextWidget(label: "Extension", value: request.extensionNumber!, showEmptyValue: true),
|
|
|
|
|
],
|
|
|
|
|
InfoTextWidget(label: "Role", value: request.role),
|
|
|
|
|
InfoTextWidget(label: "Extension", value: request.extensionNumber, showEmptyValue: true),
|
|
|
|
|
InfoTextWidget(
|
|
|
|
|
label: "Role",
|
|
|
|
|
value: request.role,
|
|
|
|
|
showEmptyValue: true,
|
|
|
|
|
),
|
|
|
|
|
if( request.returnReason != null && request.returnReason!.isNotEmpty)
|
|
|
|
|
InfoTextWidget(
|
|
|
|
|
label: "Return Reason".addTranslation,
|
|
|
|
|
value: request.returnReason,
|
|
|
|
|
showEmptyValue: true,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
@ -256,13 +281,8 @@ class _SiteRequestHistoryScreenState extends State<SiteRequestHistoryScreen> {
|
|
|
|
|
return Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Text(
|
|
|
|
|
"Old Departments:",
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
color: AppColor.labelTextStyleColor(context),
|
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
|
),
|
|
|
|
|
InfoTextLabelWidget(
|
|
|
|
|
label: "Old Departments:".addTranslation,
|
|
|
|
|
),
|
|
|
|
|
8.height,
|
|
|
|
|
Wrap(
|
|
|
|
|
@ -284,14 +304,17 @@ class _SiteRequestHistoryScreenState extends State<SiteRequestHistoryScreen> {
|
|
|
|
|
return Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Text(
|
|
|
|
|
label,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
color: AppColor.labelTextStyleColor(context),
|
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
|
),
|
|
|
|
|
InfoTextLabelWidget(
|
|
|
|
|
label: label,
|
|
|
|
|
),
|
|
|
|
|
// Text(
|
|
|
|
|
// label,
|
|
|
|
|
// style: TextStyle(
|
|
|
|
|
// fontSize: 14,
|
|
|
|
|
// color: AppColor.labelTextStyleColor(context),
|
|
|
|
|
// fontWeight: FontWeight.w500,
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
8.height,
|
|
|
|
|
Wrap(
|
|
|
|
|
runSpacing: 4.toScreenHeight,
|
|
|
|
|
|