Refactor QR code generation and error handling
This commit is contained in:
parent
ae33972b26
commit
78ac8c3807
|
@ -77,7 +77,7 @@ Future<Color> manageStatusColorAction(
|
||||||
BuildContext context, {
|
BuildContext context, {
|
||||||
required String? visitStatusStr,
|
required String? visitStatusStr,
|
||||||
}) async {
|
}) async {
|
||||||
debugPrint('visitStatusStr: $visitStatusStr');
|
log('visitStatusStr: $visitStatusStr');
|
||||||
if (visitStatusStr == 'A') {
|
if (visitStatusStr == 'A') {
|
||||||
return FlutterFlowTheme.of(context).success;
|
return FlutterFlowTheme.of(context).success;
|
||||||
} else if ((visitStatusStr == 'C') ||
|
} else if ((visitStatusStr == 'C') ||
|
||||||
|
@ -357,17 +357,17 @@ Future<bool> visitRequestComponentAction(
|
||||||
if (respondeSolicitacaoCall.statusCode == 200) {
|
if (respondeSolicitacaoCall.statusCode == 200) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
debugPrint('headers: ${respondeSolicitacaoCall.headers}');
|
log('headers: ${respondeSolicitacaoCall.headers}');
|
||||||
debugPrint('bodyText: ${respondeSolicitacaoCall.bodyText}');
|
log('bodyText: ${respondeSolicitacaoCall.bodyText}');
|
||||||
debugPrint('jsonBody: ${respondeSolicitacaoCall.jsonBody}');
|
log('jsonBody: ${respondeSolicitacaoCall.jsonBody}');
|
||||||
debugPrint('userUUID: ${FFAppState().userUUID}');
|
log('userUUID: ${FFAppState().userUUID}');
|
||||||
debugPrint('devUUID: ${FFAppState().devUUID}');
|
log('devUUID: ${FFAppState().devUUID}');
|
||||||
debugPrint('cliUUID: ${FFAppState().cliUUID}');
|
log('cliUUID: ${FFAppState().cliUUID}');
|
||||||
debugPrint('atividade: respondeSolicitacao');
|
log('atividade: respondeSolicitacao');
|
||||||
debugPrint('referencia: $refUUID');
|
log('referencia: $refUUID');
|
||||||
debugPrint('tarefa: $actionValue');
|
log('tarefa: $actionValue');
|
||||||
debugPrint('resposta: $responseValue');
|
log('resposta: $responseValue');
|
||||||
debugPrint('idVisitante: $vteUUID');
|
log('idVisitante: $vteUUID');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -413,7 +413,7 @@ Future<bool> checkLocals({
|
||||||
|
|
||||||
// Verificação rápida de erro para evitar processamento desnecessário.
|
// Verificação rápida de erro para evitar processamento desnecessário.
|
||||||
if (response.jsonBody['error']) {
|
if (response.jsonBody['error']) {
|
||||||
debugPrint("checkLocals => Erro encontrado na resposta");
|
log("checkLocals => Erro encontrado na resposta");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -425,10 +425,10 @@ Future<bool> checkLocals({
|
||||||
|
|
||||||
// Log e retorno condicional baseado no resultado da busca.
|
// Log e retorno condicional baseado no resultado da busca.
|
||||||
if (itemFound) {
|
if (itemFound) {
|
||||||
debugPrint("checkLocals => Item encontrado com CLI_ID $uuid e CLU_STATUS A");
|
log("checkLocals => Item encontrado com CLI_ID $uuid e CLU_STATUS A");
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
debugPrint("checkLocals => Item não encontrado com CLI_ID $uuid e CLU_STATUS A");
|
log("checkLocals => Item não encontrado com CLI_ID $uuid e CLU_STATUS A");
|
||||||
// A chamada para showModalBottomSheet permanece, mas a atualização da UI é otimizada.
|
// A chamada para showModalBottomSheet permanece, mas a atualização da UI é otimizada.
|
||||||
await showModalBottomSheet(
|
await showModalBottomSheet(
|
||||||
isScrollControlled: true,
|
isScrollControlled: true,
|
||||||
|
@ -458,7 +458,7 @@ Future changeStatusAction(
|
||||||
String msg,
|
String msg,
|
||||||
String vteUUID,
|
String vteUUID,
|
||||||
) async {
|
) async {
|
||||||
debugPrint('status: $status');
|
log('status: $status');
|
||||||
|
|
||||||
switch (status) {
|
switch (status) {
|
||||||
case 'L':
|
case 'L':
|
||||||
|
@ -474,9 +474,9 @@ Future changeStatusAction(
|
||||||
);
|
);
|
||||||
if (!context.mounted) return;
|
if (!context.mounted) return;
|
||||||
if (approveVisitRequest == true) {
|
if (approveVisitRequest == true) {
|
||||||
debugPrint('Aprovado');
|
log('Aprovado');
|
||||||
} else {
|
} else {
|
||||||
debugPrint('Erro ao aprovar');
|
log('Erro ao aprovar');
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'B':
|
case 'B':
|
||||||
|
@ -492,9 +492,9 @@ Future changeStatusAction(
|
||||||
);
|
);
|
||||||
if (!context.mounted) return;
|
if (!context.mounted) return;
|
||||||
if (blockVisitRequest == true) {
|
if (blockVisitRequest == true) {
|
||||||
debugPrint('Bloqueado');
|
log('Bloqueado');
|
||||||
} else {
|
} else {
|
||||||
debugPrint('Erro ao bloquear');
|
log('Erro ao bloquear');
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
import 'dart:developer';
|
||||||
|
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
|
|
||||||
|
@ -2297,7 +2298,7 @@ String _serializeList(List? list) {
|
||||||
return json.encode(list, toEncodable: _toEncodable);
|
return json.encode(list, toEncodable: _toEncodable);
|
||||||
} catch (_) {
|
} catch (_) {
|
||||||
if (kDebugMode) {
|
if (kDebugMode) {
|
||||||
print("List serialization failed. Returning empty list.");
|
log("List serialization failed. Returning empty list.");
|
||||||
}
|
}
|
||||||
return '[]';
|
return '[]';
|
||||||
}
|
}
|
||||||
|
@ -2309,7 +2310,7 @@ String _serializeJson(dynamic jsonVar, [bool isList = false]) {
|
||||||
return json.encode(jsonVar, toEncodable: _toEncodable);
|
return json.encode(jsonVar, toEncodable: _toEncodable);
|
||||||
} catch (_) {
|
} catch (_) {
|
||||||
if (kDebugMode) {
|
if (kDebugMode) {
|
||||||
print("Json serialization failed. Returning empty json.");
|
log("Json serialization failed. Returning empty json.");
|
||||||
}
|
}
|
||||||
return isList ? '[]' : '{}';
|
return isList ? '[]' : '{}';
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
import 'dart:developer';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
import 'dart:math';
|
import 'dart:math' as math;
|
||||||
|
|
||||||
import 'package:f_r_e_hub/actions/actions.dart';
|
import 'package:f_r_e_hub/actions/actions.dart';
|
||||||
import 'package:f_r_e_hub/app_state.dart';
|
import 'package:f_r_e_hub/app_state.dart';
|
||||||
|
@ -49,9 +50,9 @@ class PushNotificationService {
|
||||||
sound: true,
|
sound: true,
|
||||||
);
|
);
|
||||||
if (settings.authorizationStatus == AuthorizationStatus.authorized) {
|
if (settings.authorizationStatus == AuthorizationStatus.authorized) {
|
||||||
debugPrint('User granted permission');
|
log('User granted permission');
|
||||||
} else {
|
} else {
|
||||||
debugPrint('User declined or has not accepted permission');
|
log('User declined or has not accepted permission');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -91,7 +92,7 @@ class PushNotificationService {
|
||||||
// Passo 4: Decodificar o JSON corrigido
|
// Passo 4: Decodificar o JSON corrigido
|
||||||
return jsonDecode(correctedJson);
|
return jsonDecode(correctedJson);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('Error decoding JSON: $e');
|
log('Error decoding JSON: $e');
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -118,17 +119,17 @@ class PushNotificationService {
|
||||||
_flutterLocalNotificationsPlugin.initialize(
|
_flutterLocalNotificationsPlugin.initialize(
|
||||||
initializationSettings,
|
initializationSettings,
|
||||||
onDidReceiveNotificationResponse: (NotificationResponse response) async {
|
onDidReceiveNotificationResponse: (NotificationResponse response) async {
|
||||||
debugPrint('Response payload:${response.payload}');
|
log('Response payload:${response.payload}');
|
||||||
if (response.payload != null) {
|
if (response.payload != null) {
|
||||||
try {
|
try {
|
||||||
Map<String, dynamic> message =
|
Map<String, dynamic> message =
|
||||||
validJsonFromString(response.payload!);
|
validJsonFromString(response.payload!);
|
||||||
debugPrint('Notification payload: $message');
|
log('Notification payload: $message');
|
||||||
var data = _notificationDetails; // Assuming getOnMessage() now returns the latest RemoteMessage
|
var data = _notificationDetails; // Assuming getOnMessage() now returns the latest RemoteMessage
|
||||||
debugPrint('Extra: ${data.value}');
|
log('Extra: ${data.value}');
|
||||||
_handleNotificationClick(message, extra: data.value ?? {'extra': 'extra'});
|
_handleNotificationClick(message, extra: data.value ?? {'extra': 'extra'});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
debugPrint('Error decoding notification payload: $e');
|
log('Error decoding notification payload: $e');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -165,8 +166,8 @@ class PushNotificationService {
|
||||||
|
|
||||||
void _listenToForegroundMessages(BuildContext context) {
|
void _listenToForegroundMessages(BuildContext context) {
|
||||||
FirebaseMessaging.onMessage.listen((RemoteMessage message) {
|
FirebaseMessaging.onMessage.listen((RemoteMessage message) {
|
||||||
debugPrint('Got a message whilst in the foreground!');
|
log('Got a message whilst in the foreground!');
|
||||||
debugPrint('Message data: ${message.toMap()}');
|
log('Message data: ${message.toMap()}');
|
||||||
_onMessage.add(message);
|
_onMessage.add(message);
|
||||||
_notificationDetails.add(message.toMap()['notification']);
|
_notificationDetails.add(message.toMap()['notification']);
|
||||||
_showNotification(message);
|
_showNotification(message);
|
||||||
|
@ -179,16 +180,16 @@ class PushNotificationService {
|
||||||
|
|
||||||
void _listenToNotificationClicks(BuildContext context) {
|
void _listenToNotificationClicks(BuildContext context) {
|
||||||
FirebaseMessaging.onMessageOpenedApp.listen((RemoteMessage message) {
|
FirebaseMessaging.onMessageOpenedApp.listen((RemoteMessage message) {
|
||||||
debugPrint('Notification clicked!');
|
log('Notification clicked!');
|
||||||
|
|
||||||
_onMessage.add(message);
|
_onMessage.add(message);
|
||||||
debugPrint('Extra: ${message.notification?.body}');
|
log('Extra: ${message.notification?.body}');
|
||||||
NotificationHandler().handleMessage(message.data, context); });
|
NotificationHandler().handleMessage(message.data, context); });
|
||||||
}
|
}
|
||||||
|
|
||||||
void configureTokenRefresh() {
|
void configureTokenRefresh() {
|
||||||
_firebaseMessaging.onTokenRefresh.listen(_handleTokenUpdate).onError((err) {
|
_firebaseMessaging.onTokenRefresh.listen(_handleTokenUpdate).onError((err) {
|
||||||
debugPrint("Error refreshing token: $err");
|
log("Error refreshing token: $err");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -196,14 +197,14 @@ class PushNotificationService {
|
||||||
FFAppState().token = token;
|
FFAppState().token = token;
|
||||||
final ApiCallResponse? response = await _updateTokenOnServer(token);
|
final ApiCallResponse? response = await _updateTokenOnServer(token);
|
||||||
if (_isTokenUpdateSuccessful(response)) {
|
if (_isTokenUpdateSuccessful(response)) {
|
||||||
debugPrint('Token updated successfully on server. Token: $token');
|
log('Token updated successfully on server. Token: $token');
|
||||||
} else {
|
} else {
|
||||||
debugPrint('Error updating token on server');
|
log('Error updating token on server');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _handleTokenUpdate(String newToken) async {
|
Future<void> _handleTokenUpdate(String newToken) async {
|
||||||
debugPrint('Token refreshed: $newToken');
|
log('Token refreshed: $newToken');
|
||||||
await _updateToken(newToken);
|
await _updateToken(newToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -216,17 +217,17 @@ class PushNotificationService {
|
||||||
|
|
||||||
final String? deviceToken = await _firebaseMessaging.getToken();
|
final String? deviceToken = await _firebaseMessaging.getToken();
|
||||||
if (deviceToken != null) {
|
if (deviceToken != null) {
|
||||||
debugPrint('Push Messaging token: $deviceToken');
|
log('Push Messaging token: $deviceToken');
|
||||||
await _updateToken(deviceToken);
|
await _updateToken(deviceToken);
|
||||||
} else {
|
} else {
|
||||||
debugPrint('Failed to get Firebase Messaging token');
|
log('Failed to get Firebase Messaging token');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<NotificationSettings> _requestNotificationPermission() async {
|
Future<NotificationSettings> _requestNotificationPermission() async {
|
||||||
final NotificationSettings settings =
|
final NotificationSettings settings =
|
||||||
await _firebaseMessaging.requestPermission();
|
await _firebaseMessaging.requestPermission();
|
||||||
debugPrint(settings.authorizationStatus == AuthorizationStatus.authorized
|
log(settings.authorizationStatus == AuthorizationStatus.authorized
|
||||||
? 'User granted permission'
|
? 'User granted permission'
|
||||||
: 'User declined or has not accepted permission');
|
: 'User declined or has not accepted permission');
|
||||||
return settings;
|
return settings;
|
||||||
|
@ -235,7 +236,7 @@ class PushNotificationService {
|
||||||
Future<void> _fetchAndLogApnsToken(NotificationSettings settings) async {
|
Future<void> _fetchAndLogApnsToken(NotificationSettings settings) async {
|
||||||
if (settings.authorizationStatus == AuthorizationStatus.authorized) {
|
if (settings.authorizationStatus == AuthorizationStatus.authorized) {
|
||||||
final String? apnsToken = await _firebaseMessaging.getAPNSToken();
|
final String? apnsToken = await _firebaseMessaging.getAPNSToken();
|
||||||
debugPrint(apnsToken != null
|
log(apnsToken != null
|
||||||
? 'APNS Token: $apnsToken'
|
? 'APNS Token: $apnsToken'
|
||||||
: 'Failed to get APNS token');
|
: 'Failed to get APNS token');
|
||||||
}
|
}
|
||||||
|
@ -273,10 +274,10 @@ class PushNotificationService {
|
||||||
var generalNotificationDetails =
|
var generalNotificationDetails =
|
||||||
NotificationDetails(android: androidDetails, iOS: iOSDetails);
|
NotificationDetails(android: androidDetails, iOS: iOSDetails);
|
||||||
|
|
||||||
debugPrint('Showing notification: ${message.messageId.hashCode}');
|
log('Showing notification: ${message.messageId.hashCode}');
|
||||||
await _flutterLocalNotificationsPlugin.show(
|
await _flutterLocalNotificationsPlugin.show(
|
||||||
// DateTime.now().millisecondsSinceEpoch % (1 << 31),
|
// DateTime.now().millisecondsSinceEpoch % (1 << 31),
|
||||||
Random().nextInt(1 << 30),
|
math.Random().nextInt(1 << 30),
|
||||||
message.notification?.title,
|
message.notification?.title,
|
||||||
message.notification?.body,
|
message.notification?.body,
|
||||||
generalNotificationDetails,
|
generalNotificationDetails,
|
||||||
|
@ -288,13 +289,13 @@ class PushNotificationService {
|
||||||
switch (payload.isNotEmpty) {
|
switch (payload.isNotEmpty) {
|
||||||
case true:
|
case true:
|
||||||
// Print the 'data' property
|
// Print the 'data' property
|
||||||
debugPrint('Notification payload: $payload');
|
log('Notification payload: $payload');
|
||||||
debugPrint('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:
|
||||||
debugPrint('Notification payload is empty');
|
log('Notification payload is empty');
|
||||||
// Handle the message notification as needed
|
// Handle the message notification as needed
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -302,15 +303,15 @@ class PushNotificationService {
|
||||||
|
|
||||||
static Future<void> _firebaseMessagingBackgroundHandler(
|
static Future<void> _firebaseMessagingBackgroundHandler(
|
||||||
RemoteMessage message) async {
|
RemoteMessage message) async {
|
||||||
debugPrint('Handling a background message: ${message.messageId}');
|
log('Handling a background message: ${message.messageId}');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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 {}}) {
|
||||||
debugPrint('Notification Received!');
|
log('Notification Received!');
|
||||||
message.forEach((key, value) {
|
message.forEach((key, value) {
|
||||||
debugPrint('$key: $value');
|
log('$key: $value');
|
||||||
});
|
});
|
||||||
|
|
||||||
switch (message['click_action']) {
|
switch (message['click_action']) {
|
||||||
|
@ -327,10 +328,10 @@ class NotificationHandler {
|
||||||
_showMessageNotificationDialog(message, context, extra);
|
_showMessageNotificationDialog(message, context, extra);
|
||||||
break;
|
break;
|
||||||
case 'enroll_cond':
|
case 'enroll_cond':
|
||||||
debugPrint('enroll_cond');
|
log('enroll_cond');
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
debugPrint('Notification type not recognized');
|
log('Notification type not recognized');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -350,10 +351,10 @@ class NotificationHandler {
|
||||||
|
|
||||||
void _showAcessNotificationModal(
|
void _showAcessNotificationModal(
|
||||||
Map<String, dynamic> message, BuildContext context) {
|
Map<String, dynamic> message, BuildContext context) {
|
||||||
debugPrint('Showing access notification dialog');
|
log('Showing access notification dialog');
|
||||||
debugPrint('USR_TIPO: ${message['USR_TIPO']}');
|
log('USR_TIPO: ${message['USR_TIPO']}');
|
||||||
debugPrint('USR_ID: ${message['USR_ID']}');
|
log('USR_ID: ${message['USR_ID']}');
|
||||||
debugPrint('USR_DOCUMENTO: ${message['USR_DOCUMENTO']}');
|
log('USR_DOCUMENTO: ${message['USR_DOCUMENTO']}');
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
|
@ -379,8 +380,8 @@ class NotificationHandler {
|
||||||
|
|
||||||
void _showMessageNotificationDialog(
|
void _showMessageNotificationDialog(
|
||||||
Map<String, dynamic> message, BuildContext context, Map<String, dynamic> extra) {
|
Map<String, dynamic> message, BuildContext context, Map<String, dynamic> extra) {
|
||||||
debugPrint('Showing message notification dialog');
|
log('Showing message notification dialog');
|
||||||
debugPrint('Notification "message": $message');
|
log('Notification "message": $message');
|
||||||
showDialog(
|
showDialog(
|
||||||
useSafeArea: true,
|
useSafeArea: true,
|
||||||
context: context,
|
context: context,
|
||||||
|
@ -401,7 +402,7 @@ class NotificationHandler {
|
||||||
|
|
||||||
void _showVisitRequestDialog(
|
void _showVisitRequestDialog(
|
||||||
Map<String, dynamic> message, BuildContext context) {
|
Map<String, dynamic> message, BuildContext context) {
|
||||||
debugPrint('Showing visit request notification dialog');
|
log('Showing visit request notification dialog');
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
|
|
||||||
// void openedAppVisitRequestNotification(
|
// void openedAppVisitRequestNotification(
|
||||||
// RemoteMessage message, BuildContext context) {
|
// RemoteMessage message, BuildContext context) {
|
||||||
// debugPrint('openedAppVisitRequestNotification');
|
// log('openedAppVisitRequestNotification');
|
||||||
// showDialog(
|
// showDialog(
|
||||||
// context: context,
|
// context: context,
|
||||||
// builder: (BuildContext context) {
|
// builder: (BuildContext context) {
|
||||||
|
@ -55,9 +55,9 @@
|
||||||
|
|
||||||
// // Método para tratar mensagens recebidas
|
// // Método para tratar mensagens recebidas
|
||||||
// void handleMessage(RemoteMessage message, BuildContext context) {
|
// void handleMessage(RemoteMessage message, BuildContext context) {
|
||||||
// debugPrint('Notification Received!');
|
// log('Notification Received!');
|
||||||
// message.data.forEach((key, value) {
|
// message.data.forEach((key, value) {
|
||||||
// debugPrint('$key: $value');
|
// log('$key: $value');
|
||||||
// });
|
// });
|
||||||
|
|
||||||
// switch (message.data['type']) {
|
// switch (message.data['type']) {
|
||||||
|
@ -67,7 +67,7 @@
|
||||||
// case '':
|
// case '':
|
||||||
// break;
|
// break;
|
||||||
// default:
|
// default:
|
||||||
// debugPrint('Notification type not recognized');
|
// log('Notification type not recognized');
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import 'dart:developer';
|
||||||
|
|
||||||
import '/backend/api_requests/api_calls.dart';
|
import '/backend/api_requests/api_calls.dart';
|
||||||
import '/flutter_flow/flutter_flow_theme.dart';
|
import '/flutter_flow/flutter_flow_theme.dart';
|
||||||
import '/flutter_flow/flutter_flow_util.dart';
|
import '/flutter_flow/flutter_flow_util.dart';
|
||||||
|
@ -129,35 +131,26 @@ class _BottomArrowLinkedLocalsComponentWidgetState
|
||||||
highlightColor: Colors.transparent,
|
highlightColor: Colors.transparent,
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
|
|
||||||
if (linkedLocals.any((local) =>
|
if (
|
||||||
local['CLI_ID'] == FFAppState().cliUUID &&
|
linkedLocals.any((local) => local['CLU_STATUS'] == "A")
|
||||||
local['CLU_STATUS'] == "A")) {
|
) {
|
||||||
FFAppState().cliUUID = getJsonField(
|
FFAppState().cliUUID = localItem['CLI_ID'];
|
||||||
localItem,
|
|
||||||
r'''$.CLI_ID''',
|
|
||||||
).toString();
|
|
||||||
setState(() {});
|
setState(() {});
|
||||||
FFAppState().local = getJsonField(
|
FFAppState().local = localItem['CLI_NOME'];
|
||||||
localItem,
|
|
||||||
r'''$.CLI_NOME''',
|
|
||||||
).toString();
|
|
||||||
setState(() {});
|
setState(() {});
|
||||||
FFAppState().ownerUUID = getJsonField(
|
FFAppState().ownerUUID = localItem['CLU_OWNER_ID'];
|
||||||
localItem,
|
|
||||||
r'''$.CLU_OWNER_ID''',
|
|
||||||
).toString();
|
|
||||||
setState(() {});
|
setState(() {});
|
||||||
debugPrint('Local: ${FFAppState().local}');
|
log('Local: ${FFAppState().local}');
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
} else {
|
} else {
|
||||||
debugPrint('Local não disponível');
|
log('Local não disponível');
|
||||||
// ScaffoldMessenger.of(context).showSnackBar(
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
// SnackBar(
|
const SnackBar(
|
||||||
// content: Text(
|
content: Text(
|
||||||
// 'Local não disponível',
|
'Local não disponível',
|
||||||
// ),
|
),
|
||||||
// ),
|
),
|
||||||
// );
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import 'package:f_r_e_hub/actions/actions.dart';
|
||||||
|
|
||||||
import '/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart';
|
import '/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart';
|
||||||
import '/flutter_flow/flutter_flow_theme.dart';
|
import '/flutter_flow/flutter_flow_theme.dart';
|
||||||
import '/flutter_flow/flutter_flow_util.dart';
|
import '/flutter_flow/flutter_flow_util.dart';
|
||||||
|
@ -10,7 +12,10 @@ import 'local_profile_component_model.dart';
|
||||||
export 'local_profile_component_model.dart';
|
export 'local_profile_component_model.dart';
|
||||||
|
|
||||||
class LocalProfileComponentWidget extends StatefulWidget {
|
class LocalProfileComponentWidget extends StatefulWidget {
|
||||||
const LocalProfileComponentWidget({super.key});
|
const LocalProfileComponentWidget({
|
||||||
|
required bool localStatus,
|
||||||
|
super.key
|
||||||
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<LocalProfileComponentWidget> createState() =>
|
State<LocalProfileComponentWidget> createState() =>
|
||||||
|
@ -44,9 +49,7 @@ class _LocalProfileComponentWidgetState
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
context.watch<FFAppState>();
|
context.watch<FFAppState>();
|
||||||
|
|
||||||
return Visibility(
|
return Container(
|
||||||
visible: random_data.randomInteger(0, 10) != null,
|
|
||||||
child: Container(
|
|
||||||
decoration: const BoxDecoration(),
|
decoration: const BoxDecoration(),
|
||||||
child: Align(
|
child: Align(
|
||||||
alignment: const AlignmentDirectional(0.0, -1.0),
|
alignment: const AlignmentDirectional(0.0, -1.0),
|
||||||
|
@ -93,24 +96,22 @@ class _LocalProfileComponentWidgetState
|
||||||
},
|
},
|
||||||
child: ClipRRect(
|
child: ClipRRect(
|
||||||
borderRadius: BorderRadius.circular(200.0),
|
borderRadius: BorderRadius.circular(200.0),
|
||||||
child: Image.network(
|
child:
|
||||||
valueOrDefault<String>(
|
Image.network(
|
||||||
'https://freaccess.com.br/freaccess/Images/Clients/${FFAppState().cliUUID}.png',
|
'https://freaccess.com.br/freaccess/Images/Clients/${FFAppState().cliUUID}.png',
|
||||||
|
width: 80.0,
|
||||||
|
height: 80.0,
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
alignment: const Alignment(0.0, 0.0),
|
||||||
|
errorBuilder: (context, error, stackTrace) => Image.network(
|
||||||
'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg',
|
'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg',
|
||||||
),
|
|
||||||
width: 80.0,
|
|
||||||
height: 80.0,
|
|
||||||
fit: BoxFit.cover,
|
|
||||||
alignment: const Alignment(0.0, 0.0),
|
|
||||||
errorBuilder: (context, error, stackTrace) =>
|
|
||||||
Image.asset(
|
|
||||||
'assets/images/error_image.svg',
|
|
||||||
width: 80.0,
|
width: 80.0,
|
||||||
height: 80.0,
|
height: 80.0,
|
||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
alignment: const Alignment(0.0, 0.0),
|
alignment: const Alignment(0.0, 0.0),
|
||||||
|
errorBuilder: (context, error, stackTrace) => Image.asset('assets/images/error_image.svg'),
|
||||||
),
|
),
|
||||||
),
|
)
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -145,7 +146,6 @@ class _LocalProfileComponentWidgetState
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import 'dart:developer';
|
||||||
|
|
||||||
import 'package:f_r_e_hub/app_state.dart';
|
import 'package:f_r_e_hub/app_state.dart';
|
||||||
import 'package:f_r_e_hub/backend/api_requests/api_calls.dart';
|
import 'package:f_r_e_hub/backend/api_requests/api_calls.dart';
|
||||||
import 'package:f_r_e_hub/flutter_flow/flutter_flow_theme.dart';
|
import 'package:f_r_e_hub/flutter_flow/flutter_flow_theme.dart';
|
||||||
|
@ -7,31 +9,26 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
|
||||||
class MessageWellComponentWidget extends StatefulWidget {
|
class MessageWellComponentWidget extends StatefulWidget {
|
||||||
const MessageWellComponentWidget({super.key});
|
const MessageWellComponentWidget({Key? key}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<MessageWellComponentWidget> createState() =>
|
State<MessageWellComponentWidget> createState() =>
|
||||||
_MessageWellComponentWidgetState();
|
_MessageWellComponentWidgetState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _MessageWellComponentWidgetState extends State<MessageWellComponentWidget> {
|
class _MessageWellComponentWidgetState
|
||||||
|
extends State<MessageWellComponentWidget> {
|
||||||
late ScrollController _listViewController;
|
late ScrollController _listViewController;
|
||||||
bool _allowScrollInSingleChildScrollView = true;
|
late VoidCallback _scrollListener;
|
||||||
|
final dropdownValueNotifier = ValueNotifier<String>('All');
|
||||||
VoidCallback get _scrollListener => MessageWellNotifier()._scrollListener;
|
|
||||||
final dropdownValueNotifier = ValueNotifier<String>('All'); // Using ValueNotifier for state management
|
|
||||||
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
_listViewController = ScrollController();
|
_listViewController = ScrollController();
|
||||||
_listViewController.addListener(_scrollListener); // Adicione esta linha
|
_scrollListener = MessageWellNotifier()._scrollListener;
|
||||||
// WidgetsBinding.instance?.addPostFrameCallback((_) {
|
_listViewController.addListener(_scrollListener);
|
||||||
// context.read<MessageWellNotifier>().fetchMessages();
|
|
||||||
// });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -77,37 +74,32 @@ class _MessageWellComponentWidgetState extends State<MessageWellComponentWidget>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool _buildScrollMessageListManager(ScrollNotification notification) {
|
bool _buildScrollMessageListManager(ScrollNotification notification) {
|
||||||
final notifier = context.read<MessageWellNotifier>();
|
final notifier = context.read<MessageWellNotifier>();
|
||||||
if (notification is ScrollUpdateNotification) {
|
if (notification is ScrollUpdateNotification) {
|
||||||
debugPrint('Scrolling ...');
|
log('Scrolling ...');
|
||||||
if (_listViewController.offset <= 0 && notification.scrollDelta! < 0) {
|
if (_listViewController.offset <= 0 && notification.scrollDelta! < 0) {
|
||||||
debugPrint('Scrolling up ...');
|
log('Scrolling up ...');
|
||||||
setState(() {
|
setState(() {});
|
||||||
_allowScrollInSingleChildScrollView = true;
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
debugPrint('Scrolling down ...');
|
log('Scrolling down ...');
|
||||||
if (_listViewController.position.extentAfter == 0) {
|
if (_listViewController.position.extentAfter == 0) {
|
||||||
debugPrint('Reached end of list. Incrementing pageNumber...');
|
log('Reached end of list. Incrementing pageNumber...');
|
||||||
notifier.incrementPageNumber();
|
notifier.incrementPageNumber();
|
||||||
}
|
}
|
||||||
setState(() {
|
setState(() {});
|
||||||
_allowScrollInSingleChildScrollView = false;
|
|
||||||
// MessageWellNotifier().fetchMessages();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildMenuMessageWell(BuildContext context, FlutterFlowTheme theme, ValueNotifier<String> dropdownValueNotifier) {
|
Widget _buildMenuMessageWell(BuildContext context, FlutterFlowTheme theme,
|
||||||
|
ValueNotifier<String> dropdownValueNotifier) {
|
||||||
final locations = FFLocalizations.of(context);
|
final locations = FFLocalizations.of(context);
|
||||||
late String all = locations.getVariableText(enText: 'All', ptText: 'All');
|
final all = locations.getVariableText(enText: 'All', ptText: 'All');
|
||||||
late String personal = locations.getVariableText(enText: 'Personal', ptText: 'Pessoal');
|
final personal =
|
||||||
late String global = locations.getVariableText(enText: 'Global', ptText: 'Global');
|
locations.getVariableText(enText: 'Personal', ptText: 'Pessoal');
|
||||||
|
final global = locations.getVariableText(enText: 'Global', ptText: 'Global');
|
||||||
|
|
||||||
return SizedBox(
|
return SizedBox(
|
||||||
key: UniqueKey(),
|
key: UniqueKey(),
|
||||||
|
@ -122,8 +114,8 @@ Widget _buildMenuMessageWell(BuildContext context, FlutterFlowTheme theme, Value
|
||||||
contentPadding: EdgeInsets.symmetric(horizontal: 10.0),
|
contentPadding: EdgeInsets.symmetric(horizontal: 10.0),
|
||||||
border: OutlineInputBorder(
|
border: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color: theme.primary, // Assuming FlutterFlowTheme.of(context).primary is the correct usage
|
color: theme.primary,
|
||||||
width: 2, // Adjusted width to a reasonable value
|
width: 2,
|
||||||
),
|
),
|
||||||
borderRadius: BorderRadius.circular(10),
|
borderRadius: BorderRadius.circular(10),
|
||||||
),
|
),
|
||||||
|
@ -132,8 +124,7 @@ Widget _buildMenuMessageWell(BuildContext context, FlutterFlowTheme theme, Value
|
||||||
),
|
),
|
||||||
onChanged: (String? newValue) {
|
onChanged: (String? newValue) {
|
||||||
if (newValue != null) {
|
if (newValue != null) {
|
||||||
// logger.log('DropDown value: $newValue'); // Assuming logger is correctly initialized elsewhere
|
dropdownValueNotifier.value = newValue;
|
||||||
dropdownValueNotifier.value = newValue; // Update the ValueNotifier value
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
items: [
|
items: [
|
||||||
|
@ -144,7 +135,8 @@ Widget _buildMenuMessageWell(BuildContext context, FlutterFlowTheme theme, Value
|
||||||
style: theme.labelMedium.override(
|
style: theme.labelMedium.override(
|
||||||
fontFamily: theme.labelMediumFamily,
|
fontFamily: theme.labelMediumFamily,
|
||||||
color: theme.primaryText,
|
color: theme.primaryText,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(theme.labelMediumFamily),
|
useGoogleFonts:
|
||||||
|
GoogleFonts.asMap().containsKey(theme.labelMediumFamily),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
@ -152,9 +144,10 @@ Widget _buildMenuMessageWell(BuildContext context, FlutterFlowTheme theme, Value
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Text _buildHandleMessageWell(BuildContext context, FlutterFlowTheme theme) {
|
Text _buildHandleMessageWell(
|
||||||
|
BuildContext context, FlutterFlowTheme theme) {
|
||||||
return Text(
|
return Text(
|
||||||
FFLocalizations.of(context).getText('8fworxmb'), // Mural de Mensagens
|
FFLocalizations.of(context).getText('8fworxmb'),
|
||||||
style: theme.bodyMedium.override(
|
style: theme.bodyMedium.override(
|
||||||
fontFamily: 'Nunito Sans',
|
fontFamily: 'Nunito Sans',
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
|
@ -163,7 +156,8 @@ Widget _buildMenuMessageWell(BuildContext context, FlutterFlowTheme theme, Value
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildMessageItem(BuildContext context, dynamic message, int index) {
|
Widget _buildMessageItem(
|
||||||
|
BuildContext context, dynamic message, int index) {
|
||||||
final theme = Theme.of(context);
|
final theme = Theme.of(context);
|
||||||
String formatMessageOrigin(String messageOrigin) {
|
String formatMessageOrigin(String messageOrigin) {
|
||||||
final words = messageOrigin.split(' ');
|
final words = messageOrigin.split(' ');
|
||||||
|
@ -174,8 +168,10 @@ Widget _buildMenuMessageWell(BuildContext context, FlutterFlowTheme theme, Value
|
||||||
});
|
});
|
||||||
return formattedWords.join(' ');
|
return formattedWords.join(' ');
|
||||||
}
|
}
|
||||||
|
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: () => print('Message tapped ...\nmessage[$index]: $message'),
|
onTap: () =>
|
||||||
|
log('Message tapped ...\nmessage[$index]: $message'),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.fromLTRB(20, 5, 20, 5),
|
padding: const EdgeInsets.fromLTRB(20, 5, 20, 5),
|
||||||
child: Container(
|
child: Container(
|
||||||
|
@ -262,7 +258,9 @@ class MessageWellState {
|
||||||
return MessageWellState(
|
return MessageWellState(
|
||||||
messages: messages ?? this.messages,
|
messages: messages ?? this.messages,
|
||||||
pageNumber: pageNumber ?? this.pageNumber,
|
pageNumber: pageNumber ?? this.pageNumber,
|
||||||
allowScrollInSingleChildScrollView: allowScrollInSingleChildScrollView ?? this.allowScrollInSingleChildScrollView,
|
allowScrollInSingleChildScrollView:
|
||||||
|
allowScrollInSingleChildScrollView ??
|
||||||
|
this.allowScrollInSingleChildScrollView,
|
||||||
listViewController: listViewController ?? this.listViewController,
|
listViewController: listViewController ?? this.listViewController,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -272,7 +270,10 @@ class MessageWellNotifier extends StateNotifier<MessageWellState> {
|
||||||
var totalPageNumber = 1;
|
var totalPageNumber = 1;
|
||||||
|
|
||||||
MessageWellNotifier()
|
MessageWellNotifier()
|
||||||
: super(MessageWellState(messages: [], allowScrollInSingleChildScrollView: true, listViewController: ScrollController())) {
|
: super(MessageWellState(
|
||||||
|
messages: [],
|
||||||
|
allowScrollInSingleChildScrollView: true,
|
||||||
|
listViewController: ScrollController())) {
|
||||||
state.listViewController.addListener(_scrollListener);
|
state.listViewController.addListener(_scrollListener);
|
||||||
fetchMessages();
|
fetchMessages();
|
||||||
}
|
}
|
||||||
|
@ -291,22 +292,25 @@ class MessageWellNotifier extends StateNotifier<MessageWellState> {
|
||||||
);
|
);
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
var messagesData = response.jsonBody['mensagens'];
|
var messagesData = response.jsonBody['mensagens'];
|
||||||
debugPrint('inputs: ${FFAppState().devUUID}, ${FFAppState().userUUID}, ${FFAppState().cliUUID}');
|
log('inputs: ${FFAppState().devUUID}, ${FFAppState().userUUID}, ${FFAppState().cliUUID}');
|
||||||
debugPrint('response: ${response.jsonBody}');
|
log('response: ${response.jsonBody}');
|
||||||
debugPrint('response[mensagens]: $messagesData');
|
log('response[mensagens]: $messagesData');
|
||||||
debugPrint('response[mensagens][0][MSG_TEXTO]: ${messagesData[0]['MSG_TEXTO']}');
|
log('response[mensagens][0][MSG_TEXTO]: ${messagesData[0]['MSG_TEXTO']}');
|
||||||
var newMessages = [...state.messages, ...messagesData];
|
var newMessages = [...state.messages, ...messagesData];
|
||||||
var rExp = RegExp(r'\d+').allMatches(newMessages.toString()).map((e) => e.group(0)).toList();
|
var rExp = RegExp(r'\d+')
|
||||||
debugPrint('rExp: $rExp');
|
.allMatches(newMessages.toString())
|
||||||
debugPrint('newMessages: $newMessages');
|
.map((e) => e.group(0))
|
||||||
|
.toList();
|
||||||
|
log('rExp: $rExp');
|
||||||
|
log('newMessages: $newMessages');
|
||||||
state = state.copyWith(messages: newMessages);
|
state = state.copyWith(messages: newMessages);
|
||||||
totalPageNumber = int.parse(response.jsonBody['total_pages']);
|
totalPageNumber = int.parse(response.jsonBody['total_pages']);
|
||||||
debugPrint('totalPageNumber: $totalPageNumber');
|
log('totalPageNumber: $totalPageNumber');
|
||||||
} else {
|
} else {
|
||||||
debugPrint('Error fetching messages: ${response.statusCode}');
|
log('Error fetching messages: ${response.statusCode}');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
debugPrint('No more messages to fetch ...');
|
log('No more messages to fetch ...');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -318,7 +322,7 @@ class MessageWellNotifier extends StateNotifier<MessageWellState> {
|
||||||
if (!state.allowScrollInSingleChildScrollView) {
|
if (!state.allowScrollInSingleChildScrollView) {
|
||||||
if (state.pageNumber <= totalPageNumber) {
|
if (state.pageNumber <= totalPageNumber) {
|
||||||
state = state.copyWith(pageNumber: state.pageNumber + 1);
|
state = state.copyWith(pageNumber: state.pageNumber + 1);
|
||||||
debugPrint('state.pageNumber: ${state.pageNumber}');
|
log('state.pageNumber: ${state.pageNumber}');
|
||||||
fetchMessages();
|
fetchMessages();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -333,18 +337,12 @@ class MessageWellNotifier extends StateNotifier<MessageWellState> {
|
||||||
void incrementPageNumber() {
|
void incrementPageNumber() {
|
||||||
if (state.pageNumber <= totalPageNumber) {
|
if (state.pageNumber <= totalPageNumber) {
|
||||||
state = state.copyWith(pageNumber: state.pageNumber + 1);
|
state = state.copyWith(pageNumber: state.pageNumber + 1);
|
||||||
debugPrint('state.pageNumber: ${state.pageNumber}');
|
log('state.pageNumber: ${state.pageNumber}');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final messageWellProvider =
|
||||||
mixin Logger {
|
StateNotifierProvider<MessageWellNotifier, MessageWellState>((ref) {
|
||||||
static void log(String message) {
|
|
||||||
debugPrint('Logger: $message');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
final messageWellProvider = StateNotifierProvider<MessageWellNotifier, MessageWellState>((ref) {
|
|
||||||
return MessageWellNotifier();
|
return MessageWellNotifier();
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import 'dart:collection';
|
import 'dart:collection';
|
||||||
|
import 'dart:developer';
|
||||||
|
|
||||||
import '/flutter_flow/flutter_flow_theme.dart';
|
import '/flutter_flow/flutter_flow_theme.dart';
|
||||||
import '/flutter_flow/flutter_flow_util.dart';
|
import '/flutter_flow/flutter_flow_util.dart';
|
||||||
|
@ -69,7 +70,7 @@ class _CardItemTemplateComponentWidgetState
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
context.watch<FFAppState>();
|
context.watch<FFAppState>();
|
||||||
debugPrint('imageHashMap: ${widget.imageHashMap}');
|
log('imageHashMap: ${widget.imageHashMap}');
|
||||||
|
|
||||||
return InkWell(
|
return InkWell(
|
||||||
splashColor: Colors.transparent,
|
splashColor: Colors.transparent,
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
import 'dart:developer';
|
||||||
|
|
||||||
import '/backend/api_requests/api_calls.dart';
|
import '/backend/api_requests/api_calls.dart';
|
||||||
import '/components/molecular_components/throw_exception/throw_exception_widget.dart';
|
import '/components/molecular_components/throw_exception/throw_exception_widget.dart';
|
||||||
|
@ -58,7 +59,7 @@ List<dynamic>? findVisitorById(List<dynamic>? jsonList, String? id) {
|
||||||
);
|
);
|
||||||
return foundItem != null ? [foundItem] : null;
|
return foundItem != null ? [foundItem] : null;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Error searching item: $e");
|
log("Error searching item: $e");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -860,7 +861,7 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
||||||
size: 24.0,
|
size: 24.0,
|
||||||
),
|
),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
print('IconButton pressed ...');
|
log('IconButton pressed ...');
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|
|
@ -19,22 +19,22 @@ Future<String?> getDevUUID() async {
|
||||||
if (Platform.isIOS) {
|
if (Platform.isIOS) {
|
||||||
// import 'dart:io'
|
// import 'dart:io'
|
||||||
var iosDeviceInfo = await deviceInfo.iosInfo;
|
var iosDeviceInfo = await deviceInfo.iosInfo;
|
||||||
debugPrint('DeviceInfoPlugin => iosDeviceInfo.utsname.machine: ${iosDeviceInfo.utsname.machine}'); // e.g. "iPod7,1"
|
log('DeviceInfoPlugin => iosDeviceInfo.utsname.machine: ${iosDeviceInfo.utsname.machine}'); // e.g. "iPod7,1"
|
||||||
debugPrint('DeviceInfoPlugin => iosDeviceInfo.systemName: ${iosDeviceInfo.systemName}'); // e.g. "iOS"
|
log('DeviceInfoPlugin => iosDeviceInfo.systemName: ${iosDeviceInfo.systemName}'); // e.g. "iOS"
|
||||||
debugPrint('DeviceInfoPlugin => iosDeviceInfo.systemVersion: ${iosDeviceInfo.systemVersion}'); // e.g. "13.3"
|
log('DeviceInfoPlugin => iosDeviceInfo.systemVersion: ${iosDeviceInfo.systemVersion}'); // e.g. "13.3"
|
||||||
debugPrint('DeviceInfoPlugin => iosDeviceInfo.model: ${iosDeviceInfo.model}'); // e.g. "iPhone"
|
log('DeviceInfoPlugin => iosDeviceInfo.model: ${iosDeviceInfo.model}'); // e.g. "iPhone"
|
||||||
debugPrint('DeviceInfoPlugin => iosDeviceInfo.localizedModel: ${iosDeviceInfo.localizedModel}'); // e.g. "iPhone"
|
log('DeviceInfoPlugin => iosDeviceInfo.localizedModel: ${iosDeviceInfo.localizedModel}'); // e.g. "iPhone"
|
||||||
debugPrint('DeviceInfoPlugin => iosDeviceInfo.identifierForVendor: ${iosDeviceInfo.identifierForVendor}'); // e.g. "A8E9F7C8-4D1F-4D97-9C3B-3A3D0F0F3E9E"
|
log('DeviceInfoPlugin => iosDeviceInfo.identifierForVendor: ${iosDeviceInfo.identifierForVendor}'); // e.g. "A8E9F7C8-4D1F-4D97-9C3B-3A3D0F0F3E9E"
|
||||||
return iosDeviceInfo.identifierForVendor; // unique ID on iOS
|
return iosDeviceInfo.identifierForVendor; // unique ID on iOS
|
||||||
} else if (Platform.isAndroid) {
|
} else if (Platform.isAndroid) {
|
||||||
var androidDeviceInfo = await deviceInfo.androidInfo;
|
var androidDeviceInfo = await deviceInfo.androidInfo;
|
||||||
print(AndroidDeviceInfo);
|
log(AndroidDeviceInfo);
|
||||||
// debugPrint('Running on ${androidDeviceInfo.androidId}'); // e.g. "A8E9F7C8-4D1F-4D97-9C3B-3A3D0F0F3E9E"
|
// log('Running on ${androidDeviceInfo.androidId}'); // e.g. "A8E9F7C8-4D1F-4D97-9C3B-3A3D0F0F3E9E"
|
||||||
debugPrint('DeviceInfoPLugin => androidDeviceInfo.model: ${androidDeviceInfo.model}'); // e.g. "iPhone"
|
log('DeviceInfoPLugin => androidDeviceInfo.model: ${androidDeviceInfo.model}'); // e.g. "iPhone"
|
||||||
debugPrint('DeviceInfoPLugin => androidDeviceInfo.manufacturer: ${androidDeviceInfo.manufacturer}'); // e.g. "iPhone"
|
log('DeviceInfoPLugin => androidDeviceInfo.manufacturer: ${androidDeviceInfo.manufacturer}'); // e.g. "iPhone"
|
||||||
debugPrint('DeviceInfoPLugin => androidDeviceInfo.product: ${androidDeviceInfo.product}'); // e.g. "iPhone"
|
log('DeviceInfoPLugin => androidDeviceInfo.product: ${androidDeviceInfo.product}'); // e.g. "iPhone"
|
||||||
debugPrint('DeviceInfoPLugin => androidDeviceInfo.device: ${androidDeviceInfo.device}'); // e.g. "iPhone"
|
log('DeviceInfoPLugin => androidDeviceInfo.device: ${androidDeviceInfo.device}'); // e.g. "iPhone"
|
||||||
debugPrint('DeviceInfoPLugin => androidDeviceInfo.id: ${androidDeviceInfo.id}'); // e.g. "iPhone"
|
log('DeviceInfoPLugin => androidDeviceInfo.id: ${androidDeviceInfo.id}'); // e.g. "iPhone"
|
||||||
return androidDeviceInfo.id; // unique ID on Android
|
return androidDeviceInfo.id; // unique ID on Android
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -44,22 +44,22 @@ Future<String?> getSerialNumber() async {
|
||||||
if (Platform.isIOS) {
|
if (Platform.isIOS) {
|
||||||
// import 'dart:io'
|
// import 'dart:io'
|
||||||
var iosDeviceInfo = await deviceInfo.iosInfo;
|
var iosDeviceInfo = await deviceInfo.iosInfo;
|
||||||
debugPrint('DeviceInfoPlugin => iosDeviceInfo.utsname.machine: ${iosDeviceInfo.utsname.machine}'); // e.g. "iPod7,1"
|
log('DeviceInfoPlugin => iosDeviceInfo.utsname.machine: ${iosDeviceInfo.utsname.machine}'); // e.g. "iPod7,1"
|
||||||
debugPrint('DeviceInfoPlugin => iosDeviceInfo.systemName: ${iosDeviceInfo.systemName}'); // e.g. "iOS"
|
log('DeviceInfoPlugin => iosDeviceInfo.systemName: ${iosDeviceInfo.systemName}'); // e.g. "iOS"
|
||||||
debugPrint('DeviceInfoPlugin => iosDeviceInfo.systemVersion: ${iosDeviceInfo.systemVersion}'); // e.g. "13.3"
|
log('DeviceInfoPlugin => iosDeviceInfo.systemVersion: ${iosDeviceInfo.systemVersion}'); // e.g. "13.3"
|
||||||
debugPrint('DeviceInfoPlugin => iosDeviceInfo.model: ${iosDeviceInfo.model}'); // e.g. "iPhone"
|
log('DeviceInfoPlugin => iosDeviceInfo.model: ${iosDeviceInfo.model}'); // e.g. "iPhone"
|
||||||
debugPrint('DeviceInfoPlugin => iosDeviceInfo.localizedModel: ${iosDeviceInfo.localizedModel}'); // e.g. "iPhone"
|
log('DeviceInfoPlugin => iosDeviceInfo.localizedModel: ${iosDeviceInfo.localizedModel}'); // e.g. "iPhone"
|
||||||
debugPrint('DeviceInfoPlugin => iosDeviceInfo.identifierForVendor: ${iosDeviceInfo.identifierForVendor}'); // e.g. "A8E9F7C8-4D1F-4D97-9C3B-3A3D0F0F3E9E"
|
log('DeviceInfoPlugin => iosDeviceInfo.identifierForVendor: ${iosDeviceInfo.identifierForVendor}'); // e.g. "A8E9F7C8-4D1F-4D97-9C3B-3A3D0F0F3E9E"
|
||||||
return iosDeviceInfo.identifierForVendor; // unique ID on iOS
|
return iosDeviceInfo.identifierForVendor; // unique ID on iOS
|
||||||
} else if (Platform.isAndroid) {
|
} else if (Platform.isAndroid) {
|
||||||
var androidDeviceInfo = await deviceInfo.androidInfo;
|
var androidDeviceInfo = await deviceInfo.androidInfo;
|
||||||
print(AndroidDeviceInfo);
|
log(AndroidDeviceInfo);
|
||||||
// debugPrint('Running on ${androidDeviceInfo.androidId}'); // e.g. "A8E9F7C8-4D1F-4D97-9C3B-3A3D0F0F3E9E"
|
// log('Running on ${androidDeviceInfo.androidId}'); // e.g. "A8E9F7C8-4D1F-4D97-9C3B-3A3D0F0F3E9E"
|
||||||
debugPrint('DeviceInfoPLugin => androidDeviceInfo.model: ${androidDeviceInfo.model}'); // e.g. "iPhone"
|
log('DeviceInfoPLugin => androidDeviceInfo.model: ${androidDeviceInfo.model}'); // e.g. "iPhone"
|
||||||
debugPrint('DeviceInfoPLugin => androidDeviceInfo.manufacturer: ${androidDeviceInfo.manufacturer}'); // e.g. "iPhone"
|
log('DeviceInfoPLugin => androidDeviceInfo.manufacturer: ${androidDeviceInfo.manufacturer}'); // e.g. "iPhone"
|
||||||
debugPrint('DeviceInfoPLugin => androidDeviceInfo.product: ${androidDeviceInfo.product}'); // e.g. "iPhone"
|
log('DeviceInfoPLugin => androidDeviceInfo.product: ${androidDeviceInfo.product}'); // e.g. "iPhone"
|
||||||
debugPrint('DeviceInfoPLugin => androidDeviceInfo.device: ${androidDeviceInfo.device}'); // e.g. "iPhone"
|
log('DeviceInfoPLugin => androidDeviceInfo.device: ${androidDeviceInfo.device}'); // e.g. "iPhone"
|
||||||
debugPrint('DeviceInfoPLugin => androidDeviceInfo.id: ${androidDeviceInfo.id}'); // e.g. "iPhone"
|
log('DeviceInfoPLugin => androidDeviceInfo.id: ${androidDeviceInfo.id}'); // e.g. "iPhone"
|
||||||
return androidDeviceInfo.serialNumber; // unique ID on Android
|
return androidDeviceInfo.serialNumber; // unique ID on Android
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,7 +58,7 @@ class _ImageCropperState extends State<ImageCropper> {
|
||||||
final path = _getStoragePath(_firebasePathPrefix(),
|
final path = _getStoragePath(_firebasePathPrefix(),
|
||||||
widget.imageFile!.name!, false, 0);
|
widget.imageFile!.name!, false, 0);
|
||||||
uploadData(path, image).then((value) {
|
uploadData(path, image).then((value) {
|
||||||
print('image cropped');
|
log('image cropped');
|
||||||
widget.callBackAction!.call(value!);
|
widget.callBackAction!.call(value!);
|
||||||
loading = false;
|
loading = false;
|
||||||
});
|
});
|
||||||
|
@ -93,7 +93,7 @@ class _ImageCropperState extends State<ImageCropper> {
|
||||||
setState(() {
|
setState(() {
|
||||||
loading = true;
|
loading = true;
|
||||||
});
|
});
|
||||||
print('Button pressed ...');
|
log('Button pressed ...');
|
||||||
_crop_controller.crop();
|
_crop_controller.crop();
|
||||||
|
|
||||||
//widget.loading = true;
|
//widget.loading = true;
|
||||||
|
|
|
@ -113,7 +113,7 @@ Stream<double> getProgressValue() {
|
||||||
return Stream.periodic(duration, (int count) {
|
return Stream.periodic(duration, (int count) {
|
||||||
final currentTime = DateTime.now().millisecondsSinceEpoch;
|
final currentTime = DateTime.now().millisecondsSinceEpoch;
|
||||||
final elapsedTime = currentTime - startTime;
|
final elapsedTime = currentTime - startTime;
|
||||||
final progress = math.min(1.0, elapsedTime / (endTime - startTime));
|
final progress = math.max(0.0, 1.0 - (elapsedTime / (endTime - startTime)));
|
||||||
return progress;
|
return progress;
|
||||||
});
|
});
|
||||||
}
|
}
|
|
@ -1,4 +1,5 @@
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
import 'dart:developer';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
@ -83,7 +84,7 @@ String? serializeParam(
|
||||||
}
|
}
|
||||||
return data;
|
return data;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('Error serializing parameter: $e');
|
log('Error serializing parameter: $e');
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -224,7 +225,7 @@ dynamic deserializeParam<T>(
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('Error deserializing parameter: $e');
|
log('Error deserializing parameter: $e');
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import 'dart:developer';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.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';
|
||||||
|
@ -51,7 +53,7 @@ class _AcessHistoryPageWidgetState extends State<AcessHistoryPageWidget> {
|
||||||
_AcessHistoryPageWidgetState(Map<String, String> opt)
|
_AcessHistoryPageWidgetState(Map<String, String> opt)
|
||||||
: selectedTypeSubject = BehaviorSubject.seeded(opt) {
|
: selectedTypeSubject = BehaviorSubject.seeded(opt) {
|
||||||
selectedTypeSubject.listen((value) {
|
selectedTypeSubject.listen((value) {
|
||||||
print("selectedTypeSubject changed: $value");
|
log("selectedTypeSubject changed: $value");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,7 +61,7 @@ class _AcessHistoryPageWidgetState extends State<AcessHistoryPageWidget> {
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
_model = createModel(context, () => AcessHistoryPageModel());
|
_model = createModel(context, () => AcessHistoryPageModel());
|
||||||
debugPrint("initState called in _AcessHistoryPageWidgetState");
|
log("initState called in _AcessHistoryPageWidgetState");
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -126,7 +128,7 @@ class _AcessHistoryPageWidgetState extends State<AcessHistoryPageWidget> {
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _appBarFilterButtonAtomWidget(BuildContext context) {
|
Widget _appBarFilterButtonAtomWidget(BuildContext context) {
|
||||||
debugPrint('selectedTypeSubject: ${selectedTypeSubject.value}');
|
log('selectedTypeSubject: ${selectedTypeSubject.value}');
|
||||||
return Row(
|
return Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
children: [
|
children: [
|
||||||
|
@ -148,7 +150,7 @@ class _AcessHistoryPageWidgetState extends State<AcessHistoryPageWidget> {
|
||||||
);
|
);
|
||||||
|
|
||||||
if (selectedFilter != null) {
|
if (selectedFilter != null) {
|
||||||
debugPrint('Selected Filter: $selectedFilter');
|
log('Selected Filter: $selectedFilter');
|
||||||
_updateAccessHistoryAction(selectedFilter);
|
_updateAccessHistoryAction(selectedFilter);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -170,14 +172,14 @@ class _AcessHistoryPageWidgetState extends State<AcessHistoryPageWidget> {
|
||||||
});
|
});
|
||||||
if (needsUpdate) {
|
if (needsUpdate) {
|
||||||
selectedTypeSubject.add(updatedType);
|
selectedTypeSubject.add(updatedType);
|
||||||
print("updateAccessHistory called with newType: $newType");
|
log("updateAccessHistory called with newType: $newType");
|
||||||
safeSetState(() {});
|
safeSetState(() {});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Stream<ApiCallResponse> fetchAccessHistoryService(String selectedType) {
|
Stream<ApiCallResponse> fetchAccessHistoryService(String selectedType) {
|
||||||
debugPrint('Calling API with type: $selectedType');
|
log('Calling API with type: $selectedType');
|
||||||
switch (selectedType) {
|
switch (selectedType) {
|
||||||
case 'E':
|
case 'E':
|
||||||
return _model.accessHistory(
|
return _model.accessHistory(
|
||||||
|
@ -239,13 +241,13 @@ class _AcessHistoryPageWidgetState extends State<AcessHistoryPageWidget> {
|
||||||
|
|
||||||
Future<List<dynamic>> fetchCardListViewService(
|
Future<List<dynamic>> fetchCardListViewService(
|
||||||
Map<String, String> select) async {
|
Map<String, String> select) async {
|
||||||
debugPrint('Fetching access history');
|
log('Fetching access history');
|
||||||
final response =
|
final response =
|
||||||
await fetchAccessHistoryService(select['personType']!).first;
|
await fetchAccessHistoryService(select['personType']!).first;
|
||||||
debugPrint('Response: ${response.jsonBody}');
|
log('Response: ${response.jsonBody}');
|
||||||
final List<dynamic> accessHistory = response.jsonBody['acessos'] ?? [];
|
final List<dynamic> accessHistory = response.jsonBody['acessos'] ?? [];
|
||||||
debugPrint('Access History Before Filtering: $accessHistory');
|
log('Access History Before Filtering: $accessHistory');
|
||||||
debugPrint(
|
log(
|
||||||
'Filtering for: Person Type - ${select['personType']}, Access Type - ${select['accessType']}, Search - ${select['search']}');
|
'Filtering for: Person Type - ${select['personType']}, Access Type - ${select['accessType']}, Search - ${select['search']}');
|
||||||
|
|
||||||
return accessHistory.where((item) {
|
return accessHistory.where((item) {
|
||||||
|
@ -258,20 +260,20 @@ class _AcessHistoryPageWidgetState extends State<AcessHistoryPageWidget> {
|
||||||
.toString()
|
.toString()
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
.contains(select['search']!.toLowerCase());
|
.contains(select['search']!.toLowerCase());
|
||||||
debugPrint('NOMES: ${item["PES_NOME"].toString().toLowerCase()}');
|
log('NOMES: ${item["PES_NOME"].toString().toLowerCase()}');
|
||||||
return personTypeMatches && accessTypeMatches && searchMatches;
|
return personTypeMatches && accessTypeMatches && searchMatches;
|
||||||
}).toList();
|
}).toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _cardListViewOrganismWidget(Map<String, String> selected) {
|
Widget _cardListViewOrganismWidget(Map<String, String> selected) {
|
||||||
debugPrint(
|
log(
|
||||||
'Selected types in Card: ${selected['personType']}, ${selected['accessType']}');
|
'Selected types in Card: ${selected['personType']}, ${selected['accessType']}');
|
||||||
debugPrint('_buildAccessHistoryList called');
|
log('_buildAccessHistoryList called');
|
||||||
return FutureBuilder<List<dynamic>>(
|
return FutureBuilder<List<dynamic>>(
|
||||||
future: fetchCardListViewService(selected),
|
future: fetchCardListViewService(selected),
|
||||||
builder: (context, snapshot) {
|
builder: (context, snapshot) {
|
||||||
if (snapshot.connectionState == ConnectionState.waiting) {
|
if (snapshot.connectionState == ConnectionState.waiting) {
|
||||||
debugPrint('Waiting for data');
|
log('Waiting for data');
|
||||||
return Center(
|
return Center(
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
width: 50.0,
|
width: 50.0,
|
||||||
|
@ -286,14 +288,14 @@ class _AcessHistoryPageWidgetState extends State<AcessHistoryPageWidget> {
|
||||||
return Text('Error: ${snapshot.error}');
|
return Text('Error: ${snapshot.error}');
|
||||||
} else {
|
} else {
|
||||||
final accessHistory = snapshot.data!;
|
final accessHistory = snapshot.data!;
|
||||||
debugPrint('Access History: $accessHistory');
|
log('Access History: $accessHistory');
|
||||||
return ListView.builder(
|
return ListView.builder(
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
physics: const NeverScrollableScrollPhysics(),
|
physics: const NeverScrollableScrollPhysics(),
|
||||||
itemCount: accessHistory.length,
|
itemCount: accessHistory.length,
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
final accessHistoryItem = accessHistory[index];
|
final accessHistoryItem = accessHistory[index];
|
||||||
debugPrint(
|
log(
|
||||||
'Access History Item: ${accessHistoryItem['PES_TIPO']}');
|
'Access History Item: ${accessHistoryItem['PES_TIPO']}');
|
||||||
return _accessHistoryCardMoleculeWidget(
|
return _accessHistoryCardMoleculeWidget(
|
||||||
context, accessHistoryItem);
|
context, accessHistoryItem);
|
||||||
|
@ -306,7 +308,7 @@ class _AcessHistoryPageWidgetState extends State<AcessHistoryPageWidget> {
|
||||||
|
|
||||||
Widget _accessHistoryCardMoleculeWidget(
|
Widget _accessHistoryCardMoleculeWidget(
|
||||||
BuildContext context, dynamic accessHistoryItem) {
|
BuildContext context, dynamic accessHistoryItem) {
|
||||||
debugPrint('Access History Item: $accessHistoryItem');
|
log('Access History Item: $accessHistoryItem');
|
||||||
return CardItemTemplateComponentWidget(
|
return CardItemTemplateComponentWidget(
|
||||||
imageHashMap: Map<String, String>.from({
|
imageHashMap: Map<String, String>.from({
|
||||||
'key': accessHistoryItem['PES_ID'] ?? '',
|
'key': accessHistoryItem['PES_ID'] ?? '',
|
||||||
|
@ -389,7 +391,7 @@ Widget _cardHeaderAtomWidget(BuildContext context, String urlImagem,
|
||||||
.replaceAll('"', ''); // Remove aspas
|
.replaceAll('"', ''); // Remove aspas
|
||||||
|
|
||||||
// Debug: Imprime o valor de PES_TIPO ajustado
|
// Debug: Imprime o valor de PES_TIPO ajustado
|
||||||
debugPrint('PES_TIPO FOR COLORING: $pesTipo');
|
log('PES_TIPO FOR COLORING: $pesTipo');
|
||||||
|
|
||||||
// Retorna a cor baseada na condição ajustada
|
// Retorna a cor baseada na condição ajustada
|
||||||
return pesTipo == 'E'
|
return pesTipo == 'E'
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import 'dart:developer';
|
||||||
|
|
||||||
import 'package:f_r_e_hub/app_state.dart';
|
import 'package:f_r_e_hub/app_state.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:url_launcher/url_launcher_string.dart';
|
import 'package:url_launcher/url_launcher_string.dart';
|
||||||
|
@ -53,13 +55,13 @@ class _FastPassPageWidgetState extends State<FastPassPageWidget> {
|
||||||
..setJavaScriptMode(JavaScriptMode.unrestricted)
|
..setJavaScriptMode(JavaScriptMode.unrestricted)
|
||||||
..setBackgroundColor(const Color(0x00000000))
|
..setBackgroundColor(const Color(0x00000000))
|
||||||
..setOnConsoleMessage((message) {
|
..setOnConsoleMessage((message) {
|
||||||
debugPrint('Console: ${message.message}');
|
log('Console: ${message.message}');
|
||||||
})
|
})
|
||||||
..setNavigationDelegate(
|
..setNavigationDelegate(
|
||||||
NavigationDelegate(
|
NavigationDelegate(
|
||||||
onProgress: (int progress) {},
|
onProgress: (int progress) {},
|
||||||
onPageStarted: (String url) {
|
onPageStarted: (String url) {
|
||||||
debugPrint('Page started: $url');
|
log('Page started: $url');
|
||||||
final String token =
|
final String token =
|
||||||
"localStorage.setItem('fre-token', '\"${widget.freToken}\"');";
|
"localStorage.setItem('fre-token', '\"${widget.freToken}\"');";
|
||||||
|
|
||||||
|
@ -78,13 +80,13 @@ class _FastPassPageWidgetState extends State<FastPassPageWidget> {
|
||||||
_controller.runJavaScript(command);
|
_controller.runJavaScript(command);
|
||||||
},
|
},
|
||||||
onPageFinished: (String url) {
|
onPageFinished: (String url) {
|
||||||
debugPrint('Page finished: $url');
|
log('Page finished: $url');
|
||||||
},
|
},
|
||||||
onWebResourceError: (WebResourceError error) {
|
onWebResourceError: (WebResourceError error) {
|
||||||
debugPrint('Error: ${error.description}');
|
log('Error: ${error.description}');
|
||||||
},
|
},
|
||||||
onNavigationRequest: (NavigationRequest request) {
|
onNavigationRequest: (NavigationRequest request) {
|
||||||
debugPrint('Request: ${request.url}');
|
log('Request: ${request.url}');
|
||||||
if (request.url.startsWith('http') ||
|
if (request.url.startsWith('http') ||
|
||||||
request.url.startsWith('https://api.whatsapp.com/send') ||
|
request.url.startsWith('https://api.whatsapp.com/send') ||
|
||||||
request.url.startsWith('https://wa.me')) {
|
request.url.startsWith('https://wa.me')) {
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
// import 'package:f_r_e_hub/backend/push_notification/pushNotification.dart';
|
// import 'package:f_r_e_hub/backend/push_notification/pushNotification.dart';
|
||||||
|
import 'dart:developer';
|
||||||
|
|
||||||
import 'package:f_r_e_hub/actions/actions.dart';
|
import 'package:f_r_e_hub/actions/actions.dart';
|
||||||
import 'package:f_r_e_hub/backend/push_notification/pushNotificationService.dart';
|
import 'package:f_r_e_hub/backend/push_notification/pushNotificationService.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
@ -28,26 +30,35 @@ class HomePageWidget extends StatefulWidget {
|
||||||
|
|
||||||
class _HomePageWidgetState extends State<HomePageWidget> {
|
class _HomePageWidgetState extends State<HomePageWidget> {
|
||||||
late HomePageModel _model;
|
late HomePageModel _model;
|
||||||
|
bool localStatus = false;
|
||||||
final scaffoldKey = GlobalKey<ScaffoldState>();
|
final scaffoldKey = GlobalKey<ScaffoldState>();
|
||||||
|
|
||||||
|
|
||||||
|
Future<void> checkLocalStatus() async {
|
||||||
|
localStatus = await checkLocals(
|
||||||
|
context: context,
|
||||||
|
model: _model,
|
||||||
|
safeSetState: safeSetState,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
_model = createModel(context, () => HomePageModel());
|
_model = createModel(context, () => HomePageModel());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
SchedulerBinding.instance.addPostFrameCallback((_) async {
|
SchedulerBinding.instance.addPostFrameCallback((_) async {
|
||||||
|
|
||||||
|
|
||||||
await PushNotificationService().initialize(context);
|
await PushNotificationService().initialize(context);
|
||||||
|
|
||||||
await checkLocals(
|
|
||||||
context: context,
|
|
||||||
model: _model,
|
|
||||||
safeSetState: safeSetState,
|
@override
|
||||||
);
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
checkLocalStatus();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Rest of your code...
|
||||||
if (FFAppState().cliUUID == null || FFAppState().cliUUID.isEmpty) {
|
if (FFAppState().cliUUID == null || FFAppState().cliUUID.isEmpty) {
|
||||||
showModalBottomSheet(
|
showModalBottomSheet(
|
||||||
isScrollControlled: false,
|
isScrollControlled: false,
|
||||||
|
@ -86,7 +97,6 @@ class _HomePageWidgetState extends State<HomePageWidget> {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
context.watch<FFAppState>();
|
context.watch<FFAppState>();
|
||||||
|
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: () => _model.unfocusNode.canRequestFocus
|
onTap: () => _model.unfocusNode.canRequestFocus
|
||||||
? FocusScope.of(context).requestFocus(_model.unfocusNode)
|
? FocusScope.of(context).requestFocus(_model.unfocusNode)
|
||||||
|
@ -94,7 +104,243 @@ class _HomePageWidgetState extends State<HomePageWidget> {
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
key: scaffoldKey,
|
key: scaffoldKey,
|
||||||
backgroundColor: FlutterFlowTheme.of(context).secondaryBackground,
|
backgroundColor: FlutterFlowTheme.of(context).secondaryBackground,
|
||||||
drawer: SizedBox(
|
drawer: buildDrawer(context),
|
||||||
|
body: buildPage(context, localStatus),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Container buildPage(BuildContext context, bool localStatus) {
|
||||||
|
return Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
|
),
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.max,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Wrap(
|
||||||
|
spacing: 0.0,
|
||||||
|
runSpacing: 0.0,
|
||||||
|
alignment: WrapAlignment.start,
|
||||||
|
crossAxisAlignment: WrapCrossAlignment.start,
|
||||||
|
direction: Axis.horizontal,
|
||||||
|
runAlignment: WrapAlignment.start,
|
||||||
|
verticalDirection: VerticalDirection.down,
|
||||||
|
clipBehavior: Clip.none,
|
||||||
|
children: [
|
||||||
|
createHeader(context),
|
||||||
|
createLocal(localStatus),
|
||||||
|
createBody(),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Wrap createBody() {
|
||||||
|
return Wrap(
|
||||||
|
spacing: 0.0,
|
||||||
|
runSpacing: 0.0,
|
||||||
|
alignment: WrapAlignment.start,
|
||||||
|
crossAxisAlignment: WrapCrossAlignment.start,
|
||||||
|
direction: Axis.horizontal,
|
||||||
|
runAlignment: WrapAlignment.start,
|
||||||
|
verticalDirection: VerticalDirection.down,
|
||||||
|
clipBehavior: Clip.none,
|
||||||
|
children: [
|
||||||
|
wrapWithModel(
|
||||||
|
model: _model.menuComponentModel,
|
||||||
|
updateCallback: () => setState(() {}),
|
||||||
|
child: const MenuComponentWidget(),
|
||||||
|
),
|
||||||
|
Align(
|
||||||
|
alignment: const AlignmentDirectional(0.0, 0.0),
|
||||||
|
child: Provider<MessageWellNotifier>(
|
||||||
|
create: (_) => MessageWellNotifier(),
|
||||||
|
child: wrapWithModel(
|
||||||
|
model: _model.messageWellComponentModel,
|
||||||
|
updateCallback: () => setState(() {}),
|
||||||
|
child: const MessageWellComponentWidget(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
//footer
|
||||||
|
const SizedBox(
|
||||||
|
height: 100,
|
||||||
|
width: double.infinity,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget createLocal(bool localStatus) {
|
||||||
|
return wrapWithModel(
|
||||||
|
model: _model.localComponentModel,
|
||||||
|
updateCallback: () => setState(() {}),
|
||||||
|
child: LocalProfileComponentWidget(
|
||||||
|
localStatus: localStatus,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Row createHeader(BuildContext context) {
|
||||||
|
return Row(
|
||||||
|
mainAxisSize: MainAxisSize.max,
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: Container(
|
||||||
|
width: 100.0,
|
||||||
|
height: 100.0,
|
||||||
|
decoration: const BoxDecoration(
|
||||||
|
color: Color(0xFF1AAB5F),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Align(
|
||||||
|
alignment:
|
||||||
|
const AlignmentDirectional(0.0, 1.0),
|
||||||
|
child: Container(
|
||||||
|
height: 50.0,
|
||||||
|
decoration: const BoxDecoration(),
|
||||||
|
child: Align(
|
||||||
|
alignment:
|
||||||
|
const AlignmentDirectional(0.0, 0.0),
|
||||||
|
child: Row(
|
||||||
|
mainAxisSize: MainAxisSize.max,
|
||||||
|
children: [
|
||||||
|
Align(
|
||||||
|
alignment:
|
||||||
|
const AlignmentDirectional(
|
||||||
|
-1.0, 0.0),
|
||||||
|
child: Padding(
|
||||||
|
padding:
|
||||||
|
const EdgeInsetsDirectional
|
||||||
|
.fromSTEB(
|
||||||
|
10.0, 0.0, 0.0, 0.0),
|
||||||
|
child: FlutterFlowIconButton(
|
||||||
|
borderRadius: 20.0,
|
||||||
|
borderWidth: 1.0,
|
||||||
|
buttonSize: 40.0,
|
||||||
|
fillColor:
|
||||||
|
FlutterFlowTheme.of(context)
|
||||||
|
.primary,
|
||||||
|
icon: const Icon(
|
||||||
|
Icons.menu_rounded,
|
||||||
|
color: Colors.white,
|
||||||
|
size: 28.0,
|
||||||
|
),
|
||||||
|
onPressed: () async {
|
||||||
|
scaffoldKey.currentState!
|
||||||
|
.openDrawer();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Align(
|
||||||
|
alignment:
|
||||||
|
const AlignmentDirectional(
|
||||||
|
-1.0, 0.0),
|
||||||
|
child: Padding(
|
||||||
|
padding:
|
||||||
|
const EdgeInsetsDirectional
|
||||||
|
.fromSTEB(
|
||||||
|
60.0, 15.0, 0.0, 0.0),
|
||||||
|
child: ClipRRect(
|
||||||
|
borderRadius:
|
||||||
|
BorderRadius.circular(8.0),
|
||||||
|
child: Image.network(
|
||||||
|
'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/8r2vsbd9i03k/logo.png',
|
||||||
|
width: 50.0,
|
||||||
|
height: 200.0,
|
||||||
|
fit: BoxFit.none,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Align(
|
||||||
|
alignment:
|
||||||
|
const AlignmentDirectional(
|
||||||
|
0.0, 0.0),
|
||||||
|
child: Padding(
|
||||||
|
padding:
|
||||||
|
const EdgeInsetsDirectional
|
||||||
|
.fromSTEB(
|
||||||
|
0.0, 15.0, 0.0, 0.0),
|
||||||
|
child: Text(
|
||||||
|
FFLocalizations.of(context)
|
||||||
|
.getText(
|
||||||
|
'rg9pzkpz' /* FRE ACCESS */,
|
||||||
|
),
|
||||||
|
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),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Align(
|
||||||
|
alignment:
|
||||||
|
const AlignmentDirectional(0.0, 1.0),
|
||||||
|
child: Container(
|
||||||
|
width: 100.0,
|
||||||
|
height: 50.0,
|
||||||
|
decoration: const BoxDecoration(),
|
||||||
|
child: Align(
|
||||||
|
alignment:
|
||||||
|
const AlignmentDirectional(1.0, 1.0),
|
||||||
|
child: FlutterFlowIconButton(
|
||||||
|
borderRadius: 20.0,
|
||||||
|
borderWidth: 1.0,
|
||||||
|
buttonSize: 40.0,
|
||||||
|
icon: Icon(
|
||||||
|
Icons.notifications_sharp,
|
||||||
|
color:
|
||||||
|
FlutterFlowTheme.of(context).info,
|
||||||
|
size: 24.0,
|
||||||
|
),
|
||||||
|
onPressed: () {
|
||||||
|
log('IconButton pressed ...');
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
SizedBox buildDrawer(BuildContext context) {
|
||||||
|
return SizedBox(
|
||||||
width: 750.0,
|
width: 750.0,
|
||||||
child: Drawer(
|
child: Drawer(
|
||||||
elevation: 16.0,
|
elevation: 16.0,
|
||||||
|
@ -932,221 +1178,6 @@ class _HomePageWidgetState extends State<HomePageWidget> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
body: Container(
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: FlutterFlowTheme.of(context).primaryBackground,
|
|
||||||
),
|
|
||||||
child: SingleChildScrollView(
|
|
||||||
child: Column(
|
|
||||||
mainAxisSize: MainAxisSize.max,
|
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
Wrap(
|
|
||||||
spacing: 0.0,
|
|
||||||
runSpacing: 0.0,
|
|
||||||
alignment: WrapAlignment.start,
|
|
||||||
crossAxisAlignment: WrapCrossAlignment.start,
|
|
||||||
direction: Axis.horizontal,
|
|
||||||
runAlignment: WrapAlignment.start,
|
|
||||||
verticalDirection: VerticalDirection.down,
|
|
||||||
clipBehavior: Clip.none,
|
|
||||||
children: [
|
|
||||||
Row(
|
|
||||||
mainAxisSize: MainAxisSize.max,
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
child: Container(
|
|
||||||
width: 100.0,
|
|
||||||
height: 100.0,
|
|
||||||
decoration: const BoxDecoration(
|
|
||||||
color: Color(0xFF1AAB5F),
|
|
||||||
),
|
|
||||||
child: Row(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
|
||||||
Align(
|
|
||||||
alignment:
|
|
||||||
const AlignmentDirectional(0.0, 1.0),
|
|
||||||
child: Container(
|
|
||||||
height: 50.0,
|
|
||||||
decoration: const BoxDecoration(),
|
|
||||||
child: Align(
|
|
||||||
alignment:
|
|
||||||
const AlignmentDirectional(0.0, 0.0),
|
|
||||||
child: Row(
|
|
||||||
mainAxisSize: MainAxisSize.max,
|
|
||||||
children: [
|
|
||||||
Align(
|
|
||||||
alignment:
|
|
||||||
const AlignmentDirectional(
|
|
||||||
-1.0, 0.0),
|
|
||||||
child: Padding(
|
|
||||||
padding:
|
|
||||||
const EdgeInsetsDirectional
|
|
||||||
.fromSTEB(
|
|
||||||
10.0, 0.0, 0.0, 0.0),
|
|
||||||
child: FlutterFlowIconButton(
|
|
||||||
borderRadius: 20.0,
|
|
||||||
borderWidth: 1.0,
|
|
||||||
buttonSize: 40.0,
|
|
||||||
fillColor:
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.primary,
|
|
||||||
icon: const Icon(
|
|
||||||
Icons.menu_rounded,
|
|
||||||
color: Colors.white,
|
|
||||||
size: 28.0,
|
|
||||||
),
|
|
||||||
onPressed: () async {
|
|
||||||
scaffoldKey.currentState!
|
|
||||||
.openDrawer();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Align(
|
|
||||||
alignment:
|
|
||||||
const AlignmentDirectional(
|
|
||||||
-1.0, 0.0),
|
|
||||||
child: Padding(
|
|
||||||
padding:
|
|
||||||
const EdgeInsetsDirectional
|
|
||||||
.fromSTEB(
|
|
||||||
60.0, 15.0, 0.0, 0.0),
|
|
||||||
child: ClipRRect(
|
|
||||||
borderRadius:
|
|
||||||
BorderRadius.circular(8.0),
|
|
||||||
child: Image.network(
|
|
||||||
'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/8r2vsbd9i03k/logo.png',
|
|
||||||
width: 50.0,
|
|
||||||
height: 200.0,
|
|
||||||
fit: BoxFit.none,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Align(
|
|
||||||
alignment:
|
|
||||||
const AlignmentDirectional(
|
|
||||||
0.0, 0.0),
|
|
||||||
child: Padding(
|
|
||||||
padding:
|
|
||||||
const EdgeInsetsDirectional
|
|
||||||
.fromSTEB(
|
|
||||||
0.0, 15.0, 0.0, 0.0),
|
|
||||||
child: Text(
|
|
||||||
FFLocalizations.of(context)
|
|
||||||
.getText(
|
|
||||||
'rg9pzkpz' /* FRE ACCESS */,
|
|
||||||
),
|
|
||||||
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),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Align(
|
|
||||||
alignment:
|
|
||||||
const AlignmentDirectional(0.0, 1.0),
|
|
||||||
child: Container(
|
|
||||||
width: 100.0,
|
|
||||||
height: 50.0,
|
|
||||||
decoration: const BoxDecoration(),
|
|
||||||
child: Align(
|
|
||||||
alignment:
|
|
||||||
const AlignmentDirectional(1.0, 1.0),
|
|
||||||
child: FlutterFlowIconButton(
|
|
||||||
borderRadius: 20.0,
|
|
||||||
borderWidth: 1.0,
|
|
||||||
buttonSize: 40.0,
|
|
||||||
icon: Icon(
|
|
||||||
Icons.notifications_sharp,
|
|
||||||
color:
|
|
||||||
FlutterFlowTheme.of(context).info,
|
|
||||||
size: 24.0,
|
|
||||||
),
|
|
||||||
onPressed: () {
|
|
||||||
print('IconButton pressed ...');
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
wrapWithModel(
|
|
||||||
model: _model.localComponentModel,
|
|
||||||
updateCallback: () => setState(() {}),
|
|
||||||
child: const LocalProfileComponentWidget(),
|
|
||||||
),
|
|
||||||
Wrap(
|
|
||||||
spacing: 0.0,
|
|
||||||
runSpacing: 0.0,
|
|
||||||
|
|
||||||
alignment: WrapAlignment.start,
|
|
||||||
crossAxisAlignment: WrapCrossAlignment.start,
|
|
||||||
direction: Axis.horizontal,
|
|
||||||
runAlignment: WrapAlignment.start,
|
|
||||||
verticalDirection: VerticalDirection.down,
|
|
||||||
clipBehavior: Clip.none,
|
|
||||||
children: [
|
|
||||||
wrapWithModel(
|
|
||||||
model: _model.menuComponentModel,
|
|
||||||
updateCallback: () => setState(() {}),
|
|
||||||
child: const MenuComponentWidget(),
|
|
||||||
),
|
|
||||||
Align(
|
|
||||||
alignment: const AlignmentDirectional(0.0, 0.0),
|
|
||||||
child: Provider<MessageWellNotifier>(
|
|
||||||
create: (_) => MessageWellNotifier(),
|
|
||||||
child: wrapWithModel(
|
|
||||||
model: _model.messageWellComponentModel,
|
|
||||||
updateCallback: () => setState(() {}),
|
|
||||||
child: const MessageWellComponentWidget(),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
//footer
|
|
||||||
const SizedBox(
|
|
||||||
height: 100,
|
|
||||||
width: double.infinity,
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
// import 'dart:js_interop';
|
// import 'dart:js_interop';
|
||||||
|
|
||||||
|
import 'dart:developer';
|
||||||
|
|
||||||
import 'package:f_r_e_hub/actions/actions.dart';
|
import 'package:f_r_e_hub/actions/actions.dart';
|
||||||
import 'package:f_r_e_hub/backend/push_notification/pushNotificationService.dart';
|
import 'package:f_r_e_hub/backend/push_notification/pushNotificationService.dart';
|
||||||
import 'package:f_r_e_hub/components/templates_components/card_item_template_component/card_item_template_component_widget.dart';
|
import 'package:f_r_e_hub/components/templates_components/card_item_template_component/card_item_template_component_widget.dart';
|
||||||
|
@ -357,7 +359,7 @@ Widget liberationHistoryItemCard(
|
||||||
|
|
||||||
_pushNotificationService.onMessageReceived.listen((received) {
|
_pushNotificationService.onMessageReceived.listen((received) {
|
||||||
if (received.data['click_action'] == 'cancel_request') {
|
if (received.data['click_action'] == 'cancel_request') {
|
||||||
debugPrint('Aprovado');
|
log('Aprovado');
|
||||||
_pushNotificationService.dispose();
|
_pushNotificationService.dispose();
|
||||||
snackbar(context, opt: true);
|
snackbar(context, opt: true);
|
||||||
context.pushReplacementNamed(
|
context.pushReplacementNamed(
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
// import 'dart:js_interop';
|
// import 'dart:js_interop';
|
||||||
|
|
||||||
|
import 'dart:developer';
|
||||||
|
|
||||||
import 'package:f_r_e_hub/actions/actions.dart';
|
import 'package:f_r_e_hub/actions/actions.dart';
|
||||||
import 'package:f_r_e_hub/backend/push_notification/pushNotificationService.dart';
|
import 'package:f_r_e_hub/backend/push_notification/pushNotificationService.dart';
|
||||||
import 'package:f_r_e_hub/components/templates_components/card_item_template_component/card_item_template_component_widget.dart';
|
import 'package:f_r_e_hub/components/templates_components/card_item_template_component/card_item_template_component_widget.dart';
|
||||||
|
@ -267,7 +269,7 @@ Widget liberationHistoryItemCard(
|
||||||
|
|
||||||
_pushNotificationService.onMessageReceived.listen((received) {
|
_pushNotificationService.onMessageReceived.listen((received) {
|
||||||
if (received.data['click_action'] == 'cancel_request') {
|
if (received.data['click_action'] == 'cancel_request') {
|
||||||
debugPrint('Aprovado');
|
log('Aprovado');
|
||||||
_pushNotificationService.dispose();
|
_pushNotificationService.dispose();
|
||||||
snackbar(context, opt: true);
|
snackbar(context, opt: true);
|
||||||
context.pushReplacementNamed(
|
context.pushReplacementNamed(
|
||||||
|
|
|
@ -321,6 +321,8 @@ void dispose() {
|
||||||
final progress = snapshot.data!;
|
final progress = snapshot.data!;
|
||||||
return CircularPercentIndicator(
|
return CircularPercentIndicator(
|
||||||
percent: progress,
|
percent: progress,
|
||||||
|
restartAnimation: true,
|
||||||
|
reverse: false,
|
||||||
radius: 30.0,
|
radius: 30.0,
|
||||||
lineWidth: 7.0,
|
lineWidth: 7.0,
|
||||||
animation: true,
|
animation: true,
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import 'dart:developer';
|
||||||
|
|
||||||
import '/backend/api_requests/api_calls.dart';
|
import '/backend/api_requests/api_calls.dart';
|
||||||
import '/components/molecular_components/throw_exception/throw_exception_widget.dart';
|
import '/components/molecular_components/throw_exception/throw_exception_widget.dart';
|
||||||
import '/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart';
|
import '/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart';
|
||||||
|
@ -1953,7 +1955,7 @@ Widget visitHistory(
|
||||||
size: 24.0,
|
size: 24.0,
|
||||||
),
|
),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
print('IconButton pressed ...');
|
log('IconButton pressed ...');
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import 'dart:developer';
|
||||||
|
|
||||||
import 'package:f_r_e_hub/components/templates_components/card_item_template_component/card_item_template_component_widget.dart';
|
import 'package:f_r_e_hub/components/templates_components/card_item_template_component/card_item_template_component_widget.dart';
|
||||||
import 'package:f_r_e_hub/flutter_flow/flutter_flow_theme.dart';
|
import 'package:f_r_e_hub/flutter_flow/flutter_flow_theme.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
@ -51,7 +53,7 @@ class TestPage extends StatelessWidget {
|
||||||
imageHashMap: imageKeyValue,
|
imageHashMap: imageKeyValue,
|
||||||
onTapCardItemAction: () async {
|
onTapCardItemAction: () async {
|
||||||
// Ação ao tocar no card
|
// Ação ao tocar no card
|
||||||
print('Card tapped');
|
log('Card tapped');
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import 'dart:developer';
|
||||||
|
|
||||||
import 'package:cached_network_image/cached_network_image.dart';
|
import 'package:cached_network_image/cached_network_image.dart';
|
||||||
import 'package:f_r_e_hub/pages/visit_history_page/visit_history_page_model.dart';
|
import 'package:f_r_e_hub/pages/visit_history_page/visit_history_page_model.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
@ -223,7 +225,7 @@ Widget visitHistory(
|
||||||
size: 24.0,
|
size: 24.0,
|
||||||
),
|
),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
print('IconButton pressed ...');
|
log('IconButton pressed ...');
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|
Loading…
Reference in New Issue