Updating to latest

This commit is contained in:
FlutterFlow 2024-06-20 14:12:16 +00:00
parent 5f860daabd
commit 7cd3431557
20 changed files with 964 additions and 881 deletions

View File

@ -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>"; };
6436409E27A31CD500820AF7 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/InfoPlist.strings; sourceTree = "<group>"; };
6436409A27A31CD000820AF7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; 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>"; };
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 = (
6436409E27A31CD500820AF7 /* pt */,
6436409A27A31CD000820AF7 /* en */,
6436409227A31CD500820AF7 /* pt */,
6436409227A31CD300820AF7 /* en */,
);
name = InfoPlist.strings;
sourceTree = "<group>";

View File

@ -112,6 +112,7 @@ Future singInActionApp(
false,
),
);
if (PhpGroup.loginCall.error(
(loginCall.jsonBody ?? ''),
) ==
@ -215,6 +216,7 @@ Future<bool> signUpActionApp(
false,
),
);
if (PhpGroup.registerCall.error(
(registerCall.jsonBody ?? ''),
) ==
@ -267,6 +269,7 @@ Future forgotPasswdAction(
forgotPasswd = await PhpGroup.forgotPasswordCall.call(
email: email,
);
if (PhpGroup.forgotPasswordCall.error(
(forgotPasswd.jsonBody ?? ''),
) ==

View File

@ -31,6 +31,8 @@ class PhpGroup {
static GetVisitsCall getVisitsCall = GetVisitsCall();
static DeleteVisitCall deleteVisitCall = DeleteVisitCall();
static GetPessoasLocalCall getPessoasLocalCall = GetPessoasLocalCall();
static RespondeSolicitacaoCall respondeSolicitacaoCall =
RespondeSolicitacaoCall();
}
class LoginCall {
@ -62,6 +64,7 @@ class LoginCall {
encodeBodyUtf8: false,
decodeUtf8: false,
cache: false,
isStreamingApi: false,
alwaysAllowBody: false,
);
}
@ -146,6 +149,7 @@ class RegisterCall {
encodeBodyUtf8: false,
decodeUtf8: false,
cache: false,
isStreamingApi: false,
alwaysAllowBody: false,
);
}
@ -201,6 +205,7 @@ class ForgotPasswordCall {
encodeBodyUtf8: false,
decodeUtf8: false,
cache: false,
isStreamingApi: false,
alwaysAllowBody: false,
);
}
@ -238,6 +243,7 @@ class GetLocalsCall {
encodeBodyUtf8: false,
decodeUtf8: false,
cache: false,
isStreamingApi: false,
alwaysAllowBody: false,
);
}
@ -324,6 +330,7 @@ class PostScheduleVisitorCall {
encodeBodyUtf8: false,
decodeUtf8: false,
cache: false,
isStreamingApi: false,
alwaysAllowBody: false,
);
}
@ -381,6 +388,7 @@ class PostScheduleVisitCall {
encodeBodyUtf8: false,
decodeUtf8: false,
cache: false,
isStreamingApi: false,
alwaysAllowBody: false,
);
}
@ -438,6 +446,7 @@ class DebugCallCall {
encodeBodyUtf8: false,
decodeUtf8: false,
cache: false,
isStreamingApi: false,
alwaysAllowBody: false,
);
}
@ -485,6 +494,7 @@ class GetScheduleVisitCall {
encodeBodyUtf8: false,
decodeUtf8: false,
cache: false,
isStreamingApi: false,
alwaysAllowBody: false,
);
}
@ -755,6 +765,7 @@ class GetDadosCall {
encodeBodyUtf8: false,
decodeUtf8: false,
cache: false,
isStreamingApi: false,
alwaysAllowBody: false,
);
}
@ -997,6 +1008,7 @@ class GetVisitorByDocCall {
encodeBodyUtf8: false,
decodeUtf8: false,
cache: false,
isStreamingApi: false,
alwaysAllowBody: false,
);
}
@ -1066,6 +1078,7 @@ class GetFotoVisitanteCall {
encodeBodyUtf8: false,
decodeUtf8: false,
cache: false,
isStreamingApi: false,
alwaysAllowBody: false,
);
}
@ -1106,6 +1119,7 @@ class PostProvVisitSchedulingCall {
encodeBodyUtf8: false,
decodeUtf8: false,
cache: false,
isStreamingApi: false,
alwaysAllowBody: false,
);
}
@ -1147,6 +1161,7 @@ class GetVisitsCall {
encodeBodyUtf8: false,
decodeUtf8: false,
cache: false,
isStreamingApi: false,
alwaysAllowBody: false,
);
}
@ -1407,6 +1422,7 @@ class DeleteVisitCall {
encodeBodyUtf8: false,
decodeUtf8: false,
cache: false,
isStreamingApi: false,
alwaysAllowBody: false,
);
}
@ -1448,6 +1464,7 @@ class GetPessoasLocalCall {
encodeBodyUtf8: false,
decodeUtf8: false,
cache: false,
isStreamingApi: false,
alwaysAllowBody: false,
);
}
@ -1481,6 +1498,45 @@ class GetPessoasLocalCall {
.toList();
}
class RespondeSolicitacaoCall {
Future<ApiCallResponse> call({
String? userUUID = '',
String? devUUID = '',
String? atividade = '',
String? referencia = '',
String? tarefa = '',
String? idDestino = '',
String? idVisitante = '',
}) async {
final baseUrl = PhpGroup.getBaseUrl();
return ApiManager.instance.makeApiCall(
callName: 'respondeSolicitacao',
apiUrl: '$baseUrl/processRequest.php',
callType: ApiCallType.POST,
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
params: {
'userUUID': userUUID,
'devUUID': devUUID,
'atividade': atividade,
'referencia': referencia,
'tarefa': tarefa,
'idDestino': idDestino,
'idVisitante': idVisitante,
},
bodyType: BodyType.X_WWW_FORM_URL_ENCODED,
returnBody: true,
encodeBodyUtf8: false,
decodeUtf8: false,
cache: false,
isStreamingApi: false,
alwaysAllowBody: false,
);
}
}
/// End PHP Group Code
class ApiPagingParams {

View File

@ -13,6 +13,8 @@ import 'package:mime_type/mime_type.dart';
import '/flutter_flow/uploaded_file.dart';
import 'get_streamed_response.dart';
enum ApiCallType {
GET,
POST,
@ -43,6 +45,7 @@ class ApiCallOptions extends Equatable {
this.decodeUtf8 = false,
this.alwaysAllowBody = false,
this.cache = false,
this.isStreamingApi = false,
});
final String callName;
@ -57,6 +60,7 @@ class ApiCallOptions extends Equatable {
final bool decodeUtf8;
final bool alwaysAllowBody;
final bool cache;
final bool isStreamingApi;
ApiCallOptions clone() => ApiCallOptions(
callName: callName,
@ -71,6 +75,7 @@ class ApiCallOptions extends Equatable {
decodeUtf8: decodeUtf8,
alwaysAllowBody: alwaysAllowBody,
cache: cache,
isStreamingApi: isStreamingApi,
);
@override
@ -87,6 +92,7 @@ class ApiCallOptions extends Equatable {
decodeUtf8,
alwaysAllowBody,
cache,
isStreamingApi,
];
static Map<String, dynamic> _cloneMap(Map<String, dynamic> map) {
@ -104,12 +110,14 @@ class ApiCallResponse {
this.headers,
this.statusCode, {
this.response,
this.streamedResponse,
this.exception,
});
final dynamic jsonBody;
final Map<String, String> headers;
final int statusCode;
final http.Response? response;
final http.StreamedResponse? streamedResponse;
final Object? exception;
// Whether we received a 2xx status (which generally marks success).
bool get succeeded => statusCode >= 200 && statusCode < 300;
@ -183,7 +191,8 @@ class ApiManager {
Map<String, dynamic> headers,
Map<String, dynamic> params,
bool returnBody,
bool decodeUtf8, {
bool decodeUtf8,
bool isStreamingApi, {
http.Client? client,
}) async {
if (params.isNotEmpty) {
@ -191,6 +200,19 @@ class ApiManager {
Uri.parse(apiUrl).queryParameters.isNotEmpty ? '&' : '?';
apiUrl = '$apiUrl$specifier${asQueryParams(params)}';
}
if (isStreamingApi) {
client ??= http.Client();
final request =
http.Request(callType.toString().split('.').last, Uri.parse(apiUrl))
..headers.addAll(toStringMap(headers));
final streamedResponse = await getStreamedResponse(request);
return ApiCallResponse(
null,
streamedResponse.headers,
streamedResponse.statusCode,
streamedResponse: streamedResponse,
);
}
final makeRequest = callType == ApiCallType.GET
? (client != null ? client.get : http.get)
: (client != null ? client.delete : http.delete);
@ -209,7 +231,8 @@ class ApiManager {
bool returnBody,
bool encodeBodyUtf8,
bool decodeUtf8,
bool alwaysAllowBody, {
bool alwaysAllowBody,
bool isStreamingApi, {
http.Client? client,
}) async {
assert(
@ -219,6 +242,20 @@ class ApiManager {
);
final postBody =
createBody(headers, params, body, bodyType, encodeBodyUtf8);
if (isStreamingApi) {
client ??= http.Client();
final request =
http.Request(type.toString().split('.').last, Uri.parse(apiUrl))
..headers.addAll(toStringMap(headers));
request.body = postBody;
final streamedResponse = await getStreamedResponse(request);
return ApiCallResponse(
null,
streamedResponse.headers,
streamedResponse.statusCode,
streamedResponse: streamedResponse,
);
}
if (bodyType == BodyType.MULTIPART) {
return multipartRequest(type, apiUrl, headers, params, returnBody,
@ -352,6 +389,7 @@ class ApiManager {
decodeUtf8: options.decodeUtf8,
alwaysAllowBody: options.alwaysAllowBody,
cache: options.cache,
isStreamingApi: options.isStreamingApi,
options: options,
);
@ -368,6 +406,7 @@ class ApiManager {
bool decodeUtf8 = false,
bool alwaysAllowBody = false,
bool cache = false,
bool isStreamingApi = false,
ApiCallOptions? options,
http.Client? client,
}) async {
@ -385,6 +424,7 @@ class ApiManager {
decodeUtf8: decodeUtf8,
alwaysAllowBody: alwaysAllowBody,
cache: cache,
isStreamingApi: isStreamingApi,
);
// Modify for your specific needs if this differs from your API.
if (_accessToken != null) {
@ -411,6 +451,7 @@ class ApiManager {
params,
returnBody,
decodeUtf8,
isStreamingApi,
client: client,
);
break;
@ -427,6 +468,7 @@ class ApiManager {
encodeBodyUtf8,
decodeUtf8,
alwaysAllowBody,
isStreamingApi,
client: client,
)
: await urlRequest(
@ -436,6 +478,7 @@ class ApiManager {
params,
returnBody,
decodeUtf8,
isStreamingApi,
client: client,
);
break;
@ -453,6 +496,7 @@ class ApiManager {
encodeBodyUtf8,
decodeUtf8,
alwaysAllowBody,
isStreamingApi,
client: client,
);
break;

View File

@ -0,0 +1,4 @@
import 'package:http/http.dart';
Future<StreamedResponse> getStreamedResponse(Request request) =>
Client().send(request);

View File

@ -77,11 +77,3 @@ List<Color>? getColorsList(dynamic value) =>
List<T>? getDataList<T>(dynamic value) =>
value is! List ? null : value.map((e) => castToType<T>(e)!).toList();
extension MapDataExtensions on Map<String, dynamic> {
Map<String, dynamic> get withoutNulls => Map.fromEntries(
entries
.where((e) => e.value != null)
.map((e) => MapEntry(e.key, e.value!)),
);
}

View File

@ -65,59 +65,84 @@ class _ThrowExceptionWidgetState extends State<ThrowExceptionWidget>
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Stack(
children: [
Align(
alignment: const AlignmentDirectional(0.0, 0.0),
child: Icon(
Icons.circle_outlined,
color: FlutterFlowTheme.of(context).error,
size: 200.0,
Padding(
padding: const EdgeInsetsDirectional.fromSTEB(10.0, 0.0, 10.0, 0.0),
child: Container(
height: 400.0,
decoration: BoxDecoration(
color: FlutterFlowTheme.of(context).primaryBackground,
borderRadius: const BorderRadius.only(
bottomLeft: Radius.circular(10.0),
bottomRight: Radius.circular(10.0),
topLeft: Radius.circular(10.0),
topRight: Radius.circular(10.0),
),
),
Align(
alignment: const AlignmentDirectional(0.0, 0.0),
child: Icon(
Icons.close_outlined,
color: FlutterFlowTheme.of(context).error,
size: 200.0,
),
),
],
).animateOnPageLoad(animationsMap['stackOnPageLoadAnimation']!),
Column(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
FFLocalizations.of(context).getText(
'e58xxxiq' /* ERRO */,
),
style: FlutterFlowTheme.of(context).bodyMedium.override(
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
fontSize: 20.0,
letterSpacing: 0.0,
fontWeight: FontWeight.bold,
useGoogleFonts: GoogleFonts.asMap().containsKey(
FlutterFlowTheme.of(context).bodyMediumFamily),
),
),
Padding(
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 0.0),
child: Text(
valueOrDefault<String>(
widget.msg,
'Message Not Found',
),
style: FlutterFlowTheme.of(context).bodyMedium.override(
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap().containsKey(
FlutterFlowTheme.of(context).bodyMediumFamily),
child: Column(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Stack(
children: [
Align(
alignment: const AlignmentDirectional(0.0, 0.0),
child: Icon(
Icons.circle_outlined,
color: FlutterFlowTheme.of(context).error,
size: 200.0,
),
),
),
Align(
alignment: const AlignmentDirectional(0.0, 0.0),
child: Icon(
Icons.close_outlined,
color: FlutterFlowTheme.of(context).error,
size: 200.0,
),
),
],
).animateOnPageLoad(animationsMap['stackOnPageLoadAnimation']!),
Column(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
FFLocalizations.of(context).getText(
'e58xxxiq' /* ERRO */,
),
style: FlutterFlowTheme.of(context).bodyMedium.override(
fontFamily:
FlutterFlowTheme.of(context).bodyMediumFamily,
fontSize: 20.0,
letterSpacing: 0.0,
fontWeight: FontWeight.bold,
useGoogleFonts: GoogleFonts.asMap().containsKey(
FlutterFlowTheme.of(context).bodyMediumFamily),
),
),
Padding(
padding:
const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 0.0),
child: Text(
valueOrDefault<String>(
widget.msg,
'Message Not Found',
),
style: FlutterFlowTheme.of(context).bodyMedium.override(
fontFamily:
FlutterFlowTheme.of(context).bodyMediumFamily,
letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap().containsKey(
FlutterFlowTheme.of(context)
.bodyMediumFamily),
),
),
),
].addToStart(const SizedBox(height: 50.0)),
),
],
),
].addToStart(const SizedBox(height: 50.0)),
),
),
],
);

View File

@ -933,6 +933,7 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
obs: widget.visitObsStr,
cliID: FFAppState().cliUUID,
);
if (PhpGroup.postScheduleVisitCall.error(
(_model.postScheduleVisit?.jsonBody ?? ''),
) ==

View File

@ -793,6 +793,7 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
atividade: 'cancelaVisita',
idVisita: widget.visitIdStr,
);
if (PhpGroup.deleteVisitCall.error(
(_model.deleteVisit?.jsonBody ?? ''),
) ==

View File

@ -242,6 +242,7 @@ class _ForgotPasswordTemplateComponentWidgetState
_model.req = await PhpGroup.forgotPasswordCall.call(
email: _model.emailAddressTextController.text,
);
shouldSetState = true;
if (PhpGroup.forgotPasswordCall.error(
(_model.req?.jsonBody ?? ''),

View File

@ -722,6 +722,7 @@ class _RegisiterVistorTemplateComponentWidgetState
: 'P',
foto: 'base64;jpeg,klajsalkjslkajslkajl',
);
if (PhpGroup.postScheduleVisitorCall.error(
(_model.registerVisitor?.jsonBody ?? ''),
) ==

View File

@ -11,16 +11,30 @@ export 'visit_request_template_component_model.dart';
class VisitRequestTemplateComponentWidget extends StatefulWidget {
const VisitRequestTemplateComponentWidget({
super.key,
required this.name,
required this.reason,
required this.message,
required this.document,
required this.vteName,
required this.vteReason,
required this.vteMsg,
required this.vteDocument,
required this.cliUUID,
required this.vteUUID,
required this.vawName,
required this.msgUUID,
required this.vawRef,
required this.vawUUID,
required this.vawDestino,
});
final String? name;
final String? reason;
final String? message;
final String? document;
final String? vteName;
final String? vteReason;
final String? vteMsg;
final String? vteDocument;
final String? cliUUID;
final String? vteUUID;
final String? vawName;
final String? msgUUID;
final String? vawRef;
final String? vawUUID;
final String? vawDestino;
@override
State<VisitRequestTemplateComponentWidget> createState() =>
@ -42,13 +56,13 @@ class _VisitRequestTemplateComponentWidgetState
super.initState();
_model = createModel(context, () => VisitRequestTemplateComponentModel());
_model.textController1 ??= TextEditingController(text: widget.name);
_model.textController1 ??= TextEditingController(text: widget.vteName);
_model.textFieldFocusNode1 ??= FocusNode();
_model.textController2 ??= TextEditingController(text: widget.reason);
_model.textController2 ??= TextEditingController(text: widget.vteReason);
_model.textFieldFocusNode2 ??= FocusNode();
_model.textController3 ??= TextEditingController(text: widget.message);
_model.textController3 ??= TextEditingController(text: widget.vteMsg);
_model.textFieldFocusNode3 ??= FocusNode();
_model.textController4 ??= TextEditingController();
@ -71,6 +85,7 @@ class _VisitRequestTemplateComponentWidgetState
child: Padding(
padding: const EdgeInsetsDirectional.fromSTEB(10.0, 0.0, 10.0, 0.0),
child: Container(
width: MediaQuery.sizeOf(context).width * 0.9,
decoration: BoxDecoration(
color: FlutterFlowTheme.of(context).primaryBackground,
borderRadius: const BorderRadius.only(
@ -90,17 +105,17 @@ class _VisitRequestTemplateComponentWidgetState
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
width: 200.0,
height: 200.0,
width: 150.0,
height: 150.0,
clipBehavior: Clip.antiAlias,
decoration: const BoxDecoration(
shape: BoxShape.circle,
),
child: CachedNetworkImage(
fadeInDuration: const Duration(milliseconds: 500),
fadeOutDuration: const Duration(milliseconds: 500),
fadeInDuration: const Duration(milliseconds: 100),
fadeOutDuration: const Duration(milliseconds: 100),
imageUrl: valueOrDefault<String>(
'https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${widget.document}&tipo=E',
'https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${widget.vteDocument}&tipo=E',
'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg',
),
fit: BoxFit.cover,
@ -120,6 +135,7 @@ class _VisitRequestTemplateComponentWidgetState
readOnly: true,
obscureText: false,
decoration: InputDecoration(
isDense: true,
labelText: FFLocalizations.of(context).getText(
'ivfw4j04' /* Nome */,
),
@ -143,34 +159,10 @@ class _VisitRequestTemplateComponentWidgetState
useGoogleFonts: GoogleFonts.asMap().containsKey(
FlutterFlowTheme.of(context).labelMediumFamily),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
color: FlutterFlowTheme.of(context).accent1,
width: 0.5,
),
borderRadius: BorderRadius.circular(10.0),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
color: FlutterFlowTheme.of(context).primary,
width: 0.5,
),
borderRadius: BorderRadius.circular(10.0),
),
errorBorder: OutlineInputBorder(
borderSide: BorderSide(
color: FlutterFlowTheme.of(context).error,
width: 0.5,
),
borderRadius: BorderRadius.circular(10.0),
),
focusedErrorBorder: OutlineInputBorder(
borderSide: BorderSide(
color: FlutterFlowTheme.of(context).error,
width: 0.5,
),
borderRadius: BorderRadius.circular(10.0),
),
enabledBorder: InputBorder.none,
focusedBorder: InputBorder.none,
errorBorder: InputBorder.none,
focusedErrorBorder: InputBorder.none,
suffixIcon: Icon(
Icons.person,
color: FlutterFlowTheme.of(context).accent1,
@ -184,6 +176,7 @@ class _VisitRequestTemplateComponentWidgetState
useGoogleFonts: GoogleFonts.asMap().containsKey(
FlutterFlowTheme.of(context).bodyMediumFamily),
),
textAlign: TextAlign.start,
maxLines: null,
keyboardType: TextInputType.name,
validator:
@ -200,6 +193,7 @@ class _VisitRequestTemplateComponentWidgetState
readOnly: true,
obscureText: false,
decoration: InputDecoration(
isDense: true,
labelText: FFLocalizations.of(context).getText(
'ndzkqehm' /* Motivo */,
),
@ -223,34 +217,10 @@ class _VisitRequestTemplateComponentWidgetState
useGoogleFonts: GoogleFonts.asMap().containsKey(
FlutterFlowTheme.of(context).labelMediumFamily),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
color: FlutterFlowTheme.of(context).accent1,
width: 0.5,
),
borderRadius: BorderRadius.circular(10.0),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
color: FlutterFlowTheme.of(context).primary,
width: 0.5,
),
borderRadius: BorderRadius.circular(10.0),
),
errorBorder: OutlineInputBorder(
borderSide: BorderSide(
color: FlutterFlowTheme.of(context).error,
width: 0.5,
),
borderRadius: BorderRadius.circular(10.0),
),
focusedErrorBorder: OutlineInputBorder(
borderSide: BorderSide(
color: FlutterFlowTheme.of(context).error,
width: 0.5,
),
borderRadius: BorderRadius.circular(10.0),
),
enabledBorder: InputBorder.none,
focusedBorder: InputBorder.none,
errorBorder: InputBorder.none,
focusedErrorBorder: InputBorder.none,
suffixIcon: Icon(
Icons.history_edu,
color: FlutterFlowTheme.of(context).accent1,
@ -264,6 +234,7 @@ class _VisitRequestTemplateComponentWidgetState
useGoogleFonts: GoogleFonts.asMap().containsKey(
FlutterFlowTheme.of(context).bodyMediumFamily),
),
textAlign: TextAlign.start,
maxLines: null,
keyboardType: TextInputType.name,
validator:
@ -281,6 +252,7 @@ class _VisitRequestTemplateComponentWidgetState
readOnly: true,
obscureText: false,
decoration: InputDecoration(
isDense: true,
labelText: FFLocalizations.of(context).getText(
'kt87omsz' /* Mensagem */,
),
@ -303,34 +275,10 @@ class _VisitRequestTemplateComponentWidgetState
useGoogleFonts: GoogleFonts.asMap().containsKey(
FlutterFlowTheme.of(context).labelMediumFamily),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
color: FlutterFlowTheme.of(context).accent1,
width: 0.5,
),
borderRadius: BorderRadius.circular(10.0),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
color: FlutterFlowTheme.of(context).primary,
width: 0.5,
),
borderRadius: BorderRadius.circular(10.0),
),
errorBorder: OutlineInputBorder(
borderSide: BorderSide(
color: FlutterFlowTheme.of(context).error,
width: 0.5,
),
borderRadius: BorderRadius.circular(10.0),
),
focusedErrorBorder: OutlineInputBorder(
borderSide: BorderSide(
color: FlutterFlowTheme.of(context).error,
width: 0.5,
),
borderRadius: BorderRadius.circular(10.0),
),
enabledBorder: InputBorder.none,
focusedBorder: InputBorder.none,
errorBorder: InputBorder.none,
focusedErrorBorder: InputBorder.none,
suffixIcon: Icon(
Icons.message,
color: FlutterFlowTheme.of(context).accent1,
@ -344,12 +292,14 @@ class _VisitRequestTemplateComponentWidgetState
useGoogleFonts: GoogleFonts.asMap().containsKey(
FlutterFlowTheme.of(context).bodyMediumFamily),
),
textAlign: TextAlign.start,
validator:
_model.textController3Validator.asValidator(context),
),
),
Padding(
padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0),
padding:
const EdgeInsetsDirectional.fromSTEB(24.0, 20.0, 24.0, 20.0),
child: TextFormField(
controller: _model.textController4,
focusNode: _model.textFieldFocusNode4,
@ -357,6 +307,7 @@ class _VisitRequestTemplateComponentWidgetState
textInputAction: TextInputAction.next,
obscureText: false,
decoration: InputDecoration(
isDense: true,
labelText: FFLocalizations.of(context).getText(
'ssz899es' /* Pergunta */,
),
@ -433,9 +384,9 @@ class _VisitRequestTemplateComponentWidgetState
borderRadius: 20.0,
borderWidth: 1.0,
buttonSize: 40.0,
fillColor: FlutterFlowTheme.of(context).success,
fillColor: FlutterFlowTheme.of(context).error,
icon: Icon(
Icons.done,
Icons.close,
color: FlutterFlowTheme.of(context).primaryBackground,
size: 24.0,
),
@ -447,9 +398,9 @@ class _VisitRequestTemplateComponentWidgetState
borderRadius: 20.0,
borderWidth: 1.0,
buttonSize: 40.0,
fillColor: FlutterFlowTheme.of(context).error,
fillColor: FlutterFlowTheme.of(context).success,
icon: Icon(
Icons.close,
Icons.done,
color: FlutterFlowTheme.of(context).primaryBackground,
size: 24.0,
),
@ -460,7 +411,7 @@ class _VisitRequestTemplateComponentWidgetState
].divide(const SizedBox(width: 20.0)),
),
]
.divide(const SizedBox(height: 20.0))
.divide(const SizedBox(height: 10.0))
.addToStart(const SizedBox(height: 20.0))
.addToEnd(const SizedBox(height: 20.0)),
),

View File

@ -107,6 +107,7 @@ class _VisitorSearchModalTemplateComponentWidgetState
atividade: 'getVisitante',
documento: _model.textController.text,
);
if (PhpGroup.getVisitorByDocCall.vistanteId(
(_model.getVisitorByDoc?.jsonBody ?? ''),
) !=

View File

@ -453,6 +453,14 @@ extension ListFilterExt<T> on Iterable<T?> {
List<T> get withoutNulls => where((s) => s != null).map((e) => e!).toList();
}
extension MapFilterExtensions<T> on Map<String, T?> {
Map<String, T> get withoutNulls => Map.fromEntries(
entries
.where((e) => e.value != null)
.map((e) => MapEntry(e.key, e.value as T)),
);
}
extension MapListContainsExt on List<dynamic> {
bool containsMap(dynamic map) => map is Map
? any((e) => e is Map && const DeepCollectionEquality().equals(e, map))

View File

@ -4,6 +4,7 @@ import 'package:auto_size_text/auto_size_text.dart';
class FFButtonOptions {
const FFButtonOptions({
this.textAlign,
this.textStyle,
this.elevation,
this.height,
@ -25,6 +26,7 @@ class FFButtonOptions {
this.maxLines,
});
final TextAlign? textAlign;
final TextStyle? textStyle;
final double? elevation;
final double? height;
@ -98,6 +100,7 @@ class _FFButtonWidgetState extends State<FFButtonWidget> {
text ?? '',
style:
text == null ? null : widget.options.textStyle?.withoutColor(),
textAlign: widget.options.textAlign,
maxLines: maxLines,
overflow: TextOverflow.ellipsis,
);

View File

@ -8,3 +8,16 @@ class FormFieldController<T> extends ValueNotifier<T?> {
void reset() => value = initialValue;
void update() => notifyListeners();
}
// If the initial value is a list (which it is for multiselect),
// we need to use this controller to avoid a pass by reference issue
// that can result in the initial value being modified.
class FormListFieldController<T> extends FormFieldController<List<T>> {
final List<T>? _initialListValue;
FormListFieldController(super.initialValue)
: _initialListValue = List<T>.from(initialValue ?? []);
@override
void reset() => value = List<T>.from(_initialListValue ?? []);
}

View File

@ -174,6 +174,10 @@ final kTranslationsMap = <Map<String, Map<String, String>>>[
'pt': 'Nome',
'en': 'Name',
},
'rl8tvwnr': {
'pt': 'Documento',
'en': 'Document',
},
'yp23q90m': {
'pt': 'Selecione o tipo:',
'en': 'Select type:',
@ -194,10 +198,6 @@ final kTranslationsMap = <Map<String, Map<String, String>>>[
'pt': 'Search for an item...',
'en': '',
},
'rl8tvwnr': {
'pt': 'Documento',
'en': 'Document',
},
'bqpucwh0': {
'pt': 'Contatos',
'en': 'Contacts',

View File

@ -17,13 +17,13 @@ class RegisterVisitorPageModel
FocusNode? textFieldFocusNode1;
TextEditingController? textController1;
String? Function(BuildContext, String?)? textController1Validator;
// State field(s) for DropDown widget.
String? dropDownValue;
FormFieldController<String>? dropDownValueController;
// State field(s) for TextField widget.
FocusNode? textFieldFocusNode2;
TextEditingController? textController2;
String? Function(BuildContext, String?)? textController2Validator;
// State field(s) for DropDown widget.
String? dropDownValue;
FormFieldController<String>? dropDownValueController;
// State field(s) for TextField widget.
FocusNode? textFieldFocusNode3;
TextEditingController? textController3;

View File

@ -857,6 +857,7 @@ class _ScheduleProvisionalVisitPageWidgetState
nome: _model.textController2.text,
proID: FFAppState().ownerUUID,
);
if (PhpGroup.postProvVisitSchedulingCall.error(
(_model.provisionalVisitScheduling?.jsonBody ?? ''),
) ==