|
|
|
|
@ -1,9 +1,11 @@
|
|
|
|
|
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/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/enums/user_types.dart';
|
|
|
|
|
import 'package:test_sa/models/search_all_requests_model.dart';
|
|
|
|
|
import 'package:test_sa/new_views/app_style/app_color.dart';
|
|
|
|
|
import 'package:test_sa/new_views/common_widgets/app_filled_button.dart';
|
|
|
|
|
@ -43,6 +45,7 @@ class _AllRequestsFilterPageState extends State<AllRequestsFilterPage> {
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
bool isEngineer = (Provider.of<UserProvider>(context, listen: false).user?.type) == UsersTypes.engineer;
|
|
|
|
|
if (search == null) {
|
|
|
|
|
search = SearchAllRequestsModel(
|
|
|
|
|
requestNumber: SearchByRequestNumberModel(context, controller: TextEditingController()),
|
|
|
|
|
@ -59,14 +62,17 @@ class _AllRequestsFilterPageState extends State<AllRequestsFilterPage> {
|
|
|
|
|
context.translation.gasRefill: 2,
|
|
|
|
|
context.translation.deviceTransfer: 3,
|
|
|
|
|
context.translation.preventiveMaintenance: 4,
|
|
|
|
|
context.translation.recurrentWo: 5,
|
|
|
|
|
};
|
|
|
|
|
if (isEngineer) {
|
|
|
|
|
types.addAll({context.translation.recurrentWo: 5});
|
|
|
|
|
}
|
|
|
|
|
final statuses = {
|
|
|
|
|
context.translation.allRequests: 0,
|
|
|
|
|
"All WO": 0,
|
|
|
|
|
context.translation.open: 1,
|
|
|
|
|
context.translation.inProgress: 2,
|
|
|
|
|
context.translation.completed: 4,
|
|
|
|
|
context.translation.closed: 3,
|
|
|
|
|
"Canceled": 5,
|
|
|
|
|
};
|
|
|
|
|
return Scaffold(
|
|
|
|
|
appBar: DefaultAppBar(
|
|
|
|
|
@ -99,7 +105,7 @@ class _AllRequestsFilterPageState extends State<AllRequestsFilterPage> {
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
|
|
|
children: [
|
|
|
|
|
context.translation.requestStatus.heading5(context),
|
|
|
|
|
"WO Status".heading5(context),
|
|
|
|
|
8.height,
|
|
|
|
|
RequestsTypeFilter(
|
|
|
|
|
initialValues: search?.statuses ?? [],
|
|
|
|
|
@ -116,7 +122,7 @@ class _AllRequestsFilterPageState extends State<AllRequestsFilterPage> {
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
16.height,
|
|
|
|
|
context.translation.typeOfRequest.heading5(context),
|
|
|
|
|
"Type of WO".heading5(context),
|
|
|
|
|
8.height,
|
|
|
|
|
RequestsTypeFilter(
|
|
|
|
|
initialValues: search?.typeTransaction ?? [],
|
|
|
|
|
@ -155,7 +161,7 @@ class _AllRequestsFilterPageState extends State<AllRequestsFilterPage> {
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
16.height,
|
|
|
|
|
"Archived Requests".heading5(context),
|
|
|
|
|
"Archived WO".heading5(context),
|
|
|
|
|
// 8.height,
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
|