dashboard progress view added.
parent
ff80897a3c
commit
17e62a1671
@ -0,0 +1,58 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:test_sa/controllers/api_routes/urls.dart';
|
||||||
|
import 'package:test_sa/extensions/context_extension.dart';
|
||||||
|
import 'package:test_sa/extensions/int_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/device/asset.dart';
|
||||||
|
|
||||||
|
class AssetItemView extends StatelessWidget {
|
||||||
|
final RequestsDetails request;
|
||||||
|
|
||||||
|
const AssetItemView(this.request, {Key key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
"Device Transfer Request",
|
||||||
|
maxLines: 2,
|
||||||
|
style: AppTextStyles.heading5.copyWith(color: Color(0xFF3B3D4A)),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
"${context.translation.from} : ${request.assetTransferFrom}",
|
||||||
|
style: AppTextStyles.bodyText.copyWith(color: Color(0xFF757575)),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
"${context.translation.to} : ${request.assetTransferTo}",
|
||||||
|
style: AppTextStyles.bodyText.copyWith(color: Color(0xFF757575)),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
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,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
).toShadowContainer.onPress(() {});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,64 @@
|
|||||||
|
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/views/app_style/sizing.dart';
|
||||||
|
|
||||||
|
class GasRefillItemView extends StatelessWidget {
|
||||||
|
final RequestsDetails request;
|
||||||
|
|
||||||
|
const GasRefillItemView(this.request, {Key key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
// Row(
|
||||||
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
// children: [
|
||||||
|
// /// TBD
|
||||||
|
// // StatusLabel(
|
||||||
|
// // label: ,
|
||||||
|
// // id: ,
|
||||||
|
// // textColor: AColors.getPriorityStatusTextColor(),
|
||||||
|
// // backgroundColor: AColors.getPriorityStatusColor()),
|
||||||
|
// 8.width,
|
||||||
|
// StatusLabel(label: item.status.name, textColor: AColors.getRequestStatusTextColor(item.status.value), backgroundColor: AColors.getRequestStatusColor(item.status.value)),
|
||||||
|
// 1.width.expanded,
|
||||||
|
// Text(item.startDate != null ? item.startDate.toServiceRequestCardFormat : "", textAlign: TextAlign.end, style: AppTextStyles.tinyFont.copyWith(color: const Color(0xFF3B3D4A))),
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
// 8.height,
|
||||||
|
Text(context.translation.gasRefillRequest, style: AppTextStyles.heading5.copyWith(color: const Color(0xFF3B3D4A))),
|
||||||
|
Text(
|
||||||
|
'${context.translation.gasType}: ${request.gasType}',
|
||||||
|
style: AppTextStyles.bodyText.copyWith(color: Color(0xFF757575)),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'${context.translation.site}: ${request.site}',
|
||||||
|
style: AppTextStyles.bodyText.copyWith(color: Color(0xFF757575)),
|
||||||
|
),
|
||||||
|
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,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
).toShadowContainer.onPress(() {});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,72 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:provider/provider.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/enums/user_types.dart';
|
||||||
|
import 'package:test_sa/models/visits/visit.dart';
|
||||||
|
import 'package:test_sa/views/pages/user/visits/visit_details.dart';
|
||||||
|
|
||||||
|
class PpmItemView extends StatelessWidget {
|
||||||
|
final RequestsDetails request;
|
||||||
|
|
||||||
|
const PpmItemView(this.request, {Key key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
// Row(
|
||||||
|
// children: [
|
||||||
|
// // StatusLabel(
|
||||||
|
// // label: visit.priority.name,
|
||||||
|
// // id: visit.priority.id,
|
||||||
|
// // textColor: AColors.getPriorityStatusTextColor(visit.priority.id),
|
||||||
|
// // backgroundColor: AColors.getPriorityStatusColor(visit.priority.id)),
|
||||||
|
// // 8.width,
|
||||||
|
// StatusLabel(
|
||||||
|
// label: visit.status.name,
|
||||||
|
// id: visit.status.id,
|
||||||
|
// textColor: AColors.getRequestStatusTextColorByName(visit.status.name),
|
||||||
|
// backgroundColor: AColors.getRequestStatusColorByName(visit.status.name),
|
||||||
|
// ),
|
||||||
|
// 1.width.expanded,
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
// 8.height,
|
||||||
|
Text(context.translation.preventiveMaintenance, style: AppTextStyles.heading5.copyWith(color: const Color(0xFF3B3D4A))),
|
||||||
|
8.height,
|
||||||
|
Text(
|
||||||
|
'${context.translation.assetNumber}: ${request.assetName}',
|
||||||
|
style: AppTextStyles.bodyText.copyWith(color: const Color(0xFF757575)),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'${context.translation.assetSN}: ${request.assetNo}',
|
||||||
|
style: AppTextStyles.bodyText.copyWith(color: const Color(0xFF757575)),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'${context.translation.code}: ${request.code}',
|
||||||
|
style: AppTextStyles.bodyText.copyWith(color: const Color(0xFF757575)),
|
||||||
|
),
|
||||||
|
16.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)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
).toShadowContainer.onPress(() {
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,84 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
import 'package:test_sa/controllers/localization/localization.dart';
|
||||||
|
import 'package:test_sa/controllers/providers/api/service_requests_provider.dart';
|
||||||
|
import 'package:test_sa/controllers/providers/api/user_provider.dart';
|
||||||
|
import 'package:test_sa/controllers/providers/settings/setting_provider.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/enums/translation_keys.dart';
|
||||||
|
import 'package:test_sa/models/service_request/service_request.dart';
|
||||||
|
import 'package:test_sa/models/subtitle.dart';
|
||||||
|
import 'package:test_sa/models/user.dart';
|
||||||
|
import 'package:test_sa/views/app_style/colors.dart';
|
||||||
|
import 'package:test_sa/views/widgets/requests/request_status.dart';
|
||||||
|
|
||||||
|
class ServiceRequestItemView extends StatelessWidget {
|
||||||
|
final RequestsDetails request;
|
||||||
|
|
||||||
|
const ServiceRequestItemView(this.request, {Key key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
// Row(
|
||||||
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
// children: [
|
||||||
|
// StatusLabel(
|
||||||
|
// label: request.priority.name,
|
||||||
|
// id: request.priority.id,
|
||||||
|
// textColor: AColors.getPriorityStatusTextColor(request.priority.id),
|
||||||
|
// backgroundColor: AColors.getPriorityStatusColor(request.priority.id)),
|
||||||
|
// 8.width,
|
||||||
|
// StatusLabel(label: request.statusLabel, textColor: AColors.getRequestStatusTextColor(request.statusValue), backgroundColor: AColors.getRequestStatusColor(request.statusValue)),
|
||||||
|
// 1.width.expanded,
|
||||||
|
// Text(request.date.toServiceRequestCardFormat, textAlign: TextAlign.end, style: AppTextStyles.tinyFont.copyWith(color: const Color(0xFF3B3D4A))),
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
// 8.height,
|
||||||
|
Text(context.translation.serviceRequest, style: AppTextStyles.heading5.copyWith(color: const Color(0xFF3B3D4A))),
|
||||||
|
Text(
|
||||||
|
'${context.translation.assetName}: ${request.assetName}',
|
||||||
|
style: AppTextStyles.bodyText.copyWith(color: Color(0xFF757575)),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'${context.translation.assetNumber}: ${request.assetNo}',
|
||||||
|
style: AppTextStyles.bodyText.copyWith(color: Color(0xFF757575)),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'${context.translation.requestType}: ${request.requestType}',
|
||||||
|
style: AppTextStyles.bodyText.copyWith(color: Color(0xFF757575)),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'${context.translation.requestNo}: ${request.requestNo}',
|
||||||
|
style: AppTextStyles.bodyText.copyWith(color: Color(0xFF757575)),
|
||||||
|
),
|
||||||
|
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,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
).toShadowContainer.onPress(() {
|
||||||
|
//onPressed(request);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue