This commit is contained in:
jantunesmesias 2024-08-02 10:47:46 -03:00
parent 57bfbe33d9
commit 5a7bb289f0
12 changed files with 1259 additions and 1763 deletions

View File

@ -11,7 +11,6 @@ export 'api_manager.dart' show ApiCallResponse;
const _kPrivateApiFunctionName = 'ffPrivateApiCall'; const _kPrivateApiFunctionName = 'ffPrivateApiCall';
/// Start PHP Group Code /// Start PHP Group Code
class PhpGroup { class PhpGroup {
@ -46,6 +45,81 @@ class PhpGroup {
static ChangeNotifica changeNotifica = ChangeNotifica(); static ChangeNotifica changeNotifica = ChangeNotifica();
static RespondeVinculo resopndeVinculo = RespondeVinculo(); static RespondeVinculo resopndeVinculo = RespondeVinculo();
static ChangePass changePass = ChangePass(); static ChangePass changePass = ChangePass();
static ChangePanic changePanic = ChangePanic();
static DeleteAccount deleteAccount = DeleteAccount();
}
class DeleteAccount {
Future<ApiCallResponse> call({
String? devUUID = '',
String? userUUID = '',
}) async {
final baseUrl = PhpGroup.getBaseUrl();
return ApiManager.instance.makeApiCall(
callName: 'deleteAccount',
apiUrl: '$baseUrl/deleteAccount.php',
callType: ApiCallType.POST,
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
params: {
'devUUID': devUUID,
'userUUID': userUUID,
},
bodyType: BodyType.X_WWW_FORM_URL_ENCODED,
returnBody: true,
encodeBodyUtf8: false,
decodeUtf8: false,
cache: false,
isStreamingApi: false,
alwaysAllowBody: false,
);
}
bool? error(dynamic response) => castToType<bool>(getJsonField(
response,
r'''$.error''',
));
}
class ChangePanic {
Future<ApiCallResponse> call({
String? devUUID = '',
String? userUUID = '',
String? cliID = '',
String? atividade = '',
String? newSenhaPanico = '',
}) async {
final baseUrl = PhpGroup.getBaseUrl();
return ApiManager.instance.makeApiCall(
callName: 'changePass',
apiUrl: '$baseUrl/processRequest.php',
callType: ApiCallType.POST,
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
params: {
'devUUID': devUUID,
'userUUID': userUUID,
'cliID': cliID,
'atividade': atividade,
'newSenhaPanico': newSenhaPanico,
},
bodyType: BodyType.X_WWW_FORM_URL_ENCODED,
returnBody: true,
encodeBodyUtf8: false,
decodeUtf8: false,
cache: false,
isStreamingApi: false,
alwaysAllowBody: false,
);
}
bool? error(dynamic response) => castToType<bool>(getJsonField(
response,
r'''$.error''',
));
} }
class ChangePass { class ChangePass {
@ -95,31 +169,30 @@ class RespondeVinculo {
String? cliID = '', String? cliID = '',
String? tarefa = '', String? tarefa = '',
}) async { }) async {
final baseUrl = PhpGroup.getBaseUrl(); final baseUrl = PhpGroup.getBaseUrl();
return ApiManager.instance.makeApiCall( return ApiManager.instance.makeApiCall(
callName: 'respondeVinculo', callName: 'respondeVinculo',
apiUrl: '$baseUrl/processRequest.php', apiUrl: '$baseUrl/responderVinculo.php',
callType: ApiCallType.POST, callType: ApiCallType.POST,
headers: { headers: {
'Content-Type': 'application/x-www-form-urlencoded', 'Content-Type': 'application/x-www-form-urlencoded',
}, },
params: { params: {
'devUUID': devUUID, 'devUUID': devUUID,
'userUUID': userUUID, 'userUUID': userUUID,
'cliID': cliID, 'cliID': cliID,
'tarefa': tarefa, 'tarefa': tarefa,
}, },
bodyType: BodyType.X_WWW_FORM_URL_ENCODED, bodyType: BodyType.X_WWW_FORM_URL_ENCODED,
returnBody: true, returnBody: true,
encodeBodyUtf8: false, encodeBodyUtf8: false,
decodeUtf8: false, decodeUtf8: false,
cache: false, cache: false,
isStreamingApi: false, isStreamingApi: false,
alwaysAllowBody: false, alwaysAllowBody: false,
); );
} }
} }
class ChangeNotifica { class ChangeNotifica {
@ -160,7 +233,7 @@ class ChangeNotifica {
response, response,
r'''$.error''', r'''$.error''',
)); ));
} }
class UpdToken { class UpdToken {
Future<ApiCallResponse> call({ Future<ApiCallResponse> call({
@ -2433,4 +2506,4 @@ String _serializeJson(dynamic jsonVar, [bool isList = false]) {
} }
return isList ? '[]' : '{}'; return isList ? '[]' : '{}';
} }
} }

View File

@ -4,8 +4,6 @@ import 'dart:developer';
import 'dart:io'; import 'dart:io';
import 'dart:math' as math; import 'dart:math' as math;
import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -17,11 +15,12 @@ import 'package:hub/backend/api_requests/api_manager.dart';
import 'package:hub/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_widget.dart'; import 'package:hub/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_widget.dart';
import 'package:hub/components/templates_components/message_notificaion_modal_template_component/message_notification_widget.dart'; import 'package:hub/components/templates_components/message_notificaion_modal_template_component/message_notification_widget.dart';
import 'package:hub/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart'; import 'package:hub/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart';
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
import 'package:hub/flutter_flow/internationalization.dart';
import 'package:rxdart/rxdart.dart'; import 'package:rxdart/rxdart.dart';
// //
class PushNotificationService { class PushNotificationService {
final FirebaseMessaging _firebaseMessaging = FirebaseMessaging.instance; final FirebaseMessaging _firebaseMessaging = FirebaseMessaging.instance;
final FlutterLocalNotificationsPlugin _flutterLocalNotificationsPlugin = final FlutterLocalNotificationsPlugin _flutterLocalNotificationsPlugin =
@ -104,8 +103,6 @@ class PushNotificationService {
} }
} }
void _initializeLocalNotifications( void _initializeLocalNotifications(
BehaviorSubject<BuildContext> context) async { BehaviorSubject<BuildContext> context) async {
while (context.valueOrNull == null) { while (context.valueOrNull == null) {
@ -132,9 +129,10 @@ class PushNotificationService {
Map<String, dynamic> message = Map<String, dynamic> message =
validJsonFromString(response.payload!); validJsonFromString(response.payload!);
log('Notification payload: $message'); log('Notification payload: $message');
var data = _notificationDetails; // Assuming getOnMessage() now returns the latest RemoteMessage var data =
log('Extra: ${data.value}'); _notificationDetails; // Assuming getOnMessage() now returns the latest RemoteMessage
_handleNotificationClick(message, extra: data.value); log('Extra: ${data.value}');
_handleNotificationClick(message, extra: data.value);
} catch (e) { } catch (e) {
log('Error decoding notification payload: $e'); log('Error decoding notification payload: $e');
} }
@ -191,7 +189,8 @@ class PushNotificationService {
_onMessage.add(message); _onMessage.add(message);
log('Extra: ${message.notification?.body}'); log('Extra: ${message.notification?.body}');
NotificationHandler().handleMessage(message.data, context); }); NotificationHandler().handleMessage(message.data, context);
});
} }
void configureTokenRefresh() { void configureTokenRefresh() {
@ -292,14 +291,16 @@ class PushNotificationService {
); );
} }
_handleNotificationClick(Map<String, dynamic> payload, {Map<String, dynamic> extra = const {}}) { _handleNotificationClick(Map<String, dynamic> payload,
{Map<String, dynamic> extra = const {}}) {
switch (payload.isNotEmpty) { switch (payload.isNotEmpty) {
case true: case true:
// Print the 'data' property // Print the 'data' property
log('Notification payload: $payload'); log('Notification payload: $payload');
log('Extra: $extra'); log('Extra: $extra');
// Handle the message data as needed // Handle the message data as needed
NotificationHandler().handleMessage(payload, _context.value, extra: extra.isEmpty ? {} : extra); NotificationHandler().handleMessage(payload, _context.value,
extra: extra.isEmpty ? {} : extra);
// Access the 'data' property of 'RemoteMessage' // Access the 'data' property of 'RemoteMessage'
case false: case false:
log('Notification payload is empty'); log('Notification payload is empty');
@ -315,7 +316,8 @@ class PushNotificationService {
} }
class NotificationHandler { class NotificationHandler {
void handleMessage(Map<String, dynamic> message, BuildContext context, {Map<String, dynamic> extra = const {}}) { void handleMessage(Map<String, dynamic> message, BuildContext context,
{Map<String, dynamic> extra = const {}}) {
log('Notification Received!'); log('Notification Received!');
message.forEach((key, value) { message.forEach((key, value) {
log('$key: $value'); log('$key: $value');
@ -331,8 +333,8 @@ class NotificationHandler {
case 'access': case 'access':
_showAcessNotificationModal(message, context); _showAcessNotificationModal(message, context);
break; break;
case 'mensagem': case 'mensagem':
_showMessageNotificationDialog(message, context, extra); _showMessageNotificationDialog(message, context, extra);
break; break;
case 'enroll_cond': case 'enroll_cond':
log('enroll_cond'); log('enroll_cond');
@ -385,8 +387,8 @@ class NotificationHandler {
); );
} }
void _showMessageNotificationDialog( void _showMessageNotificationDialog(Map<String, dynamic> message,
Map<String, dynamic> message, BuildContext context, Map<String, dynamic> extra) { BuildContext context, Map<String, dynamic> extra) {
log('Showing message notification dialog'); log('Showing message notification dialog');
log('Notification "message": $message'); log('Notification "message": $message');
showDialog( showDialog(
@ -398,15 +400,18 @@ class NotificationHandler {
child: MessageNotificationModalTemplateComponentWidget( child: MessageNotificationModalTemplateComponentWidget(
id: message['local']['CLI_ID'].toString(), id: message['local']['CLI_ID'].toString(),
from: message['remetente'].toString(), from: message['remetente'].toString(),
to: message['destinatario'].toString() == 'O' ? 'Morador' : 'Visitante', to: message['destinatario'].toString() == 'O'
message: extra['body'].toString().isEmpty ? 'Unknown' : extra['body'].toString(), ? 'Morador'
: 'Visitante',
message: extra['body'].toString().isEmpty
? 'Unknown'
: extra['body'].toString(),
), ),
); );
}, },
); );
} }
void _showVisitRequestDialog( void _showVisitRequestDialog(
Map<String, dynamic> message, BuildContext context) { Map<String, dynamic> message, BuildContext context) {
log('Showing visit request notification dialog'); log('Showing visit request notification dialog');
@ -424,6 +429,22 @@ class NotificationHandler {
vteUUID: message['idVisitante'].toString(), vteUUID: message['idVisitante'].toString(),
vawRef: message['referencia'].toString(), vawRef: message['referencia'].toString(),
vawStatus: 'S', vawStatus: 'S',
labelsHashMap: Map<String, String>.from({
'key': message['documento'],
'value': 'E',
}),
imageHashMap: Map<String, String>.from({
'key': message['documento'],
'value': 'E',
}),
statusHashMap: [
{
FFLocalizations.of(context).getVariableText(
enText: 'Pending',
ptText: 'Pendente',
): FlutterFlowTheme.of(context).primary,
},
],
changeStatusAction: changeStatusAction, changeStatusAction: changeStatusAction,
), ),
); );
@ -448,6 +469,4 @@ class PushNotificationManager {
void dispose() { void dispose() {
_onMessageReceivedController.close(); _onMessageReceivedController.close();
} }
}
}

View File

@ -93,7 +93,6 @@ class _ThrowExceptionWidgetState extends State<ThrowExceptionWidget>
case EnumThrowException.success: case EnumThrowException.success:
return FFLocalizations.of(context) return FFLocalizations.of(context)
.getVariableText(ptText: "Sucesso ;)", enText: "Success ;)"); .getVariableText(ptText: "Sucesso ;)", enText: "Success ;)");
;
} }
} }

View File

@ -12,8 +12,6 @@ export 'card_item_template_component_model.dart';
/// ///
class CardItemTemplateComponentWidget extends StatefulWidget { class CardItemTemplateComponentWidget extends StatefulWidget {
const CardItemTemplateComponentWidget({ const CardItemTemplateComponentWidget({
super.key, super.key,
@ -25,7 +23,7 @@ class CardItemTemplateComponentWidget extends StatefulWidget {
final Map<String, String>? labelsHashMap; final Map<String, String>? labelsHashMap;
final List<Map<String, Color>?> statusHashMap; final List<Map<String, Color>?> statusHashMap;
final Map<String, String> imageHashMap; final Map<String, String> imageHashMap;
final Future Function()? onTapCardItemAction; final Future Function()? onTapCardItemAction;
@override @override
@ -40,7 +38,9 @@ class _CardItemTemplateComponentWidgetState
LinkedHashMap.from(widget.labelsHashMap ?? {}); LinkedHashMap.from(widget.labelsHashMap ?? {});
List<LinkedHashMap<String, Color>> get statusLinkedHashMap => List<LinkedHashMap<String, Color>> get statusLinkedHashMap =>
widget.statusHashMap.map((map) => LinkedHashMap<String, Color>.from(map ?? {})).toList(); widget.statusHashMap
.map((map) => LinkedHashMap<String, Color>.from(map ?? {}))
.toList();
@override @override
void setState(VoidCallback callback) { void setState(VoidCallback callback) {
@ -74,9 +74,14 @@ class _CardItemTemplateComponentWidgetState
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
context.watch<FFAppState>(); context.watch<FFAppState>();
log('------------------------------');
log('labelsHashMap: ${widget.labelsHashMap}');
log('statusHashMap: ${widget.statusHashMap}');
log('imageHashMap: ${widget.imageHashMap}');
log('onTapCardItemAction: ${widget.onTapCardItemAction}');
log('labelsLinkedHashMap: $labelsLinkedHashMap');
log('statusLinkedHashMap: $statusLinkedHashMap');
log('------------------------------');
return InkWell( return InkWell(
splashColor: Colors.transparent, splashColor: Colors.transparent,
focusColor: Colors.transparent, focusColor: Colors.transparent,
@ -89,7 +94,7 @@ class _CardItemTemplateComponentWidgetState
padding: const EdgeInsets.fromLTRB(10, 0, 10, 0), padding: const EdgeInsets.fromLTRB(10, 0, 10, 0),
child: Card( child: Card(
clipBehavior: Clip.antiAliasWithSaveLayer, clipBehavior: Clip.antiAliasWithSaveLayer,
color: FlutterFlowTheme.of(context).secondaryBackground, color: FlutterFlowTheme.of(context).primaryBackground,
elevation: 5.0, elevation: 5.0,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8.0), borderRadius: BorderRadius.circular(8.0),
@ -98,7 +103,7 @@ class _CardItemTemplateComponentWidgetState
width: 350.0, width: 350.0,
height: 115.0, height: 115.0,
decoration: BoxDecoration( decoration: BoxDecoration(
color: FlutterFlowTheme.of(context).secondaryBackground, color: FlutterFlowTheme.of(context).primaryBackground,
), ),
child: Row( child: Row(
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
@ -106,27 +111,27 @@ class _CardItemTemplateComponentWidgetState
children: [ children: [
Expanded( Expanded(
child: Container( child: Container(
width: 100.0, width: MediaQuery.of(context).size.width,
height: 100.0, height: MediaQuery.of(context).size.height,
decoration: const BoxDecoration(), decoration: const BoxDecoration(),
child: Column( child: Padding(
mainAxisSize: MainAxisSize.max, padding: const EdgeInsets.all(8.0),
mainAxisAlignment: MainAxisAlignment.center, child: Column(
children: [ mainAxisSize: MainAxisSize.max,
Expanded( mainAxisAlignment: MainAxisAlignment.center,
child: ListView.builder( children: [
shrinkWrap: true, Expanded(
itemCount: labelsLinkedHashMap.length, child: ListView.builder(
physics: const NeverScrollableScrollPhysics(), shrinkWrap: true,
itemBuilder: (context, index) { itemCount: labelsLinkedHashMap.length,
String key = physics: const NeverScrollableScrollPhysics(),
labelsLinkedHashMap.keys.elementAt(index); itemBuilder: (context, index) {
String value = labelsLinkedHashMap[key]!; String key =
return Padding( labelsLinkedHashMap.keys.elementAt(index);
padding: const EdgeInsets.only(bottom: 5.0), String value = labelsLinkedHashMap[key]!;
child: Padding( return Padding(
padding: padding:
const EdgeInsets.fromLTRB(20, 0, 0, 0), const EdgeInsets.fromLTRB(20, 0, 0, 5),
child: Row( child: Row(
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
mainAxisAlignment: mainAxisAlignment:
@ -157,68 +162,80 @@ class _CardItemTemplateComponentWidgetState
const SizedBox( const SizedBox(
width: width:
5.0), // Espaçamento entre o label e o valor 5.0), // Espaçamento entre o label e o valor
Text( Flexible(
value, child: Text(
style: FlutterFlowTheme.of(context) value,
.bodyMedium overflow: TextOverflow.ellipsis,
.override( style: FlutterFlowTheme.of(context)
fontFamily: .bodyMedium
FlutterFlowTheme.of(context) .override(
.bodyMediumFamily, fontFamily:
fontSize: 12.5, FlutterFlowTheme.of(
letterSpacing: 0.0, context)
fontWeight: FontWeight.bold, .bodyMediumFamily,
useGoogleFonts: GoogleFonts fontSize: 12.5,
.asMap() letterSpacing: 0.0,
.containsKey( fontWeight: FontWeight.bold,
FlutterFlowTheme.of( useGoogleFonts: GoogleFonts
context) .asMap()
.bodyMediumFamily), .containsKey(
), FlutterFlowTheme.of(
context)
.bodyMediumFamily),
),
),
), ),
], ],
), ),
), );
); },
}, ),
), ),
), Row(
Row( mainAxisAlignment: MainAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center, mainAxisSize: MainAxisSize.max,
mainAxisSize: MainAxisSize.max, children:
children: statusLinkedHashMap.expand((linkedHashMap) { statusLinkedHashMap.expand((linkedHashMap) {
return linkedHashMap.entries.map((MapEntry<String, Color> item) { return linkedHashMap.entries
return Container( .map((MapEntry<String, Color> item) {
child: Row( return Container(
mainAxisAlignment: MainAxisAlignment.spaceBetween, child: Row(
children: [ mainAxisAlignment:
Padding( MainAxisAlignment.spaceBetween,
padding: const EdgeInsets.symmetric(horizontal: 1.0, vertical: 3.0), children: [
child: Container( Padding(
width: 100.0, padding: const EdgeInsets.symmetric(
height: 27.0, horizontal: 1.0, vertical: 3.0),
decoration: BoxDecoration( child: Container(
color: item.value, // Usa a cor do item atual width: 100.0,
borderRadius: BorderRadius.circular(5.0), height: 27.0,
), decoration: BoxDecoration(
child: Align( color: item
alignment: Alignment.center, .value, // Usa a cor do item atual
child: Text( borderRadius:
item.key, // Usa a chave do item atual como texto BorderRadius.circular(5.0),
style: TextStyle( ),
color: FlutterFlowTheme.of(context).info, // Ajuste conforme necessário child: Align(
alignment: Alignment.center,
child: Text(
item.key, // Usa a chave do item atual como texto
style: TextStyle(
color: FlutterFlowTheme.of(
context)
.info, // Ajuste conforme necessário
),
), ),
), ),
), ),
), ),
), ],
], ),
), );
); }).toList();
}).toList(); }).toList(),
}).toList(), ),
), ]),
]), ),
), ),
), ),
Padding( Padding(
@ -226,18 +243,19 @@ class _CardItemTemplateComponentWidgetState
10.0, 10.0, 10.0, 10.0), 10.0, 10.0, 10.0, 10.0),
child: ClipRRect( child: ClipRRect(
borderRadius: BorderRadius.circular(22.0), borderRadius: BorderRadius.circular(22.0),
child: CachedNetworkImage( child: AspectRatio(
fadeInDuration: const Duration(milliseconds: 500), aspectRatio:
fadeOutDuration: const Duration(milliseconds: 500), 1.0, // Define a proporção desejada (1:1 neste caso)
imageUrl: valueOrDefault<String>( child: CachedNetworkImage(
// 'https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${widget.imageHashMap['key']}&tipo=${widget.imageHashMap['value']}', fadeInDuration: const Duration(milliseconds: 500),
'https://freaccess.com.br/freaccess/getImage.php?cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${widget.imageHashMap['key']}&tipo=${widget.imageHashMap['value']}', fadeOutDuration: const Duration(milliseconds: 500),
'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', imageUrl:
'https://freaccess.com.br/freaccess/getImage.php?cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${widget.imageHashMap['key']}&tipo=${widget.imageHashMap['value']}',
fit: BoxFit.cover,
), ),
fit: BoxFit.cover,
), ),
), ),
), )
], ],
), ),
), ),
@ -245,4 +263,4 @@ class _CardItemTemplateComponentWidgetState
), ),
); );
} }
} }

View File

@ -131,10 +131,10 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
context.watch<FFAppState>(); context.watch<FFAppState>();
return Padding( return Padding(
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 35.0, 0.0, 0.0), padding: const EdgeInsetsDirectional.fromSTEB(0.0, 200.0, 0.0, 0.0),
child: Container( child: Container(
width: double.infinity, width: MediaQuery.of(context).size.width,
height: double.infinity, height: MediaQuery.of(context).size.height,
decoration: BoxDecoration( decoration: BoxDecoration(
color: FlutterFlowTheme.of(context).primaryBackground, color: FlutterFlowTheme.of(context).primaryBackground,
borderRadius: const BorderRadius.only( borderRadius: const BorderRadius.only(
@ -264,6 +264,10 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
focusNode: _model.textFieldFocusNode1, focusNode: _model.textFieldFocusNode1,
autofocus: false, autofocus: false,
obscureText: false, obscureText: false,
showCursor: false,
enabled: false,
cursorColor: FlutterFlowTheme.of(context).primary,
readOnly: true,
decoration: InputDecoration( decoration: InputDecoration(
labelText: FFLocalizations.of(context).getText( labelText: FFLocalizations.of(context).getText(
'9yu35pzg' /* Encerramento da Visita */, '9yu35pzg' /* Encerramento da Visita */,
@ -348,6 +352,10 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
focusNode: _model.textFieldFocusNode2, focusNode: _model.textFieldFocusNode2,
autofocus: false, autofocus: false,
obscureText: false, obscureText: false,
showCursor: false,
enabled: false,
cursorColor: FlutterFlowTheme.of(context).primary,
readOnly: true,
decoration: InputDecoration( decoration: InputDecoration(
labelText: FFLocalizations.of(context).getText( labelText: FFLocalizations.of(context).getText(
'aj6scczp' /* Início */, 'aj6scczp' /* Início */,
@ -436,6 +444,10 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
focusNode: _model.textFieldFocusNode3, focusNode: _model.textFieldFocusNode3,
autofocus: false, autofocus: false,
obscureText: false, obscureText: false,
showCursor: false,
enabled: false,
cursorColor: FlutterFlowTheme.of(context).primary,
readOnly: true,
decoration: InputDecoration( decoration: InputDecoration(
labelText: FFLocalizations.of(context).getText( labelText: FFLocalizations.of(context).getText(
'rvi5z7wg' /* Término */, 'rvi5z7wg' /* Término */,
@ -534,6 +546,10 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
focusNode: _model.textFieldFocusNode4, focusNode: _model.textFieldFocusNode4,
autofocus: false, autofocus: false,
obscureText: false, obscureText: false,
showCursor: false,
enabled: false,
cursorColor: FlutterFlowTheme.of(context).primary,
readOnly: true,
decoration: InputDecoration( decoration: InputDecoration(
labelText: FFLocalizations.of(context).getText( labelText: FFLocalizations.of(context).getText(
'yxilg7ek' /* Motivo da Visita */, 'yxilg7ek' /* Motivo da Visita */,
@ -622,6 +638,10 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
focusNode: _model.textFieldFocusNode5, focusNode: _model.textFieldFocusNode5,
autofocus: false, autofocus: false,
obscureText: false, obscureText: false,
showCursor: false,
enabled: false,
cursorColor: FlutterFlowTheme.of(context).primary,
readOnly: true,
decoration: InputDecoration( decoration: InputDecoration(
labelText: FFLocalizations.of(context).getText( labelText: FFLocalizations.of(context).getText(
'dgr3pk3a' /* Nível de Acesso */, 'dgr3pk3a' /* Nível de Acesso */,
@ -714,6 +734,10 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
focusNode: _model.textFieldFocusNode6, focusNode: _model.textFieldFocusNode6,
autofocus: false, autofocus: false,
obscureText: false, obscureText: false,
showCursor: false,
enabled: false,
cursorColor: FlutterFlowTheme.of(context).primary,
readOnly: true,
decoration: InputDecoration( decoration: InputDecoration(
labelText: FFLocalizations.of(context).getText( labelText: FFLocalizations.of(context).getText(
'lppn9rxa' /* Observações da Visita */, 'lppn9rxa' /* Observações da Visita */,
@ -785,178 +809,153 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
], ],
), ),
), ),
Align( Builder(
alignment: const AlignmentDirectional(0.0, 1.0), builder: (context) {
child: Padding( if (widget.visitStatusStr == 'A') {
padding: return Row(
const EdgeInsetsDirectional.fromSTEB(0.0, 6.0, 0.0, 0.0), mainAxisSize: MainAxisSize.max,
child: Container( mainAxisAlignment: MainAxisAlignment.spaceEvenly,
width: double.infinity, children: [
height: 35.0, FlutterFlowIconButton(
decoration: BoxDecoration( borderRadius: 20.0,
color: widget.visitStatusColor, borderWidth: 1.0,
borderRadius: const BorderRadius.only( buttonSize: 40.0,
bottomLeft: Radius.circular(0.0), // fillColor: widget.visitStatusColor,
bottomRight: Radius.circular(0.0), icon: Icon(
topLeft: Radius.circular(0.0), Icons.block_sharp,
topRight: Radius.circular(0.0), color: FlutterFlowTheme.of(context).error,
), size: 24.0,
), ),
child: Builder( onPressed: () async {
builder: (context) { _model.deleteVisit =
if (widget.visitStatusStr == 'A') { await PhpGroup.deleteVisitCall.call(
return Row( devUUID: FFAppState().devUUID,
mainAxisSize: MainAxisSize.max, userUUID: FFAppState().userUUID,
mainAxisAlignment: MainAxisAlignment.spaceEvenly, cliID: FFAppState().cliUUID,
children: [ atividade: 'cancelaVisita',
FlutterFlowIconButton( idVisita: widget.visitIdStr,
borderRadius: 20.0, );
borderWidth: 1.0,
buttonSize: 40.0,
icon: Icon(
Icons.block_sharp,
color: FlutterFlowTheme.of(context)
.primaryBackground,
size: 24.0,
),
onPressed: () async {
_model.deleteVisit =
await PhpGroup.deleteVisitCall.call(
devUUID: FFAppState().devUUID,
userUUID: FFAppState().userUUID,
cliID: FFAppState().cliUUID,
atividade: 'cancelaVisita',
idVisita: widget.visitIdStr,
);
if (PhpGroup.deleteVisitCall.error( if (PhpGroup.deleteVisitCall.error(
(_model.deleteVisit?.jsonBody ?? ''), (_model.deleteVisit?.jsonBody ?? ''),
) == ) ==
false) { false) {
Navigator.pop(context);
} else {
await showModalBottomSheet(
isScrollControlled: true,
backgroundColor: Colors.transparent,
enableDrag: false,
context: context,
builder: (context) {
return Padding(
padding:
MediaQuery.viewInsetsOf(context),
child: ThrowExceptionWidget(
msg: PhpGroup.deleteVisitCall.msg(
(_model.deleteVisit?.jsonBody ??
''),
)!,
),
);
},
).then((value) => safeSetState(() {}));
}
setState(() {});
},
),
FlutterFlowIconButton(
borderColor: Colors.transparent,
borderRadius: 20.0,
borderWidth: 1.0,
buttonSize: 40.0,
icon: Icon(
Icons.share,
color: FlutterFlowTheme.of(context)
.primaryBackground,
size: 24.0,
),
onPressed: () {
log('IconButton pressed ...');
// Implement share functionality here
Share.share(
'Visita agendada para ${widget.visitStartDate} com término previsto para ${widget.visitEndDate}. Motivo: ${widget.visitReasonStr}. Nível de acesso: ${widget.visitLevelStr}. Observações: ${widget.visitObsStr}.',
);
},
),
],
);
} else if ((widget.visitStatusStr == 'C') ||
(widget.visitStatusStr == 'F') ||
(widget.visitStatusStr == 'B') ||
(widget.visitStatusStr == 'I')) {
return InkWell(
splashColor: Colors.transparent,
focusColor: Colors.transparent,
hoverColor: Colors.transparent,
highlightColor: Colors.transparent,
onTap: () async {
Navigator.pop(context); Navigator.pop(context);
} else {
context.pushNamed( await showModalBottomSheet(
'scheduleCompleteVisitPage', isScrollControlled: true,
queryParameters: { backgroundColor: Colors.transparent,
'visitStartDateStr': serializeParam( enableDrag: false,
dateTimeFormat( context: context,
'd/M/y H:mm:ss', builder: (context) {
getCurrentTimestamp, return Padding(
locale: FFLocalizations.of(context) padding: MediaQuery.viewInsetsOf(context),
.languageCode, child: ThrowExceptionWidget(
msg: PhpGroup.deleteVisitCall.msg(
(_model.deleteVisit?.jsonBody ?? ''),
)!,
), ),
ParamType.String, );
), },
'visitEndDateStr': serializeParam( ).then((value) => safeSetState(() {}));
'', }
ParamType.String,
), setState(() {});
'visitReasonStr': serializeParam( },
widget.visitReasonStr, ),
ParamType.String, FlutterFlowIconButton(
), borderColor: Colors.transparent,
'visitLevelStr': serializeParam( borderRadius: 20.0,
widget.visitLevelStr, borderWidth: 1.0,
ParamType.String, buttonSize: 40.0,
), icon: Icon(
'visitTempBol': serializeParam( Icons.share,
widget.visitTempStr == 'Sim' ? true : false, color: FlutterFlowTheme.of(context).accent1,
ParamType.bool, size: 24.0,
), ),
'visitObsStr': serializeParam( onPressed: () {
widget.visitObsStr, log('IconButton pressed ...');
ParamType.String, // Implement share functionality here
), Share.share(
'visitorStrList': serializeParam( 'Visita agendada para ${widget.visitStartDate} com término previsto para ${widget.visitEndDate}. Motivo: ${widget.visitReasonStr}. Nível de acesso: ${widget.visitLevelStr}. Observações: ${widget.visitObsStr}.',
widget.visitorStrList, );
ParamType.String, },
), ),
'visitorJsonList': serializeParam( ],
filteredVisitorJsonList, );
ParamType.JSON, } else if ((widget.visitStatusStr == 'C') ||
isList: true, (widget.visitStatusStr == 'F') ||
), (widget.visitStatusStr == 'B') ||
}.withoutNulls, (widget.visitStatusStr == 'I')) {
); return InkWell(
}, splashColor: Colors.transparent,
child: Icon( focusColor: Colors.transparent,
Icons.repeat, hoverColor: Colors.transparent,
color: FlutterFlowTheme.of(context).secondaryText, highlightColor: Colors.transparent,
size: 24.0, onTap: () async {
Navigator.pop(context);
context.pushNamed(
'scheduleCompleteVisitPage',
queryParameters: {
'visitStartDateStr': serializeParam(
dateTimeFormat(
'd/M/y H:mm:ss',
getCurrentTimestamp,
locale: FFLocalizations.of(context).languageCode,
),
ParamType.String,
), ),
); 'visitEndDateStr': serializeParam(
} else { '',
return Container( ParamType.String,
width: 100.0,
height: 100.0,
decoration: BoxDecoration(
color: FlutterFlowTheme.of(context)
.secondaryBackground,
), ),
); 'visitReasonStr': serializeParam(
} widget.visitReasonStr,
ParamType.String,
),
'visitLevelStr': serializeParam(
widget.visitLevelStr,
ParamType.String,
),
'visitTempBol': serializeParam(
widget.visitTempStr == 'Sim' ? true : false,
ParamType.bool,
),
'visitObsStr': serializeParam(
widget.visitObsStr,
ParamType.String,
),
'visitorStrList': serializeParam(
widget.visitorStrList,
ParamType.String,
),
'visitorJsonList': serializeParam(
filteredVisitorJsonList,
ParamType.JSON,
isList: true,
),
}.withoutNulls,
);
}, },
), child: Icon(
), Icons.repeat,
), color: widget.visitStatusColor,
size: 24.0,
),
);
} else {
return Container(
width: 100.0,
height: 100.0,
decoration: BoxDecoration(
color: FlutterFlowTheme.of(context).primaryBackground,
),
);
}
},
), ),
], ].addToEnd(const SizedBox(height: 5.0)),
), ),
), ),
); );

View File

@ -1,3 +1,5 @@
import 'dart:developer';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hub/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart'; import 'package:hub/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart';
import 'package:hub/components/templates_components/view_visit_detail/view_visit_detail_widget.dart'; import 'package:hub/components/templates_components/view_visit_detail/view_visit_detail_widget.dart';
@ -71,6 +73,23 @@ class _VisitDetailsModalTemplateComponentWidgetState
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
log('------------------ VisitDetailsModalTemplateComponentWidget ------------------');
log('visitStatusStr: ${widget.visitStatusStr}');
log('visitStartDateStr: ${widget.visitStartDateStr}');
log('visitEndDateStr: ${widget.visitEndDateStr}');
log('visitReasonStr: ${widget.visitReasonStr}');
log('visitLevelStr: ${widget.visitLevelStr}');
log('visitTempStr: ${widget.visitTempStr}');
log('visitObsStr: ${widget.visitObsStr}');
log('visitorStrList: ${widget.visitorStrList}');
log('visitorJsonList: ${widget.visitorJsonList}');
log('visitorImgPath: ${widget.visitorImgPath}');
log('visitorImgList: ${widget.visitorImgList}');
log('visitIdStr: ${widget.visitIdStr}');
log('updateToggleIdx: ${widget.updateToggleIdx}');
log('repeatVisitSchedule: ${widget.repeatVisitSchedule}');
log('visitStatusColor: ${widget.visitStatusColor}');
log('-----------------------------------------------------------------------------');
return Builder( return Builder(
builder: (context) { builder: (context) {
if (widget.visitStatusStr != null && widget.visitStatusStr != '') { if (widget.visitStatusStr != null && widget.visitStatusStr != '') {

View File

@ -1,3 +1,6 @@
import 'dart:collection';
import 'dart:developer';
import 'package:cached_network_image/cached_network_image.dart'; import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart'; import 'package:google_fonts/google_fonts.dart';
@ -8,11 +11,9 @@ import 'package:hub/flutter_flow/flutter_flow_util.dart';
import 'package:hub/flutter_flow/internationalization.dart'; import 'package:hub/flutter_flow/internationalization.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class VisitRequestTemplateComponentWidget extends StatefulWidget { class VisitRequestTemplateComponentWidget extends StatefulWidget {
const VisitRequestTemplateComponentWidget({ const VisitRequestTemplateComponentWidget({
super.key, Key? key,
required this.vteName, required this.vteName,
required this.vteReason, required this.vteReason,
required this.vteMsg, required this.vteMsg,
@ -27,8 +28,17 @@ class VisitRequestTemplateComponentWidget extends StatefulWidget {
required this.vawStatus, required this.vawStatus,
this.vawDate, this.vawDate,
this.changeStatusAction, this.changeStatusAction,
required this.labelsHashMap,
required this.statusHashMap,
required this.imageHashMap,
this.onTapCardItemAction,
}); });
final Map<String, String> labelsHashMap;
final List<Map<String, Color>?> statusHashMap;
final Map<String, String> imageHashMap;
final Future Function()? onTapCardItemAction;
final String? vteName; final String? vteName;
final String? vteReason; final String? vteReason;
final String? vteMsg; final String? vteMsg;
@ -60,6 +70,14 @@ class _VisitRequestTemplateComponentWidgetState
extends State<VisitRequestTemplateComponentWidget> { extends State<VisitRequestTemplateComponentWidget> {
late VisitRequestTemplateComponentModel _model; late VisitRequestTemplateComponentModel _model;
LinkedHashMap<String, String> get labelsLinkedHashMap =>
LinkedHashMap.from(widget.labelsHashMap ?? {});
List<LinkedHashMap<String, Color>> get statusLinkedHashMap =>
widget.statusHashMap
.map((map) => LinkedHashMap<String, Color>.from(map ?? {}))
.toList();
@override @override
void setState(VoidCallback callback) { void setState(VoidCallback callback) {
super.setState(callback); super.setState(callback);
@ -102,738 +120,163 @@ class _VisitRequestTemplateComponentWidgetState
Widget build(BuildContext context) { Widget build(BuildContext context) {
context.watch<FFAppState>(); context.watch<FFAppState>();
bool isLoaded = false; bool isLoaded = false;
log('------------------ VisitRequestTemplateComponentWidget ------------------');
log('vteName: ${widget.imageHashMap}');
log('Teste: ${statusLinkedHashMap.expand((linkedHashMap) {
return [
linkedHashMap.entries
.map((MapEntry<String, Color> item) => item.key)
.first
];
}).first}');
log('-------------------------------------------------------------------------');
final pending = FFLocalizations.of(context).getVariableText(
enText: 'Pending',
ptText: 'Pendente',
);
final active = FFLocalizations.of(context).getVariableText(
enText: 'Ativo',
ptText: 'Ativo',
);
final canceled = FFLocalizations.of(context).getVariableText(
enText: 'Canceled',
ptText: 'Cancelado',
);
return Align( return LayoutBuilder(
alignment: const AlignmentDirectional(0.0, 0.0), builder: (context, constraints) {
child: Padding( return Align(
padding: const EdgeInsetsDirectional.fromSTEB(10.0, 0.0, 10.0, 0.0), alignment: const AlignmentDirectional(0.0, 0.0),
child: Container( child: Padding(
width: MediaQuery.sizeOf(context).width * 0.9, padding: const EdgeInsets.symmetric(horizontal: 10.0),
decoration: BoxDecoration( child: Container(
color: FlutterFlowTheme.of(context).primaryBackground, width: constraints.maxWidth,
borderRadius: const BorderRadius.only( decoration: BoxDecoration(
bottomLeft: Radius.circular(25.0), color: FlutterFlowTheme.of(context).primaryBackground,
bottomRight: Radius.circular(25.0), borderRadius: const BorderRadius.all(Radius.circular(25.0)),
topLeft: Radius.circular(25.0), ),
topRight: Radius.circular(25.0), child: SingleChildScrollView(
), child: Column(
), mainAxisSize: MainAxisSize.min,
child: SingleChildScrollView( mainAxisAlignment: MainAxisAlignment.start,
child: Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Column( const SizedBox(height: 20.0),
mainAxisSize: MainAxisSize.max, Container(
children: [ width: 150.0,
Container( height: 150.0,
width: 150.0, clipBehavior: Clip.antiAlias,
height: 150.0, decoration: const BoxDecoration(
clipBehavior: Clip.antiAlias, shape: BoxShape.circle,
decoration: const BoxDecoration( ),
shape: BoxShape.circle, child: CachedNetworkImage(
), fadeInDuration: const Duration(milliseconds: 100),
child: CachedNetworkImage( fadeOutDuration: const Duration(milliseconds: 100),
fadeInDuration: const Duration(milliseconds: 100), imageUrl:
fadeOutDuration: const Duration(milliseconds: 100), 'https://freaccess.com.br/freaccess/getImage.php?cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${widget.imageHashMap['key']}&tipo=${widget.imageHashMap['value']}',
imageUrl: valueOrDefault<String>( fit: BoxFit.cover,
// 'https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${widget.vteDocument}&tipo=E',
'https://freaccess.com.br/freaccess/getImage.php?cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${widget.vteDocument != null ? widget.vteDocument : widget.vteUUID}&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,
),
),
// Container(
// width: 153.0,
// height: 25.0,
// decoration: BoxDecoration(
// color: () {
// if (widget.vawStatus == 'L') {
// return FlutterFlowTheme.of(context).primary;
// } else if (widget.vawStatus == 'B') {
// return FlutterFlowTheme.of(context).error;
// } else if (widget.vawStatus == 'S') {
// return FlutterFlowTheme.of(context).warning;
// } else {
// return FlutterFlowTheme.of(context).warning;
// }
// }(),
// borderRadius: BorderRadius.circular(16.0),
// ),
// child: Align(
// alignment: const AlignmentDirectional(0.0, 0.0),
// child: Text(
// () {
// if (widget.vawStatus == 'L') {
// return FFLocalizations.of(context)
// .getVariableText(
// ptText: 'Ativo',
// enText: 'Active',
// );
// } else if (widget.vawStatus == 'B') {
// return FFLocalizations.of(context)
// .getVariableText(
// ptText: 'Bloqueado',
// enText: 'Blocked',
// );
// } else {
// return FFLocalizations.of(context)
// .getVariableText(
// ptText: 'Pendente',
// enText: 'Pending',
// );
// }
// }(),
// style: FlutterFlowTheme.of(context)
// .bodyMedium
// .override(
// fontFamily: FlutterFlowTheme.of(context)
// .bodyMediumFamily,
// letterSpacing: 0.0,
// useGoogleFonts: GoogleFonts.asMap()
// .containsKey(
// FlutterFlowTheme.of(context)
// .bodyMediumFamily),
// ),
// ),
// ),
// ),
].divide(const SizedBox(height: 5.0)),
),
]
.addToStart(const SizedBox(width: 10.0))
.addToEnd(const SizedBox(width: 10.0)),
),
// Padding(
// padding: const EdgeInsetsDirectional.fromSTEB(
// 24.0, 0.0, 24.0, 0.0),
// child: TextFormField(
// controller: _model.textController1,
// focusNode: _model.textFieldFocusNode1,
// autofocus: false,
// textInputAction: TextInputAction.next,
// readOnly: true,
// obscureText: false,
// decoration: InputDecoration(
// labelText: FFLocalizations.of(context).getText(
// 'ivfw4j04' /* Nome */,
// ),
// labelStyle: FlutterFlowTheme.of(context)
// .labelMedium
// .override(
// fontFamily:
// FlutterFlowTheme.of(context).labelMediumFamily,
// color: FlutterFlowTheme.of(context).primaryText,
// letterSpacing: 0.0,
// useGoogleFonts: GoogleFonts.asMap().containsKey(
// FlutterFlowTheme.of(context).labelMediumFamily),
// ),
// hintStyle: FlutterFlowTheme.of(context)
// .labelMedium
// .override(
// fontFamily:
// FlutterFlowTheme.of(context).labelMediumFamily,
// color: FlutterFlowTheme.of(context).primaryText,
// letterSpacing: 0.0,
// 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),
// ),
// suffixIcon: Icon(
// Icons.person,
// color: FlutterFlowTheme.of(context).accent1,
// ),
// ),
// style: FlutterFlowTheme.of(context).bodyMedium.override(
// fontFamily:
// FlutterFlowTheme.of(context).bodyMediumFamily,
// color: FlutterFlowTheme.of(context).primaryText,
// letterSpacing: 0.0,
// useGoogleFonts: GoogleFonts.asMap().containsKey(
// FlutterFlowTheme.of(context).bodyMediumFamily),
// ),
// maxLines: null,
// keyboardType: TextInputType.name,
// validator:
// _model.textController1Validator.asValidator(context),
// ),
// ),
// Padding(
// padding: const EdgeInsetsDirectional.fromSTEB(
// 24.0, 0.0, 24.0, 0.0),
// child: TextFormField(
// controller: _model.textController2,
// focusNode: _model.textFieldFocusNode2,
// autofocus: false,
// textInputAction: TextInputAction.next,
// readOnly: true,
// obscureText: false,
// decoration: InputDecoration(
// labelText: FFLocalizations.of(context).getText(
// 'ndzkqehm' /* Motivo */,
// ),
// labelStyle: FlutterFlowTheme.of(context)
// .labelMedium
// .override(
// fontFamily:
// FlutterFlowTheme.of(context).labelMediumFamily,
// color: FlutterFlowTheme.of(context).primaryText,
// letterSpacing: 0.0,
// useGoogleFonts: GoogleFonts.asMap().containsKey(
// FlutterFlowTheme.of(context).labelMediumFamily),
// ),
// hintStyle: FlutterFlowTheme.of(context)
// .labelMedium
// .override(
// fontFamily:
// FlutterFlowTheme.of(context).labelMediumFamily,
// color: FlutterFlowTheme.of(context).primaryText,
// letterSpacing: 0.0,
// 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),
// ),
// suffixIcon: Icon(
// Icons.history_edu,
// color: FlutterFlowTheme.of(context).accent1,
// ),
// ),
// style: FlutterFlowTheme.of(context).bodyMedium.override(
// fontFamily:
// FlutterFlowTheme.of(context).bodyMediumFamily,
// color: FlutterFlowTheme.of(context).primaryText,
// letterSpacing: 0.0,
// useGoogleFonts: GoogleFonts.asMap().containsKey(
// FlutterFlowTheme.of(context).bodyMediumFamily),
// ),
// maxLines: null,
// keyboardType: TextInputType.name,
// validator:
// _model.textController2Validator.asValidator(context),
// ),
// ),
Padding(
padding: const EdgeInsetsDirectional.fromSTEB(
24.0, 0.0, 24.0, 0.0),
child: TextFormField(
// controller: _model.textControllerStatus,
// focusNode: _model.textFieldFocusNodeStatus,
autofocus: false,
canRequestFocus: false,
readOnly: true,
obscureText: false,
decoration: InputDecoration(
isDense: true,
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(10.0)),
filled: true,
fillColor: () {
if (widget.vawStatus == 'L') {
return FlutterFlowTheme.of(context).primary;
} else if (widget.vawStatus == 'B') {
return FlutterFlowTheme.of(context).error;
} else if (widget.vawStatus == 'S') {
return FlutterFlowTheme.of(context).warning;
} else {
return FlutterFlowTheme.of(context).warning;
}
}(),
labelText: () {
if (widget.vawStatus == 'L') {
return FFLocalizations.of(context).getVariableText(
ptText: 'Ativo',
enText: 'Active',
);
} else if (widget.vawStatus == 'B') {
return FFLocalizations.of(context).getVariableText(
ptText: 'Bloqueado',
enText: 'Blocked',
);
} else {
return FFLocalizations.of(context).getVariableText(
ptText: 'Pendente',
enText: 'Pending',
);
}
}(),
labelStyle: FlutterFlowTheme.of(context)
.labelMedium
.override(
fontFamily:
FlutterFlowTheme.of(context).labelMediumFamily,
color: FlutterFlowTheme.of(context).primaryText,
letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap().containsKey(
FlutterFlowTheme.of(context).labelMediumFamily),
),
hintStyle: FlutterFlowTheme.of(context)
.labelMedium
.override(
fontFamily:
FlutterFlowTheme.of(context).labelMediumFamily,
color: FlutterFlowTheme.of(context).primaryText,
letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap().containsKey(
FlutterFlowTheme.of(context).labelMediumFamily),
),
focusedBorder: InputBorder.none,
errorBorder: InputBorder.none,
focusedErrorBorder: InputBorder.none,
suffixIcon: Icon(
Icons.info,
color: FlutterFlowTheme.of(context).accent1,
), ),
), ),
style: FlutterFlowTheme.of(context).bodyMedium.override( const SizedBox(height: 10.0),
fontFamily: Row(
FlutterFlowTheme.of(context).bodyMediumFamily, children: statusLinkedHashMap.expand((linkedHashMap) {
color: FlutterFlowTheme.of(context).primaryText, return linkedHashMap.entries
letterSpacing: 0.0, .map((MapEntry<String, Color> item) {
useGoogleFonts: GoogleFonts.asMap().containsKey( return Expanded(
FlutterFlowTheme.of(context).bodyMediumFamily), child: Padding(
), padding:
textAlign: TextAlign.start, const EdgeInsets.symmetric(horizontal: 24.0),
maxLines: null, child: TextFormField(
keyboardType: TextInputType.name, // controller: _model.textControllerStatus,
validator: // focusNode: _model.textFieldFocusNodeStatus,
_model.textController1Validator.asValidator(context), autofocus: false,
), canRequestFocus: false,
), readOnly: true,
Padding( obscureText: false,
padding: const EdgeInsetsDirectional.fromSTEB( decoration: InputDecoration(
24.0, 0.0, 24.0, 0.0), isDense: true,
child: TextFormField( enabledBorder: OutlineInputBorder(
controller: _model.textController1, borderRadius: BorderRadius.circular(10.0),
focusNode: _model.textFieldFocusNode1, ),
autofocus: false, filled: true,
textInputAction: TextInputAction.next, fillColor: item.value,
readOnly: true, labelText: item.key,
obscureText: false, labelStyle: FlutterFlowTheme.of(context)
decoration: InputDecoration( .labelMedium
isDense: true, .override(
labelText: FFLocalizations.of(context).getText( fontFamily: FlutterFlowTheme.of(context)
'ivfw4j04' /* Nome */, .labelMediumFamily,
), color: FlutterFlowTheme.of(context)
labelStyle: FlutterFlowTheme.of(context) .primaryText,
.labelMedium letterSpacing: 0.0,
.override( useGoogleFonts: GoogleFonts.asMap()
fontFamily: .containsKey(
FlutterFlowTheme.of(context).labelMediumFamily, FlutterFlowTheme.of(context)
color: FlutterFlowTheme.of(context).primaryText, .labelMediumFamily),
letterSpacing: 0.0, ),
useGoogleFonts: GoogleFonts.asMap().containsKey( hintStyle: FlutterFlowTheme.of(context)
FlutterFlowTheme.of(context).labelMediumFamily), .labelMedium
), .override(
hintStyle: FlutterFlowTheme.of(context) fontFamily: FlutterFlowTheme.of(context)
.labelMedium .labelMediumFamily,
.override( color: FlutterFlowTheme.of(context)
fontFamily: .primaryText,
FlutterFlowTheme.of(context).labelMediumFamily, letterSpacing: 0.0,
color: FlutterFlowTheme.of(context).primaryText, useGoogleFonts: GoogleFonts.asMap()
letterSpacing: 0.0, .containsKey(
useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context)
FlutterFlowTheme.of(context).labelMediumFamily), .labelMediumFamily),
), ),
enabledBorder: InputBorder.none, focusedBorder: InputBorder.none,
focusedBorder: InputBorder.none, errorBorder: InputBorder.none,
errorBorder: InputBorder.none, focusedErrorBorder: InputBorder.none,
focusedErrorBorder: InputBorder.none, suffixIcon: Icon(
suffixIcon: Icon( Icons.info,
Icons.person, color: FlutterFlowTheme.of(context).accent1,
color: FlutterFlowTheme.of(context).accent1, ),
),
),
style: FlutterFlowTheme.of(context).bodyMedium.override(
fontFamily:
FlutterFlowTheme.of(context).bodyMediumFamily,
color: FlutterFlowTheme.of(context).primaryText,
letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap().containsKey(
FlutterFlowTheme.of(context).bodyMediumFamily),
),
textAlign: TextAlign.start,
maxLines: null,
keyboardType: TextInputType.name,
validator:
_model.textController1Validator.asValidator(context),
),
),
Padding(
padding: const EdgeInsetsDirectional.fromSTEB(
24.0, 0.0, 24.0, 0.0),
child: TextFormField(
controller: _model.textController2,
focusNode: _model.textFieldFocusNode2,
autofocus: false,
textInputAction: TextInputAction.next,
readOnly: true,
obscureText: false,
decoration: InputDecoration(
isDense: true,
labelText: FFLocalizations.of(context).getText(
'ndzkqehm' /* Motivo */,
),
labelStyle: FlutterFlowTheme.of(context)
.labelMedium
.override(
fontFamily:
FlutterFlowTheme.of(context).labelMediumFamily,
color: FlutterFlowTheme.of(context).primaryText,
letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap().containsKey(
FlutterFlowTheme.of(context).labelMediumFamily),
),
hintStyle: FlutterFlowTheme.of(context)
.labelMedium
.override(
fontFamily:
FlutterFlowTheme.of(context).labelMediumFamily,
color: FlutterFlowTheme.of(context).primaryText,
letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap().containsKey(
FlutterFlowTheme.of(context).labelMediumFamily),
),
enabledBorder: InputBorder.none,
focusedBorder: InputBorder.none,
errorBorder: InputBorder.none,
focusedErrorBorder: InputBorder.none,
suffixIcon: Icon(
Icons.history_edu,
color: FlutterFlowTheme.of(context).accent1,
),
),
style: FlutterFlowTheme.of(context).bodyMedium.override(
fontFamily:
FlutterFlowTheme.of(context).bodyMediumFamily,
color: FlutterFlowTheme.of(context).primaryText,
letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap().containsKey(
FlutterFlowTheme.of(context).bodyMediumFamily),
),
textAlign: TextAlign.start,
maxLines: null,
keyboardType: TextInputType.name,
validator:
_model.textController2Validator.asValidator(context),
),
),
if (widget.vawStatus != 'S')
Padding(
padding: const EdgeInsetsDirectional.fromSTEB(
24.0, 0.0, 24.0, 0.0),
child: TextFormField(
controller: _model.textController3,
focusNode: _model.textFieldFocusNode3,
autofocus: false,
textCapitalization: TextCapitalization.none,
textInputAction: TextInputAction.next,
readOnly: true,
obscureText: false,
decoration: InputDecoration(
isDense: true,
labelText: FFLocalizations.of(context).getText(
'kt87omsz' /* Mensagem */,
),
labelStyle: FlutterFlowTheme.of(context)
.labelMedium
.override(
fontFamily: FlutterFlowTheme.of(context)
.labelMediumFamily,
color: FlutterFlowTheme.of(context).primaryText,
letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap().containsKey(
FlutterFlowTheme.of(context)
.labelMediumFamily),
),
hintStyle:
FlutterFlowTheme.of(context).labelMedium.override(
fontFamily: FlutterFlowTheme.of(context)
.labelMediumFamily,
letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap()
.containsKey(FlutterFlowTheme.of(context)
.labelMediumFamily),
), ),
enabledBorder: InputBorder.none, style: FlutterFlowTheme.of(context)
focusedBorder: InputBorder.none, .bodyMedium
errorBorder: InputBorder.none, .override(
focusedErrorBorder: InputBorder.none, fontFamily: FlutterFlowTheme.of(context)
suffixIcon: Icon( .bodyMediumFamily,
Icons.message, color: FlutterFlowTheme.of(context)
color: FlutterFlowTheme.of(context).accent1, .primaryText,
), letterSpacing: 0.0,
), useGoogleFonts: GoogleFonts.asMap()
style: FlutterFlowTheme.of(context).bodyMedium.override( .containsKey(
fontFamily: FlutterFlowTheme.of(context)
FlutterFlowTheme.of(context).bodyMediumFamily, .bodyMediumFamily),
color: FlutterFlowTheme.of(context).primaryText, ),
letterSpacing: 0.0, textAlign: TextAlign.start,
useGoogleFonts: GoogleFonts.asMap().containsKey( maxLines: null,
FlutterFlowTheme.of(context).bodyMediumFamily), keyboardType: TextInputType.name,
), validator: _model.textController1Validator
textAlign: TextAlign.start, .asValidator(context),
validator: ),
_model.textController3Validator.asValidator(context),
),
),
if (widget.vawStatus != 'S')
Padding(
padding: const EdgeInsetsDirectional.fromSTEB(
24.0, 0.0, 24.0, 0.0),
child: TextFormField(
controller: _model.textController4,
focusNode: _model.textFieldFocusNode4,
autofocus: false,
textCapitalization: TextCapitalization.none,
textInputAction: TextInputAction.next,
readOnly: true,
obscureText: false,
decoration: InputDecoration(
isDense: true,
labelText: FFLocalizations.of(context).getText(
'yyni99pe' /* Data */,
),
labelStyle: FlutterFlowTheme.of(context)
.labelMedium
.override(
fontFamily: FlutterFlowTheme.of(context)
.labelMediumFamily,
color: FlutterFlowTheme.of(context).primaryText,
letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap().containsKey(
FlutterFlowTheme.of(context)
.labelMediumFamily),
), ),
hintStyle:
FlutterFlowTheme.of(context).labelMedium.override(
fontFamily: FlutterFlowTheme.of(context)
.labelMediumFamily,
letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap()
.containsKey(FlutterFlowTheme.of(context)
.labelMediumFamily),
),
enabledBorder: InputBorder.none,
focusedBorder: InputBorder.none,
errorBorder: InputBorder.none,
focusedErrorBorder: InputBorder.none,
suffixIcon: Icon(
Icons.date_range,
color: FlutterFlowTheme.of(context).accent1,
),
),
style: FlutterFlowTheme.of(context).bodyMedium.override(
fontFamily:
FlutterFlowTheme.of(context).bodyMediumFamily,
color: FlutterFlowTheme.of(context).primaryText,
letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap().containsKey(
FlutterFlowTheme.of(context).bodyMediumFamily),
),
textAlign: TextAlign.start,
validator:
_model.textController4Validator.asValidator(context),
),
),
if (widget.vawStatus == 'S')
Padding(
padding: const EdgeInsetsDirectional.fromSTEB(
24.0, 20.0, 24.0, 20.0),
child: TextFormField(
controller: _model.textController5,
focusNode: _model.textFieldFocusNode5,
autofocus: false,
textInputAction: TextInputAction.next,
obscureText: false,
decoration: InputDecoration(
isDense: true,
labelText: FFLocalizations.of(context).getText(
'ssz899es' /* Pergunta */,
),
labelStyle: FlutterFlowTheme.of(context)
.labelMedium
.override(
fontFamily: FlutterFlowTheme.of(context)
.labelMediumFamily,
color: FlutterFlowTheme.of(context).primaryText,
letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap().containsKey(
FlutterFlowTheme.of(context)
.labelMediumFamily),
),
hintStyle: FlutterFlowTheme.of(context)
.labelMedium
.override(
fontFamily: FlutterFlowTheme.of(context)
.labelMediumFamily,
color: FlutterFlowTheme.of(context).primaryText,
letterSpacing: 0.0,
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),
),
suffixIcon: Icon(
Icons.question_answer,
color: FlutterFlowTheme.of(context).accent1,
),
),
style: FlutterFlowTheme.of(context).bodyMedium.override(
fontFamily:
FlutterFlowTheme.of(context).bodyMediumFamily,
color: FlutterFlowTheme.of(context).primaryText,
letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap().containsKey(
FlutterFlowTheme.of(context).bodyMediumFamily),
),
validator:
_model.textController5Validator.asValidator(context),
),
),
if (widget.vawStatus == 'S')
Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center,
children: [
FlutterFlowIconButton(
borderRadius: 20.0,
borderWidth: 1.0,
showLoadingIndicator: isLoaded,
buttonSize: 40.0,
fillColor: FlutterFlowTheme.of(context).error,
icon: Icon(
Icons.close,
color: FlutterFlowTheme.of(context).primaryBackground,
size: 24.0,
),
onPressed: () async {
await widget.changeStatusAction?.call(
context,
'B',
widget.vawRef ?? '',
_model.textController5.text,
widget.vteUUID ?? '',
); );
}, }).toList();
), }).toList(),
FlutterFlowIconButton( ),
borderRadius: 20.0, const SizedBox(height: 10.0),
showLoadingIndicator: isLoaded, // ListView.builder(
borderWidth: 1.0, // shrinkWrap: true,
buttonSize: 40.0, // itemCount: labelsLinkedHashMap.length,
fillColor: FlutterFlowTheme.of(context).success, // physics: const NeverScrollableScrollPhysics(),
icon: Icon( // itemBuilder: (context, index) {
Icons.done, // String key = labelsLinkedHashMap.keys.elementAt(index);
color: FlutterFlowTheme.of(context).primaryBackground, // String value = labelsLinkedHashMap[key]!;
size: 24.0, // return Text('key: $key, value: $value');
), // },
onPressed: () async { // ),
await widget.changeStatusAction?.call( const SizedBox(height: 20.0),
context, ],
'L', ),
widget.vawRef ?? '', ),
_model.textController5.text,
widget.vteUUID ?? '',
);
},
),
].divide(const SizedBox(width: 20.0)),
),
]
.divide(const SizedBox(height: 10.0))
.addToStart(const SizedBox(height: 20.0))
.addToEnd(const SizedBox(height: 20.0)),
), ),
), ),
), );
), },
); );
} }
} }

View File

@ -1,4 +1,3 @@
import 'package:firebase_core/firebase_core.dart'; import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_crashlytics/firebase_crashlytics.dart'; import 'package:firebase_crashlytics/firebase_crashlytics.dart';
import 'package:hub/app_state.dart'; import 'package:hub/app_state.dart';
@ -141,4 +140,4 @@ class _MyAppState extends State<MyApp> {
routerConfig: _router, routerConfig: _router,
); );
} }
} }

View File

@ -21,7 +21,6 @@ import 'package:google_fonts/google_fonts.dart';
import 'package:hub/pages/liberation_history/liberation_history_model.dart'; import 'package:hub/pages/liberation_history/liberation_history_model.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class LiberationHistoryWidget extends StatefulWidget { class LiberationHistoryWidget extends StatefulWidget {
const LiberationHistoryWidget({super.key}); const LiberationHistoryWidget({super.key});
@ -258,11 +257,9 @@ Widget liberationDynamicListView(
.where((item) => jsonToStr(getJsonField( .where((item) => jsonToStr(getJsonField(
item, item,
r'''$.VTE_NOME''', r'''$.VTE_NOME''',
)) )).toLowerCase().contains(
.toLowerCase() _model.textController.text.toLowerCase(),
.contains( ))
_model.textController.text.toLowerCase(),
))
.toList() .toList()
: liberationHistory; : liberationHistory;
@ -309,26 +306,28 @@ Widget liberationHistoryItemCard(
'Data:': liberationHistoryItem['NOT_DTENVIO'], 'Data:': liberationHistoryItem['NOT_DTENVIO'],
'Motivo:': liberationHistoryItem['NOT_MOTIVO'], 'Motivo:': liberationHistoryItem['NOT_MOTIVO'],
}), }),
statusHashMap: [liberationHistoryItem['NOT_STATUS'] == 'L' statusHashMap: [
? Map<String, Color>.from({ liberationHistoryItem['NOT_STATUS'] == 'L'
FFLocalizations.of(context).getVariableText( ? Map<String, Color>.from({
ptText: 'Ativo', FFLocalizations.of(context).getVariableText(
enText: 'Active', ptText: 'Ativo',
): FlutterFlowTheme.of(context).success, enText: 'Active',
}) ): FlutterFlowTheme.of(context).success,
: liberationHistoryItem['NOT_STATUS'] == 'B' })
? Map<String, Color>.from({ : liberationHistoryItem['NOT_STATUS'] == 'B'
FFLocalizations.of(context).getVariableText( ? Map<String, Color>.from({
ptText: 'Bloqueado', FFLocalizations.of(context).getVariableText(
enText: 'Blocked', ptText: 'Bloqueado',
): FlutterFlowTheme.of(context).error, enText: 'Blocked',
}) ): FlutterFlowTheme.of(context).error,
: Map<String, Color>.from({ })
FFLocalizations.of(context).getVariableText( : Map<String, Color>.from({
ptText: 'Pendente', FFLocalizations.of(context).getVariableText(
enText: 'Pending', ptText: 'Pendente',
): FlutterFlowTheme.of(context).warning, enText: 'Pending',
})], ): FlutterFlowTheme.of(context).warning,
})
],
onTapCardItemAction: () async { onTapCardItemAction: () async {
showModalBottomSheet( showModalBottomSheet(
isScrollControlled: true, isScrollControlled: true,
@ -352,6 +351,39 @@ Widget liberationHistoryItemCard(
vawUUID: liberationHistoryItem['NOT_ID'], vawUUID: liberationHistoryItem['NOT_ID'],
vawName: liberationHistoryItem['NOT_NOME'], vawName: liberationHistoryItem['NOT_NOME'],
vawRef: liberationHistoryItem['NOT_ID'], vawRef: liberationHistoryItem['NOT_ID'],
labelsHashMap: Map<String, String>.from({
'Nome:': liberationHistoryItem['VTE_NOME'],
'Data:': liberationHistoryItem['NOT_DTENVIO'],
'Motivo:': liberationHistoryItem['NOT_MOTIVO'],
'Mensagem:': liberationHistoryItem['NOT_MSGENVIO'],
// 'Resposta:': liberationHistoryItem['NOT_MSGRESPOSTA'],
}),
statusHashMap: [
liberationHistoryItem['NOT_STATUS'] == 'L'
? Map<String, Color>.from({
FFLocalizations.of(context).getVariableText(
ptText: 'Ativo',
enText: 'Active',
): FlutterFlowTheme.of(context).success,
})
: liberationHistoryItem['NOT_STATUS'] == 'B'
? Map<String, Color>.from({
FFLocalizations.of(context).getVariableText(
ptText: 'Bloqueado',
enText: 'Blocked',
): FlutterFlowTheme.of(context).error,
})
: Map<String, Color>.from({
FFLocalizations.of(context).getVariableText(
ptText: 'Pendente',
enText: 'Pending',
): FlutterFlowTheme.of(context).warning,
})
],
imageHashMap: Map<String, String>.from({
'key': liberationHistoryItem['VTE_ID'],
'value': 'E',
}),
changeStatusAction: changeStatusAction, changeStatusAction: changeStatusAction,
// vteDocument: liberationHistoryItem['VTE_DOCUMENTO'], // vteDocument: liberationHistoryItem['VTE_DOCUMENTO'],
); );
@ -380,4 +412,4 @@ Widget liberationHistoryItemCard(
}); });
}, },
); );
} }

View File

@ -239,6 +239,7 @@ Widget messageHistoryItem(BuildContext context, dynamic jsonBody) {
return Padding( return Padding(
padding: const EdgeInsets.symmetric(horizontal: 15), padding: const EdgeInsets.symmetric(horizontal: 15),
child: Card( child: Card(
color: FlutterFlowTheme.of(context).primaryBackground,
child: Container( child: Container(
// height: 100, // height: 100,
child: Padding( child: Padding(
@ -249,54 +250,65 @@ Widget messageHistoryItem(BuildContext context, dynamic jsonBody) {
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Row( Column(
mainAxisAlignment: MainAxisAlignment.end,
mainAxisSize: MainAxisSize.max,
children: [ children: [
Padding(
padding: const EdgeInsets.only(left: 15.0),
child: Text(
jsonBody['MSG_DATE'].toString(),
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 10,
color: FlutterFlowTheme.of(context).customColor6,
overflow: TextOverflow.ellipsis,
),
),
),
],
),
Row(
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 15.0),
child: Text(
jsonBody['MSG_ORIGEM_DESC'].toString(),
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 12,
color: FlutterFlowTheme.of(context).primary,
),
overflow: TextOverflow.fade,
),
),
Icon( Icon(
jsonBody['MSG_DESTINO_TP'] == 'T' jsonBody['MSG_DESTINO_TP'] == 'T'
? Icons.group ? Icons.group
: Icons.person, : Icons.person,
color: FlutterFlowTheme.of(context).primary, color: FlutterFlowTheme.of(context).primary,
size: 25,
),
Icon(
Icons.history,
color: FlutterFlowTheme.of(context).customColor6,
size: 15,
), ),
], ],
), ),
Expanded(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 15.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
jsonBody['MSG_ORIGEM_DESC'].toString(),
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 15,
color: FlutterFlowTheme.of(context).primary,
),
overflow: TextOverflow.fade,
),
SizedBox(height: 4),
Text(
jsonBody['MSG_DATE'].toString(),
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 10,
color: FlutterFlowTheme.of(context).customColor6,
overflow: TextOverflow.ellipsis,
),
),
],
),
),
),
], ],
), ),
SizedBox(height: 8), SizedBox(height: 8),
Padding( Row(
padding: const EdgeInsets.all(8.0), children: [
child: Text( Expanded(
jsonBody['MSG_TEXTO'].toString(), child: Padding(
), padding: const EdgeInsets.all(8.0),
child: Text(
jsonBody['MSG_TEXTO'].toString(),
),
),
),
],
), ),
SizedBox(height: 8), SizedBox(height: 8),
], ],

View File

@ -52,7 +52,11 @@ class PreferencesPageModel with ChangeNotifier {
void enablePerson(BuildContext context) { void enablePerson(BuildContext context) {
notifyListeners(); notifyListeners();
Share.share( Share.share(
FFAppState().userDevUUID, FFLocalizations.of(context).getVariableText(
ptText:
'Este é o meu identificador de acesse: ${FFAppState().userDevUUID}',
enText: 'This is my access identifier: ${FFAppState().userDevUUID}',
),
); );
} }
@ -89,151 +93,335 @@ class PreferencesPageModel with ChangeNotifier {
} }
void localUnlink(BuildContext context) { void localUnlink(BuildContext context) {
PhpGroup.resopndeVinculo showDialog(
.call( context: context,
userUUID: FFAppState().userUUID, builder: (context) {
devUUID: FFAppState().devUUID, return AlertDialog(
cliID: FFAppState().cliUUID, backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
tarefa: 'I', title: Text(
)
.catchError((err) {
log(err.toString());
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(
FFLocalizations.of(context).getVariableText( FFLocalizations.of(context).getVariableText(
enText: 'Error unlinking device', enText: 'Unlink device',
ptText: 'Erro ao desvincular dispositivo', ptText: 'Desvincular dispositivo',
), ),
style: TextStyle(color: FlutterFlowTheme.of(context).info)), ),
backgroundColor: FlutterFlowTheme.of(context).error, content: Text(
duration: const Duration(seconds: 3), FFLocalizations.of(context).getVariableText(
behavior: SnackBarBehavior.floating, enText: 'Are you sure you want to unlink this device?',
shape: RoundedRectangleBorder( ptText: 'Tem certeza que deseja desvincular este dispositivo?',
borderRadius: BorderRadius.circular(30), ),
), ),
), actions: [
); TextButton(
}).then( onPressed: () {
(value) { Navigator.pop(context);
FFAppState().deleteCliUUID(); },
FFAppState().deleteLocal(); child: Text(
FFAppState().deleteOwnerUUID(); FFLocalizations.of(context).getVariableText(
Navigator.pop(context); enText: 'Cancel',
}, ptText: 'Cancelar',
); ),
style: TextStyle(color: FlutterFlowTheme.of(context).info),
),
),
TextButton(
onPressed: () {
PhpGroup.resopndeVinculo
.call(
userUUID: FFAppState().userUUID,
devUUID: FFAppState().devUUID,
cliID: FFAppState().cliUUID,
tarefa: 'I',
)
.catchError((err) {
log(err.toString());
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(
FFLocalizations.of(context).getVariableText(
enText: 'Error unlinking device',
ptText: 'Erro ao desvincular dispositivo',
),
style: TextStyle(
color: FlutterFlowTheme.of(context).info)),
backgroundColor: FlutterFlowTheme.of(context).error,
duration: const Duration(seconds: 3),
behavior: SnackBarBehavior.floating,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(30),
),
),
);
}).then(
(value) {
FFAppState().deleteCliUUID();
FFAppState().deleteLocal();
FFAppState().deleteOwnerUUID();
Navigator.pop(context);
Navigator.pop(context);
},
);
notifyListeners();
},
child: Text(
FFLocalizations.of(context).getVariableText(
enText: 'Unlink',
ptText: 'Desvincular',
),
style: TextStyle(color: FlutterFlowTheme.of(context).info),
),
),
],
);
});
notifyListeners(); notifyListeners();
} }
void deleteAccount(BuildContext context) { void deleteAccount(BuildContext context) {
FFAppState().deleteAll(); showDialog(
FFAppState().isLogged = false; context: context,
context.goNamed( builder: (context) {
'welcomePage', return AlertDialog(
extra: <String, dynamic>{ backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
kTransitionInfoKey: const TransitionInfo( title: Text(
hasTransition: true, FFLocalizations.of(context).getVariableText(
transitionType: PageTransitionType.scale, enText: 'Delete account',
alignment: Alignment.bottomCenter, ptText: 'Deletar conta',
), ),
}, ),
); content: Text(
FFLocalizations.of(context).getVariableText(
enText: 'Are you sure you want to delete your account?',
ptText: 'Tem certeza que deseja deletar sua conta?',
),
),
actions: [
TextButton(
onPressed: () => Navigator.pop(context),
child: Text(
FFLocalizations.of(context).getVariableText(
enText: 'Cancel',
ptText: 'Cancelar',
),
style: TextStyle(color: FlutterFlowTheme.of(context).info),
),
),
TextButton(
onPressed: () {
PhpGroup.deleteAccount
.call(
devUUID: FFAppState().devUUID,
userUUID: FFAppState().userUUID,
)
.then((value) {
FFAppState().deleteAll();
FFAppState().isLogged = false;
context.goNamed(
'welcomePage',
extra: <String, dynamic>{
kTransitionInfoKey: const TransitionInfo(
hasTransition: true,
transitionType: PageTransitionType.scale,
alignment: Alignment.bottomCenter,
),
},
);
}).catchError((err) {
log(err.toString());
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(
FFLocalizations.of(context).getVariableText(
enText: 'Error deleting account',
ptText: 'Erro ao deletar conta',
),
style: TextStyle(
color: FlutterFlowTheme.of(context).info)),
backgroundColor: FlutterFlowTheme.of(context).error,
duration: const Duration(seconds: 3),
behavior: SnackBarBehavior.floating,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(30),
),
),
);
});
notifyListeners();
},
child: Text(
FFLocalizations.of(context).getVariableText(
enText: 'Delete',
ptText: 'Deletar',
),
style: TextStyle(color: FlutterFlowTheme.of(context).info),
),
),
],
);
});
notifyListeners();
// PhpGroup.deleteAccount
// .call(
// devUUID: FFAppState().devUUID,
// userUUID: FFAppState().userUUID,
// )
// .then((value) {
// FFAppState().deleteAll();
// FFAppState().isLogged = false;
// context.goNamed(
// 'welcomePage',
// extra: <String, dynamic>{
// kTransitionInfoKey: const TransitionInfo(
// hasTransition: true,
// transitionType: PageTransitionType.scale,
// alignment: Alignment.bottomCenter,
// ),
// },
// );
// }).catchError((err) {
// log(err.toString());
// ScaffoldMessenger.of(context).showSnackBar(
// SnackBar(
// content: Text(
// FFLocalizations.of(context).getVariableText(
// ptText: 'Erro ao deletar dispositivo',
// enText: 'Error deleting device',
// ),
// style: TextStyle(color: FlutterFlowTheme.of(context).info)),
// backgroundColor: FlutterFlowTheme.of(context).error,
// duration: const Duration(seconds: 3),
// behavior: SnackBarBehavior.floating,
// shape: RoundedRectangleBorder(
// borderRadius: BorderRadius.circular(30),
// ),
// ),
// );
// });
} }
Future<void> togglePass(BuildContext context) async { Future<void> togglePass(BuildContext context) async {
debugPrint('pass: ${FFAppState().pass}'); debugPrint('pass: ${FFAppState().pass}');
if (FFAppState().pass) { // if (FFAppState().pass) {
FFAppState().pass = false; // FFAppState().pass = false;
FFAppState().deleteAccessPass(); // FFAppState().deleteAccessPass();
notifyListeners(); // notifyListeners();
} else { // } else {
await showModalBottomSheet( await showModalBottomSheet(
isScrollControlled: true, isScrollControlled: true,
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
useSafeArea: true, useSafeArea: true,
context: context, context: context,
builder: (context) { builder: (context) {
return Padding( return Padding(
padding: MediaQuery.viewInsetsOf(context), padding: MediaQuery.viewInsetsOf(context),
child: PassKeyTemplateWidget( child: PassKeyTemplateWidget(
toggleActionStatus: (key) async { toggleActionStatus: (key) async {
FFAppState().accessPass = key; FFAppState().accessPass = key;
notifyListeners(); notifyListeners();
debugPrint('key: $key'); debugPrint('key: $key');
await PhpGroup.changePass await PhpGroup.changePass
.call( .call(
userUUID: FFAppState().userUUID, userUUID: FFAppState().userUUID,
devUUID: FFAppState().devUUID, devUUID: FFAppState().devUUID,
cliID: FFAppState().cliUUID, cliID: FFAppState().cliUUID,
atividade: 'updVisitado', atividade: 'updVisitado',
newSenha: FFAppState().accessPass, newSenha: FFAppState().accessPass,
) )
.then((value) { .then((value) {
FFAppState().pass = true;
// var error = jsonDecode(value.jsonBody['error'].toString());
// log('${jsonDecode(value.jsonBody['error'].toString())}');
if (jsonDecode(value.jsonBody['error'].toString()) == false) {
FFAppState().pass = true; FFAppState().pass = true;
// var error = jsonDecode(value.jsonBody['error'].toString()); } else {
// log('${jsonDecode(value.jsonBody['error'].toString())}');
if (jsonDecode(value.jsonBody['error'].toString()) == false) {
FFAppState().pass = true;
} else {
FFAppState().pass = false;
}
}).onError((error, StackTrace) {
FFAppState().pass = false; FFAppState().pass = false;
log(error.toString()); }
log(StackTrace.toString()); }).catchError((error, StackTrace) {
}).whenComplete(() => notifyListeners()); FFAppState().pass = false;
}, log(error.toString());
), log(StackTrace.toString());
); ScaffoldMessenger.of(context).showSnackBar(
}, SnackBar(
); content: Text(
} FFLocalizations.of(context).getVariableText(
ptText: 'Erro ao alterar senha de acesso',
enText: 'Error changing access password',
),
style: TextStyle(
color: FlutterFlowTheme.of(context).info)),
backgroundColor: FlutterFlowTheme.of(context).error,
duration: const Duration(seconds: 3),
behavior: SnackBarBehavior.floating,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(30),
),
),
);
}).whenComplete(() => notifyListeners());
},
),
);
},
);
// }
} }
Future<void> togglePanic(BuildContext context) async { Future<void> togglePanic(BuildContext context) async {
if (FFAppState().panic) { await showModalBottomSheet(
FFAppState().panic = false; isScrollControlled: true,
FFAppState().deletePanicPass(); backgroundColor: Colors.transparent,
notifyListeners(); useSafeArea: true,
} else { context: context,
await showModalBottomSheet( builder: (context) {
isScrollControlled: true, return Padding(
backgroundColor: Colors.transparent, padding: MediaQuery.viewInsetsOf(context),
useSafeArea: true, child: PassKeyTemplateWidget(
context: context, toggleActionStatus: (key) async {
builder: (context) { FFAppState().panicPass = key;
return Padding( notifyListeners();
padding: MediaQuery.viewInsetsOf(context), await PhpGroup.changePanic
child: PassKeyTemplateWidget( .call(
toggleActionStatus: (key) async { userUUID: FFAppState().userUUID,
FFAppState().panicPass = key; devUUID: FFAppState().devUUID,
notifyListeners(); cliID: FFAppState().cliUUID,
await PhpGroup.changePass atividade: 'updVisitado',
.call( newSenhaPanico: FFAppState().panicPass,
userUUID: FFAppState().userUUID, )
devUUID: FFAppState().devUUID, .then((value) {
cliID: FFAppState().cliUUID, FFAppState().panic = true;
atividade: 'updVisitado', if (jsonDecode(value.jsonBody['error'].toString()) == false) {
newSenha: FFAppState().panicPass,
)
.then((value) {
FFAppState().panic = true; FFAppState().panic = true;
if (jsonDecode(value.jsonBody['error'].toString()) == false) { } else {
FFAppState().panic = true;
} else {
FFAppState().panic = false;
}
}).onError((e, s) {
FFAppState().panic = false; FFAppState().panic = false;
log(e.toString()); }
log(s.toString()); }).catchError((e, s) {
}).whenComplete(() => notifyListeners()); FFAppState().panic = false;
},
), log(e.toString());
); log(s.toString());
}, ScaffoldMessenger.of(context).showSnackBar(
); SnackBar(
} content: Text(
FFLocalizations.of(context).getVariableText(
ptText: 'Erro ao alterar senha de pânico',
enText: 'Error changing panic password',
),
style: TextStyle(
color: FlutterFlowTheme.of(context).info)),
backgroundColor: FlutterFlowTheme.of(context).error,
duration: const Duration(seconds: 3),
behavior: SnackBarBehavior.floating,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(30),
),
),
);
}).whenComplete(() => notifyListeners());
},
),
);
},
);
} }
@override @override

