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
5db73dec
Commit
5db73dec
authored
3 years ago
by
Shoaib
Browse files
Options
Download
Patches
Plain Diff
Fixed issues in inspection field widget.
parent
baf29e97
master
add-assessor-location
deps-update
two-lead-assessor
No related merge requests found
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
lib/constants/api_endpoints.dart
+2
-0
lib/constants/api_endpoints.dart
lib/constants/app_constants.dart
+2
-0
lib/constants/app_constants.dart
lib/l10n/app_en.arb
+6
-1
lib/l10n/app_en.arb
lib/pages/application_details_page.dart
+5
-0
lib/pages/application_details_page.dart
lib/pages/file_viewer.dart
+84
-0
lib/pages/file_viewer.dart
lib/services/application_service.dart
+29
-3
lib/services/application_service.dart
lib/widgets/assistant_inspector_application_field.dart
+34
-46
lib/widgets/assistant_inspector_application_field.dart
lib/widgets/lead_inspector_application_field.dart
+244
-38
lib/widgets/lead_inspector_application_field.dart
lib/widgets/lead_inspector_dialog.dart
+14
-15
lib/widgets/lead_inspector_dialog.dart
pubspec.lock
+36
-1
pubspec.lock
pubspec.yaml
+2
-0
pubspec.yaml
with
458 additions
and
104 deletions
+458
-104
lib/constants/api_endpoints.dart
+
2
−
0
View file @
5db73dec
...
...
@@ -13,4 +13,6 @@ class ApiUrl {
static
const
submitConcent
=
'
$baseUrl
/api/forms/consentApplication'
;
static
const
submitBulkConcent
=
'
$baseUrl
/api/forms/consentBulkApplication'
;
static
const
getAllForms
=
'
$baseUrl
/api/forms/getAllForms?isDetail=true'
;
static
const
fileUpload
=
'
$baseUrl
/api/forms/fileUpload'
;
static
const
deleteFile
=
'
$baseUrl
/api/forms/deleteCloudFile'
;
}
This diff is collapsed.
Click to expand it.
lib/constants/app_constants.dart
+
2
−
0
View file @
5db73dec
...
...
@@ -14,6 +14,8 @@ class FieldType {
static
const
String
radio
=
"radio"
;
static
const
String
boolean
=
"boolean"
;
static
const
String
file
=
"file"
;
static
const
String
image
=
"image"
;
static
const
String
pdf
=
"pdf"
;
static
const
String
heading
=
'heading'
;
}
...
...
This diff is collapsed.
Click to expand it.
lib/l10n/app_en.arb
+
6
−
1
View file @
5db73dec
...
...
@@ -61,5 +61,10 @@
"invalidResponse"
:
"Invalid response recieved from the server"
,
"takeAPicture"
:
"Take a picture"
,
"goToFiles"
:
"Go to files"
,
"cropImage"
:
"Crop image"
"cropImage"
:
"Crop image"
,
"reasonForIncorrectSelection"
:
"Reason for incorrect selection"
,
"fileViewer"
:
"File viewer"
,
"preview"
:
"Preview"
,
"remove"
:
"Remove"
,
"attachment"
:
"Attachment"
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
lib/pages/application_details_page.dart
+
5
−
0
View file @
5db73dec
...
...
@@ -191,6 +191,11 @@ class _ApplicationDetailsPageState extends State<ApplicationDetailsPage>
?
existingData
[
childKey
]
[
existingData
[
childKey
]
.
keys
.
elementAt
(
0
)]
[
'inspectionValue'
]
:
''
,
'attachment'
:
_isleadInspector
?
existingData
[
childKey
]
[
existingData
[
childKey
]
.
keys
.
elementAt
(
0
)]
[
'attachment'
]
:
''
}
}
...
...
This diff is collapsed.
Click to expand it.
lib/pages/file_viewer.dart
0 → 100644
+
84
−
0
View file @
5db73dec
import
'dart:io'
;
import
'package:flutter/material.dart'
;
import
'package:google_fonts/google_fonts.dart'
;
import
'package:smf_mobile/constants/app_constants.dart'
;
import
'package:smf_mobile/constants/color_constants.dart'
;
import
'package:flutter_gen/gen_l10n/app_localizations.dart'
;
import
'package:webview_flutter/webview_flutter.dart'
;
import
'dart:async'
;
class
FileViewer
extends
StatefulWidget
{
final
String
fileType
;
final
String
fileUrl
;
const
FileViewer
({
Key
?
key
,
required
this
.
fileType
,
required
this
.
fileUrl
})
:
super
(
key:
key
);
@override
_FileViewerState
createState
()
=
>
_FileViewerState
();
}
class
_FileViewerState
extends
State
<
FileViewer
>
{
final
Completer
<
WebViewController
>
_controller
=
Completer
<
WebViewController
>();
late
String
_fileUrl
;
bool
_isLoading
=
true
;
@override
void
initState
()
{
super
.
initState
();
if
(
Platform
.
isAndroid
)
WebView
.
platform
=
AndroidWebView
();
if
(
widget
.
fileType
==
FieldType
.
image
)
{
_fileUrl
=
widget
.
fileUrl
;
}
else
{
_fileUrl
=
'https://docs.google.com/gview?embedded=true&url='
+
widget
.
fileUrl
;
}
// print(widget.fileUrl);
}
@override
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
appBar:
AppBar
(
titleSpacing:
10
,
elevation:
0
,
backgroundColor:
Colors
.
white
,
leading:
const
BackButton
(
color:
AppColors
.
black60
),
title:
Text
(
AppLocalizations
.
of
(
context
)
!.
fileViewer
,
style:
GoogleFonts
.
lato
(
color:
AppColors
.
black87
,
fontSize:
16.0
,
letterSpacing:
0.12
,
fontWeight:
FontWeight
.
w600
,
),
),
// centerTitle: true,
),
// Tab controller
body:
Container
(
color:
AppColors
.
scaffoldBackground
,
height:
MediaQuery
.
of
(
context
)
.
size
.
height
,
child:
Stack
(
children:
<
Widget
>[
Builder
(
builder:
(
BuildContext
context
)
{
return
WebView
(
debuggingEnabled:
true
,
initialUrl:
_fileUrl
,
javascriptMode:
JavascriptMode
.
unrestricted
,
onWebViewCreated:
(
WebViewController
webViewController
)
{
_controller
.
complete
(
webViewController
);
},
onPageFinished:
(
finish
)
{
setState
(()
{
_isLoading
=
false
;
});
},
gestureNavigationEnabled:
true
,
);
}),
_isLoading
?
const
Center
(
child:
CircularProgressIndicator
(),
)
:
Stack
(),
])));
}
}
This diff is collapsed.
Click to expand it.
lib/services/application_service.dart
+
29
−
3
View file @
5db73dec
import
'dart:convert'
;
import
'dart:io'
;
import
'package:dio/dio.dart'
;
import
'package:dio/adapter.dart'
;
import
'package:http/http.dart'
as
http
;
import
'package:smf_mobile/constants/api_endpoints.dart'
;
import
'package:smf_mobile/constants/app_constants.dart'
;
...
...
@@ -26,9 +28,9 @@ class ApplicationService extends BaseService {
final
response
=
await
http
.
post
(
Uri
.
parse
(
ApiUrl
.
submitInspection
),
headers:
headers
,
body:
body
);
developer
.
log
(
ApiUrl
.
submitInspection
);
developer
.
log
(
body
);
developer
.
log
(
response
.
body
);
//
developer.log(ApiUrl.submitInspection);
//
developer.log(body);
//
developer.log(response.body);
return
response
;
}
...
...
@@ -67,4 +69,28 @@ class ApplicationService extends BaseService {
// developer.log(response.body);
return
response
;
}
static
Future
<
dynamic
>
uploadImage
(
filepath
)
async
{
var
dio
=
Dio
();
dio
.
options
.
headers
=
await
BaseService
.
getHeaders
();
var
formData
=
FormData
.
fromMap
({
'files'
:
await
MultipartFile
.
fromFile
(
filepath
,
filename:
filepath
.
split
(
"/"
)
.
last
)
});
final
response
=
await
dio
.
post
(
ApiUrl
.
fileUpload
,
data:
formData
,
);
return
response
.
data
[
'responseData'
][
0
];
}
static
Future
<
dynamic
>
deleteImage
(
List
data
)
async
{
var
body
=
json
.
encode
(
data
);
Map
<
String
,
String
>
headers
=
await
BaseService
.
getHeaders
();
final
response
=
await
http
.
delete
(
Uri
.
parse
(
ApiUrl
.
deleteFile
),
headers:
headers
,
body:
body
);
Map
_data
=
json
.
decode
(
response
.
body
);
return
_data
[
'responseData'
];
}
}
This diff is collapsed.
Click to expand it.
lib/widgets/assistant_inspector_application_field.dart
+
34
−
46
View file @
5db73dec
import
'package:flutter/material.dart'
;
import
'package:google_fonts/google_fonts.dart'
;
import
'package:smf_mobile/constants/app_constants.dart'
;
import
'package:smf_mobile/constants/color_constants.dart'
;
import
'package:flutter_gen/gen_l10n/app_localizations.dart'
;
import
'package:smf_mobile/util/helper.dart'
;
...
...
@@ -26,6 +27,7 @@ class _AssistantInspectorApplicationFieldState
String
_radioValue
=
''
;
String
_inspectionValue
=
''
;
String
_inspectionComment
=
''
;
String
_attachment
=
''
;
String
_noteText
=
''
;
@override
...
...
@@ -35,6 +37,7 @@ class _AssistantInspectorApplicationFieldState
_inspectionComment
=
widget
.
leadInspectorData
[
'comments'
];
_radioValue
=
widget
.
leadInspectorData
[
'value'
];
_inspectionValue
=
widget
.
leadInspectorData
[
'inspectionValue'
];
_attachment
=
widget
.
leadInspectorData
[
'attachment'
];
}
catch
(
_
)
{
return
;
}
...
...
@@ -180,7 +183,8 @@ class _AssistantInspectorApplicationFieldState
),
),
),
_radioValue
==
'incorrect'
_radioValue
.
toLowerCase
()
==
FieldValue
.
inCorrect
.
toLowerCase
()
?
Wrap
(
children:
[
Container
(
width:
...
...
@@ -188,7 +192,8 @@ class _AssistantInspectorApplicationFieldState
padding:
const
EdgeInsets
.
only
(
top:
20
),
child:
Text
(
'Reason for the incorrect selection'
,
AppLocalizations
.
of
(
context
)
!
.
reasonForIncorrectSelection
,
style:
GoogleFonts
.
lato
(
color:
AppColors
.
black60
,
fontWeight:
FontWeight
.
w700
,
...
...
@@ -271,50 +276,33 @@ class _AssistantInspectorApplicationFieldState
),
),
),
// Container(
// width:
// MediaQuery.of(context).size.width,
// padding:
// const EdgeInsets.only(top: 20),
// child: Text(
// "Instiute's comment",
// style: GoogleFonts.lato(
// color: AppColors.black60,
// fontWeight: FontWeight.w700,
// fontSize: 14.0,
// letterSpacing: 0.25,
// ),
// )),
// Container(
// width:
// MediaQuery.of(context).size.width,
// margin:
// const EdgeInsets.only(bottom: 0),
// child: Container(
// padding: const EdgeInsets.fromLTRB(
// 15, 10, 15, 10),
// margin:
// const EdgeInsets.only(top: 10),
// decoration: BoxDecoration(
// color: Colors.white,
// borderRadius:
// const BorderRadius.all(
// Radius.circular(4.0)),
// border: Border.all(
// color: AppColors.black08,
// ),
// ),
// child: Text(
// 'Omne animal, simul atque integre iudicante itaque turbent.',
// style: GoogleFonts.lato(
// color: AppColors.black87,
// fontWeight: FontWeight.w400,
// fontSize: 14.0,
// letterSpacing: 0.25,
// ),
// ),
// ),
// ),
_attachment
!=
''
?
Container
(
width:
MediaQuery
.
of
(
context
)
.
size
.
width
,
margin:
const
EdgeInsets
.
only
(
bottom:
0
),
child:
Container
(
padding:
const
EdgeInsets
.
fromLTRB
(
15
,
10
,
15
,
10
),
margin:
const
EdgeInsets
.
only
(
top:
10
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
const
BorderRadius
.
all
(
Radius
.
circular
(
4.0
)),
border:
Border
.
all
(
color:
AppColors
.
black08
,
),
),
child:
Image
.
network
(
_attachment
),
),
)
:
const
Center
(),
])
:
const
Center
()
],
...
...
This diff is collapsed.
Click to expand it.
lib/widgets/lead_inspector_application_field.dart
+
244
−
38
View file @
5db73dec
...
...
@@ -3,6 +3,9 @@ import 'package:flutter/material.dart';
import
'package:google_fonts/google_fonts.dart'
;
import
'package:smf_mobile/constants/app_constants.dart'
;
import
'package:smf_mobile/constants/color_constants.dart'
;
import
'package:smf_mobile/pages/file_viewer.dart'
;
import
'package:smf_mobile/services/application_service.dart'
;
import
'package:smf_mobile/util/helper.dart'
;
import
'package:smf_mobile/widgets/lead_inspector_dialog.dart'
;
import
'package:flutter_gen/gen_l10n/app_localizations.dart'
;
import
'package:image_picker/image_picker.dart'
;
...
...
@@ -34,11 +37,19 @@ class _LeadInspectorApplicationFieldState
late
Map
_data
;
late
String
_radioValue
;
String
_inspectionValue
=
''
;
String
_attachment
=
''
;
String
_summaryText
=
''
;
final
List
<
String
>
_options
=
[
FieldValue
.
correct
,
FieldValue
.
inCorrect
];
late
File
_selectedFile
;
final
_picker
=
ImagePicker
();
bool
_inProcess
=
false
;
final
List
<
String
>
_imageExtensions
=
[
'apng'
,
'png'
,
'jpg'
,
'jpeg'
,
'avif'
,
'gif'
,
'svg'
];
@override
void
initState
()
{
...
...
@@ -50,6 +61,7 @@ class _LeadInspectorApplicationFieldState
_summaryText
=
_data
[
_data
.
keys
.
elementAt
(
1
)];
try
{
_inspectionValue
=
_data
[
_data
.
keys
.
elementAt
(
2
)];
_attachment
=
_data
[
_data
.
keys
.
elementAt
(
3
)];
}
catch
(
_
)
{
return
;
}
...
...
@@ -69,7 +81,8 @@ class _LeadInspectorApplicationFieldState
widget
.
fieldData
.
keys
.
elementAt
(
0
)
:
{
'value'
:
FieldValue
.
correct
,
'comments'
:
''
,
'inspectionValue'
:
''
'inspectionValue'
:
''
,
'attachment'
:
_attachment
}
}
};
...
...
@@ -79,7 +92,8 @@ class _LeadInspectorApplicationFieldState
widget
.
fieldData
.
keys
.
elementAt
(
0
)
:
{
'value'
:
_radioValue
,
'comments'
:
dialogData
[
'summaryText'
],
'inspectionValue'
:
dialogData
[
'inspectionValue'
]
'inspectionValue'
:
dialogData
[
'inspectionValue'
],
'attachment'
:
_attachment
}
}
};
...
...
@@ -90,7 +104,8 @@ class _LeadInspectorApplicationFieldState
widget
.
fieldData
.
keys
.
elementAt
(
0
)
:
{
'value'
:
_radioValue
,
'comments'
:
dialogData
[
'summaryText'
],
'inspectionValue'
:
dialogData
[
'inspectionValue'
]
'inspectionValue'
:
dialogData
[
'inspectionValue'
],
'attachment'
:
_attachment
}
}
};
...
...
@@ -103,6 +118,24 @@ class _LeadInspectorApplicationFieldState
widget
.
parentAction
(
data
);
}
_triggerAttachmentUpdate
(
String
attachment
)
{
Map
data
=
{
widget
.
fieldName
:
{
widget
.
fieldData
.
keys
.
elementAt
(
0
)
:
{
'value'
:
_radioValue
,
'comments'
:
_summaryText
,
'inspectionValue'
:
_inspectionValue
,
'attachment'
:
attachment
}
}
};
// print(data);
setState
(()
{
_attachment
=
attachment
;
});
widget
.
parentAction
(
data
);
}
Future
_displayCommentDialog
()
{
return
showDialog
(
barrierDismissible:
false
,
...
...
@@ -199,9 +232,7 @@ class _LeadInspectorApplicationFieldState
}
Future
<
dynamic
>
_getImage
(
ImageSource
source
)
async
{
_inProcess
=
true
;
XFile
?
image
=
await
_picker
.
pickImage
(
source
:
source
)
;
if
(
image
!=
null
)
{
try
{
File
?
cropped
=
await
ImageCropper
()
.
cropImage
(
...
...
@@ -218,21 +249,51 @@ class _LeadInspectorApplicationFieldState
statusBarColor:
Colors
.
grey
.
shade900
,
backgroundColor:
Colors
.
white
,
))
;
print
(
cropped
!.
path
);
setState
(()
{
_selectedFile
=
cropped
;
_inProcess
=
false
;
});
String
fileUrl
=
await
ApplicationService
.
uploadImage
(
cropped
!.
path
)
;
_triggerAttachmentUpdate
(
fileUrl
);
}
catch
(
e
)
{
print
(
e
);
// print(e);
return
;
}
}
else
{
}
}
Future
<
void
>
_deleteAttachment
(
String
attachment
)
async
{
List
data
=
[
attachment
];
final
bool
fileDeleted
=
await
ApplicationService
.
deleteImage
(
data
);
if
(
fileDeleted
)
{
Helper
.
toastMessage
(
'Attachment removed'
);
setState
(()
{
_
inProcess
=
false
;
_
attachment
=
''
;
});
}
}
void
_viewFile
(
String
fileUrl
)
{
String
extension
=
fileUrl
.
split
(
'.'
)
.
last
.
toLowerCase
();
if
(
_imageExtensions
.
contains
(
extension
)
||
extension
==
FieldType
.
pdf
)
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=
>
FileViewer
(
fileType:
extension
==
FieldType
.
pdf
?
FieldType
.
pdf
:
FieldType
.
image
,
fileUrl:
fileUrl
,
)),
);
}
else
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=
>
FileViewer
(
fileType:
''
,
fileUrl:
fileUrl
,
)),
);
}
}
@override
Widget
build
(
BuildContext
context
)
{
return
SingleChildScrollView
(
...
...
@@ -275,22 +336,46 @@ class _LeadInspectorApplicationFieldState
),
),
Container
(
margin:
const
EdgeInsets
.
only
(
top:
10
),
padding:
const
EdgeInsets
.
fromLTRB
(
15
,
10
,
15
,
10
),
width:
double
.
infinity
,
decoration:
BoxDecoration
(
border:
Border
.
all
(
color:
AppColors
.
black16
),
),
child:
Text
(
widget
.
fieldData
.
keys
.
elementAt
(
0
),
style:
GoogleFonts
.
lato
(
color:
AppColors
.
black87
,
fontSize:
14.0
,
letterSpacing:
0.25
,
fontWeight:
FontWeight
.
w400
,
margin:
const
EdgeInsets
.
only
(
top:
10
),
padding:
widget
.
fieldType
==
FieldType
.
file
?
const
EdgeInsets
.
fromLTRB
(
10
,
10
,
10
,
10
)
:
const
EdgeInsets
.
fromLTRB
(
15
,
10
,
15
,
10
),
width:
double
.
infinity
,
decoration:
BoxDecoration
(
border:
Border
.
all
(
color:
AppColors
.
black16
),
),
),
)
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
widget
.
fieldData
.
keys
.
elementAt
(
0
),
style:
GoogleFonts
.
lato
(
color:
AppColors
.
black87
,
fontSize:
14.0
,
letterSpacing:
0.25
,
fontWeight:
FontWeight
.
w400
,
),
),
widget
.
fieldType
==
FieldType
.
file
?
InkWell
(
onTap:
()
=
>
_viewFile
(
widget
.
fieldData
.
keys
.
elementAt
(
0
)),
child:
Padding
(
padding:
const
EdgeInsets
.
only
(
top:
10
),
child:
Text
(
AppLocalizations
.
of
(
context
)
!
.
preview
,
style:
GoogleFonts
.
lato
(
color:
AppColors
.
primaryBlue
,
fontSize:
14.0
,
letterSpacing:
0.25
,
fontWeight:
FontWeight
.
w700
,
),
)))
:
const
Center
(),
],
))
],
),
),
...
...
@@ -457,13 +542,13 @@ class _LeadInspectorApplicationFieldState
padding:
const
EdgeInsets
.
only
(
left:
0
),
child:
IconButton
(
onPressed:
()
{
//
if (widget.applicationStatus !=
//
InspectionStatus
//
.inspectionCompleted &&
//
_radioValue !=
//
FieldValue.correct) {
_photoOptions
(
context
);
//
}
if
(
widget
.
applicationStatus
!=
InspectionStatus
.
inspectionCompleted
&&
_radioValue
!=
FieldValue
.
correct
)
{
_photoOptions
(
context
);
}
},
icon:
_radioValue
!=
FieldValue
.
correct
...
...
@@ -479,6 +564,22 @@ class _LeadInspectorApplicationFieldState
)
],
)),
_radioValue
!=
FieldValue
.
correct
&&
_summaryText
!=
''
?
Container
(
width:
MediaQuery
.
of
(
context
)
.
size
.
width
,
padding:
const
EdgeInsets
.
only
(
top:
20
),
child:
Text
(
AppLocalizations
.
of
(
context
)
!
.
reasonForIncorrectSelection
,
style:
GoogleFonts
.
lato
(
color:
AppColors
.
black60
,
fontWeight:
FontWeight
.
w700
,
fontSize:
14.0
,
letterSpacing:
0.25
,
),
))
:
const
Center
(),
_radioValue
!=
FieldValue
.
correct
&&
_summaryText
!=
''
?
Container
(
...
...
@@ -509,7 +610,8 @@ class _LeadInspectorApplicationFieldState
width:
MediaQuery
.
of
(
context
)
.
size
.
width
,
padding:
const
EdgeInsets
.
only
(
top:
20
),
child:
Text
(
widget
.
fieldName
,
AppLocalizations
.
of
(
context
)
!
.
actualValue
,
style:
GoogleFonts
.
lato
(
color:
AppColors
.
black60
,
fontWeight:
FontWeight
.
w700
,
...
...
@@ -542,6 +644,110 @@ class _LeadInspectorApplicationFieldState
),
)
:
const
Center
(),
_radioValue
!=
FieldValue
.
correct
&&
_attachment
!=
''
?
Container
(
width:
MediaQuery
.
of
(
context
)
.
size
.
width
,
padding:
const
EdgeInsets
.
only
(
top:
20
),
child:
Text
(
AppLocalizations
.
of
(
context
)
!
.
attachment
,
style:
GoogleFonts
.
lato
(
color:
AppColors
.
black60
,
fontWeight:
FontWeight
.
w700
,
fontSize:
14.0
,
letterSpacing:
0.25
,
),
))
:
const
Center
(),
_radioValue
!=
FieldValue
.
correct
&&
_attachment
!=
''
?
Container
(
margin:
const
EdgeInsets
.
only
(
top:
10
,
),
padding:
const
EdgeInsets
.
fromLTRB
(
10
,
10
,
10
,
10
),
width:
double
.
infinity
,
decoration:
BoxDecoration
(
color:
Colors
.
white
,
border:
Border
.
all
(
color:
AppColors
.
black16
),
borderRadius:
BorderRadius
.
circular
(
4
),
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
_attachment
,
style:
GoogleFonts
.
lato
(
color:
AppColors
.
black87
,
fontSize:
14.0
,
letterSpacing:
0.25
,
fontWeight:
FontWeight
.
w400
,
),
),
Row
(
children:
[
InkWell
(
onTap:
()
=
>
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=
>
FileViewer
(
fileType:
FieldType
.
image
,
fileUrl:
_attachment
,
))),
child:
Padding
(
padding:
const
EdgeInsets
.
only
(
top:
10
),
child:
Text
(
AppLocalizations
.
of
(
context
)
!
.
preview
,
style:
GoogleFonts
.
lato
(
color:
AppColors
.
primaryBlue
,
fontSize:
14.0
,
letterSpacing:
0.25
,
fontWeight:
FontWeight
.
w700
,
),
))),
const
Spacer
(),
InkWell
(
onTap:
()
=
>
_deleteAttachment
(
_attachment
),
child:
Padding
(
padding:
const
EdgeInsets
.
only
(
top:
10
),
child:
Text
(
AppLocalizations
.
of
(
context
)
!
.
remove
,
style:
GoogleFonts
.
lato
(
color:
AppColors
.
sentForIns
,
fontSize:
14.0
,
letterSpacing:
0.25
,
fontWeight:
FontWeight
.
w700
,
),
))),
],
),
]))
:
const
Center
(),
],
))),
])));
...
...
This diff is collapsed.
Click to expand it.
lib/widgets/lead_inspector_dialog.dart
+
14
−
15
View file @
5db73dec
...
...
@@ -67,7 +67,7 @@ class _LeadInspectorDialogState extends State<LeadInspectorDialog> {
Helper
.
toastMessage
(
'Please enter reason'
);
return
;
}
if
(
_inspectionValue
==
''
&&
widget
.
fieldType
!=
FieldType
.
file
)
{
if
(
_inspectionValue
==
''
)
{
Helper
.
toastMessage
(
'Please enter actual value'
);
return
;
}
...
...
@@ -157,24 +157,23 @@ class _LeadInspectorDialogState extends State<LeadInspectorDialog> {
),
),
),
widget
.
fieldType
!=
FieldType
.
file
?
Padding
(
padding:
const
EdgeInsets
.
only
(
top:
20
),
child:
Text
(
'Actual value(s)'
,
style:
GoogleFonts
.
lato
(
color:
AppColors
.
black87
,
fontWeight:
FontWeight
.
w700
,
fontSize:
14
,
letterSpacing:
0.25
,
),
))
:
const
Center
(),
Padding
(
padding:
const
EdgeInsets
.
only
(
top:
20
),
child:
Text
(
'Actual value(s)'
,
style:
GoogleFonts
.
lato
(
color:
AppColors
.
black87
,
fontWeight:
FontWeight
.
w700
,
fontSize:
14
,
letterSpacing:
0.25
,
),
)),
widget
.
fieldType
==
FieldType
.
text
||
widget
.
fieldType
==
FieldType
.
numeric
||
widget
.
fieldType
==
FieldType
.
email
||
widget
.
fieldType
==
FieldType
.
date
||
widget
.
fieldType
==
FieldType
.
textarea
widget
.
fieldType
==
FieldType
.
textarea
||
widget
.
fieldType
==
FieldType
.
file
?
TextQuestion
(
fieldType:
widget
.
fieldType
,
answerGiven:
widget
.
inspectionValue
,
...
...
This diff is collapsed.
Click to expand it.
pubspec.lock
+
36
−
1
View file @
5db73dec
...
...
@@ -141,6 +141,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.7.1"
dio:
dependency: "direct main"
description:
name: dio
url: "https://pub.dartlang.org"
source: hosted
version: "4.0.4"
email_validator:
dependency: "direct main"
description:
...
...
@@ -461,7 +468,7 @@ packages:
name: path_provider
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.
8
"
version: "2.0.
9
"
path_provider_android:
dependency: transitive
description:
...
...
@@ -635,6 +642,34 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
webview_flutter:
dependency: "direct main"
description:
name: webview_flutter
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.1"
webview_flutter_android:
dependency: transitive
description:
name: webview_flutter_android
url: "https://pub.dartlang.org"
source: hosted
version: "2.8.3"
webview_flutter_platform_interface:
dependency: transitive
description:
name: webview_flutter_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.1"
webview_flutter_wkwebview:
dependency: transitive
description:
name: webview_flutter_wkwebview
url: "https://pub.dartlang.org"
source: hosted
version: "2.7.1"
win32:
dependency: transitive
description:
...
...
This diff is collapsed.
Click to expand it.
pubspec.yaml
+
2
−
0
View file @
5db73dec
...
...
@@ -54,6 +54,8 @@ dependencies:
email_validator
:
^2.0.1
image_picker
:
^0.8.4+11
image_cropper
:
^1.5.0
dio
:
^4.0.4
webview_flutter
:
^3.0.1
dev_dependencies
:
flutter_test
:
...
...
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