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';
/// Start PHP Group Code
class PhpGroup {
@ -46,6 +45,81 @@ class PhpGroup {
static ChangeNotifica changeNotifica = ChangeNotifica();
static RespondeVinculo resopndeVinculo = RespondeVinculo();
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 {
@ -99,7 +173,7 @@ class RespondeVinculo {
return ApiManager.instance.makeApiCall(
callName: 'respondeVinculo',
apiUrl: '$baseUrl/processRequest.php',
apiUrl: '$baseUrl/responderVinculo.php',
callType: ApiCallType.POST,
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
@ -119,7 +193,6 @@ class RespondeVinculo {
alwaysAllowBody: false,
);
}
}
class ChangeNotifica {

View File

@ -4,8 +4,6 @@ import 'dart:developer';
import 'dart:io';
import 'dart:math' as math;
import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter/cupertino.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/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/flutter_flow/flutter_flow_theme.dart';
import 'package:hub/flutter_flow/internationalization.dart';
import 'package:rxdart/rxdart.dart';
//
class PushNotificationService {
final FirebaseMessaging _firebaseMessaging = FirebaseMessaging.instance;
final FlutterLocalNotificationsPlugin _flutterLocalNotificationsPlugin =
@ -104,8 +103,6 @@ class PushNotificationService {
}
}
void _initializeLocalNotifications(
BehaviorSubject<BuildContext> context) async {
while (context.valueOrNull == null) {
@ -132,7 +129,8 @@ class PushNotificationService {
Map<String, dynamic> message =
validJsonFromString(response.payload!);
log('Notification payload: $message');
var data = _notificationDetails; // Assuming getOnMessage() now returns the latest RemoteMessage
var data =
_notificationDetails; // Assuming getOnMessage() now returns the latest RemoteMessage
log('Extra: ${data.value}');
_handleNotificationClick(message, extra: data.value);
} catch (e) {
@ -191,7 +189,8 @@ class PushNotificationService {
_onMessage.add(message);
log('Extra: ${message.notification?.body}');
NotificationHandler().handleMessage(message.data, context); });
NotificationHandler().handleMessage(message.data, context);
});
}
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) {
case true:
// Print the 'data' property
log('Notification payload: $payload');
log('Extra: $extra');
// 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'
case false:
log('Notification payload is empty');
@ -315,7 +316,8 @@ class PushNotificationService {
}
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!');
message.forEach((key, value) {
log('$key: $value');
@ -385,8 +387,8 @@ class NotificationHandler {
);
}
void _showMessageNotificationDialog(
Map<String, dynamic> message, BuildContext context, Map<String, dynamic> extra) {
void _showMessageNotificationDialog(Map<String, dynamic> message,
BuildContext context, Map<String, dynamic> extra) {
log('Showing message notification dialog');
log('Notification "message": $message');
showDialog(
@ -398,15 +400,18 @@ class NotificationHandler {
child: MessageNotificationModalTemplateComponentWidget(
id: message['local']['CLI_ID'].toString(),
from: message['remetente'].toString(),
to: message['destinatario'].toString() == 'O' ? 'Morador' : 'Visitante',
message: extra['body'].toString().isEmpty ? 'Unknown' : extra['body'].toString(),
to: message['destinatario'].toString() == 'O'
? 'Morador'
: 'Visitante',
message: extra['body'].toString().isEmpty
? 'Unknown'
: extra['body'].toString(),
),
);
},
);
}
void _showVisitRequestDialog(
Map<String, dynamic> message, BuildContext context) {
log('Showing visit request notification dialog');
@ -424,6 +429,22 @@ class NotificationHandler {
vteUUID: message['idVisitante'].toString(),
vawRef: message['referencia'].toString(),
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,
),
);
@ -448,6 +469,4 @@ class PushNotificationManager {
void dispose() {
_onMessageReceivedController.close();
}
}

View File

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

View File

@ -12,8 +12,6 @@ export 'card_item_template_component_model.dart';
///
class CardItemTemplateComponentWidget extends StatefulWidget {
const CardItemTemplateComponentWidget({
super.key,
@ -40,7 +38,9 @@ class _CardItemTemplateComponentWidgetState
LinkedHashMap.from(widget.labelsHashMap ?? {});
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
void setState(VoidCallback callback) {
@ -74,9 +74,14 @@ class _CardItemTemplateComponentWidgetState
@override
Widget build(BuildContext context) {
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(
splashColor: Colors.transparent,
focusColor: Colors.transparent,
@ -89,7 +94,7 @@ class _CardItemTemplateComponentWidgetState
padding: const EdgeInsets.fromLTRB(10, 0, 10, 0),
child: Card(
clipBehavior: Clip.antiAliasWithSaveLayer,
color: FlutterFlowTheme.of(context).secondaryBackground,
color: FlutterFlowTheme.of(context).primaryBackground,
elevation: 5.0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8.0),
@ -98,7 +103,7 @@ class _CardItemTemplateComponentWidgetState
width: 350.0,
height: 115.0,
decoration: BoxDecoration(
color: FlutterFlowTheme.of(context).secondaryBackground,
color: FlutterFlowTheme.of(context).primaryBackground,
),
child: Row(
mainAxisSize: MainAxisSize.max,
@ -106,9 +111,11 @@ class _CardItemTemplateComponentWidgetState
children: [
Expanded(
child: Container(
width: 100.0,
height: 100.0,
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height,
decoration: const BoxDecoration(),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center,
@ -123,10 +130,8 @@ class _CardItemTemplateComponentWidgetState
labelsLinkedHashMap.keys.elementAt(index);
String value = labelsLinkedHashMap[key]!;
return Padding(
padding: const EdgeInsets.only(bottom: 5.0),
child: Padding(
padding:
const EdgeInsets.fromLTRB(20, 0, 0, 0),
const EdgeInsets.fromLTRB(20, 0, 0, 5),
child: Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment:
@ -157,13 +162,16 @@ class _CardItemTemplateComponentWidgetState
const SizedBox(
width:
5.0), // Espaçamento entre o label e o valor
Text(
Flexible(
child: Text(
value,
overflow: TextOverflow.ellipsis,
style: FlutterFlowTheme.of(context)
.bodyMedium
.override(
fontFamily:
FlutterFlowTheme.of(context)
FlutterFlowTheme.of(
context)
.bodyMediumFamily,
fontSize: 12.5,
letterSpacing: 0.0,
@ -176,8 +184,8 @@ class _CardItemTemplateComponentWidgetState
.bodyMediumFamily),
),
),
],
),
],
),
);
},
@ -186,27 +194,35 @@ class _CardItemTemplateComponentWidgetState
Row(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.max,
children: statusLinkedHashMap.expand((linkedHashMap) {
return linkedHashMap.entries.map((MapEntry<String, Color> item) {
children:
statusLinkedHashMap.expand((linkedHashMap) {
return linkedHashMap.entries
.map((MapEntry<String, Color> item) {
return Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 1.0, vertical: 3.0),
padding: const EdgeInsets.symmetric(
horizontal: 1.0, vertical: 3.0),
child: Container(
width: 100.0,
height: 27.0,
decoration: BoxDecoration(
color: item.value, // Usa a cor do item atual
borderRadius: BorderRadius.circular(5.0),
color: item
.value, // Usa a cor do item atual
borderRadius:
BorderRadius.circular(5.0),
),
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
color: FlutterFlowTheme.of(
context)
.info, // Ajuste conforme necessário
),
),
),
@ -221,23 +237,25 @@ class _CardItemTemplateComponentWidgetState
]),
),
),
),
Padding(
padding: const EdgeInsetsDirectional.fromSTEB(
10.0, 10.0, 10.0, 10.0),
child: ClipRRect(
borderRadius: BorderRadius.circular(22.0),
child: AspectRatio(
aspectRatio:
1.0, // Define a proporção desejada (1:1 neste caso)
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=${widget.imageHashMap['key']}&tipo=${widget.imageHashMap['value']}',
imageUrl:
'https://freaccess.com.br/freaccess/getImage.php?cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${widget.imageHashMap['key']}&tipo=${widget.imageHashMap['value']}',
'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg',
),
fit: BoxFit.cover,
),
),
),
)
],
),
),

View File

@ -131,10 +131,10 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
context.watch<FFAppState>();
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(
width: double.infinity,
height: double.infinity,
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height,
decoration: BoxDecoration(
color: FlutterFlowTheme.of(context).primaryBackground,
borderRadius: const BorderRadius.only(
@ -264,6 +264,10 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
focusNode: _model.textFieldFocusNode1,
autofocus: false,
obscureText: false,
showCursor: false,
enabled: false,
cursorColor: FlutterFlowTheme.of(context).primary,
readOnly: true,
decoration: InputDecoration(
labelText: FFLocalizations.of(context).getText(
'9yu35pzg' /* Encerramento da Visita */,
@ -348,6 +352,10 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
focusNode: _model.textFieldFocusNode2,
autofocus: false,
obscureText: false,
showCursor: false,
enabled: false,
cursorColor: FlutterFlowTheme.of(context).primary,
readOnly: true,
decoration: InputDecoration(
labelText: FFLocalizations.of(context).getText(
'aj6scczp' /* Início */,
@ -436,6 +444,10 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
focusNode: _model.textFieldFocusNode3,
autofocus: false,
obscureText: false,
showCursor: false,
enabled: false,
cursorColor: FlutterFlowTheme.of(context).primary,
readOnly: true,
decoration: InputDecoration(
labelText: FFLocalizations.of(context).getText(
'rvi5z7wg' /* Término */,
@ -534,6 +546,10 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
focusNode: _model.textFieldFocusNode4,
autofocus: false,
obscureText: false,
showCursor: false,
enabled: false,
cursorColor: FlutterFlowTheme.of(context).primary,
readOnly: true,
decoration: InputDecoration(
labelText: FFLocalizations.of(context).getText(
'yxilg7ek' /* Motivo da Visita */,
@ -622,6 +638,10 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
focusNode: _model.textFieldFocusNode5,
autofocus: false,
obscureText: false,
showCursor: false,
enabled: false,
cursorColor: FlutterFlowTheme.of(context).primary,
readOnly: true,
decoration: InputDecoration(
labelText: FFLocalizations.of(context).getText(
'dgr3pk3a' /* Nível de Acesso */,
@ -714,6 +734,10 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
focusNode: _model.textFieldFocusNode6,
autofocus: false,
obscureText: false,
showCursor: false,
enabled: false,
cursorColor: FlutterFlowTheme.of(context).primary,
readOnly: true,
decoration: InputDecoration(
labelText: FFLocalizations.of(context).getText(
'lppn9rxa' /* Observações da Visita */,
@ -785,24 +809,7 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
],
),
),
Align(
alignment: const AlignmentDirectional(0.0, 1.0),
child: Padding(
padding:
const EdgeInsetsDirectional.fromSTEB(0.0, 6.0, 0.0, 0.0),
child: Container(
width: double.infinity,
height: 35.0,
decoration: BoxDecoration(
color: widget.visitStatusColor,
borderRadius: const BorderRadius.only(
bottomLeft: Radius.circular(0.0),
bottomRight: Radius.circular(0.0),
topLeft: Radius.circular(0.0),
topRight: Radius.circular(0.0),
),
),
child: Builder(
Builder(
builder: (context) {
if (widget.visitStatusStr == 'A') {
return Row(
@ -813,10 +820,10 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
borderRadius: 20.0,
borderWidth: 1.0,
buttonSize: 40.0,
// fillColor: widget.visitStatusColor,
icon: Icon(
Icons.block_sharp,
color: FlutterFlowTheme.of(context)
.primaryBackground,
color: FlutterFlowTheme.of(context).error,
size: 24.0,
),
onPressed: () async {
@ -842,12 +849,10 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
context: context,
builder: (context) {
return Padding(
padding:
MediaQuery.viewInsetsOf(context),
padding: MediaQuery.viewInsetsOf(context),
child: ThrowExceptionWidget(
msg: PhpGroup.deleteVisitCall.msg(
(_model.deleteVisit?.jsonBody ??
''),
(_model.deleteVisit?.jsonBody ?? ''),
)!,
),
);
@ -865,8 +870,7 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
buttonSize: 40.0,
icon: Icon(
Icons.share,
color: FlutterFlowTheme.of(context)
.primaryBackground,
color: FlutterFlowTheme.of(context).accent1,
size: 24.0,
),
onPressed: () {
@ -898,8 +902,7 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
dateTimeFormat(
'd/M/y H:mm:ss',
getCurrentTimestamp,
locale: FFLocalizations.of(context)
.languageCode,
locale: FFLocalizations.of(context).languageCode,
),
ParamType.String,
),
@ -937,7 +940,7 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
},
child: Icon(
Icons.repeat,
color: FlutterFlowTheme.of(context).secondaryText,
color: widget.visitStatusColor,
size: 24.0,
),
);
@ -946,17 +949,13 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
width: 100.0,
height: 100.0,
decoration: BoxDecoration(
color: FlutterFlowTheme.of(context)
.secondaryBackground,
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: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';
@ -71,6 +73,23 @@ class _VisitDetailsModalTemplateComponentWidgetState
@override
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(
builder: (context) {
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:flutter/material.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:provider/provider.dart';
class VisitRequestTemplateComponentWidget extends StatefulWidget {
const VisitRequestTemplateComponentWidget({
super.key,
Key? key,
required this.vteName,
required this.vteReason,
required this.vteMsg,
@ -27,8 +28,17 @@ class VisitRequestTemplateComponentWidget extends StatefulWidget {
required this.vawStatus,
this.vawDate,
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? vteReason;
final String? vteMsg;
@ -60,6 +70,14 @@ class _VisitRequestTemplateComponentWidgetState
extends State<VisitRequestTemplateComponentWidget> {
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
void setState(VoidCallback callback) {
super.setState(callback);
@ -102,34 +120,47 @@ class _VisitRequestTemplateComponentWidgetState
Widget build(BuildContext context) {
context.watch<FFAppState>();
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 LayoutBuilder(
builder: (context, constraints) {
return Align(
alignment: const AlignmentDirectional(0.0, 0.0),
child: Padding(
padding: const EdgeInsetsDirectional.fromSTEB(10.0, 0.0, 10.0, 0.0),
padding: const EdgeInsets.symmetric(horizontal: 10.0),
child: Container(
width: MediaQuery.sizeOf(context).width * 0.9,
width: constraints.maxWidth,
decoration: BoxDecoration(
color: FlutterFlowTheme.of(context).primaryBackground,
borderRadius: const BorderRadius.only(
bottomLeft: Radius.circular(25.0),
bottomRight: Radius.circular(25.0),
topLeft: Radius.circular(25.0),
topRight: Radius.circular(25.0),
),
borderRadius: const BorderRadius.all(Radius.circular(25.0)),
),
child: SingleChildScrollView(
child: Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Column(
mainAxisSize: MainAxisSize.max,
children: [
const SizedBox(height: 20.0),
Container(
width: 150.0,
height: 150.0,
@ -140,240 +171,20 @@ class _VisitRequestTemplateComponentWidgetState
child: CachedNetworkImage(
fadeInDuration: const Duration(milliseconds: 100),
fadeOutDuration: const Duration(milliseconds: 100),
imageUrl: valueOrDefault<String>(
// 'https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${widget.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',
),
imageUrl:
'https://freaccess.com.br/freaccess/getImage.php?cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${widget.imageHashMap['key']}&tipo=${widget.imageHashMap['value']}',
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),
const SizedBox(height: 10.0),
Row(
children: statusLinkedHashMap.expand((linkedHashMap) {
return linkedHashMap.entries
.map((MapEntry<String, Color> item) {
return Expanded(
child: Padding(
padding:
const EdgeInsets.symmetric(horizontal: 24.0),
child: TextFormField(
// controller: _model.textControllerStatus,
// focusNode: _model.textFieldFocusNodeStatus,
@ -384,56 +195,36 @@ class _VisitRequestTemplateComponentWidgetState
decoration: InputDecoration(
isDense: true,
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(10.0)),
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',
);
}
}(),
fillColor: item.value,
labelText: item.key,
labelStyle: FlutterFlowTheme.of(context)
.labelMedium
.override(
fontFamily:
FlutterFlowTheme.of(context).labelMediumFamily,
color: FlutterFlowTheme.of(context).primaryText,
fontFamily: FlutterFlowTheme.of(context)
.labelMediumFamily,
color: FlutterFlowTheme.of(context)
.primaryText,
letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap().containsKey(
FlutterFlowTheme.of(context).labelMediumFamily),
useGoogleFonts: GoogleFonts.asMap()
.containsKey(
FlutterFlowTheme.of(context)
.labelMediumFamily),
),
hintStyle: FlutterFlowTheme.of(context)
.labelMedium
.override(
fontFamily:
FlutterFlowTheme.of(context).labelMediumFamily,
color: FlutterFlowTheme.of(context).primaryText,
fontFamily: FlutterFlowTheme.of(context)
.labelMediumFamily,
color: FlutterFlowTheme.of(context)
.primaryText,
letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap().containsKey(
FlutterFlowTheme.of(context).labelMediumFamily),
useGoogleFonts: GoogleFonts.asMap()
.containsKey(
FlutterFlowTheme.of(context)
.labelMediumFamily),
),
focusedBorder: InputBorder.none,
errorBorder: InputBorder.none,
@ -443,397 +234,49 @@ class _VisitRequestTemplateComponentWidgetState
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.textController1,
focusNode: _model.textFieldFocusNode1,
autofocus: false,
textInputAction: TextInputAction.next,
readOnly: true,
obscureText: false,
decoration: InputDecoration(
isDense: true,
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: InputBorder.none,
focusedBorder: InputBorder.none,
errorBorder: InputBorder.none,
focusedErrorBorder: InputBorder.none,
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),
),
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
style: FlutterFlowTheme.of(context)
.bodyMedium
.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,
.bodyMediumFamily,
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.message,
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),
.containsKey(
FlutterFlowTheme.of(context)
.bodyMediumFamily),
),
textAlign: TextAlign.start,
validator:
_model.textController3Validator.asValidator(context),
maxLines: null,
keyboardType: TextInputType.name,
validator: _model.textController1Validator
.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 */,
);
}).toList();
}).toList(),
),
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,
const SizedBox(height: 10.0),
// ListView.builder(
// shrinkWrap: true,
// itemCount: labelsLinkedHashMap.length,
// physics: const NeverScrollableScrollPhysics(),
// itemBuilder: (context, index) {
// String key = labelsLinkedHashMap.keys.elementAt(index);
// String value = labelsLinkedHashMap[key]!;
// return Text('key: $key, value: $value');
// },
// ),
const SizedBox(height: 20.0),
],
),
),
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 ?? '',
);
},
),
FlutterFlowIconButton(
borderRadius: 20.0,
showLoadingIndicator: isLoaded,
borderWidth: 1.0,
buttonSize: 40.0,
fillColor: FlutterFlowTheme.of(context).success,
icon: Icon(
Icons.done,
color: FlutterFlowTheme.of(context).primaryBackground,
size: 24.0,
),
onPressed: () async {
await widget.changeStatusAction?.call(
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_crashlytics/firebase_crashlytics.dart';
import 'package:hub/app_state.dart';

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:provider/provider.dart';
class LiberationHistoryWidget extends StatefulWidget {
const LiberationHistoryWidget({super.key});
@ -258,9 +257,7 @@ Widget liberationDynamicListView(
.where((item) => jsonToStr(getJsonField(
item,
r'''$.VTE_NOME''',
))
.toLowerCase()
.contains(
)).toLowerCase().contains(
_model.textController.text.toLowerCase(),
))
.toList()
@ -309,7 +306,8 @@ Widget liberationHistoryItemCard(
'Data:': liberationHistoryItem['NOT_DTENVIO'],
'Motivo:': liberationHistoryItem['NOT_MOTIVO'],
}),
statusHashMap: [liberationHistoryItem['NOT_STATUS'] == 'L'
statusHashMap: [
liberationHistoryItem['NOT_STATUS'] == 'L'
? Map<String, Color>.from({
FFLocalizations.of(context).getVariableText(
ptText: 'Ativo',
@ -328,7 +326,8 @@ Widget liberationHistoryItemCard(
ptText: 'Pendente',
enText: 'Pending',
): FlutterFlowTheme.of(context).warning,
})],
})
],
onTapCardItemAction: () async {
showModalBottomSheet(
isScrollControlled: true,
@ -352,6 +351,39 @@ Widget liberationHistoryItemCard(
vawUUID: liberationHistoryItem['NOT_ID'],
vawName: liberationHistoryItem['NOT_NOME'],
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,
// vteDocument: liberationHistoryItem['VTE_DOCUMENTO'],
);

View File

@ -239,6 +239,7 @@ Widget messageHistoryItem(BuildContext context, dynamic jsonBody) {
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 15),
child: Card(
color: FlutterFlowTheme.of(context).primaryBackground,
child: Container(
// height: 100,
child: Padding(
@ -249,13 +250,39 @@ Widget messageHistoryItem(BuildContext context, dynamic jsonBody) {
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.end,
mainAxisSize: MainAxisSize.max,
Column(
children: [
Padding(
padding: const EdgeInsets.only(left: 15.0),
child: Text(
Icon(
jsonBody['MSG_DESTINO_TP'] == 'T'
? Icons.group
: Icons.person,
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,
@ -264,40 +291,25 @@ Widget messageHistoryItem(BuildContext context, dynamic jsonBody) {
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(
jsonBody['MSG_DESTINO_TP'] == 'T'
? Icons.group
: Icons.person,
color: FlutterFlowTheme.of(context).primary,
),
],
),
],
),
SizedBox(height: 8),
Padding(
Row(
children: [
Expanded(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
jsonBody['MSG_TEXTO'].toString(),
),
),
),
],
),
SizedBox(height: 8),
],
),

View File

@ -52,7 +52,11 @@ class PreferencesPageModel with ChangeNotifier {
void enablePerson(BuildContext context) {
notifyListeners();
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,6 +93,38 @@ class PreferencesPageModel with ChangeNotifier {
}
void localUnlink(BuildContext context) {
showDialog(
context: context,
builder: (context) {
return AlertDialog(
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
title: Text(
FFLocalizations.of(context).getVariableText(
enText: 'Unlink device',
ptText: 'Desvincular dispositivo',
),
),
content: Text(
FFLocalizations.of(context).getVariableText(
enText: 'Are you sure you want to unlink this device?',
ptText: 'Tem certeza que deseja desvincular este dispositivo?',
),
),
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.resopndeVinculo
.call(
userUUID: FFAppState().userUUID,
@ -105,7 +141,8 @@ class PreferencesPageModel with ChangeNotifier {
enText: 'Error unlinking device',
ptText: 'Erro ao desvincular dispositivo',
),
style: TextStyle(color: FlutterFlowTheme.of(context).info)),
style: TextStyle(
color: FlutterFlowTheme.of(context).info)),
backgroundColor: FlutterFlowTheme.of(context).error,
duration: const Duration(seconds: 3),
behavior: SnackBarBehavior.floating,
@ -120,12 +157,62 @@ class PreferencesPageModel with ChangeNotifier {
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();
}
void deleteAccount(BuildContext context) {
showDialog(
context: context,
builder: (context) {
return AlertDialog(
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
title: Text(
FFLocalizations.of(context).getVariableText(
enText: 'Delete account',
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(
@ -138,15 +225,87 @@ class PreferencesPageModel with ChangeNotifier {
),
},
);
}).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 {
debugPrint('pass: ${FFAppState().pass}');
if (FFAppState().pass) {
FFAppState().pass = false;
FFAppState().deleteAccessPass();
notifyListeners();
} else {
// if (FFAppState().pass) {
// FFAppState().pass = false;
// FFAppState().deleteAccessPass();
// notifyListeners();
// } else {
await showModalBottomSheet(
isScrollControlled: true,
backgroundColor: Colors.transparent,
@ -177,25 +336,37 @@ class PreferencesPageModel with ChangeNotifier {
} else {
FFAppState().pass = false;
}
}).onError((error, StackTrace) {
}).catchError((error, StackTrace) {
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 {
if (FFAppState().panic) {
FFAppState().panic = false;
FFAppState().deletePanicPass();
notifyListeners();
} else {
await showModalBottomSheet(
isScrollControlled: true,
backgroundColor: Colors.transparent,
@ -208,13 +379,13 @@ class PreferencesPageModel with ChangeNotifier {
toggleActionStatus: (key) async {
FFAppState().panicPass = key;
notifyListeners();
await PhpGroup.changePass
await PhpGroup.changePanic
.call(
userUUID: FFAppState().userUUID,
devUUID: FFAppState().devUUID,
cliID: FFAppState().cliUUID,
atividade: 'updVisitado',
newSenha: FFAppState().panicPass,
newSenhaPanico: FFAppState().panicPass,
)
.then((value) {
FFAppState().panic = true;
@ -223,10 +394,28 @@ class PreferencesPageModel with ChangeNotifier {
} else {
FFAppState().panic = false;
}
}).onError((e, s) {
}).catchError((e, s) {
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());
},
),
@ -234,7 +423,6 @@ class PreferencesPageModel with ChangeNotifier {
},
);
}
}
@override
void dispose() {

View File

@ -6,8 +6,11 @@ import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
import 'package:flutter_spinkit/flutter_spinkit.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/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_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_search_modal_template_component/visitor_search_modal_template_component_widget.dart';
import 'package:hub/flutter_flow/custom_functions.dart';
@ -1675,30 +1678,7 @@ Widget visitHistory(
color: FlutterFlowTheme.of(context).primaryBackground,
),
child: SingleChildScrollView(
child: Column(
mainAxisSize: MainAxisSize.max,
children: [
Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
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>(
child: FutureBuilder<ApiCallResponse>(
future: _model.visitHistory(
requestFn: () => PhpGroup.getVisitsCall.call(
devUUID: FFAppState().devUUID,
@ -1743,476 +1723,191 @@ Widget visitHistory(
final visitaWrapItem = visitaWrap[index];
// visitaWrap.length, (visitaWrapIndex) {
return InkWell(
splashColor: Colors.transparent,
focusColor: Colors.transparent,
hoverColor: Colors.transparent,
highlightColor: Colors.transparent,
onTap: () async {
await showModalBottomSheet(
isScrollControlled: true,
backgroundColor: Colors.transparent,
enableDrag: false,
useSafeArea: true,
context: context,
builder: (context) {
return GestureDetector(
onTap: () =>
_model.unfocusNode.canRequestFocus
? FocusScope.of(context)
.requestFocus(_model.unfocusNode)
: FocusScope.of(context).unfocus(),
child: Padding(
padding: MediaQuery.viewInsetsOf(context),
child:
VisitDetailsModalTemplateComponentWidget(
visitStatusStr: getJsonField(
visitaWrapItem,
r'''$.VAW_STATUS''',
).toString(),
visitStartDateStr: getJsonField(
visitaWrapItem,
r'''$.VAW_DTINICIO''',
).toString(),
visitEndDateStr: getJsonField(
visitaWrapItem,
r'''$.VAW_DTFIM''',
).toString(),
visitReasonStr: getJsonField(
visitaWrapItem,
r'''$.MOT_DESCRICAO''',
).toString(),
visitLevelStr: getJsonField(
visitaWrapItem,
r'''$.NAC_DESCRICAO''',
).toString(),
visitTempStr: getJsonField(
visitaWrapItem,
r'''$.VTE_UNICA''',
).toString(),
visitObsStr: getJsonField(
visitaWrapItem,
r'''$.VAW_OBS''',
).toString(),
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: getJsonField(
visitaWrapItem,
r'''$.VTE_DOCUMENTO''',
).toString(),
visitIdStr: getJsonField(
visitaWrapItem,
r'''$.VAW_ID''',
).toString(),
visitStatusColor: getJsonField(
visitaWrapItem,
r'''$.VAW_STATUS''',
).toString() ==
'A'
? FlutterFlowTheme.of(context).success
: FlutterFlowTheme.of(context).error,
visitorJsonList:
PhpGroup.getVisitsCall.visitasList(
wrapGetVisitsResponse.jsonBody,
),
updateToggleIdx: () async {},
repeatVisitSchedule: () async {},
),
),
);
},
).then((value) => safeSetState(() {}));
},
child: Card(
clipBehavior: Clip.antiAliasWithSaveLayer,
color:
FlutterFlowTheme.of(context).primaryBackground,
elevation: 5.0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8.0),
),
child: Container(
width: 350.0,
height: 115.0,
decoration: BoxDecoration(
color: FlutterFlowTheme.of(context)
.primaryBackground,
),
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(
return CardItemTemplateComponentWidget(
imageHashMap: Map<String, String>.from({
'key': visitaWrapItem['VTE_DOCUMENTO'] ?? '',
'value': 'E',
}),
labelsHashMap: Map<String, String>.from({
'Nome:': visitaWrapItem['VTE_NOME'] ?? '',
'Inicio:': visitaWrapItem['VAW_DTINICIO'] ?? '',
'Fim:': visitaWrapItem['VAW_DTFIM'] ?? '',
}),
statusHashMap: [
visitaWrapItem['VAW_STATUS'] == 'A'
? Map<String, Color>.from({
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)
): FlutterFlowTheme.of(context).success,
})
: visitaWrapItem['VAW_STATUS'] == 'F' ||
visitaWrapItem['VAW_STATUS'] == 'B' ||
visitaWrapItem['VAW_STATUS'] == 'C' ||
visitaWrapItem['VAW_STATUS'] == 'I'
? Map<String, Color>.from({
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,
),
),
): FlutterFlowTheme.of(context).warning,
})
: Map<String, Color>.from({
FFLocalizations.of(context)
.getVariableText(
ptText: 'Cancelado',
enText: 'Canceled',
): FlutterFlowTheme.of(context).error,
}),
],
),
),
),
onTapCardItemAction: () async {
showModalBottomSheet(
isScrollControlled: true,
isDismissible: true,
backgroundColor: Colors.transparent,
useSafeArea: true,
context: context,
builder: (context) {
return VisitRequestTemplateComponentWidget(
vteName: 'Lorem Ipsus',
vteReason: 'Lorem Ipsus',
vawDate: 'Lorem Ipsus',
vawStatus: 'Lorem Ipsus',
vteMsg: 'Lorem Ipsus',
vteUUID: 'Lorem Ipsus',
cliUUID: FFAppState().cliUUID,
msgUUID: 'Lorem Ipsus',
vawDestino: 'Lorem Ipsus',
vawUUID: 'Lorem Ipsus',
vawName: 'Lorem Ipsus',
vawRef: 'Lorem Ipsus',
labelsHashMap: Map<String, String>.from({
'Nome:': visitaWrapItem['VTE_NOME'] ?? '',
'Inicio:':
visitaWrapItem['VAW_DTINICIO'] ?? '',
'Fim:': visitaWrapItem['VAW_DTFIM'] ?? '',
}),
imageHashMap: Map<String, String>.from({
'key': visitaWrapItem['VTE_DOCUMENTO'] ?? '',
'value': 'E',
}),
statusHashMap: [
visitaWrapItem['VAW_STATUS'] == 'A'
? Map<String, Color>.from({
FFLocalizations.of(context)
.getVariableText(
ptText: 'Ativo',
enText: 'Active',
): FlutterFlowTheme.of(context)
.success,
})
: visitaWrapItem['VAW_STATUS'] == 'F' ||
visitaWrapItem['VAW_STATUS'] ==
'B' ||
visitaWrapItem['VAW_STATUS'] ==
'C' ||
visitaWrapItem['VAW_STATUS'] ==
'I'
? Map<String, Color>.from({
FFLocalizations.of(context)
.getVariableText(
ptText: 'Pendente',
enText: 'Pending',
): FlutterFlowTheme.of(context)
.warning,
})
: Map<String, Color>.from({
FFLocalizations.of(context)
.getVariableText(
ptText: 'Cancelado',
enText: 'Canceled',
): FlutterFlowTheme.of(context)
.error,
}),
],
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(() {}));
});
});
},
);
},
)
],
),
),
);