Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Register
Sign in
Toggle navigation
Menu
UPSMF
uphrh-smf-mobile
Commits
9492ecd3
Commit
9492ecd3
authored
2 years ago
by
devendra
Browse files
Options
Download
Patches
Plain Diff
Feat: two-lead-assessor- api changes adopted
parent
7773cec0
master
two-lead-assessor
1 merge request
!3
Two lead assessor
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
lib/models/application_model.dart
+3
-0
lib/models/application_model.dart
lib/pages/application_details_page.dart
+1
-0
lib/pages/application_details_page.dart
lib/pages/home_page.dart
+8
-6
lib/pages/home_page.dart
with
12 additions
and
6 deletions
+12
-6
lib/models/application_model.dart
+
3
−
0
View file @
9492ecd3
...
...
@@ -14,6 +14,7 @@ class Application {
final
String
scheduledDate
;
final
String
createdDate
;
final
String
createdBy
;
final
String
updatedBy
;
const
Application
({
required
this
.
formId
,
...
...
@@ -31,6 +32,7 @@ class Application {
required
this
.
scheduledDate
,
required
this
.
createdDate
,
required
this
.
createdBy
,
required
this
.
updatedBy
,
});
factory
Application
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
...
...
@@ -58,6 +60,7 @@ class Application {
json
[
'inspection'
]
!=
null
?
json
[
'inspection'
][
'scheduledDate'
]
:
''
,
createdDate:
json
[
'createdDate'
],
createdBy:
json
[
'createdBy'
],
updatedBy:
json
[
'updatedBy'
]
??
""
,
);
}
...
...
This diff is collapsed.
Click to expand it.
lib/pages/application_details_page.dart
+
1
−
0
View file @
9492ecd3
...
...
@@ -284,6 +284,7 @@ class _ApplicationDetailsPageState extends State<ApplicationDetailsPage>
//Validate assessment form to make sure all inputs are given by the assessor when second assessor submmits the form
if
(
widget
.
application
.
inspectionStatus
==
InspectionStatus
.
leadInspectorCompleted
)
{
data
[
"inspectionCompleted"
]
=
true
;
isValidForm
=
true
;
for
(
int
i
=
0
;
i
<
fieldsLength
;
i
++
)
{
_data
[
_data
.
keys
.
elementAt
(
i
)]
.
forEach
((
key
,
value
)
{
...
...
This diff is collapsed.
Click to expand it.
lib/pages/home_page.dart
+
8
−
6
View file @
9492ecd3
...
...
@@ -128,6 +128,7 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
Future
<
dynamic
>
_getApplications
()
async
{
String
rawUserId
=
await
Helper
.
getUser
(
Storage
.
userId
);
String
username
=
await
Helper
.
getUser
(
Storage
.
username
);
int
userId
=
int
.
parse
(
rawUserId
);
bool
isInternetConnected
=
await
Helper
.
isInternetConnected
();
// await Future.delayed(const Duration(milliseconds: 10));
...
...
@@ -154,17 +155,18 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
temp
=
List
.
from
(
temp
.
reversed
);
int
days
=
Helper
.
getDateDiffence
(
DateTime
.
now
(),
DateTime
.
parse
(
temp
.
join
(
"-"
)));
if
((
days
==
0
||
days
>
0
)
&&
if
((
days
==
0
)
&&
application
.
status
==
InspectionStatus
.
sentForInspection
)
{
if
(
application
.
leadI
nspect
or
[
0
]
==
userId
&&
application
.
inspectionStatus
==
InspectionStatus
.
leadInspectorCompleted
)
{
if
(
application
.
i
nspect
ionStatus
==
InspectionStatus
.
leadInspectorCompleted
&&
application
.
updatedBy
==
username
)
{
_pastApplications
.
add
(
application
);
}
else
{
_pendingApplications
.
add
(
application
);
}
}
else
if
((
days
==
0
||
days
>
0
)
&&
application
.
status
!=
InspectionStatus
.
sentForInspection
)
{
}
else
if
(((
days
==
0
)
&&
application
.
status
!=
InspectionStatus
.
sentForInspection
)
||
(
days
>
0
))
{
_pastApplications
.
add
(
application
);
}
else
{
_upcomingApplications
.
add
(
application
);
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets