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
7773cec0
Commit
7773cec0
authored
2 years ago
by
devendra
Browse files
Options
Download
Patches
Plain Diff
Feat: 2 lead assessor workflow
parent
8c6ae9f9
master
two-lead-assessor
1 merge request
!3
Two lead assessor
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
.vscode/launch.json
+25
-0
.vscode/launch.json
lib/l10n/app_en.arb
+4
-1
lib/l10n/app_en.arb
lib/models/application_model.dart
+6
-0
lib/models/application_model.dart
lib/pages/application_details_page.dart
+220
-190
lib/pages/application_details_page.dart
lib/pages/inspection_summary.dart
+11
-10
lib/pages/inspection_summary.dart
lib/pages/past_applications.dart
+3
-1
lib/pages/past_applications.dart
lib/widgets/application_card.dart
+6
-1
lib/widgets/application_card.dart
lib/widgets/lead_inspector_application_field.dart
+20
-20
lib/widgets/lead_inspector_application_field.dart
with
295 additions
and
223 deletions
+295
-223
.vscode/launch.json
0 → 100644
+
25
−
0
View file @
7773cec0
{
//
Use
IntelliSense
to
learn
about
possible
attributes.
//
Hover
to
view
descriptions
of
existing
attributes.
//
For
more
information
,
visit:
https://go.microsoft.com/fwlink/?linkid=
830387
"version"
:
"0.2.0"
,
"configurations"
:
[
{
"name"
:
"smf-mobile"
,
"request"
:
"launch"
,
"type"
:
"dart"
},
{
"name"
:
"smf-mobile (profile mode)"
,
"request"
:
"launch"
,
"type"
:
"dart"
,
"flutterMode"
:
"profile"
},
{
"name"
:
"smf-mobile (release mode)"
,
"request"
:
"launch"
,
"type"
:
"dart"
,
"flutterMode"
:
"release"
}
]
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
lib/l10n/app_en.arb
+
4
−
1
View file @
7773cec0
...
...
@@ -50,6 +50,8 @@
"inspetionCompletedOn"
:
"Assessment completed on"
,
"inspectionSummary"
:
"Assessment Summary"
,
"leadInspector"
:
"Lead assessor"
,
"firstLeadAssessor"
:
"First Lead assessor"
,
"secondLeadAssessor"
:
"Second Lead assessor"
,
"assistingInspectors"
:
"Assisting assessor"
,
"iDisagree"
:
"I disagree"
,
"iConsent"
:
"I consent"
,
...
...
@@ -68,5 +70,6 @@
"remove"
:
"Remove"
,
"attachment"
:
"Attachment"
,
"version"
:
"Version"
,
"canNotSubmitEmptyForm"
:
"Empty assessment can't be submitted"
"canNotSubmitEmptyFormError"
:
"Empty assessment can't be submitted"
,
"assessmentForAllError"
:
"Assessment is not given for all fields"
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
lib/models/application_model.dart
+
6
−
0
View file @
7773cec0
...
...
@@ -7,6 +7,7 @@ class Application {
final
Map
dataObject
;
final
List
inspectors
;
final
List
leadInspector
;
final
List
assistingInspector
;
// using it as second lead assessor
final
Map
inspectorDataObject
;
final
Map
inspectorSummaryDataObject
;
final
String
inspectionStatus
;
...
...
@@ -23,6 +24,7 @@ class Application {
required
this
.
dataObject
,
required
this
.
inspectors
,
required
this
.
leadInspector
,
required
this
.
assistingInspector
,
required
this
.
inspectorDataObject
,
required
this
.
inspectorSummaryDataObject
,
required
this
.
inspectionStatus
,
...
...
@@ -43,6 +45,9 @@ class Application {
json
[
'inspection'
]
!=
null
?
json
[
'inspection'
][
'assignedTo'
]
:
[],
leadInspector:
json
[
'inspection'
]
!=
null
?
json
[
'inspection'
][
'leadInspector'
]
:
[],
assistingInspector:
json
[
'inspection'
]
!=
null
?
json
[
'inspection'
][
'assistingInspector'
]
:
[],
inspectorDataObject:
json
[
'inspectorDataObject'
]
!=
null
?
json
[
'inspectorDataObject'
][
'dataObject'
]
:
{},
...
...
@@ -65,6 +70,7 @@ class Application {
dataObject
,
inspectors
,
leadInspector
,
assistingInspector
,
inspectorDataObject
,
inspectorSummaryDataObject
,
inspectionStatus
,
...
...
This diff is collapsed.
Click to expand it.
lib/pages/application_details_page.dart
+
220
−
190
View file @
7773cec0
This diff is collapsed.
Click to expand it.
lib/pages/inspection_summary.dart
+
11
−
10
View file @
7773cec0
...
...
@@ -24,14 +24,14 @@ class InspectionSummaryPage extends StatefulWidget {
final
List
inspectionFields
;
final
Map
inspectionData
;
const
InspectionSummaryPage
(
{
Key
?
key
,
required
this
.
formId
,
required
this
.
inspectors
,
required
this
.
leadInspector
,
required
this
.
inspectionFields
,
required
this
.
inspectionData
})
:
super
(
key:
key
);
const
InspectionSummaryPage
(
{
Key
?
key
,
required
this
.
formId
,
required
this
.
inspectors
,
required
this
.
leadInspector
,
required
this
.
inspectionFields
,
required
this
.
inspectionData
,
})
:
super
(
key:
key
);
@override
_InspectionSummaryPageState
createState
()
=
>
_InspectionSummaryPageState
();
}
...
...
@@ -40,6 +40,7 @@ class _InspectionSummaryPageState extends State<InspectionSummaryPage> {
// Map _source = {ConnectivityResult.none: false};
// final MyConnectivity _connectivity = MyConnectivity.instance;
final
TextEditingController
_summaryController
=
TextEditingController
();
final
List
<
Map
>
_inspectors
=
[];
int
_leadInspectorId
=
0
;
bool
_iAgree
=
false
;
...
...
@@ -247,7 +248,7 @@ class _InspectionSummaryPageState extends State<InspectionSummaryPage> {
?
Container
(
margin:
const
EdgeInsets
.
fromLTRB
(
20
,
10
,
20
,
15
),
child:
Text
(
'
Lead
a
ssessor
'
,
AppLocalizations
.
of
(
context
)
!.
first
Lead
A
ssessor
,
style:
GoogleFonts
.
lato
(
color:
AppColors
.
black87
,
fontWeight:
FontWeight
.
w700
,
...
...
@@ -266,7 +267,7 @@ class _InspectionSummaryPageState extends State<InspectionSummaryPage> {
Container
(
margin:
const
EdgeInsets
.
fromLTRB
(
20
,
10
,
20
,
15
),
child:
Text
(
'Assisting a
ssessor
'
,
AppLocalizations
.
of
(
context
)
!.
secondLeadA
ssessor
,
style:
GoogleFonts
.
lato
(
color:
AppColors
.
black87
,
fontWeight:
FontWeight
.
w700
,
...
...
This diff is collapsed.
Click to expand it.
lib/pages/past_applications.dart
+
3
−
1
View file @
7773cec0
...
...
@@ -53,7 +53,9 @@ class _PastApplicationsState extends State<PastApplications> {
itemCount:
widget
.
pastApplications
.
length
,
itemBuilder:
(
context
,
i
)
{
return
ApplicationCard
(
application:
widget
.
pastApplications
[
i
]);
application:
widget
.
pastApplications
[
i
],
isPastApplication:
true
,
);
},
),
],
...
...
This diff is collapsed.
Click to expand it.
lib/widgets/application_card.dart
+
6
−
1
View file @
7773cec0
...
...
@@ -12,9 +12,13 @@ class ApplicationCard extends StatefulWidget {
static
const
route
=
AppUrl
.
homePage
;
final
Application
application
;
final
bool
isUpcomingApplication
;
final
bool
isPastApplication
;
const
ApplicationCard
(
{
Key
?
key
,
required
this
.
application
,
this
.
isUpcomingApplication
=
false
})
{
Key
?
key
,
required
this
.
application
,
this
.
isUpcomingApplication
=
false
,
this
.
isPastApplication
=
false
})
:
super
(
key:
key
);
@override
_ApplicationCardState
createState
()
=
>
_ApplicationCardState
();
...
...
@@ -49,6 +53,7 @@ class _ApplicationCardState extends State<ApplicationCard> {
MaterialPageRoute
(
builder:
(
context
)
=
>
ApplicationDetailsPage
(
application:
widget
.
application
,
isPastApplication:
widget
.
isPastApplication
,
)));
}
},
...
...
This diff is collapsed.
Click to expand it.
lib/widgets/lead_inspector_application_field.dart
+
20
−
20
View file @
7773cec0
...
...
@@ -61,11 +61,11 @@ class _LeadInspectorApplicationFieldState
_data
=
widget
.
fieldData
[
widget
.
fieldData
.
keys
.
elementAt
(
0
)];
// print('Field: ' + _data.toString());
_radioValue
=
_data
[
_data
.
keys
.
elementAt
(
0
)];
_summaryText
=
_data
[
_data
.
keys
.
elementAt
(
1
)];
_radioValue
=
_data
[
_data
.
keys
.
elementAt
(
0
)]
??
""
;
_summaryText
=
_data
[
_data
.
keys
.
elementAt
(
1
)]
??
""
;
try
{
_inspectionValue
=
_data
[
_data
.
keys
.
elementAt
(
2
)];
_attachment
=
_data
[
_data
.
keys
.
elementAt
(
3
)];
_inspectionValue
=
_data
[
_data
.
keys
.
elementAt
(
2
)]
??
""
;
_attachment
=
_data
[
_data
.
keys
.
elementAt
(
3
)]
??
""
;
}
catch
(
_
)
{
return
;
}
...
...
@@ -445,23 +445,23 @@ class _LeadInspectorApplicationFieldState
InkWell
(
onTap:
()
{
// print(_options[i]);
if
(
widget
.
applicationStatus
!=
InspectionStatus
.
inspectionCompleted
)
{
setState
(()
{
_radioValue
=
_options
[
i
];
});
if
(
_options
[
i
]
==
FieldValue
.
inCorrect
)
{
_displayCommentDialog
();
}
Map
data
=
{
'summaryText'
:
_summaryText
,
'inspectionValue'
:
_inspectionValue
};
triggerUpdate
(
data
);
// if (widget.applicationStatus !=
// InspectionStatus
// .inspectionCompleted) {
setState
(()
{
_radioValue
=
_options
[
i
];
});
if
(
_options
[
i
]
==
FieldValue
.
inCorrect
)
{
_displayCommentDialog
();
}
Map
data
=
{
'summaryText'
:
_summaryText
,
'inspectionValue'
:
_inspectionValue
};
triggerUpdate
(
data
);
// }
},
child:
Container
(
padding:
const
EdgeInsets
.
only
(
...
...
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