View File

@ -6,8 +6,11 @@ import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart'; import 'package:flutter/scheduler.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart';
import 'package:google_fonts/google_fonts.dart'; import 'package:google_fonts/google_fonts.dart';
import 'package:hub/actions/actions.dart';
import 'package:hub/backend/api_requests/api_calls.dart'; import 'package:hub/backend/api_requests/api_calls.dart';
import 'package:hub/components/templates_components/card_item_template_component/card_item_template_component_widget.dart';
import 'package:hub/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart'; import 'package:hub/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart';
import 'package:hub/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart';
import 'package:hub/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart'; import 'package:hub/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart';
import 'package:hub/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart'; import 'package:hub/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart';
import 'package:hub/flutter_flow/custom_functions.dart'; import 'package:hub/flutter_flow/custom_functions.dart';
@ -1675,544 +1678,236 @@ Widget visitHistory(
color: FlutterFlowTheme.of(context).primaryBackground, color: FlutterFlowTheme.of(context).primaryBackground,
), ),
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column( child: FutureBuilder<ApiCallResponse>(
mainAxisSize: MainAxisSize.max, future: _model.visitHistory(
children: [ requestFn: () => PhpGroup.getVisitsCall.call(
Row( devUUID: FFAppState().devUUID,
mainAxisSize: MainAxisSize.max, userUUID: FFAppState().userUUID,
mainAxisAlignment: MainAxisAlignment.spaceEvenly, cliID: FFAppState().cliUUID,
children: [ atividade: 'getVisitas',
FlutterFlowIconButton(
borderColor: Colors.transparent,
borderRadius: 20.0,
borderWidth: 1.0,
buttonSize: 40.0,
icon: Icon(
Icons.settings_sharp,
color: FlutterFlowTheme.of(context).primary,
size: 24.0,
),
onPressed: () {
log('IconButton pressed ...');
},
),
],
), ),
FutureBuilder<ApiCallResponse>( ),
future: _model.visitHistory( builder: (context, snapshot) {
requestFn: () => PhpGroup.getVisitsCall.call( // Customize what your widget looks like when it's loading.
devUUID: FFAppState().devUUID, if (!snapshot.hasData) {
userUUID: FFAppState().userUUID, return Center(
cliID: FFAppState().cliUUID, child: SizedBox(
atividade: 'getVisitas', width: 50.0,
height: 50.0,
child: SpinKitCircle(
color: FlutterFlowTheme.of(context).primary,
size: 50.0,
),
), ),
), );
builder: (context, snapshot) { }
// Customize what your widget looks like when it's loading. final wrapGetVisitsResponse = snapshot.data!;
if (!snapshot.hasData) { return Builder(
return Center( builder: (context) {
child: SizedBox( final visitaWrap = PhpGroup.getVisitsCall
width: 50.0, .visitasList(
height: 50.0, wrapGetVisitsResponse.jsonBody,
child: SpinKitCircle( )
color: FlutterFlowTheme.of(context).primary, ?.toList() ??
size: 50.0, [];
), return ListView.builder(
), itemCount: visitaWrap.length,
); shrinkWrap: true,
} scrollDirection: Axis.vertical,
final wrapGetVisitsResponse = snapshot.data!; physics: const BouncingScrollPhysics(),
return Builder( addAutomaticKeepAlives: true,
builder: (context) { cacheExtent: 1000.0,
final visitaWrap = PhpGroup.getVisitsCall addRepaintBoundaries: true,
.visitasList( addSemanticIndexes: true,
wrapGetVisitsResponse.jsonBody, itemBuilder: (context, index) {
) final visitaWrapItem = visitaWrap[index];
?.toList() ?? // visitaWrap.length, (visitaWrapIndex) {
[];
return ListView.builder(
itemCount: visitaWrap.length,
shrinkWrap: true,
scrollDirection: Axis.vertical,
physics: const BouncingScrollPhysics(),
addAutomaticKeepAlives: true,
cacheExtent: 1000.0,
addRepaintBoundaries: true,
addSemanticIndexes: true,
itemBuilder: (context, index) {
final visitaWrapItem = visitaWrap[index];
// visitaWrap.length, (visitaWrapIndex) {
return InkWell( return CardItemTemplateComponentWidget(
splashColor: Colors.transparent, imageHashMap: Map<String, String>.from({
focusColor: Colors.transparent, 'key': visitaWrapItem['VTE_DOCUMENTO'] ?? '',
hoverColor: Colors.transparent, 'value': 'E',
highlightColor: Colors.transparent, }),
onTap: () async { labelsHashMap: Map<String, String>.from({
await showModalBottomSheet( 'Nome:': visitaWrapItem['VTE_NOME'] ?? '',
isScrollControlled: true, 'Inicio:': visitaWrapItem['VAW_DTINICIO'] ?? '',
backgroundColor: Colors.transparent, 'Fim:': visitaWrapItem['VAW_DTFIM'] ?? '',
enableDrag: false, }),
useSafeArea: true, statusHashMap: [
context: context, visitaWrapItem['VAW_STATUS'] == 'A'
builder: (context) { ? Map<String, Color>.from({
return GestureDetector( FFLocalizations.of(context).getVariableText(
onTap: () => ptText: 'Ativo',
_model.unfocusNode.canRequestFocus enText: 'Active',
? FocusScope.of(context) ): FlutterFlowTheme.of(context).success,
.requestFocus(_model.unfocusNode) })
: FocusScope.of(context).unfocus(), : visitaWrapItem['VAW_STATUS'] == 'F' ||
child: Padding( visitaWrapItem['VAW_STATUS'] == 'B' ||
padding: MediaQuery.viewInsetsOf(context), visitaWrapItem['VAW_STATUS'] == 'C' ||
child: visitaWrapItem['VAW_STATUS'] == 'I'
VisitDetailsModalTemplateComponentWidget( ? Map<String, Color>.from({
visitStatusStr: getJsonField( FFLocalizations.of(context)
visitaWrapItem, .getVariableText(
r'''$.VAW_STATUS''', ptText: 'Pendente',
).toString(), enText: 'Pending',
visitStartDateStr: getJsonField( ): FlutterFlowTheme.of(context).warning,
visitaWrapItem, })
r'''$.VAW_DTINICIO''', : Map<String, Color>.from({
).toString(), FFLocalizations.of(context)
visitEndDateStr: getJsonField( .getVariableText(
visitaWrapItem, ptText: 'Cancelado',
r'''$.VAW_DTFIM''', enText: 'Canceled',
).toString(), ): FlutterFlowTheme.of(context).error,
visitReasonStr: getJsonField( }),
visitaWrapItem, ],
r'''$.MOT_DESCRICAO''', onTapCardItemAction: () async {
).toString(), showModalBottomSheet(
visitLevelStr: getJsonField( isScrollControlled: true,
visitaWrapItem, isDismissible: true,
r'''$.NAC_DESCRICAO''', backgroundColor: Colors.transparent,
).toString(), useSafeArea: true,
visitTempStr: getJsonField( context: context,
visitaWrapItem, builder: (context) {
r'''$.VTE_UNICA''', return VisitRequestTemplateComponentWidget(
).toString(), vteName: 'Lorem Ipsus',
visitObsStr: getJsonField( vteReason: 'Lorem Ipsus',
visitaWrapItem, vawDate: 'Lorem Ipsus',
r'''$.VAW_OBS''', vawStatus: 'Lorem Ipsus',
).toString(), vteMsg: 'Lorem Ipsus',
visitorImgPath: valueOrDefault<String>( vteUUID: 'Lorem Ipsus',
"https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( cliUUID: FFAppState().cliUUID,
visitaWrapItem, msgUUID: 'Lorem Ipsus',
r'''$.VTE_DOCUMENTO''', vawDestino: 'Lorem Ipsus',
).toString()}&tipo=E", vawUUID: 'Lorem Ipsus',
'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', vawName: 'Lorem Ipsus',
), vawRef: 'Lorem Ipsus',
visitorStrList: getJsonField( labelsHashMap: Map<String, String>.from({
visitaWrapItem, 'Nome:': visitaWrapItem['VTE_NOME'] ?? '',
r'''$.VTE_DOCUMENTO''', 'Inicio:':
).toString(), visitaWrapItem['VAW_DTINICIO'] ?? '',
visitIdStr: getJsonField( 'Fim:': visitaWrapItem['VAW_DTFIM'] ?? '',
visitaWrapItem, }),
r'''$.VAW_ID''', imageHashMap: Map<String, String>.from({
).toString(), 'key': visitaWrapItem['VTE_DOCUMENTO'] ?? '',
visitStatusColor: getJsonField( 'value': 'E',
visitaWrapItem, }),
r'''$.VAW_STATUS''', statusHashMap: [
).toString() == visitaWrapItem['VAW_STATUS'] == 'A'
'A' ? Map<String, Color>.from({
? FlutterFlowTheme.of(context).success FFLocalizations.of(context)
: FlutterFlowTheme.of(context).error, .getVariableText(
visitorJsonList: ptText: 'Ativo',
PhpGroup.getVisitsCall.visitasList( enText: 'Active',
wrapGetVisitsResponse.jsonBody, ): FlutterFlowTheme.of(context)
), .success,
updateToggleIdx: () async {}, })
repeatVisitSchedule: () async {}, : visitaWrapItem['VAW_STATUS'] == 'F' ||
), visitaWrapItem['VAW_STATUS'] ==
), 'B' ||
); visitaWrapItem['VAW_STATUS'] ==
}, 'C' ||
).then((value) => safeSetState(() {})); visitaWrapItem['VAW_STATUS'] ==
}, 'I'
child: Card( ? Map<String, Color>.from({
clipBehavior: Clip.antiAliasWithSaveLayer, FFLocalizations.of(context)
color: .getVariableText(
FlutterFlowTheme.of(context).primaryBackground, ptText: 'Pendente',
elevation: 5.0, enText: 'Pending',
shape: RoundedRectangleBorder( ): FlutterFlowTheme.of(context)
borderRadius: BorderRadius.circular(8.0), .warning,
), })
child: Container( : Map<String, Color>.from({
width: 350.0, FFLocalizations.of(context)
height: 115.0, .getVariableText(
decoration: BoxDecoration( ptText: 'Cancelado',
color: FlutterFlowTheme.of(context) enText: 'Canceled',
.primaryBackground, ): FlutterFlowTheme.of(context)
), .error,
child: Row( }),
mainAxisSize: MainAxisSize.max,
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Container(
width: 100.0,
height: 100.0,
decoration: const BoxDecoration(),
child: Column(
mainAxisSize: MainAxisSize.max,
children: [
Row(
mainAxisSize: MainAxisSize.max,
children: [
Text(
FFLocalizations.of(context)
.getText(
'i46frqyi' /* Visitante: */,
),
style:
FlutterFlowTheme.of(context)
.bodyMedium
.override(
fontFamily:
FlutterFlowTheme.of(
context)
.bodyMediumFamily,
fontSize: 12.5,
letterSpacing: 0.0,
fontWeight:
FontWeight.bold,
useGoogleFonts: GoogleFonts
.asMap()
.containsKey(
FlutterFlowTheme.of(
context)
.bodyMediumFamily),
),
),
Align(
alignment:
const AlignmentDirectional(
-1.0, -1.0),
child: Text(
getJsonField(
visitaWrapItem,
r'''$.VTE_NOME''',
).toString(),
style: FlutterFlowTheme.of(
context)
.bodyMedium
.override(
fontFamily:
FlutterFlowTheme.of(
context)
.bodyMediumFamily,
fontSize: 12.5,
letterSpacing: 0.0,
useGoogleFonts: GoogleFonts
.asMap()
.containsKey(
FlutterFlowTheme.of(
context)
.bodyMediumFamily),
),
),
),
].addToStart(
const SizedBox(width: 10.0)),
),
Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment:
MainAxisAlignment.start,
children: [
Text(
FFLocalizations.of(context)
.getText(
'73b1kj59' /* Início em: */,
),
style:
FlutterFlowTheme.of(context)
.bodyMedium
.override(
fontFamily:
FlutterFlowTheme.of(
context)
.bodyMediumFamily,
fontSize: 12.5,
letterSpacing: 0.0,
fontWeight:
FontWeight.bold,
useGoogleFonts: GoogleFonts
.asMap()
.containsKey(
FlutterFlowTheme.of(
context)
.bodyMediumFamily),
),
),
Text(
getJsonField(
visitaWrapItem,
r'''$.VAW_DTINICIO''',
).toString(),
style:
FlutterFlowTheme.of(context)
.bodyMedium
.override(
fontFamily:
FlutterFlowTheme.of(
context)
.bodyMediumFamily,
fontSize: 12.5,
letterSpacing: 0.0,
useGoogleFonts: GoogleFonts
.asMap()
.containsKey(
FlutterFlowTheme.of(
context)
.bodyMediumFamily),
),
),
].addToStart(
const SizedBox(width: 10.0)),
),
Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment:
MainAxisAlignment.start,
children: [
Text(
FFLocalizations.of(context)
.getText(
'klzzrfbn' /* Fim em: */,
),
style:
FlutterFlowTheme.of(context)
.bodyMedium
.override(
fontFamily:
FlutterFlowTheme.of(
context)
.bodyMediumFamily,
fontSize: 12.5,
letterSpacing: 0.0,
fontWeight:
FontWeight.bold,
useGoogleFonts: GoogleFonts
.asMap()
.containsKey(
FlutterFlowTheme.of(
context)
.bodyMediumFamily),
),
),
Text(
getJsonField(
visitaWrapItem,
r'''$.VAW_DTFIM''',
).toString(),
style:
FlutterFlowTheme.of(context)
.bodyMedium
.override(
fontFamily:
FlutterFlowTheme.of(
context)
.bodyMediumFamily,
fontSize: 12.5,
letterSpacing: 0.0,
useGoogleFonts: GoogleFonts
.asMap()
.containsKey(
FlutterFlowTheme.of(
context)
.bodyMediumFamily),
),
),
].addToStart(
const SizedBox(width: 10.0)),
),
Align(
alignment:
const AlignmentDirectional(
-1.0, 0.0),
child: Padding(
padding:
const EdgeInsetsDirectional
.fromSTEB(
10.0, 0.0, 0.0, 0.0),
child: Container(
width: 200.0,
height: 27.0,
decoration: BoxDecoration(
color: valueOrDefault<Color>(
() {
if (jsonToStr(
getJsonField(
visitaWrapItem,
r'''$.VAW_STATUS''',
)) ==
'\"A\"') {
return FlutterFlowTheme
.of(context)
.success;
} else if ((jsonToStr(
getJsonField(
visitaWrapItem,
r'''$.VAW_STATUS''',
)) ==
'\"C\"') ||
(jsonToStr(
getJsonField(
visitaWrapItem,
r'''$.VAW_STATUS''',
)) ==
'\"F\"') ||
(jsonToStr(
getJsonField(
visitaWrapItem,
r'''$.VAW_STATUS''',
)) ==
'\"B\"') ||
(jsonToStr(
getJsonField(
visitaWrapItem,
r'''$.VAW_STATUS''',
)) ==
'\"I\"')) {
return FlutterFlowTheme
.of(context)
.error;
} else if (jsonToStr(
getJsonField(
visitaWrapItem,
r'''$.VAW_STATUS''',
)) ==
'\"I\"') {
return FlutterFlowTheme
.of(context)
.warning;
} else {
return FlutterFlowTheme
.of(context)
.primary;
}
}(),
FlutterFlowTheme.of(context)
.primary,
),
borderRadius:
BorderRadius.circular(
5.0),
),
child: Align(
alignment:
const AlignmentDirectional(
0.0, 0.0),
child: Text(
() {
if (jsonToStr(
getJsonField(
visitaWrapItem,
r'''$.VAW_STATUS''',
)) ==
'\"A\"') {
return FFLocalizations
.of(context)
.getVariableText(
ptText: 'Ativo',
enText: 'Active',
);
} else if ((jsonToStr(
getJsonField(
visitaWrapItem,
r'''$.VAW_STATUS''',
)) ==
'\"F\"') ||
(jsonToStr(
getJsonField(
visitaWrapItem,
r'''$.VAW_STATUS''',
)) ==
'\"C\"') ||
(jsonToStr(
getJsonField(
visitaWrapItem,
r'''$.VAW_STATUS''',
)) ==
'\"B\"') ||
(jsonToStr(
getJsonField(
visitaWrapItem,
r'''$.VAW_STATUS''',
)) ==
'\"I\"')) {
return FFLocalizations
.of(context)
.getVariableText(
ptText: 'Cancelado',
enText: 'Canceled',
);
} else {
return FFLocalizations
.of(context)
.getVariableText(
ptText: 'Pendente',
enText: 'Pending',
);
}
}(),
style: FlutterFlowTheme.of(
context)
.bodyMedium
.override(
fontFamily:
FlutterFlowTheme.of(
context)
.bodyMediumFamily,
color: FlutterFlowTheme
.of(context)
.info,
letterSpacing: 0.0,
useGoogleFonts: GoogleFonts
.asMap()
.containsKey(
FlutterFlowTheme.of(
context)
.bodyMediumFamily),
),
),
),
),
),
),
].divide(const SizedBox(height: 3.0)),
),
),
),
ClipRRect(
borderRadius: BorderRadius.circular(0.0),
child: CachedNetworkImage(
fadeInDuration:
const Duration(milliseconds: 500),
fadeOutDuration:
const Duration(milliseconds: 500),
imageUrl: valueOrDefault<String>(
"https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField(
visitaWrapItem,
r'''$.VTE_DOCUMENTO''',
).toString()}&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,
),
),
], ],
), changeStatusAction: changeStatusAction,
), // vteDocument: liberationHistoryItem['VTE_DOCUMENTO'],
), );
); },
}); ).then((_) {
}, // PushNotificationManager _pushNotificationService =
); // PushNotificationManager();
// _pushNotificationService.onMessageReceived
// .listen((received) {
// if (received.data['click_action'] ==
// 'cancel_request') {
// log('Aprovado');
// _pushNotificationService.dispose();
// snackbar(context, opt: true);
// context.pushReplacementNamed(
// 'liberationHistory',
// extra: <String, dynamic>{
// kTransitionInfoKey: const TransitionInfo(
// hasTransition: true,
// transitionType: PageTransitionType.scale,
// alignment: Alignment.bottomCenter,
// ),
// },
// );
// }
// });
});
// await showModalBottomSheet(
// isScrollControlled: true,
// backgroundColor: Colors.transparent,
// enableDrag: true,
// isDismissible: true,
// useSafeArea: true,
// context: context,
// builder: (context) {
// return GestureDetector(
// onTap: () => _model.unfocusNode.canRequestFocus
// ? FocusScope.of(context)
// .requestFocus(_model.unfocusNode)
// : FocusScope.of(context).unfocus(),
// child: VisitDetailsModalTemplateComponentWidget(
// visitStatusStr: visitaWrapItem['VAW_STATUS'],
// visitStartDateStr:
// visitaWrapItem['VAW_DTINICIO'],
// visitEndDateStr: visitaWrapItem['VAW_DTFIM'],
// visitReasonStr:
// visitaWrapItem['MOT_DESCRICAO'],
// visitLevelStr:
// visitaWrapItem['NAC_DESCRICAO'],
// visitTempStr:
// visitaWrapItem['VTE_UNICA'].toString(),
// visitObsStr: visitaWrapItem['VAW_OBS'],
// visitorImgPath: valueOrDefault<String>(
// "https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField(
// visitaWrapItem,
// r'''$.VTE_DOCUMENTO''',
// ).toString()}&tipo=E",
// 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg',
// ),
// visitorStrList:
// visitaWrapItem['VTE_DOCUMENTO'],
// visitIdStr: visitaWrapItem['VAW_ID'],
// visitStatusColor:
// visitaWrapItem['VAW_STATUS'] == 'A'
// ? FlutterFlowTheme.of(context).success
// : FlutterFlowTheme.of(context).error,
// visitorJsonList:
// PhpGroup.getVisitsCall.visitasList(
// wrapGetVisitsResponse.jsonBody,
// ),
// updateToggleIdx: () async {},
// repeatVisitSchedule: () async {},
// ),
// );
// },
// ).then((value) => safeSetState(() {}));
});
});
}, },
) );
], },
), ),
), ),
); );