Updating to visitRequestModal
This commit is contained in:
parent
7cd3431557
commit
00bdbc8b68
|
@ -44,8 +44,8 @@
|
|||
97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
|
||||
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
|
||||
6436409227A31CD500820AF7 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/InfoPlist.strings; sourceTree = "<group>"; };
|
||||
6436409227A31CD300820AF7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
|
||||
6436409D27A31CDB00820AF7 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/InfoPlist.strings; sourceTree = "<group>"; };
|
||||
6436409727A31CDD00820AF7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
|
||||
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
|
@ -225,8 +225,8 @@
|
|||
6436409C27A31CD800820AF7 /* InfoPlist.strings */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
6436409227A31CD500820AF7 /* pt */,
|
||||
6436409227A31CD300820AF7 /* en */,
|
||||
6436409D27A31CDB00820AF7 /* pt */,
|
||||
6436409727A31CDD00820AF7 /* en */,
|
||||
);
|
||||
name = InfoPlist.strings;
|
||||
sourceTree = "<group>";
|
||||
|
|
|
@ -1505,8 +1505,9 @@ class RespondeSolicitacaoCall {
|
|||
String? atividade = '',
|
||||
String? referencia = '',
|
||||
String? tarefa = '',
|
||||
String? idDestino = '',
|
||||
String? resposta = '',
|
||||
String? idVisitante = '',
|
||||
String? cliUUID = '',
|
||||
}) async {
|
||||
final baseUrl = PhpGroup.getBaseUrl();
|
||||
|
||||
|
@ -1520,10 +1521,11 @@ class RespondeSolicitacaoCall {
|
|||
params: {
|
||||
'userUUID': userUUID,
|
||||
'devUUID': devUUID,
|
||||
'cliID': cliUUID,
|
||||
'atividade': atividade,
|
||||
'referencia': referencia,
|
||||
'tarefa': tarefa,
|
||||
'idDestino': idDestino,
|
||||
'resposta': resposta,
|
||||
'idVisitante': idVisitante,
|
||||
},
|
||||
bodyType: BodyType.X_WWW_FORM_URL_ENCODED,
|
||||
|
@ -1535,6 +1537,15 @@ class RespondeSolicitacaoCall {
|
|||
alwaysAllowBody: false,
|
||||
);
|
||||
}
|
||||
|
||||
bool? error(dynamic response) => castToType<bool>(getJsonField(
|
||||
response,
|
||||
r'''$.error''',
|
||||
));
|
||||
String? msg(dynamic response) => castToType<String>(getJsonField(
|
||||
response,
|
||||
r'''$.error_msg''',
|
||||
));
|
||||
}
|
||||
|
||||
/// End PHP Group Code
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import '/backend/api_requests/api_calls.dart';
|
||||
import '/flutter_flow/flutter_flow_util.dart';
|
||||
import 'visit_request_template_component_widget.dart'
|
||||
show VisitRequestTemplateComponentWidget;
|
||||
|
@ -41,4 +42,35 @@ class VisitRequestTemplateComponentModel
|
|||
textFieldFocusNode4?.dispose();
|
||||
textController4?.dispose();
|
||||
}
|
||||
|
||||
/// Action blocks.
|
||||
Future visitRequestComponentAction(
|
||||
BuildContext context, {
|
||||
required String? actionValue,
|
||||
required String? refUUID,
|
||||
required String? responseValue,
|
||||
required String? vteUUID,
|
||||
}) async {
|
||||
ApiCallResponse? visitRequest;
|
||||
|
||||
visitRequest = await PhpGroup.respondeSolicitacaoCall.call(
|
||||
userUUID: FFAppState().userUUID,
|
||||
devUUID: FFAppState().devUUID,
|
||||
cliUUID: FFAppState().cliUUID,
|
||||
atividade: 'respondeSolicitacao',
|
||||
referencia: refUUID,
|
||||
tarefa: actionValue,
|
||||
resposta: responseValue,
|
||||
idVisitante: vteUUID,
|
||||
);
|
||||
|
||||
if (PhpGroup.respondeSolicitacaoCall.error(
|
||||
(visitRequest.jsonBody ?? ''),
|
||||
) ==
|
||||
false) {
|
||||
Navigator.pop(context);
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -390,8 +390,15 @@ class _VisitRequestTemplateComponentWidgetState
|
|||
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||
size: 24.0,
|
||||
),
|
||||
onPressed: () {
|
||||
print('IconButton pressed ...');
|
||||
onPressed: () async {
|
||||
await _model.visitRequestComponentAction(
|
||||
context,
|
||||
actionValue: 'B',
|
||||
refUUID: widget.vawRef,
|
||||
responseValue: _model.textController4.text,
|
||||
vteUUID: widget.vteUUID,
|
||||
);
|
||||
setState(() {});
|
||||
},
|
||||
),
|
||||
FlutterFlowIconButton(
|
||||
|
@ -404,8 +411,15 @@ class _VisitRequestTemplateComponentWidgetState
|
|||
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||
size: 24.0,
|
||||
),
|
||||
onPressed: () {
|
||||
print('IconButton pressed ...');
|
||||
onPressed: () async {
|
||||
await _model.visitRequestComponentAction(
|
||||
context,
|
||||
actionValue: 'L',
|
||||
refUUID: widget.vawRef,
|
||||
responseValue: _model.textController4.text,
|
||||
vteUUID: widget.vteUUID,
|
||||
);
|
||||
setState(() {});
|
||||
},
|
||||
),
|
||||
].divide(const SizedBox(width: 20.0)),
|
||||
|
|
Loading…
Reference in New Issue