commit
10668c9f97
|
@ -1,4 +1,7 @@
|
||||||
PODS:
|
PODS:
|
||||||
|
- connectivity_plus (0.0.1):
|
||||||
|
- Flutter
|
||||||
|
- FlutterMacOS
|
||||||
- device_info_plus (0.0.1):
|
- device_info_plus (0.0.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
- DKImagePickerController/Core (4.3.9):
|
- DKImagePickerController/Core (4.3.9):
|
||||||
|
@ -225,6 +228,7 @@ PODS:
|
||||||
- Flutter
|
- Flutter
|
||||||
|
|
||||||
DEPENDENCIES:
|
DEPENDENCIES:
|
||||||
|
- connectivity_plus (from `.symlinks/plugins/connectivity_plus/darwin`)
|
||||||
- device_info_plus (from `.symlinks/plugins/device_info_plus/ios`)
|
- device_info_plus (from `.symlinks/plugins/device_info_plus/ios`)
|
||||||
- file_picker (from `.symlinks/plugins/file_picker/ios`)
|
- file_picker (from `.symlinks/plugins/file_picker/ios`)
|
||||||
- firebase_analytics (from `.symlinks/plugins/firebase_analytics/ios`)
|
- firebase_analytics (from `.symlinks/plugins/firebase_analytics/ios`)
|
||||||
|
@ -271,6 +275,8 @@ SPEC REPOS:
|
||||||
- SwiftyGif
|
- SwiftyGif
|
||||||
|
|
||||||
EXTERNAL SOURCES:
|
EXTERNAL SOURCES:
|
||||||
|
connectivity_plus:
|
||||||
|
:path: ".symlinks/plugins/connectivity_plus/darwin"
|
||||||
device_info_plus:
|
device_info_plus:
|
||||||
:path: ".symlinks/plugins/device_info_plus/ios"
|
:path: ".symlinks/plugins/device_info_plus/ios"
|
||||||
file_picker:
|
file_picker:
|
||||||
|
@ -313,6 +319,7 @@ EXTERNAL SOURCES:
|
||||||
:path: ".symlinks/plugins/webview_flutter_wkwebview/ios"
|
:path: ".symlinks/plugins/webview_flutter_wkwebview/ios"
|
||||||
|
|
||||||
SPEC CHECKSUMS:
|
SPEC CHECKSUMS:
|
||||||
|
connectivity_plus: ddd7f30999e1faaef5967c23d5b6d503d10434db
|
||||||
device_info_plus: 97af1d7e84681a90d0693e63169a5d50e0839a0d
|
device_info_plus: 97af1d7e84681a90d0693e63169a5d50e0839a0d
|
||||||
DKImagePickerController: 946cec48c7873164274ecc4624d19e3da4c1ef3c
|
DKImagePickerController: 946cec48c7873164274ecc4624d19e3da4c1ef3c
|
||||||
DKPhotoGallery: b3834fecb755ee09a593d7c9e389d8b5d6deed60
|
DKPhotoGallery: b3834fecb755ee09a593d7c9e389d8b5d6deed60
|
||||||
|
|
|
@ -41,6 +41,8 @@
|
||||||
4C588A6A63D12FBFE8C3D586 /* GoogleService-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; name = "GoogleService-Info.plist"; path = "Runner/GoogleService-Info.plist"; sourceTree = "<group>"; };
|
4C588A6A63D12FBFE8C3D586 /* GoogleService-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; name = "GoogleService-Info.plist"; path = "Runner/GoogleService-Info.plist"; sourceTree = "<group>"; };
|
||||||
4C7A2C30DCF835BA60FAD235 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
|
4C7A2C30DCF835BA60FAD235 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
|
||||||
50BE974D08F66282C0031620 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
|
50BE974D08F66282C0031620 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
|
||||||
|
6436409127A31CDB00820AF7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
|
||||||
|
6436409227A31CD800820AF7 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/InfoPlist.strings; sourceTree = "<group>"; };
|
||||||
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
|
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
|
||||||
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||||
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
|
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
|
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
|
||||||
|
<device id="retina6_12" orientation="portrait" appearance="light"/>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<deployment identifier="iOS"/>
|
<deployment identifier="iOS"/>
|
||||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
|
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/>
|
||||||
|
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<scenes>
|
<scenes>
|
||||||
<!--Flutter View Controller-->
|
<!--Flutter View Controller-->
|
||||||
|
@ -14,13 +16,14 @@
|
||||||
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
|
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
|
||||||
</layoutGuides>
|
</layoutGuides>
|
||||||
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
|
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
|
||||||
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
|
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
|
||||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
|
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||||
</view>
|
</view>
|
||||||
</viewController>
|
</viewController>
|
||||||
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
|
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
|
||||||
</objects>
|
</objects>
|
||||||
|
<point key="canvasLocation" x="-16" y="-40"/>
|
||||||
</scene>
|
</scene>
|
||||||
</scenes>
|
</scenes>
|
||||||
</document>
|
</document>
|
||||||
|
|
|
@ -22,7 +22,6 @@ import 'package:url_launcher/url_launcher.dart';
|
||||||
import '../shared/utils/log_util.dart';
|
import '../shared/utils/log_util.dart';
|
||||||
|
|
||||||
Future<void> openTermsOfUse(BuildContext context) async {
|
Future<void> openTermsOfUse(BuildContext context) async {
|
||||||
log('openTermsOfUse');
|
|
||||||
final Uri url = Uri.parse('https://freaccess.com.br/pp/');
|
final Uri url = Uri.parse('https://freaccess.com.br/pp/');
|
||||||
if (!await launchUrl(url)) {
|
if (!await launchUrl(url)) {
|
||||||
throw Exception('Could not launch $url');
|
throw Exception('Could not launch $url');
|
||||||
|
@ -90,7 +89,6 @@ Future<Color> manageStatusColorAction(
|
||||||
BuildContext context, {
|
BuildContext context, {
|
||||||
required String? visitStatusStr,
|
required String? visitStatusStr,
|
||||||
}) async {
|
}) async {
|
||||||
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') ||
|
||||||
|
@ -322,40 +320,28 @@ Future toggleHomePage(BuildContext context) async {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<bool> visitRequestComponentAction(
|
Future<bool> visitCancelAction(BuildContext context,
|
||||||
BuildContext context, {
|
{required int? idDestino,
|
||||||
required String? actionValue,
|
required int? idVisita,
|
||||||
required String? refUUID,
|
required String? accessKey,
|
||||||
required String? responseValue,
|
required String? email}) async {
|
||||||
required String? vteUUID,
|
ApiCallResponse? apiCallResponse;
|
||||||
}) async {
|
|
||||||
ApiCallResponse? respondeSolicitacaoCall;
|
|
||||||
|
|
||||||
respondeSolicitacaoCall = await PhpGroup.respondeSolicitacaoCall.call(
|
apiCallResponse = await PhpGroup.cancelaVisita.call(
|
||||||
userUUID: FFAppState().userUUID,
|
userUUID: FFAppState().userUUID,
|
||||||
devUUID: FFAppState().devUUID,
|
devUUID: FFAppState().devUUID,
|
||||||
cliUUID: FFAppState().cliUUID,
|
cliID: FFAppState().cliUUID,
|
||||||
atividade: 'respondeSolicitacao',
|
atividade: 'cancelaVisita',
|
||||||
referencia: refUUID,
|
idDestino: idDestino,
|
||||||
tarefa: actionValue,
|
idVisita: idVisita,
|
||||||
resposta: responseValue,
|
AccessKey: accessKey,
|
||||||
idVisitante: vteUUID,
|
UsuEmail: email,
|
||||||
|
DevDesc: '',
|
||||||
);
|
);
|
||||||
|
|
||||||
if (respondeSolicitacaoCall.statusCode == 200) {
|
if (apiCallResponse.statusCode == 200) {
|
||||||
return true;
|
return !apiCallResponse.jsonBody['error'];
|
||||||
} else {
|
} else {
|
||||||
log('headers: ${respondeSolicitacaoCall.headers}');
|
|
||||||
log('bodyText: ${respondeSolicitacaoCall.bodyText}');
|
|
||||||
log('jsonBody: ${respondeSolicitacaoCall.jsonBody}');
|
|
||||||
log('userUUID: ${FFAppState().userUUID}');
|
|
||||||
log('devUUID: ${FFAppState().devUUID}');
|
|
||||||
log('cliUUID: ${FFAppState().cliUUID}');
|
|
||||||
log('atividade: respondeSolicitacao');
|
|
||||||
log('referencia: $refUUID');
|
|
||||||
log('tarefa: $actionValue');
|
|
||||||
log('resposta: $responseValue');
|
|
||||||
log('idVisitante: $vteUUID');
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -401,7 +387,6 @@ 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']) {
|
||||||
log("checkLocals => Erro encontrado na resposta");
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -413,10 +398,8 @@ 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) {
|
||||||
log("checkLocals => Item encontrado com CLI_ID $uuid e CLU_STATUS A");
|
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
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,
|
||||||
|
@ -439,54 +422,50 @@ Future<bool> checkLocals({
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future answersRequest(BuildContext context, String? ref, String? task,
|
||||||
|
String? response, String? id) async {
|
||||||
|
ApiCallResponse? respondeSolicitacaoCall;
|
||||||
|
|
||||||
|
respondeSolicitacaoCall = await PhpGroup.respondeSolicitacaoCall.call(
|
||||||
|
userUUID: FFAppState().userUUID,
|
||||||
|
devUUID: FFAppState().devUUID,
|
||||||
|
cliUUID: FFAppState().cliUUID,
|
||||||
|
atividade: 'respondeSolicitacao',
|
||||||
|
referencia: ref,
|
||||||
|
tarefa: task,
|
||||||
|
resposta: response,
|
||||||
|
idVisitante: id,
|
||||||
|
);
|
||||||
|
|
||||||
|
if (respondeSolicitacaoCall.statusCode == 200) {
|
||||||
|
return !respondeSolicitacaoCall.jsonBody['error'];
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Future changeStatusAction(
|
Future changeStatusAction(
|
||||||
BuildContext context,
|
BuildContext context,
|
||||||
String status,
|
int idDestino,
|
||||||
String vawREF,
|
int idVisita,
|
||||||
String msg,
|
String accessKey,
|
||||||
String vteUUID,
|
String email,
|
||||||
) async {
|
) async {
|
||||||
log('status: $status');
|
Navigator.pop(context, true);
|
||||||
|
|
||||||
switch (status) {
|
bool? blockVisitRequest;
|
||||||
case 'L':
|
blockVisitRequest = await visitCancelAction(
|
||||||
Navigator.pop(context, true);
|
context,
|
||||||
|
accessKey: accessKey,
|
||||||
bool? approveVisitRequest;
|
idDestino: idDestino,
|
||||||
approveVisitRequest = await visitRequestComponentAction(
|
idVisita: idVisita,
|
||||||
context,
|
email: email,
|
||||||
actionValue: status,
|
);
|
||||||
refUUID: vawREF,
|
if (!context.mounted) return;
|
||||||
responseValue: msg,
|
if (blockVisitRequest == true) {
|
||||||
vteUUID: vteUUID,
|
return true;
|
||||||
);
|
} else {
|
||||||
if (!context.mounted) return;
|
return false;
|
||||||
if (approveVisitRequest == true) {
|
|
||||||
log('Aprovado');
|
|
||||||
} else {
|
|
||||||
log('Erro ao aprovar');
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 'B':
|
|
||||||
Navigator.pop(context, true);
|
|
||||||
|
|
||||||
bool? blockVisitRequest;
|
|
||||||
blockVisitRequest = await visitRequestComponentAction(
|
|
||||||
context,
|
|
||||||
actionValue: status,
|
|
||||||
refUUID: vawREF,
|
|
||||||
responseValue: msg,
|
|
||||||
vteUUID: vteUUID,
|
|
||||||
);
|
|
||||||
if (!context.mounted) return;
|
|
||||||
if (blockVisitRequest == true) {
|
|
||||||
log('Bloqueado');
|
|
||||||
} else {
|
|
||||||
log('Erro ao bloquear');
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -497,8 +476,6 @@ Uint8List assembleQRPacket(int direction, String identifier, String password) {
|
||||||
|
|
||||||
String paddedBadge = identifier.padLeft(30, '0');
|
String paddedBadge = identifier.padLeft(30, '0');
|
||||||
|
|
||||||
log("Badge: $paddedBadge");
|
|
||||||
|
|
||||||
for (var i = 0; i < paddedBadge.length; i += 2) {
|
for (var i = 0; i < paddedBadge.length; i += 2) {
|
||||||
packet.add(int.parse(paddedBadge.substring(i, i + 2), radix: 16));
|
packet.add(int.parse(paddedBadge.substring(i, i + 2), radix: 16));
|
||||||
}
|
}
|
||||||
|
@ -540,8 +517,6 @@ Uint8List assembleQRPacket(int direction, String identifier, String password) {
|
||||||
var bytes =
|
var bytes =
|
||||||
packet.map((byte) => byte.toRadixString(16).padLeft(2, '0')).join((' '));
|
packet.map((byte) => byte.toRadixString(16).padLeft(2, '0')).join((' '));
|
||||||
|
|
||||||
log("Pacote: $packet");
|
|
||||||
log("Bytes: $bytes");
|
|
||||||
return Uint8List.fromList(packet);
|
return Uint8List.fromList(packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -577,7 +552,6 @@ Widget buildQrCode(
|
||||||
required String pass,
|
required String pass,
|
||||||
required int direction}) {
|
required int direction}) {
|
||||||
try {
|
try {
|
||||||
log("pass: $pass");
|
|
||||||
const Color backgroundColor = Colors.white;
|
const Color backgroundColor = Colors.white;
|
||||||
const Color foregroundColor = Colors.black;
|
const Color foregroundColor = Colors.black;
|
||||||
return QrImageView.withQr(
|
return QrImageView.withQr(
|
||||||
|
@ -779,3 +753,22 @@ Future accessQRCodeOptAction(BuildContext context) async {
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum status { active, unknown, canceled, finished, blocked, inactive }
|
||||||
|
|
||||||
|
status? getStatus(dynamic data) {
|
||||||
|
switch (data) {
|
||||||
|
case 'A':
|
||||||
|
return status.active;
|
||||||
|
case 'F':
|
||||||
|
return status.finished;
|
||||||
|
case 'B':
|
||||||
|
return status.blocked;
|
||||||
|
case 'C':
|
||||||
|
return status.canceled;
|
||||||
|
case 'I':
|
||||||
|
return status.inactive;
|
||||||
|
default:
|
||||||
|
return status.unknown;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -20,7 +20,6 @@ class FFAppState extends ChangeNotifier {
|
||||||
return await auth.canCheckBiometrics;
|
return await auth.canCheckBiometrics;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
clearBiometricAuthentication();
|
clearBiometricAuthentication();
|
||||||
debugPrint('Error checking biometrics: $e');
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -44,8 +43,6 @@ class FFAppState extends ChangeNotifier {
|
||||||
// Salvar o estado de autenticação biométrica, se necessário
|
// Salvar o estado de autenticação biométrica, se necessário
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print(e);
|
|
||||||
debugPrint('Error authenticating: $e');
|
|
||||||
clearBiometricAuthentication();
|
clearBiometricAuthentication();
|
||||||
return Future.error(e);
|
return Future.error(e);
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,6 @@ export 'api_manager.dart' show ApiCallResponse;
|
||||||
|
|
||||||
const _kPrivateApiFunctionName = 'ffPrivateApiCall';
|
const _kPrivateApiFunctionName = 'ffPrivateApiCall';
|
||||||
|
|
||||||
|
|
||||||
/// Start PHP Group Code
|
/// Start PHP Group Code
|
||||||
|
|
||||||
class PhpGroup {
|
class PhpGroup {
|
||||||
|
@ -47,6 +46,128 @@ class PhpGroup {
|
||||||
static ChangeNotifica changeNotifica = ChangeNotifica();
|
static ChangeNotifica changeNotifica = ChangeNotifica();
|
||||||
static RespondeVinculo resopndeVinculo = RespondeVinculo();
|
static RespondeVinculo resopndeVinculo = RespondeVinculo();
|
||||||
static ChangePass changePass = ChangePass();
|
static ChangePass changePass = ChangePass();
|
||||||
|
static ChangePanic changePanic = ChangePanic();
|
||||||
|
static DeleteAccount deleteAccount = DeleteAccount();
|
||||||
|
static CancelaVisita cancelaVisita = CancelaVisita();
|
||||||
|
}
|
||||||
|
|
||||||
|
class CancelaVisita {
|
||||||
|
Future<ApiCallResponse> call({
|
||||||
|
String? devUUID = '',
|
||||||
|
String? userUUID = '',
|
||||||
|
String? cliID = '',
|
||||||
|
String? atividade = '',
|
||||||
|
int? idDestino,
|
||||||
|
int? idVisita,
|
||||||
|
String? AccessKey = '',
|
||||||
|
String? UsuEmail = '',
|
||||||
|
String? DevDesc = '',
|
||||||
|
}) async {
|
||||||
|
final baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
|
return ApiManager.instance.makeApiCall(
|
||||||
|
callName: 'cancelaVisita',
|
||||||
|
apiUrl: '$baseUrl/processRequest.php',
|
||||||
|
callType: ApiCallType.POST,
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/x-www-form-urlencoded',
|
||||||
|
},
|
||||||
|
params: {
|
||||||
|
'devUUID': devUUID,
|
||||||
|
'userUUID': userUUID,
|
||||||
|
'atividade': atividade,
|
||||||
|
'cliID': cliID,
|
||||||
|
'idVisita': idVisita,
|
||||||
|
'AccessKey': AccessKey,
|
||||||
|
'UsuEmail': UsuEmail,
|
||||||
|
'DevDesc': DevDesc,
|
||||||
|
},
|
||||||
|
bodyType: BodyType.X_WWW_FORM_URL_ENCODED,
|
||||||
|
returnBody: true,
|
||||||
|
encodeBodyUtf8: false,
|
||||||
|
decodeUtf8: false,
|
||||||
|
cache: false,
|
||||||
|
alwaysAllowBody: false,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool? error(dynamic response) => castToType<bool>(getJsonField(
|
||||||
|
response,
|
||||||
|
r'''$.error''',
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
class DeleteAccount {
|
||||||
|
Future<ApiCallResponse> call({
|
||||||
|
String? devUUID = '',
|
||||||
|
String? userUUID = '',
|
||||||
|
}) async {
|
||||||
|
final baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
return ApiManager.instance.makeApiCall(
|
||||||
|
callName: 'deleteAccount',
|
||||||
|
apiUrl: '$baseUrl/deleteAccount.php',
|
||||||
|
callType: ApiCallType.POST,
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/x-www-form-urlencoded',
|
||||||
|
},
|
||||||
|
params: {
|
||||||
|
'devUUID': devUUID,
|
||||||
|
'userUUID': userUUID,
|
||||||
|
},
|
||||||
|
bodyType: BodyType.X_WWW_FORM_URL_ENCODED,
|
||||||
|
returnBody: true,
|
||||||
|
encodeBodyUtf8: false,
|
||||||
|
decodeUtf8: false,
|
||||||
|
cache: false,
|
||||||
|
isStreamingApi: false,
|
||||||
|
alwaysAllowBody: false,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool? error(dynamic response) => castToType<bool>(getJsonField(
|
||||||
|
response,
|
||||||
|
r'''$.error''',
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
class ChangePanic {
|
||||||
|
Future<ApiCallResponse> call({
|
||||||
|
String? devUUID = '',
|
||||||
|
String? userUUID = '',
|
||||||
|
String? cliID = '',
|
||||||
|
String? atividade = '',
|
||||||
|
String? newSenhaPanico = '',
|
||||||
|
}) async {
|
||||||
|
final baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
|
return ApiManager.instance.makeApiCall(
|
||||||
|
callName: 'changePass',
|
||||||
|
apiUrl: '$baseUrl/processRequest.php',
|
||||||
|
callType: ApiCallType.POST,
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/x-www-form-urlencoded',
|
||||||
|
},
|
||||||
|
params: {
|
||||||
|
'devUUID': devUUID,
|
||||||
|
'userUUID': userUUID,
|
||||||
|
'cliID': cliID,
|
||||||
|
'atividade': atividade,
|
||||||
|
'newSenhaPanico': newSenhaPanico,
|
||||||
|
},
|
||||||
|
bodyType: BodyType.X_WWW_FORM_URL_ENCODED,
|
||||||
|
returnBody: true,
|
||||||
|
encodeBodyUtf8: false,
|
||||||
|
decodeUtf8: false,
|
||||||
|
cache: false,
|
||||||
|
isStreamingApi: false,
|
||||||
|
alwaysAllowBody: false,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool? error(dynamic response) => castToType<bool>(getJsonField(
|
||||||
|
response,
|
||||||
|
r'''$.error''',
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
class ChangePass {
|
class ChangePass {
|
||||||
|
@ -96,31 +217,30 @@ class RespondeVinculo {
|
||||||
String? cliID = '',
|
String? cliID = '',
|
||||||
String? tarefa = '',
|
String? tarefa = '',
|
||||||
}) async {
|
}) async {
|
||||||
final baseUrl = PhpGroup.getBaseUrl();
|
final baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
return ApiManager.instance.makeApiCall(
|
return ApiManager.instance.makeApiCall(
|
||||||
callName: 'respondeVinculo',
|
callName: 'respondeVinculo',
|
||||||
apiUrl: '$baseUrl/processRequest.php',
|
apiUrl: '$baseUrl/responderVinculo.php',
|
||||||
callType: ApiCallType.POST,
|
callType: ApiCallType.POST,
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/x-www-form-urlencoded',
|
'Content-Type': 'application/x-www-form-urlencoded',
|
||||||
},
|
},
|
||||||
params: {
|
params: {
|
||||||
'devUUID': devUUID,
|
'devUUID': devUUID,
|
||||||
'userUUID': userUUID,
|
'userUUID': userUUID,
|
||||||
'cliID': cliID,
|
'cliID': cliID,
|
||||||
'tarefa': tarefa,
|
'tarefa': tarefa,
|
||||||
},
|
},
|
||||||
bodyType: BodyType.X_WWW_FORM_URL_ENCODED,
|
bodyType: BodyType.X_WWW_FORM_URL_ENCODED,
|
||||||
returnBody: true,
|
returnBody: true,
|
||||||
encodeBodyUtf8: false,
|
encodeBodyUtf8: false,
|
||||||
decodeUtf8: false,
|
decodeUtf8: false,
|
||||||
cache: false,
|
cache: false,
|
||||||
isStreamingApi: false,
|
isStreamingApi: false,
|
||||||
alwaysAllowBody: false,
|
alwaysAllowBody: false,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class ChangeNotifica {
|
class ChangeNotifica {
|
||||||
|
@ -161,7 +281,7 @@ class ChangeNotifica {
|
||||||
response,
|
response,
|
||||||
r'''$.error''',
|
r'''$.error''',
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
class UpdToken {
|
class UpdToken {
|
||||||
Future<ApiCallResponse> call({
|
Future<ApiCallResponse> call({
|
||||||
|
@ -2405,9 +2525,7 @@ String _serializeList(List? list) {
|
||||||
try {
|
try {
|
||||||
return json.encode(list, toEncodable: _toEncodable);
|
return json.encode(list, toEncodable: _toEncodable);
|
||||||
} catch (_) {
|
} catch (_) {
|
||||||
if (kDebugMode) {
|
if (kDebugMode) {}
|
||||||
log("List serialization failed. Returning empty list.");
|
|
||||||
}
|
|
||||||
return '[]';
|
return '[]';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2417,9 +2535,7 @@ String _serializeJson(dynamic jsonVar, [bool isList = false]) {
|
||||||
try {
|
try {
|
||||||
return json.encode(jsonVar, toEncodable: _toEncodable);
|
return json.encode(jsonVar, toEncodable: _toEncodable);
|
||||||
} catch (_) {
|
} catch (_) {
|
||||||
if (kDebugMode) {
|
if (kDebugMode) {}
|
||||||
log("Json serialization failed. Returning empty json.");
|
|
||||||
}
|
|
||||||
return isList ? '[]' : '{}';
|
return isList ? '[]' : '{}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'dart:core';
|
import 'dart:core';
|
||||||
|
import 'dart:developer';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
import 'dart:typed_data';
|
import 'dart:typed_data';
|
||||||
|
|
||||||
|
@ -15,9 +16,6 @@ import '/flutter_flow/uploaded_file.dart';
|
||||||
|
|
||||||
import 'get_streamed_response.dart';
|
import 'get_streamed_response.dart';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
enum ApiCallType {
|
enum ApiCallType {
|
||||||
GET,
|
GET,
|
||||||
POST,
|
POST,
|
||||||
|
@ -413,6 +411,7 @@ class ApiManager {
|
||||||
ApiCallOptions? options,
|
ApiCallOptions? options,
|
||||||
http.Client? client,
|
http.Client? client,
|
||||||
}) async {
|
}) async {
|
||||||
|
|
||||||
final callOptions = options ??
|
final callOptions = options ??
|
||||||
ApiCallOptions(
|
ApiCallOptions(
|
||||||
callName: callName,
|
callName: callName,
|
||||||
|
@ -515,4 +514,4 @@ class ApiManager {
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,8 +4,6 @@ import 'dart:developer';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
import 'dart:math' as math;
|
import 'dart:math' as math;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import 'package:firebase_messaging/firebase_messaging.dart';
|
import 'package:firebase_messaging/firebase_messaging.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
@ -17,11 +15,16 @@ import 'package:hub/backend/api_requests/api_manager.dart';
|
||||||
import 'package:hub/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_widget.dart';
|
import 'package:hub/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_widget.dart';
|
||||||
import 'package:hub/components/templates_components/details_component/details_component_widget.dart';
|
import 'package:hub/components/templates_components/details_component/details_component_widget.dart';
|
||||||
import 'package:hub/components/templates_components/message_notificaion_modal_template_component/message_notification_widget.dart';
|
import 'package:hub/components/templates_components/message_notificaion_modal_template_component/message_notification_widget.dart';
|
||||||
|
import 'package:hub/components/templates_components/details_component/details_component_widget.dart';
|
||||||
|
import 'package:hub/flutter_flow/flutter_flow_icon_button.dart';
|
||||||
|
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
||||||
|
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
||||||
|
import 'package:hub/flutter_flow/flutter_flow_widgets.dart';
|
||||||
|
import 'package:hub/flutter_flow/internationalization.dart';
|
||||||
import 'package:rxdart/rxdart.dart';
|
import 'package:rxdart/rxdart.dart';
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
class PushNotificationService {
|
class PushNotificationService {
|
||||||
final FirebaseMessaging _firebaseMessaging = FirebaseMessaging.instance;
|
final FirebaseMessaging _firebaseMessaging = FirebaseMessaging.instance;
|
||||||
final FlutterLocalNotificationsPlugin _flutterLocalNotificationsPlugin =
|
final FlutterLocalNotificationsPlugin _flutterLocalNotificationsPlugin =
|
||||||
|
@ -57,10 +60,7 @@ class PushNotificationService {
|
||||||
sound: true,
|
sound: true,
|
||||||
);
|
);
|
||||||
if (settings.authorizationStatus == AuthorizationStatus.authorized) {
|
if (settings.authorizationStatus == AuthorizationStatus.authorized) {
|
||||||
log('User granted permission');
|
} else {}
|
||||||
} else {
|
|
||||||
log('User declined or has not accepted permission');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, dynamic> validJsonFromString(String? jsonString) {
|
Map<String, dynamic> validJsonFromString(String? jsonString) {
|
||||||
|
@ -99,13 +99,10 @@ class PushNotificationService {
|
||||||
// Passo 4: Decodificar o JSON corrigido
|
// Passo 4: Decodificar o JSON corrigido
|
||||||
return jsonDecode(correctedJson);
|
return jsonDecode(correctedJson);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('Error decoding JSON: $e');
|
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void _initializeLocalNotifications(
|
void _initializeLocalNotifications(
|
||||||
BehaviorSubject<BuildContext> context) async {
|
BehaviorSubject<BuildContext> context) async {
|
||||||
while (context.valueOrNull == null) {
|
while (context.valueOrNull == null) {
|
||||||
|
@ -126,18 +123,12 @@ class PushNotificationService {
|
||||||
_flutterLocalNotificationsPlugin.initialize(
|
_flutterLocalNotificationsPlugin.initialize(
|
||||||
initializationSettings,
|
initializationSettings,
|
||||||
onDidReceiveNotificationResponse: (NotificationResponse response) async {
|
onDidReceiveNotificationResponse: (NotificationResponse response) async {
|
||||||
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!);
|
|
||||||
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);
|
||||||
_handleNotificationClick(message, extra: data.value);
|
} catch (e) {}
|
||||||
} catch (e) {
|
|
||||||
log('Error decoding notification payload: $e');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
@ -173,8 +164,7 @@ class PushNotificationService {
|
||||||
|
|
||||||
void _listenToForegroundMessages(BuildContext context) {
|
void _listenToForegroundMessages(BuildContext context) {
|
||||||
FirebaseMessaging.onMessage.listen((RemoteMessage message) {
|
FirebaseMessaging.onMessage.listen((RemoteMessage message) {
|
||||||
log('Got a message whilst in the foreground!');
|
log("Message Foregroud: ${message.data}");
|
||||||
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);
|
||||||
|
@ -187,31 +177,25 @@ class PushNotificationService {
|
||||||
|
|
||||||
void _listenToNotificationClicks(BuildContext context) {
|
void _listenToNotificationClicks(BuildContext context) {
|
||||||
FirebaseMessaging.onMessageOpenedApp.listen((RemoteMessage message) {
|
FirebaseMessaging.onMessageOpenedApp.listen((RemoteMessage message) {
|
||||||
log('Notification clicked!');
|
|
||||||
|
|
||||||
_onMessage.add(message);
|
_onMessage.add(message);
|
||||||
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
|
||||||
log("Error refreshing token: $err");
|
.listen(_handleTokenUpdate)
|
||||||
});
|
.onError((err) {});
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _updateToken(String token) async {
|
Future<void> _updateToken(String token) async {
|
||||||
FFAppState().token = token;
|
FFAppState().token = token;
|
||||||
final ApiCallResponse? response = await _updateTokenOnServer(token);
|
final ApiCallResponse? response = await _updateTokenOnServer(token);
|
||||||
if (_isTokenUpdateSuccessful(response)) {
|
if (_isTokenUpdateSuccessful(response)) {
|
||||||
log('Token updated successfully on server. Token: $token');
|
} else {}
|
||||||
} else {
|
|
||||||
log('Error updating token on server');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _handleTokenUpdate(String newToken) async {
|
Future<void> _handleTokenUpdate(String newToken) async {
|
||||||
log('Token refreshed: $newToken');
|
|
||||||
await _updateToken(newToken);
|
await _updateToken(newToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -224,11 +208,8 @@ class PushNotificationService {
|
||||||
|
|
||||||
final String? deviceToken = await _firebaseMessaging.getToken();
|
final String? deviceToken = await _firebaseMessaging.getToken();
|
||||||
if (deviceToken != null) {
|
if (deviceToken != null) {
|
||||||
log('Push Messaging token: $deviceToken');
|
|
||||||
await _updateToken(deviceToken);
|
await _updateToken(deviceToken);
|
||||||
} else {
|
} else {}
|
||||||
log('Failed to get Firebase Messaging token');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<NotificationSettings> _requestNotificationPermission() async {
|
Future<NotificationSettings> _requestNotificationPermission() async {
|
||||||
|
@ -278,10 +259,8 @@ class PushNotificationService {
|
||||||
priority: Priority.high,
|
priority: Priority.high,
|
||||||
);
|
);
|
||||||
var iOSDetails = DarwinNotificationDetails();
|
var iOSDetails = DarwinNotificationDetails();
|
||||||
var generalNotificationDetails =
|
var generalNotificationDetails = NotificationDetails(android: androidDetails, iOS: iOSDetails);
|
||||||
NotificationDetails(android: androidDetails, iOS: iOSDetails);
|
|
||||||
|
|
||||||
log('Showing notification: ${message.messageId.hashCode}');
|
|
||||||
await _flutterLocalNotificationsPlugin.show(
|
await _flutterLocalNotificationsPlugin.show(
|
||||||
// DateTime.now().millisecondsSinceEpoch % (1 << 31),
|
// DateTime.now().millisecondsSinceEpoch % (1 << 31),
|
||||||
math.Random().nextInt(1 << 30),
|
math.Random().nextInt(1 << 30),
|
||||||
|
@ -292,53 +271,45 @@ class PushNotificationService {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
_handleNotificationClick(Map<String, dynamic> payload, {Map<String, dynamic> extra = const {}}) {
|
_handleNotificationClick(Map<String, dynamic> payload,
|
||||||
|
{Map<String, dynamic> extra = const {}}) {
|
||||||
switch (payload.isNotEmpty) {
|
switch (payload.isNotEmpty) {
|
||||||
case true:
|
case true:
|
||||||
// Print the 'data' property
|
// Print the 'data' property
|
||||||
log('Notification payload: $payload');
|
|
||||||
log('Extra: $extra');
|
|
||||||
// Handle the message data as needed
|
// Handle the message data as needed
|
||||||
NotificationHandler().handleMessage(payload, _context.value, extra: extra.isEmpty ? {} : extra);
|
NotificationHandler().handleMessage(payload, _context.value, extra: extra.isEmpty ? {} : extra);
|
||||||
// Access the 'data' property of 'RemoteMessage'
|
// Access the 'data' property of 'RemoteMessage'
|
||||||
case false:
|
case false:
|
||||||
log('Notification payload is empty');
|
|
||||||
// Handle the message notification as needed
|
// Handle the message notification as needed
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<void> _firebaseMessagingBackgroundHandler(
|
static Future<void> _firebaseMessagingBackgroundHandler(RemoteMessage message) async {
|
||||||
RemoteMessage message) async {
|
log("Mensagem firebase: $message");
|
||||||
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 {}}) {
|
||||||
log('Notification Received!');
|
message.forEach((key, value) {});
|
||||||
message.forEach((key, value) {
|
|
||||||
log('$key: $value');
|
|
||||||
});
|
|
||||||
|
|
||||||
switch (message['click_action']) {
|
switch (message['click_action']) {
|
||||||
case 'visit_request':
|
case 'visit_request':
|
||||||
_showVisitRequestDialog(message, context);
|
_showVisitRequestDialog(message, context);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case '':
|
case '':
|
||||||
break;
|
break;
|
||||||
case 'access':
|
case 'access':
|
||||||
_showAcessNotificationModal(message, context);
|
_showAcessNotificationModal(message, context);
|
||||||
break;
|
break;
|
||||||
case 'mensagem':
|
case 'mensagem':
|
||||||
_showMessageNotificationDialog(message, context, extra);
|
log("Extra Handle Message: $extra");
|
||||||
|
_showMessageNotificationDialog(message, context, extra);
|
||||||
break;
|
break;
|
||||||
case 'enroll_cond':
|
case 'enroll_cond':
|
||||||
log('enroll_cond');
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
log('Notification type not recognized');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -358,10 +329,6 @@ class NotificationHandler {
|
||||||
|
|
||||||
void _showAcessNotificationModal(
|
void _showAcessNotificationModal(
|
||||||
Map<String, dynamic> message, BuildContext context) {
|
Map<String, dynamic> message, BuildContext context) {
|
||||||
log('Showing access notification dialog');
|
|
||||||
log('USR_TIPO: ${message['USR_TIPO']}');
|
|
||||||
log('USR_ID: ${message['USR_ID']}');
|
|
||||||
log('USR_DOCUMENTO: ${message['USR_DOCUMENTO']}');
|
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
|
@ -385,46 +352,199 @@ 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) {
|
|
||||||
log('Showing message notification dialog');
|
|
||||||
log('Notification "message": $message');
|
|
||||||
showDialog(
|
showDialog(
|
||||||
useSafeArea: true,
|
useSafeArea: true,
|
||||||
|
barrierDismissible: true,
|
||||||
context: context,
|
context: context,
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
return Dialog(
|
String localId = '';
|
||||||
backgroundColor: Colors.transparent,
|
try {
|
||||||
child: MessageNotificationModalTemplateComponentWidget(
|
localId = jsonDecode(message['local'])['CLI_ID'];
|
||||||
id: message['local']['CLI_ID'].toString(),
|
} catch(e, s) {
|
||||||
from: message['remetente'].toString(),
|
localId = message['local']['CLI_ID'].toString();
|
||||||
to: message['destinatario'].toString() == 'O' ? 'Morador' : 'Visitante',
|
}
|
||||||
message: extra['body'].toString().isEmpty ? 'Unknown' : extra['body'].toString(),
|
|
||||||
|
log("Mensagem: $message");
|
||||||
|
log("Extra: $extra");
|
||||||
|
|
||||||
|
return GestureDetector(
|
||||||
|
onTap: () => Navigator.of(context).pop(),
|
||||||
|
child: SizedBox(
|
||||||
|
width: MediaQuery.of(context).size.width,
|
||||||
|
height: MediaQuery.of(context).size.height,
|
||||||
|
child: Dialog(
|
||||||
|
backgroundColor: Colors.transparent,
|
||||||
|
child: GestureDetector(
|
||||||
|
onTap: () => Navigator.of(context).pop(),
|
||||||
|
child: SizedBox(
|
||||||
|
width: MediaQuery.of(context).size.width,
|
||||||
|
height: MediaQuery.of(context).size.height,
|
||||||
|
child: MessageNotificationModalTemplateComponentWidget(
|
||||||
|
id: localId,
|
||||||
|
from: message['remetente'].toString(),
|
||||||
|
to: message['destinatario'].toString() == 'O'
|
||||||
|
? 'Morador'
|
||||||
|
: 'Visitante',
|
||||||
|
message: extra['body'].toString().isEmpty
|
||||||
|
? 'Unknown'
|
||||||
|
: extra['body'].toString(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void _showVisitRequestDialog(
|
void _showVisitRequestDialog(
|
||||||
Map<String, dynamic> message, BuildContext context) {
|
Map<String, dynamic> message, BuildContext context) {
|
||||||
log('Showing visit request notification dialog');
|
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
|
barrierDismissible: true,
|
||||||
|
// barrierColor: Colors.green,
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
_getIdBasedOnUserType(message);
|
_getIdBasedOnUserType(message);
|
||||||
return Dialog(
|
return Dialog(
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
child: DetailsComponentWidget(
|
child: DetailsComponentWidget(
|
||||||
vteName: message['mensagem'] ?? 'Unknown',
|
buttons: [
|
||||||
vteReason: message['motivo'] ?? 'Unknown',
|
FlutterFlowIconButton(
|
||||||
vteMsg: message['mensagem'] ?? 'Unknown',
|
icon: const Icon(Icons.done),
|
||||||
vteDocument: message['documento'] ?? '',
|
onPressed: () async {
|
||||||
vteUUID: message['idVisitante'].toString(),
|
showDialog(
|
||||||
vawRef: message['referencia'].toString(),
|
context: context,
|
||||||
vawStatus: 'S',
|
builder: (context) {
|
||||||
changeStatusAction: changeStatusAction,
|
return AlertDialog(
|
||||||
|
title: Text(
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText: 'Aprovar Visita',
|
||||||
|
enText: 'Approve Visit',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
content: Text(
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText:
|
||||||
|
'Você tem certeza que deseja aprovar essa visita?',
|
||||||
|
enText:
|
||||||
|
'Are you sure you want to approve this visit?',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
backgroundColor:
|
||||||
|
FlutterFlowTheme.of(context).primaryBackground,
|
||||||
|
actions: [
|
||||||
|
FFButtonWidget(
|
||||||
|
text: FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'No',
|
||||||
|
ptText: 'Não',
|
||||||
|
),
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.pop(context);
|
||||||
|
},
|
||||||
|
options: FFButtonOptions(
|
||||||
|
width: 100,
|
||||||
|
height: 40,
|
||||||
|
color: FlutterFlowTheme.of(context)
|
||||||
|
.primaryBackground,
|
||||||
|
textStyle: TextStyle(
|
||||||
|
color: FlutterFlowTheme.of(context)
|
||||||
|
.primaryText,
|
||||||
|
),
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: FlutterFlowTheme.of(context)
|
||||||
|
.primaryBackground,
|
||||||
|
width: 1,
|
||||||
|
),
|
||||||
|
borderRadius: BorderRadius.circular(10)),
|
||||||
|
),
|
||||||
|
FFButtonWidget(
|
||||||
|
text: FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'Yes',
|
||||||
|
ptText: 'Sim',
|
||||||
|
),
|
||||||
|
onPressed: () async {
|
||||||
|
await answersRequest.call(
|
||||||
|
context,
|
||||||
|
message['referencia'].toString(),
|
||||||
|
'L',
|
||||||
|
'Mensagem',
|
||||||
|
message['idVisitante'].toString(),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
options: FFButtonOptions(
|
||||||
|
width: 100,
|
||||||
|
height: 40,
|
||||||
|
color: FlutterFlowTheme.of(context)
|
||||||
|
.primaryBackground,
|
||||||
|
textStyle: TextStyle(
|
||||||
|
color:
|
||||||
|
FlutterFlowTheme.of(context).primaryText,
|
||||||
|
),
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: FlutterFlowTheme.of(context)
|
||||||
|
.primaryBackground,
|
||||||
|
width: 1,
|
||||||
|
),
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
),
|
||||||
|
FlutterFlowIconButton(
|
||||||
|
icon: const Icon(Icons.close),
|
||||||
|
onPressed: () async {
|
||||||
|
showAlertDialog(
|
||||||
|
context,
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText: 'Bloquear Visita',
|
||||||
|
enText: 'Block Visit',
|
||||||
|
),
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText:
|
||||||
|
'Você tem certeza que deseja bloquear essa visita?',
|
||||||
|
enText: 'Are you sure you want to block this visit?',
|
||||||
|
), () async {
|
||||||
|
await answersRequest.call(
|
||||||
|
context,
|
||||||
|
message['referencia'].toString(),
|
||||||
|
'B',
|
||||||
|
'Mensagem',
|
||||||
|
message['idVisitante'].toString(),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
labelsHashMap: Map<String, String>.from({
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'Visitor',
|
||||||
|
ptText: 'Visitante',
|
||||||
|
): message['nomevisita'],
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'Reason',
|
||||||
|
ptText: 'Motivo',
|
||||||
|
): message['motivo'],
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'Message',
|
||||||
|
ptText: 'Mensagem',
|
||||||
|
): message['mensagem'],
|
||||||
|
}),
|
||||||
|
imagePath:
|
||||||
|
'https://freaccess.com.br/freaccess/getImage.php?cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${message['documento'] ?? ''}&tipo=E',
|
||||||
|
statusHashMap: [
|
||||||
|
{
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'Active',
|
||||||
|
ptText: 'Ativo',
|
||||||
|
): FlutterFlowTheme.of(context).warning,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
// changeStatusAction: answersRequest,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
@ -448,6 +568,4 @@ class PushNotificationManager {
|
||||||
void dispose() {
|
void dispose() {
|
||||||
_onMessageReceivedController.close();
|
_onMessageReceivedController.close();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,90 +1 @@
|
||||||
// import 'package:f_r_e_hub/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart';
|
|
||||||
// import 'package:firebase_messaging/firebase_messaging.dart';
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:rxdart/rxdart.dart';
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// class NotificationHandler {
|
|
||||||
// // Criar BehaviorSubjects para mensagens em primeiro plano e mensagens que abriram o app
|
|
||||||
// final BehaviorSubject<RemoteMessage> _onMessage =
|
|
||||||
// BehaviorSubject<RemoteMessage>();
|
|
||||||
// final BehaviorSubject<RemoteMessage> _onMessageOpenedApp =
|
|
||||||
// BehaviorSubject<RemoteMessage>();
|
|
||||||
|
|
||||||
// // Inicializar listeners no construtor
|
|
||||||
// NotificationHandler() {
|
|
||||||
// initializeListeners();
|
|
||||||
// }
|
|
||||||
|
|
||||||
// void initializeListeners() async {
|
|
||||||
// // Listener para mensagens em primeiro plano
|
|
||||||
// // FirebaseMessaging.onMessage.listen((message) {
|
|
||||||
// // _onMessage.add(message); // Adicionar mensagem ao stream
|
|
||||||
// // });
|
|
||||||
|
|
||||||
// RemoteMessage? initialMessage =
|
|
||||||
// await FirebaseMessaging.instance.getInitialMessage();
|
|
||||||
|
|
||||||
// if (initialMessage != null) _onMessage.add(initialMessage);
|
|
||||||
|
|
||||||
// // Listener para mensagens que abriram o app
|
|
||||||
// FirebaseMessaging.onMessageOpenedApp.listen((message) {
|
|
||||||
// _onMessageOpenedApp.add(message); // Adicionar mensagem ao stream
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
|
|
||||||
// void openedAppVisitRequestNotification(
|
|
||||||
// RemoteMessage message, BuildContext context) {
|
|
||||||
// log('openedAppVisitRequestNotification');
|
|
||||||
// showDialog(
|
|
||||||
// context: context,
|
|
||||||
// builder: (BuildContext context) {
|
|
||||||
// return Dialog(
|
|
||||||
// backgroundColor:
|
|
||||||
// Colors.transparent, // Faz o fundo do Dialog ser transparente
|
|
||||||
// child: VisitRequestTemplateComponentWidget(
|
|
||||||
// name: message.data['nome'] ?? 'blabla',
|
|
||||||
// reason: message.data['motivo'] ?? 'blabla',
|
|
||||||
// message: message.data['mensagem'] ?? 'blabla',
|
|
||||||
// document: message.data['document']),
|
|
||||||
// );
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
|
|
||||||
// // Método para tratar mensagens recebidas
|
|
||||||
// void handleMessage(RemoteMessage message, BuildContext context) {
|
|
||||||
// log('Notification Received!');
|
|
||||||
// message.data.forEach((key, value) {
|
|
||||||
// log('$key: $value');
|
|
||||||
// });
|
|
||||||
|
|
||||||
// switch (message.data['type']) {
|
|
||||||
// case 'visit_request':
|
|
||||||
// openedAppVisitRequestNotification(message, context);
|
|
||||||
// break;
|
|
||||||
// case '':
|
|
||||||
// break;
|
|
||||||
// default:
|
|
||||||
// log('Notification type not recognized');
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// // Ouvir streams
|
|
||||||
// void listenToNotifications(BuildContext context) {
|
|
||||||
// _onMessage.listen((message) {
|
|
||||||
// handleMessage(message, context);
|
|
||||||
// });
|
|
||||||
|
|
||||||
// _onMessageOpenedApp.listen((message) {
|
|
||||||
// handleMessage(message, context);
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
|
|
||||||
// // Dispor streams
|
|
||||||
// void dispose() {
|
|
||||||
// _onMessage.close();
|
|
||||||
// _onMessageOpenedApp.close();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
|
@ -93,7 +93,6 @@ class _ThrowExceptionWidgetState extends State<ThrowExceptionWidget>
|
||||||
case EnumThrowException.success:
|
case EnumThrowException.success:
|
||||||
return FFLocalizations.of(context)
|
return FFLocalizations.of(context)
|
||||||
.getVariableText(ptText: "Sucesso ;)", enText: "Success ;)");
|
.getVariableText(ptText: "Sucesso ;)", enText: "Success ;)");
|
||||||
;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import 'dart:developer';
|
||||||
|
|
||||||
import 'package:hub/components/molecular_components/visitor_not_found_component/visitor_not_found_component_model.dart';
|
import 'package:hub/components/molecular_components/visitor_not_found_component/visitor_not_found_component_model.dart';
|
||||||
import 'package:hub/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart';
|
import 'package:hub/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_icon_button.dart';
|
import 'package:hub/flutter_flow/flutter_flow_icon_button.dart';
|
||||||
|
@ -9,8 +11,9 @@ import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_widgets.dart';
|
import 'package:hub/flutter_flow/flutter_flow_widgets.dart';
|
||||||
|
|
||||||
class VisitorNotFoundComponentWidget extends StatefulWidget {
|
class VisitorNotFoundComponentWidget extends StatefulWidget {
|
||||||
const VisitorNotFoundComponentWidget({super.key});
|
const VisitorNotFoundComponentWidget({this.doc, Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
final String? doc;
|
||||||
@override
|
@override
|
||||||
State<VisitorNotFoundComponentWidget> createState() =>
|
State<VisitorNotFoundComponentWidget> createState() =>
|
||||||
_VisitorNotFoundComponentWidgetState();
|
_VisitorNotFoundComponentWidgetState();
|
||||||
|
@ -41,138 +44,144 @@ class _VisitorNotFoundComponentWidgetState
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Container(
|
return SingleChildScrollView(
|
||||||
width: MediaQuery.of(context).size.height * 0.5,
|
child: Container(
|
||||||
height: MediaQuery.of(context).size.height * 0.4,
|
// width: MediaQuery.of(context).size.width,
|
||||||
decoration: BoxDecoration(
|
// height: MediaQuery.of(context).size.height,
|
||||||
color: FlutterFlowTheme.of(context).primaryBackground,
|
decoration: BoxDecoration(
|
||||||
borderRadius: const BorderRadius.only(
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
bottomLeft: Radius.circular(25.0),
|
borderRadius: const BorderRadius.only(
|
||||||
bottomRight: Radius.circular(25.0),
|
bottomLeft: Radius.circular(25.0),
|
||||||
topLeft: Radius.circular(25.0),
|
bottomRight: Radius.circular(25.0),
|
||||||
topRight: Radius.circular(25.0),
|
topLeft: Radius.circular(25.0),
|
||||||
|
topRight: Radius.circular(25.0),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
child: Column(
|
||||||
child: Column(
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
mainAxisSize: MainAxisSize.max,
|
children: [
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
Align(
|
||||||
children: [
|
alignment: const AlignmentDirectional(1.0, -1.0),
|
||||||
Align(
|
child: Padding(
|
||||||
alignment: const AlignmentDirectional(1.0, -1.0),
|
padding:
|
||||||
child: Padding(
|
const EdgeInsetsDirectional.fromSTEB(0.0, 5.0, 5.0, 0.0),
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 5.0, 5.0, 0.0),
|
child: FlutterFlowIconButton(
|
||||||
child: FlutterFlowIconButton(
|
borderRadius: 20.0,
|
||||||
borderRadius: 20.0,
|
borderWidth: 1.0,
|
||||||
borderWidth: 1.0,
|
buttonSize: 40.0,
|
||||||
buttonSize: 40.0,
|
icon: Icon(
|
||||||
icon: Icon(
|
Icons.close,
|
||||||
Icons.close,
|
color: FlutterFlowTheme.of(context).accent1,
|
||||||
color: FlutterFlowTheme.of(context).accent1,
|
size: 24.0,
|
||||||
size: 24.0,
|
),
|
||||||
|
onPressed: () async {
|
||||||
|
Navigator.pop(context);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
onPressed: () async {
|
|
||||||
Navigator.pop(context);
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
Icon(
|
||||||
Icon(
|
Icons.notifications_none,
|
||||||
Icons.notifications_none,
|
color: FlutterFlowTheme.of(context).accent1,
|
||||||
color: FlutterFlowTheme.of(context).accent1,
|
size: 72.0,
|
||||||
size: 72.0,
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 16.0, 0.0, 0.0),
|
|
||||||
child: Text(
|
|
||||||
FFLocalizations.of(context).getText(
|
|
||||||
'1p9mykbj' /* Usuário não encontrado */,
|
|
||||||
),
|
|
||||||
style: FlutterFlowTheme.of(context).headlineMedium.override(
|
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(context).headlineMediumFamily,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
|
||||||
FlutterFlowTheme.of(context).headlineMediumFamily),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
Padding(
|
||||||
Padding(
|
padding:
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(20.0, 4.0, 20.0, 0.0),
|
const EdgeInsetsDirectional.fromSTEB(0.0, 16.0, 0.0, 0.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
FFLocalizations.of(context).getText(
|
FFLocalizations.of(context).getText(
|
||||||
'kt937sp6' /* O documento inserido não corre... */,
|
'1p9mykbj' /* Usuário não encontrado */,
|
||||||
|
),
|
||||||
|
style: FlutterFlowTheme.of(context).headlineMedium.override(
|
||||||
|
fontFamily:
|
||||||
|
FlutterFlowTheme.of(context).headlineMediumFamily,
|
||||||
|
letterSpacing: 0.0,
|
||||||
|
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||||
|
FlutterFlowTheme.of(context).headlineMediumFamily),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
style: FlutterFlowTheme.of(context).labelMedium.override(
|
|
||||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
|
||||||
fontSize: 14.0,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
fontStyle: FontStyle.italic,
|
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
Padding(
|
||||||
Expanded(
|
padding:
|
||||||
child: Align(
|
const EdgeInsetsDirectional.fromSTEB(20.0, 4.0, 20.0, 0.0),
|
||||||
alignment: const AlignmentDirectional(0.0, 1.0),
|
child: Text(
|
||||||
child: FFButtonWidget(
|
FFLocalizations.of(context).getText(
|
||||||
onPressed: () async {
|
'kt937sp6' /* O documento inserido não corre... */,
|
||||||
Navigator.pop(context);
|
),
|
||||||
await showModalBottomSheet(
|
style: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
isScrollControlled: true,
|
fontFamily:
|
||||||
backgroundColor: Colors.transparent,
|
FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
enableDrag: true,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
useSafeArea: true,
|
fontSize: 14.0,
|
||||||
isDismissible: true,
|
letterSpacing: 0.0,
|
||||||
context: context,
|
fontStyle: FontStyle.italic,
|
||||||
builder: (context) {
|
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||||
return Padding(
|
FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
padding: MediaQuery.viewInsetsOf(context),
|
),
|
||||||
child: SizedBox(
|
),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(vertical: 10),
|
||||||
|
child: Align(
|
||||||
|
alignment: const AlignmentDirectional(0.0, 1.0),
|
||||||
|
child: FFButtonWidget(
|
||||||
|
onPressed: () async {
|
||||||
|
await showModalBottomSheet(
|
||||||
|
isScrollControlled: true,
|
||||||
|
backgroundColor: Colors.transparent,
|
||||||
|
enableDrag: true,
|
||||||
|
useSafeArea: true,
|
||||||
|
isDismissible: true,
|
||||||
|
context: context,
|
||||||
|
builder: (context) {
|
||||||
|
return Padding(
|
||||||
|
padding: MediaQuery.viewInsetsOf(context),
|
||||||
|
child: SizedBox(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: MediaQuery.of(context).size.height * 0.9,
|
height: MediaQuery.of(context).size.height * 0.9,
|
||||||
child: const RegisiterVistorTemplateComponentWidget(
|
child: RegisiterVistorTemplateComponentWidget(
|
||||||
source: 'VisitorNotFoundComponent',
|
source: 'VisitorNotFoundComponent',
|
||||||
)),
|
doc: _model.widget?.doc,
|
||||||
);
|
),
|
||||||
},
|
),
|
||||||
).then((value) => safeSetState(() {}));
|
);
|
||||||
},
|
},
|
||||||
text: FFLocalizations.of(context)
|
).then((value) => Navigator.pop(context, value));
|
||||||
.getVariableText(enText: 'Add', ptText: 'Adicionar'),
|
},
|
||||||
options: FFButtonOptions(
|
text: FFLocalizations.of(context)
|
||||||
width: double.infinity,
|
.getVariableText(enText: 'Add', ptText: 'Adicionar'),
|
||||||
height: 30.0,
|
options: FFButtonOptions(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
height: 30.0,
|
||||||
24.0, 0.0, 24.0, 0.0),
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
iconPadding:
|
24.0, 0.0, 24.0, 0.0),
|
||||||
const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
iconPadding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
color: FlutterFlowTheme.of(context).primary,
|
0.0, 0.0, 0.0, 0.0),
|
||||||
textStyle: FlutterFlowTheme.of(context).titleSmall.override(
|
color: FlutterFlowTheme.of(context).primary,
|
||||||
fontFamily:
|
textStyle: FlutterFlowTheme.of(context).titleSmall.override(
|
||||||
FlutterFlowTheme.of(context).titleSmallFamily,
|
fontFamily:
|
||||||
color: Colors.white,
|
FlutterFlowTheme.of(context).titleSmallFamily,
|
||||||
letterSpacing: 0.0,
|
color: Colors.white,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
letterSpacing: 0.0,
|
||||||
FlutterFlowTheme.of(context).titleSmallFamily),
|
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||||
),
|
FlutterFlowTheme.of(context).titleSmallFamily),
|
||||||
elevation: 3.0,
|
),
|
||||||
borderSide: const BorderSide(
|
elevation: 3.0,
|
||||||
color: Colors.transparent,
|
borderSide: const BorderSide(
|
||||||
width: 1.0,
|
color: Colors.transparent,
|
||||||
),
|
width: 1.0,
|
||||||
borderRadius: const BorderRadius.only(
|
),
|
||||||
bottomLeft: Radius.circular(25.0),
|
borderRadius: const BorderRadius.only(
|
||||||
bottomRight: Radius.circular(25.0),
|
bottomLeft: Radius.circular(25.0),
|
||||||
topLeft: Radius.circular(15.0),
|
bottomRight: Radius.circular(25.0),
|
||||||
topRight: Radius.circular(15.0),
|
topLeft: Radius.circular(25.0),
|
||||||
|
topRight: Radius.circular(25.0),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,6 @@ import 'package:google_fonts/google_fonts.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
|
||||||
class BottomArrowLinkedLocalsComponentWidget extends StatefulWidget {
|
class BottomArrowLinkedLocalsComponentWidget extends StatefulWidget {
|
||||||
const BottomArrowLinkedLocalsComponentWidget({super.key});
|
const BottomArrowLinkedLocalsComponentWidget({super.key});
|
||||||
|
|
||||||
|
@ -100,9 +99,7 @@ class _BottomArrowLinkedLocalsComponentWidgetState
|
||||||
color: FlutterFlowTheme.of(context).primary,
|
color: FlutterFlowTheme.of(context).primary,
|
||||||
size: 24.0,
|
size: 24.0,
|
||||||
),
|
),
|
||||||
onPressed: () {
|
onPressed: () {},
|
||||||
print('IconButton pressed ...');
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
|
@ -180,8 +177,8 @@ class _BottomArrowLinkedLocalsComponentWidgetState
|
||||||
width: 50.0,
|
width: 50.0,
|
||||||
height: double.infinity,
|
height: double.infinity,
|
||||||
decoration: const BoxDecoration(),
|
decoration: const BoxDecoration(),
|
||||||
alignment:
|
alignment: const AlignmentDirectional(
|
||||||
const AlignmentDirectional(0.0, 0.0),
|
0.0, 0.0),
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
mainAxisAlignment:
|
mainAxisAlignment:
|
||||||
|
@ -232,14 +229,15 @@ class _BottomArrowLinkedLocalsComponentWidgetState
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: double.infinity,
|
height: double.infinity,
|
||||||
fit: BoxFit.fill,
|
fit: BoxFit.fill,
|
||||||
alignment:
|
alignment: const Alignment(
|
||||||
const Alignment(0.0, 0.0),
|
0.0, 0.0),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsetsDirectional
|
padding:
|
||||||
.fromSTEB(
|
const EdgeInsetsDirectional
|
||||||
|
.fromSTEB(
|
||||||
0.0, 10.0, 0.0, 0.0),
|
0.0, 10.0, 0.0, 0.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
getJsonField(
|
getJsonField(
|
||||||
|
@ -290,4 +288,4 @@ class _BottomArrowLinkedLocalsComponentWidgetState
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
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';
|
||||||
|
@ -12,10 +11,7 @@ export 'local_profile_component_model.dart';
|
||||||
////
|
////
|
||||||
|
|
||||||
class LocalProfileComponentWidget extends StatefulWidget {
|
class LocalProfileComponentWidget extends StatefulWidget {
|
||||||
const LocalProfileComponentWidget({
|
const LocalProfileComponentWidget({required bool localStatus, super.key});
|
||||||
required bool localStatus,
|
|
||||||
super.key
|
|
||||||
});
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<LocalProfileComponentWidget> createState() =>
|
State<LocalProfileComponentWidget> createState() =>
|
||||||
|
@ -87,35 +83,34 @@ class _LocalProfileComponentWidgetState
|
||||||
padding: MediaQuery.viewInsetsOf(context),
|
padding: MediaQuery.viewInsetsOf(context),
|
||||||
child: const SizedBox(
|
child: const SizedBox(
|
||||||
height: double.infinity,
|
height: double.infinity,
|
||||||
child:
|
child: BottomArrowLinkedLocalsComponentWidget(),
|
||||||
BottomArrowLinkedLocalsComponentWidget(),
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
).then((value) => safeSetState(() {}));
|
).then((value) => safeSetState(() {}));
|
||||||
},
|
},
|
||||||
child: ClipRRect(
|
child: ClipRRect(
|
||||||
borderRadius: BorderRadius.circular(200.0),
|
borderRadius: BorderRadius.circular(200.0),
|
||||||
child:
|
child: Image.network(
|
||||||
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',
|
|
||||||
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'),
|
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',
|
||||||
),
|
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'),
|
||||||
|
),
|
||||||
|
)),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
Column(
|
Column(
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
@ -125,16 +120,15 @@ class _LocalProfileComponentWidgetState
|
||||||
functions.convertToUppercase(FFAppState().local),
|
functions.convertToUppercase(FFAppState().local),
|
||||||
'NOME DO LOCAL',
|
'NOME DO LOCAL',
|
||||||
),
|
),
|
||||||
style:
|
style: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
FlutterFlowTheme.of(context).labelMedium.override(
|
fontFamily: 'Nunito',
|
||||||
fontFamily: 'Nunito',
|
color: FlutterFlowTheme.of(context).info,
|
||||||
color: FlutterFlowTheme.of(context).info,
|
fontSize: 14.0,
|
||||||
fontSize: 14.0,
|
letterSpacing: 0.0,
|
||||||
letterSpacing: 0.0,
|
fontWeight: FontWeight.w500,
|
||||||
fontWeight: FontWeight.w500,
|
useGoogleFonts:
|
||||||
useGoogleFonts:
|
GoogleFonts.asMap().containsKey('Nunito'),
|
||||||
GoogleFonts.asMap().containsKey('Nunito'),
|
),
|
||||||
),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
@ -148,4 +142,4 @@ class _LocalProfileComponentWidgetState
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,17 +13,16 @@ import 'package:flutter/material.dart';
|
||||||
import 'menu_component_model.dart';
|
import 'menu_component_model.dart';
|
||||||
export 'menu_component_model.dart';
|
export 'menu_component_model.dart';
|
||||||
|
|
||||||
|
|
||||||
class MenuComponentWidget extends StatefulWidget {
|
class MenuComponentWidget extends StatefulWidget {
|
||||||
const MenuComponentWidget({
|
const MenuComponentWidget({
|
||||||
Key? key,
|
Key? key,
|
||||||
required this.style,
|
required this.style,
|
||||||
required this.item,
|
required this.item,
|
||||||
required this.expandable,
|
required this.expandable,
|
||||||
});
|
});
|
||||||
final MenuView style;
|
final MenuView style;
|
||||||
final MenuItem item;
|
final MenuItem item;
|
||||||
final bool expandable;
|
final bool expandable;
|
||||||
@override
|
@override
|
||||||
State<MenuComponentWidget> createState() => _MenuComponentWidgetState();
|
State<MenuComponentWidget> createState() => _MenuComponentWidgetState();
|
||||||
}
|
}
|
||||||
|
@ -31,11 +30,8 @@ class MenuComponentWidget extends StatefulWidget {
|
||||||
class _MenuComponentWidgetState extends State<MenuComponentWidget> {
|
class _MenuComponentWidgetState extends State<MenuComponentWidget> {
|
||||||
late MenuComponentModel _model;
|
late MenuComponentModel _model;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void setState(VoidCallback callback) {
|
void setState(VoidCallback callback) {
|
||||||
|
|
||||||
super.setState(callback);
|
super.setState(callback);
|
||||||
_model.onUpdate();
|
_model.onUpdate();
|
||||||
}
|
}
|
||||||
|
@ -44,7 +40,6 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
_model = createModel(context, () => MenuComponentModel());
|
_model = createModel(context, () => MenuComponentModel());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -57,43 +52,165 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final options = widget.item == MenuItem.button
|
final options = widget.item == MenuItem.button
|
||||||
? <MenuEntry>[
|
? <MenuEntry>[
|
||||||
MenuButtonWidget(icon: FFIcons.kvector1, action: () async { await _model.scheduleVisitOptAction(context);setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Schedule\nVisit' , ptText:'Agendar\nVisita' ,),),
|
MenuButtonWidget(
|
||||||
|
icon: FFIcons.kvector1,
|
||||||
|
action: () async {
|
||||||
|
await _model.scheduleVisitOptAction(context);
|
||||||
|
setState(() {});
|
||||||
|
},
|
||||||
|
title: FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'Schedule\nVisit',
|
||||||
|
ptText: 'Agendar\nVisita',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
MenuButtonWidget(icon: FFIcons.khome, action: () async {await _model.registerVisitorOptAction(context); setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Register\nVisitor' , ptText:'Cadastro\nde Visitante' ,),),
|
MenuButtonWidget(
|
||||||
|
icon: FFIcons.khome,
|
||||||
|
action: () async {
|
||||||
|
await _model.registerVisitorOptAction(context);
|
||||||
|
setState(() {});
|
||||||
|
},
|
||||||
|
title: FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'Register\nVisitor',
|
||||||
|
ptText: 'Cadastro\nde Visitante',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
// MenuButtonWidget(icon: FFIcons.kvector2, action: () async {setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Link\nCondominum' , ptText:'' ,),),
|
// MenuButtonWidget(icon: FFIcons.kvector2, action: () async {setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Link\nCondominum' , ptText:'' ,),),
|
||||||
// MenuButtonWidget(icon: FFIcons.kpets, action: () async {setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Register\Pet' , ptText:'' ,),),
|
// MenuButtonWidget(icon: FFIcons.kpets, action: () async {setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Register\Pet' , ptText:'' ,),),
|
||||||
|
|
||||||
MenuButtonWidget(icon: Icons.qr_code, action: () async {await _model.accessQRCodeOptAction(context); setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'QRCode\nAccess' , ptText:'QRCode\nde Acesso' ,),),
|
MenuButtonWidget(
|
||||||
|
icon: Icons.qr_code,
|
||||||
|
action: () async {
|
||||||
|
await _model.accessQRCodeOptAction(context);
|
||||||
|
setState(() {});
|
||||||
|
},
|
||||||
|
title: FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'QRCode\nAccess',
|
||||||
|
ptText: 'QRCode\nde Acesso',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
MenuButtonWidget(icon: Icons.people, action: () async {await _model.peopleOnThePropertyAction(context); setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Poeple on\nthe Property' , ptText:'Pessoas na\nPropriedade' ,),),
|
MenuButtonWidget(
|
||||||
|
icon: Icons.people,
|
||||||
|
action: () async {
|
||||||
|
await _model.peopleOnThePropertyAction(context);
|
||||||
|
setState(() {});
|
||||||
|
},
|
||||||
|
title: FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'Poeple on\nthe Property',
|
||||||
|
ptText: 'Pessoas na\nPropriedade',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
MenuButtonWidget(icon: Icons.history_sharp, action: () async {await _model.liberationHistoryOptAction(context);setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Consult\nHistories' , ptText:'Consultar\nHistóricos' ,),),
|
MenuButtonWidget(
|
||||||
|
icon: Icons.history_sharp,
|
||||||
|
action: () async {
|
||||||
|
await _model.liberationHistoryOptAction(context);
|
||||||
|
setState(() {});
|
||||||
|
},
|
||||||
|
title: FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'Consult\nHistories',
|
||||||
|
ptText: 'Consultar\nHistóricos',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
MenuButtonWidget(icon: Icons.settings, action: () async {await _model.preferencesSettings(context);setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Preferences\nSettings' , ptText:'Configurações' ,),),
|
MenuButtonWidget(
|
||||||
] : <MenuEntry>[
|
icon: Icons.settings,
|
||||||
MenuCardItem(icon: FFIcons.kvector1, action: () async { await _model.scheduleVisitOptAction(context);setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Schedule Visit' , ptText:'Agendar\nVisita' ,),),
|
action: () async {
|
||||||
|
await _model.preferencesSettings(context);
|
||||||
|
setState(() {});
|
||||||
|
},
|
||||||
|
title: FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'Preferences\nSettings',
|
||||||
|
ptText: 'Preferências \nde Configurações',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
]
|
||||||
|
: <MenuEntry>[
|
||||||
|
MenuCardItem(
|
||||||
|
icon: FFIcons.kvector1,
|
||||||
|
action: () async {
|
||||||
|
await _model.scheduleVisitOptAction(context);
|
||||||
|
setState(() {});
|
||||||
|
},
|
||||||
|
title: FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'Schedule\nVisit',
|
||||||
|
ptText: 'Agendar\nVisita',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
MenuCardItem(icon: FFIcons.khome, action: () async {await _model.registerVisitorOptAction(context); setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Register Visitor' , ptText:'Cadastro de Visitante' ,),),
|
MenuCardItem(
|
||||||
|
icon: FFIcons.khome,
|
||||||
|
action: () async {
|
||||||
|
await _model.registerVisitorOptAction(context);
|
||||||
|
setState(() {});
|
||||||
|
},
|
||||||
|
title: FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'Register\nVisitor',
|
||||||
|
ptText: 'Cadastro\nde Visitante',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
// MenuCardItem(icon: FFIcons.kvector2, action: () async {setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Link Condominum' , ptText:'' ,),),
|
// MenuCardItem(icon: FFIcons.kvector2, action: () async {setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Link Condominum' , ptText:'' ,),),
|
||||||
// MenuCardItem(icon: FFIcons.kpets, action: () async {setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Register\Pet' , ptText:'' ,),),
|
// MenuCardItem(icon: FFIcons.kpets, action: () async {setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Register\Pet' , ptText:'' ,),),
|
||||||
|
|
||||||
MenuCardItem(icon: Icons.qr_code, action: () async {await _model.accessQRCodeOptAction(context); setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'QRCode Access' , ptText:'QRCode de Acesso' ,),),
|
MenuCardItem(
|
||||||
|
icon: Icons.qr_code,
|
||||||
|
action: () async {
|
||||||
|
await _model.accessQRCodeOptAction(context);
|
||||||
|
setState(() {});
|
||||||
|
},
|
||||||
|
title: FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'QRCode\nAccess',
|
||||||
|
ptText: 'QRCode\nde Acesso',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
MenuCardItem(icon: Icons.people, action: () async {await _model.peopleOnThePropertyAction(context); setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Poeple on the Property' , ptText:'Pessoas na Propriedade' ,),),
|
MenuCardItem(
|
||||||
|
icon: Icons.people,
|
||||||
|
action: () async {
|
||||||
|
await _model.peopleOnThePropertyAction(context);
|
||||||
|
setState(() {});
|
||||||
|
},
|
||||||
|
title: FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'Poeple on\nthe Property',
|
||||||
|
ptText: 'Pessoas\nna Propriedade',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
MenuCardItem(icon: Icons.history_sharp, action: () async {await _model.liberationHistoryOptAction(context);setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Consult Histories' , ptText:'Consultar Historicos' ,),),
|
MenuCardItem(
|
||||||
|
icon: Icons.history_sharp,
|
||||||
|
action: () async {
|
||||||
|
await _model.liberationHistoryOptAction(context);
|
||||||
|
setState(() {});
|
||||||
|
},
|
||||||
|
title: FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'Consult\nHistories',
|
||||||
|
ptText: 'Consultar\nHistoricos',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
MenuCardItem(icon: Icons.settings, action: () async {await _model.preferencesSettings(context);setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Preferences Settings' , ptText:'Configurações' ,),),
|
MenuCardItem(
|
||||||
|
icon: Icons.settings,
|
||||||
];
|
action: () async {
|
||||||
|
await _model.preferencesSettings(context);
|
||||||
|
setState(() {});
|
||||||
|
},
|
||||||
|
title: FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'Preferences\nSettings',
|
||||||
|
ptText: 'Preferências\nde Configuração',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
];
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 0.0),
|
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 0.0),
|
||||||
child: Builder(
|
child: Builder(
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
if (widget.style == MenuView.list_grid && widget.expandable == true && widget.item == MenuItem.button) {
|
if (widget.style == MenuView.list_grid &&
|
||||||
|
widget.expandable == true &&
|
||||||
|
widget.item == MenuItem.button) {
|
||||||
if (_model.isGrid == true) {
|
if (_model.isGrid == true) {
|
||||||
return wrapWithModel(
|
return wrapWithModel(
|
||||||
model: _model.menuListViewComponentModel,
|
model: _model.menuListViewComponentModel,
|
||||||
|
@ -125,30 +242,32 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (widget.style == MenuView.list && widget.expandable == false && widget.item == MenuItem.card){
|
if (widget.style == MenuView.list &&
|
||||||
return wrapWithModel(
|
widget.expandable == false &&
|
||||||
model: _model.menuListViewComponentModel,
|
widget.item == MenuItem.card) {
|
||||||
updateCallback: () => setState(() {}),
|
return wrapWithModel(
|
||||||
updateOnChange: true,
|
model: _model.menuListViewComponentModel,
|
||||||
child: MenuListViewComponentWidget(
|
updateCallback: () => setState(() {}),
|
||||||
options: options,
|
updateOnChange: true,
|
||||||
expandable: widget.expandable,
|
child: MenuListViewComponentWidget(
|
||||||
item: widget.item,
|
options: options,
|
||||||
changeMenuStyle: () async {
|
expandable: widget.expandable,
|
||||||
await _model.changeMenuStyle(context);
|
item: widget.item,
|
||||||
setState(() {});
|
changeMenuStyle: () async {
|
||||||
},
|
await _model.changeMenuStyle(context);
|
||||||
),
|
setState(() {});
|
||||||
);
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
return const SizedBox();
|
return const SizedBox();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future accessQRCodeOptAction(BuildContext context) async {
|
Future accessQRCodeOptAction(BuildContext context) async {
|
||||||
context.pushNamed(
|
context.pushNamed(
|
||||||
'qrCodePage',
|
'qrCodePage',
|
||||||
extra: <String, dynamic>{
|
extra: <String, dynamic>{
|
||||||
|
@ -160,6 +279,4 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
|
@ -2,7 +2,6 @@ import 'dart:async';
|
||||||
import 'dart:collection';
|
import 'dart:collection';
|
||||||
import 'dart:developer';
|
import 'dart:developer';
|
||||||
|
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
import 'package:flutter/widgets.dart';
|
||||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
|
@ -14,7 +13,6 @@ import 'package:rxdart/rxdart.dart';
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
final dropdown = BehaviorSubject<LinkedHashMap<String, String>>.seeded(
|
final dropdown = BehaviorSubject<LinkedHashMap<String, String>>.seeded(
|
||||||
LinkedHashMap.from({
|
LinkedHashMap.from({
|
||||||
'All': 'A',
|
'All': 'A',
|
||||||
|
@ -82,7 +80,6 @@ class _MessageWellComponentWidgetState
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Widget _buildMenuMessageWell(BuildContext context, FlutterFlowTheme theme) {
|
Widget _buildMenuMessageWell(BuildContext context, FlutterFlowTheme theme) {
|
||||||
final dropdownItems = LinkedHashMap.from({
|
final dropdownItems = LinkedHashMap.from({
|
||||||
'All': 'A',
|
'All': 'A',
|
||||||
|
@ -148,7 +145,8 @@ class _MessageWellComponentWidgetState
|
||||||
fillColor: theme.primary,
|
fillColor: theme.primary,
|
||||||
),
|
),
|
||||||
onChanged: (String? newValue) {
|
onChanged: (String? newValue) {
|
||||||
safeSetState(() => dropdown.value = LinkedHashMap.from({newValue!: dropdownItems[newValue].toString()}));
|
safeSetState(() => dropdown.value = LinkedHashMap.from(
|
||||||
|
{newValue!: dropdownItems[newValue].toString()}));
|
||||||
},
|
},
|
||||||
items: dropdownItems.entries
|
items: dropdownItems.entries
|
||||||
.map((entry) => DropdownMenuItem<String>(
|
.map((entry) => DropdownMenuItem<String>(
|
||||||
|
@ -178,84 +176,138 @@ class _MessageWellComponentWidgetState
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildMessageItem(
|
Widget _buildMessageItem(BuildContext context, dynamic message, int index) {
|
||||||
BuildContext context, dynamic message, int index) {
|
|
||||||
final theme = FlutterFlowTheme.of(context);
|
final theme = FlutterFlowTheme.of(context);
|
||||||
String formatMessageOrigin(String messageOrigin) {
|
String formatMessageOrigin(String messageOrigin) {
|
||||||
final words = messageOrigin.split(' ');
|
final words = messageOrigin.split(' ');
|
||||||
final formattedWords = words.map((word) {
|
final formattedWords = words.map((word) {
|
||||||
|
if (word.isEmpty) return word; // Handle empty words
|
||||||
final firstLetter = word.substring(0, 1).toUpperCase();
|
final firstLetter = word.substring(0, 1).toUpperCase();
|
||||||
final remainingLetters = word.substring(1).toLowerCase();
|
final remainingLetters =
|
||||||
|
word.length > 1 ? word.substring(1).toLowerCase() : '';
|
||||||
return '$firstLetter$remainingLetters';
|
return '$firstLetter$remainingLetters';
|
||||||
});
|
});
|
||||||
return formattedWords.join(' ');
|
return formattedWords.join(' ');
|
||||||
}
|
}
|
||||||
return GestureDetector(
|
|
||||||
onTap: () => {},
|
return Padding(
|
||||||
child: Padding(
|
padding: const EdgeInsets.symmetric(horizontal: 30),
|
||||||
padding: const EdgeInsets.fromLTRB(20, 5, 20, 5),
|
child: Card(
|
||||||
child: Container(
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
width: MediaQuery.of(context).size.width * 0.9,
|
child: Container(
|
||||||
height: 127.0,
|
// height: 100,
|
||||||
decoration: BoxDecoration(
|
child: Padding(
|
||||||
borderRadius: BorderRadius.circular(10),
|
padding: const EdgeInsets.all(8.0),
|
||||||
),
|
child: Column(
|
||||||
child: Row(
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
mainAxisSize: MainAxisSize.max,
|
children: [
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
Padding(
|
||||||
children: [
|
padding: const EdgeInsets.symmetric(horizontal: 15.0),
|
||||||
Padding(
|
child: Column(
|
||||||
padding: const EdgeInsets.fromLTRB(0, 0, 0, 0),
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
child: Container(
|
children: [
|
||||||
width: 64.0,
|
Row(
|
||||||
height: 64.0,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
decoration: const BoxDecoration(shape: BoxShape.circle),
|
mainAxisSize: MainAxisSize.max,
|
||||||
|
children: [
|
||||||
|
Icon(
|
||||||
|
message['MSG_DESTINO_TP'] == 'T'
|
||||||
|
? Icons.language
|
||||||
|
: message['MSG_DESTINO_TP'] == 'P'
|
||||||
|
? Icons.person
|
||||||
|
: Icons.home,
|
||||||
|
color: FlutterFlowTheme.of(context).primary,
|
||||||
|
size: 25,
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Text(
|
||||||
|
message['MSG_ORIGEM_DESC'].toString(),
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
fontSize: 15,
|
||||||
|
color: FlutterFlowTheme.of(context).primary,
|
||||||
|
),
|
||||||
|
overflow: TextOverflow.fade,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
].divide(const SizedBox(width: 10)),
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
mainAxisSize: MainAxisSize.max,
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(left: 5),
|
||||||
|
child: Icon(
|
||||||
|
Icons.history,
|
||||||
|
color:
|
||||||
|
FlutterFlowTheme.of(context).customColor6,
|
||||||
|
size: 15,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Text(
|
||||||
|
message['MSG_DATE'].toString(),
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
fontSize: 10,
|
||||||
|
color:
|
||||||
|
FlutterFlowTheme.of(context).customColor6,
|
||||||
|
),
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
].divide(const SizedBox(width: 15)),
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
mainAxisSize: MainAxisSize.max,
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(left: 5),
|
||||||
|
child: Icon(
|
||||||
|
Icons.message,
|
||||||
|
color:
|
||||||
|
FlutterFlowTheme.of(context).customColor6,
|
||||||
|
size: 15,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Text(
|
||||||
|
message['MSG_TEXTO'].toString(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
].divide(const SizedBox(width: 15)),
|
||||||
|
),
|
||||||
|
].divide(const SizedBox(height: 4)),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
// Row(
|
||||||
|
// children: [
|
||||||
|
// Icon(
|
||||||
|
// Icons.message,
|
||||||
|
// color: FlutterFlowTheme.of(context).customColor6,
|
||||||
|
// size: 15,
|
||||||
|
// ),
|
||||||
|
// Expanded(
|
||||||
|
// child: Padding(
|
||||||
|
// padding: const EdgeInsets.all(8.0),
|
||||||
|
// child: Text(
|
||||||
|
// message['MSG_TEXTO'].toString(),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ]
|
||||||
|
// .addToStart(const SizedBox(width: 8))
|
||||||
|
// .addToEnd(const SizedBox(width: 8))),
|
||||||
|
].divide(
|
||||||
|
const SizedBox(height: 8),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Expanded(
|
),
|
||||||
child: Column(
|
|
||||||
mainAxisSize: MainAxisSize.max,
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
const SizedBox(height: 8.0),
|
|
||||||
Center(
|
|
||||||
child: Text(
|
|
||||||
'~ ${formatMessageOrigin(message['MSG_ORIGEM_DESC'].toString())}',
|
|
||||||
style: theme.bodyMedium.copyWith(
|
|
||||||
fontFamily: 'Nunito Sans',
|
|
||||||
color: theme.primary,
|
|
||||||
fontSize: 14.0,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 8.0),
|
|
||||||
Expanded(
|
|
||||||
child: SingleChildScrollView(
|
|
||||||
scrollDirection: Axis.vertical,
|
|
||||||
child: Text(
|
|
||||||
formatMessageOrigin(message['MSG_TEXTO'].toString()),
|
|
||||||
style: theme.bodyMedium.copyWith(
|
|
||||||
fontFamily: 'Nunito Sans',
|
|
||||||
color: theme.bodyMedium.color,
|
|
||||||
fontSize: 14.0,
|
|
||||||
),
|
|
||||||
softWrap: true,
|
|
||||||
maxLines: 10,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
));
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class MessageWellState {
|
class MessageWellState {
|
||||||
|
@ -277,9 +329,8 @@ class MessageWellState {
|
||||||
return MessageWellState(
|
return MessageWellState(
|
||||||
messages: messages ?? this.messages,
|
messages: messages ?? this.messages,
|
||||||
pageNumber: pageNumber ?? this.pageNumber,
|
pageNumber: pageNumber ?? this.pageNumber,
|
||||||
allowScrollInSingleChildScrollView:
|
allowScrollInSingleChildScrollView: allowScrollInSingleChildScrollView ??
|
||||||
allowScrollInSingleChildScrollView ??
|
this.allowScrollInSingleChildScrollView,
|
||||||
this.allowScrollInSingleChildScrollView,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -300,7 +351,7 @@ class MessageWellNotifier extends StateNotifier<MessageWellState> {
|
||||||
fetchMessages();
|
fetchMessages();
|
||||||
}
|
}
|
||||||
|
|
||||||
void fetchMessages() async {
|
void fetchMessages() async {
|
||||||
if (state.pageNumber <= totalPageNumber) {
|
if (state.pageNumber <= totalPageNumber) {
|
||||||
var apiCall = GetMessagesCall();
|
var apiCall = GetMessagesCall();
|
||||||
var response = await apiCall.call(
|
var response = await apiCall.call(
|
||||||
|
@ -322,17 +373,14 @@ class MessageWellNotifier extends StateNotifier<MessageWellState> {
|
||||||
// .toList();
|
// .toList();
|
||||||
// Provider.of<MessageCounter>(context, listen: false).setCounter(int.parse(response.jsonBody['total_pages']));
|
// Provider.of<MessageCounter>(context, listen: false).setCounter(int.parse(response.jsonBody['total_pages']));
|
||||||
// totalPageNumber = int.parse(response.jsonBody['total_pages']);
|
// totalPageNumber = int.parse(response.jsonBody['total_pages']);
|
||||||
} else {
|
} else {}
|
||||||
log('Error fetching messages: ${response.statusCode}');
|
} else {}
|
||||||
}
|
|
||||||
} else {
|
|
||||||
log('No more messages to fetch ...');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
List<dynamic> getMessages() {
|
List<dynamic> getMessages() {
|
||||||
return state.messages;
|
return state.messages;
|
||||||
}
|
}
|
||||||
|
|
||||||
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);
|
||||||
|
@ -343,4 +391,4 @@ class MessageWellNotifier extends StateNotifier<MessageWellState> {
|
||||||
final messageWellProvider =
|
final messageWellProvider =
|
||||||
StateNotifierProvider<MessageWellNotifier, MessageWellState>((ref) {
|
StateNotifierProvider<MessageWellNotifier, MessageWellState>((ref) {
|
||||||
return MessageWellNotifier();
|
return MessageWellNotifier();
|
||||||
});
|
});
|
||||||
|
|
|
@ -40,8 +40,6 @@ class ScheduleVisitDetailModel
|
||||||
|
|
||||||
String convertDateFormat(String dateStr) {
|
String convertDateFormat(String dateStr) {
|
||||||
try {
|
try {
|
||||||
log('Received date string: $dateStr');
|
|
||||||
|
|
||||||
// Formato original
|
// Formato original
|
||||||
DateFormat originalFormat = DateFormat('d/M/y H:mm:ss');
|
DateFormat originalFormat = DateFormat('d/M/y H:mm:ss');
|
||||||
// Novo formato
|
// Novo formato
|
||||||
|
@ -50,7 +48,6 @@ class ScheduleVisitDetailModel
|
||||||
// Validate the input string format
|
// Validate the input string format
|
||||||
if (!RegExp(r'^\d{1,2}/\d{1,2}/\d{4} \d{1,2}:\d{2}:\d{2}$')
|
if (!RegExp(r'^\d{1,2}/\d{1,2}/\d{4} \d{1,2}:\d{2}:\d{2}$')
|
||||||
.hasMatch(dateStr)) {
|
.hasMatch(dateStr)) {
|
||||||
log('Invalid date format: $dateStr');
|
|
||||||
return 'Invalid date format';
|
return 'Invalid date format';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,11 +56,9 @@ class ScheduleVisitDetailModel
|
||||||
|
|
||||||
// Converte DateTime para a nova string formatada
|
// Converte DateTime para a nova string formatada
|
||||||
String formattedDate = newFormat.format(dateTime);
|
String formattedDate = newFormat.format(dateTime);
|
||||||
log('Formatted date: $formattedDate');
|
|
||||||
return formattedDate;
|
return formattedDate;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// Handle the exception by returning an error message or a default value
|
// Handle the exception by returning an error message or a default value
|
||||||
log('Error parsing date: $e');
|
|
||||||
return 'Invalid date format';
|
return 'Invalid date format';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,13 +19,13 @@ class CardItemTemplateComponentWidget extends StatefulWidget {
|
||||||
super.key,
|
super.key,
|
||||||
required this.labelsHashMap,
|
required this.labelsHashMap,
|
||||||
required this.statusHashMap,
|
required this.statusHashMap,
|
||||||
required this.imageHashMap,
|
required this.imagePath,
|
||||||
required this.onTapCardItemAction,
|
required this.onTapCardItemAction,
|
||||||
});
|
});
|
||||||
|
|
||||||
final Map<String, String>? labelsHashMap;
|
final Map<String, String>? labelsHashMap;
|
||||||
final List<Map<String, Color>?> statusHashMap;
|
final List<Map<String, Color>?> statusHashMap;
|
||||||
final Map<String, String> imageHashMap;
|
final String? imagePath;
|
||||||
final Future Function()? onTapCardItemAction;
|
final Future Function()? onTapCardItemAction;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -84,7 +84,6 @@ class _CardItemTemplateComponentWidgetState
|
||||||
double screenWidth = MediaQuery.of(context).size.width;
|
double screenWidth = MediaQuery.of(context).size.width;
|
||||||
double screenHeight = MediaQuery.of(context).size.height;
|
double screenHeight = MediaQuery.of(context).size.height;
|
||||||
context.watch<FFAppState>();
|
context.watch<FFAppState>();
|
||||||
|
|
||||||
return InkWell(
|
return InkWell(
|
||||||
splashColor: Colors.transparent,
|
splashColor: Colors.transparent,
|
||||||
focusColor: Colors.transparent,
|
focusColor: Colors.transparent,
|
||||||
|
@ -97,7 +96,7 @@ class _CardItemTemplateComponentWidgetState
|
||||||
padding: const EdgeInsets.fromLTRB(10, 0, 10, 0),
|
padding: const EdgeInsets.fromLTRB(10, 0, 10, 0),
|
||||||
child: Card(
|
child: Card(
|
||||||
clipBehavior: Clip.antiAliasWithSaveLayer,
|
clipBehavior: Clip.antiAliasWithSaveLayer,
|
||||||
color: FlutterFlowTheme.of(context).secondaryBackground,
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
elevation: 5.0,
|
elevation: 5.0,
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
|
@ -106,7 +105,7 @@ class _CardItemTemplateComponentWidgetState
|
||||||
width: 350.0,
|
width: 350.0,
|
||||||
height: 115.0,
|
height: 115.0,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: FlutterFlowTheme.of(context).secondaryBackground,
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
),
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
|
@ -114,28 +113,27 @@ class _CardItemTemplateComponentWidgetState
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Container(
|
child: Container(
|
||||||
width: 100.0,
|
width: MediaQuery.of(context).size.width,
|
||||||
height: 100.0,
|
height: MediaQuery.of(context).size.height,
|
||||||
decoration: const BoxDecoration(),
|
decoration: const BoxDecoration(),
|
||||||
child: Column(
|
child: Padding(
|
||||||
mainAxisSize: MainAxisSize.max,
|
padding: const EdgeInsets.all(8.0),
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
child: Column(
|
||||||
children: [
|
mainAxisSize: MainAxisSize.max,
|
||||||
Expanded(
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
child: ListView.builder(
|
children: [
|
||||||
shrinkWrap: true,
|
Expanded(
|
||||||
itemCount: labelsLinkedHashMap.length,
|
child: ListView.builder(
|
||||||
physics: const NeverScrollableScrollPhysics(),
|
shrinkWrap: true,
|
||||||
itemBuilder: (context, index) {
|
itemCount: labelsLinkedHashMap.length,
|
||||||
String key =
|
physics: const NeverScrollableScrollPhysics(),
|
||||||
labelsLinkedHashMap.keys.elementAt(index);
|
itemBuilder: (context, index) {
|
||||||
String value = labelsLinkedHashMap[key]!;
|
String key =
|
||||||
return Padding(
|
labelsLinkedHashMap.keys.elementAt(index);
|
||||||
padding:
|
String value = labelsLinkedHashMap[key]!;
|
||||||
const EdgeInsets.fromLTRB(0, 2, 0, 5),
|
return Padding(
|
||||||
child: Padding(
|
|
||||||
padding:
|
padding:
|
||||||
const EdgeInsets.fromLTRB(20, 0, 0, 0),
|
const EdgeInsets.fromLTRB(20, 0, 0, 5),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
mainAxisAlignment:
|
mainAxisAlignment:
|
||||||
|
@ -166,38 +164,37 @@ class _CardItemTemplateComponentWidgetState
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
width:
|
width:
|
||||||
5.0), // Espaçamento entre o label e o valor
|
5.0), // Espaçamento entre o label e o valor
|
||||||
Text(
|
Flexible(
|
||||||
truncate(20, value),
|
child: Text(
|
||||||
overflow: TextOverflow.ellipsis,
|
value,
|
||||||
maxLines: 1,
|
overflow: TextOverflow.ellipsis,
|
||||||
style: FlutterFlowTheme.of(context)
|
style: FlutterFlowTheme.of(context)
|
||||||
.bodyMedium
|
.bodyMedium
|
||||||
.override(
|
.override(
|
||||||
fontFamily:
|
fontFamily:
|
||||||
FlutterFlowTheme.of(context)
|
FlutterFlowTheme.of(
|
||||||
.bodyMediumFamily,
|
context)
|
||||||
fontSize: screenWidth * 0.030,
|
.bodyMediumFamily,
|
||||||
letterSpacing: 0.0,
|
fontSize: 12.5,
|
||||||
fontWeight: FontWeight.bold,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts
|
fontWeight: FontWeight.bold,
|
||||||
.asMap()
|
useGoogleFonts: GoogleFonts
|
||||||
.containsKey(
|
.asMap()
|
||||||
FlutterFlowTheme.of(
|
.containsKey(
|
||||||
context)
|
FlutterFlowTheme.of(
|
||||||
.bodyMediumFamily),
|
context)
|
||||||
),
|
.bodyMediumFamily),
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
);
|
||||||
);
|
},
|
||||||
},
|
),
|
||||||
),
|
),
|
||||||
),
|
Row(
|
||||||
Padding(
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
padding: const EdgeInsets.fromLTRB(20, 0, 0, 0),
|
|
||||||
child: Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
children:
|
children:
|
||||||
statusLinkedHashMap.expand((linkedHashMap) {
|
statusLinkedHashMap.expand((linkedHashMap) {
|
||||||
|
@ -212,7 +209,7 @@ class _CardItemTemplateComponentWidgetState
|
||||||
padding: const EdgeInsets.symmetric(
|
padding: const EdgeInsets.symmetric(
|
||||||
horizontal: 1.0, vertical: 3.0),
|
horizontal: 1.0, vertical: 3.0),
|
||||||
child: Container(
|
child: Container(
|
||||||
width: screenWidth * 0.20,
|
width: 100.0,
|
||||||
height: 27.0,
|
height: 27.0,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: item
|
color: item
|
||||||
|
@ -225,7 +222,6 @@ class _CardItemTemplateComponentWidgetState
|
||||||
child: Text(
|
child: Text(
|
||||||
item.key, // Usa a chave do item atual como texto
|
item.key, // Usa a chave do item atual como texto
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: screenWidth * 0.03,
|
|
||||||
color: FlutterFlowTheme.of(
|
color: FlutterFlowTheme.of(
|
||||||
context)
|
context)
|
||||||
.info, // Ajuste conforme necessário
|
.info, // Ajuste conforme necessário
|
||||||
|
@ -240,8 +236,8 @@ class _CardItemTemplateComponentWidgetState
|
||||||
}).toList();
|
}).toList();
|
||||||
}).toList(),
|
}).toList(),
|
||||||
),
|
),
|
||||||
),
|
]),
|
||||||
]),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
|
@ -249,18 +245,18 @@ class _CardItemTemplateComponentWidgetState
|
||||||
10.0, 10.0, 10.0, 10.0),
|
10.0, 10.0, 10.0, 10.0),
|
||||||
child: ClipRRect(
|
child: ClipRRect(
|
||||||
borderRadius: BorderRadius.circular(22.0),
|
borderRadius: BorderRadius.circular(22.0),
|
||||||
child: CachedNetworkImage(
|
child: AspectRatio(
|
||||||
fadeInDuration: const Duration(milliseconds: 500),
|
aspectRatio:
|
||||||
fadeOutDuration: const Duration(milliseconds: 500),
|
1.0, // Define a proporção desejada (1:1 neste caso)
|
||||||
imageUrl: valueOrDefault<String>(
|
child: CachedNetworkImage(
|
||||||
// 'https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${widget.imageHashMap['key']}&tipo=${widget.imageHashMap['value']}',
|
fadeInDuration: const Duration(milliseconds: 500),
|
||||||
'https://freaccess.com.br/freaccess/getImage.php?cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${widget.imageHashMap['key']}&tipo=${widget.imageHashMap['value']}',
|
fadeOutDuration: const Duration(milliseconds: 500),
|
||||||
'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg',
|
imageUrl: widget.imagePath ?? '',
|
||||||
|
fit: BoxFit.cover,
|
||||||
),
|
),
|
||||||
fit: BoxFit.cover,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
@ -0,0 +1,226 @@
|
||||||
|
import 'dart:developer';
|
||||||
|
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:hub/actions/actions.dart';
|
||||||
|
import 'package:hub/app_state.dart';
|
||||||
|
import 'package:hub/components/templates_components/details_component/details_component_widget.dart';
|
||||||
|
import 'package:hub/flutter_flow/flutter_flow_icon_button.dart';
|
||||||
|
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
||||||
|
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
||||||
|
import 'package:hub/flutter_flow/flutter_flow_widgets.dart';
|
||||||
|
import 'package:hub/flutter_flow/internationalization.dart';
|
||||||
|
import 'package:hub/flutter_flow/nav/nav.dart';
|
||||||
|
import 'package:hub/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart';
|
||||||
|
import 'package:rxdart/rxdart.dart';
|
||||||
|
import 'package:share_plus/share_plus.dart';
|
||||||
|
|
||||||
|
Widget buildDetails(
|
||||||
|
dynamic visitaWrapItem,
|
||||||
|
BuildContext context,
|
||||||
|
Future<dynamic> Function(BuildContext, int, int, String, String)?
|
||||||
|
changeStatusAction) {
|
||||||
|
return DetailsComponentWidget(
|
||||||
|
buttons: [
|
||||||
|
if (getStatus(visitaWrapItem['VAW_STATUS']) ==
|
||||||
|
status.active) // REJECT ACTION
|
||||||
|
FFButtonWidget(
|
||||||
|
text: FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText: 'Cancelar',
|
||||||
|
enText: 'Cancel',
|
||||||
|
),
|
||||||
|
icon: const Icon(Icons.close),
|
||||||
|
onPressed: () async {
|
||||||
|
showAlertDialog(
|
||||||
|
context,
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText: 'Bloquear Visita',
|
||||||
|
enText: 'Block Visit',
|
||||||
|
),
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText: 'Você tem certeza que deseja bloquear essa visita?',
|
||||||
|
enText: 'Are you sure you want to block this visit?',
|
||||||
|
), () async {
|
||||||
|
await changeStatusAction
|
||||||
|
?.call(
|
||||||
|
context,
|
||||||
|
int.parse(visitaWrapItem['VAW_DESTINO']),
|
||||||
|
int.parse(visitaWrapItem['VAW_ID']),
|
||||||
|
visitaWrapItem['VAW_CHAVE'] ?? '',
|
||||||
|
visitaWrapItem['VTE_DOCUMENTO'] ?? '',
|
||||||
|
)
|
||||||
|
.then((value) {
|
||||||
|
Navigator.pop(context, value);
|
||||||
|
if (value == false) {
|
||||||
|
showSnackbar(
|
||||||
|
context,
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'Error blocking visit',
|
||||||
|
ptText: 'Erro ao bloquear visita',
|
||||||
|
),
|
||||||
|
true,
|
||||||
|
);
|
||||||
|
} else if (value == true) {
|
||||||
|
showSnackbar(
|
||||||
|
context,
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'Success canceling visit',
|
||||||
|
ptText: 'Succeso ao cancelar visita',
|
||||||
|
),
|
||||||
|
false,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}).catchError((err, stack) {
|
||||||
|
Navigator.pop(context);
|
||||||
|
showSnackbar(
|
||||||
|
context,
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'Error blocking visit',
|
||||||
|
ptText: 'Erro ao bloquear visita',
|
||||||
|
),
|
||||||
|
true,
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
options: FFButtonOptions(
|
||||||
|
width: 130,
|
||||||
|
height: 40,
|
||||||
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
|
elevation: 0,
|
||||||
|
textStyle: TextStyle(
|
||||||
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
|
),
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
|
width: 1,
|
||||||
|
),
|
||||||
|
// borderRadius: 12,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
if (getStatus(visitaWrapItem['VAW_STATUS']) !=
|
||||||
|
status.active) // RECALL ACTION
|
||||||
|
FFButtonWidget(
|
||||||
|
text: FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText: 'Reagendar',
|
||||||
|
enText: 'Reschedule',
|
||||||
|
),
|
||||||
|
icon: const Icon(Icons.refresh),
|
||||||
|
onPressed: () async {
|
||||||
|
Navigator.pop(context);
|
||||||
|
Navigator.pop(context);
|
||||||
|
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (context) => ScheduleCompleteVisitPageWidget(
|
||||||
|
dropdownValue1: visitaWrapItem['MOT_DESCRICAO'],
|
||||||
|
dropdownValue2: visitaWrapItem['NAC_DESCRICAO'],
|
||||||
|
visitorJsonList: [visitaWrapItem],
|
||||||
|
visitorStrList: visitaWrapItem['VTE_DOCUMENTO'],
|
||||||
|
)
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
options: FFButtonOptions(
|
||||||
|
width: 130,
|
||||||
|
height: 40,
|
||||||
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
|
elevation: 0,
|
||||||
|
textStyle: TextStyle(
|
||||||
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
|
),
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
|
width: 1,
|
||||||
|
),
|
||||||
|
// borderRadius: 12,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
if (getStatus(visitaWrapItem['VAW_STATUS']) ==
|
||||||
|
status.active) // SHARE ACTION
|
||||||
|
FFButtonWidget(
|
||||||
|
text: FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText: 'Compartilhar',
|
||||||
|
enText: 'Share',
|
||||||
|
),
|
||||||
|
icon: const Icon(Icons.share),
|
||||||
|
onPressed: () async {
|
||||||
|
Share.share('''
|
||||||
|
Olá, \*${visitaWrapItem['VTE_NOME']}\*! Você foi convidado para \*${visitaWrapItem['NAC_DESCRICAO']}\*.
|
||||||
|
|
||||||
|
\*Validade do Convite\*:
|
||||||
|
- Início: ${visitaWrapItem['VAW_DTINICIO']}
|
||||||
|
- Fim: ${visitaWrapItem['VAW_DTFIM']}
|
||||||
|
|
||||||
|
URL do Convite: https://visita.freaccess.com.br/${visitaWrapItem['VAW_ID']}/${visitaWrapItem['CLI_ID']}/${visitaWrapItem['VAW_CHAVE']}
|
||||||
|
''');
|
||||||
|
},
|
||||||
|
options: FFButtonOptions(
|
||||||
|
width: 130,
|
||||||
|
height: 40,
|
||||||
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
|
elevation: 0,
|
||||||
|
textStyle: TextStyle(
|
||||||
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
|
),
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
|
width: 1,
|
||||||
|
),
|
||||||
|
// borderRadius: 12,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
labelsHashMap: Map<String, String>.from({
|
||||||
|
'Nome': visitaWrapItem['VTE_NOME'] ?? '',
|
||||||
|
'Inicio': visitaWrapItem['VAW_DTINICIO'] ?? '',
|
||||||
|
'Fim': visitaWrapItem['VAW_DTFIM'] ?? '',
|
||||||
|
}),
|
||||||
|
imagePath:
|
||||||
|
'https://freaccess.com.br/freaccess/getImage.php?cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${visitaWrapItem['VTE_DOCUMENTO'] ?? ''}&tipo=E',
|
||||||
|
statusHashMap: [
|
||||||
|
if (getStatus(visitaWrapItem['VAW_STATUS']) == status.active)
|
||||||
|
Map<String, Color>.from({
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText: 'Ativo',
|
||||||
|
enText: 'Active',
|
||||||
|
): FlutterFlowTheme.of(context).warning,
|
||||||
|
}),
|
||||||
|
if (getStatus(visitaWrapItem['VAW_STATUS']) == status.unknown)
|
||||||
|
Map<String, Color>.from({
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText: 'Pendente',
|
||||||
|
enText: 'Pending',
|
||||||
|
): FlutterFlowTheme.of(context).alternate,
|
||||||
|
}),
|
||||||
|
if (getStatus(visitaWrapItem['VAW_STATUS']) == status.canceled)
|
||||||
|
Map<String, Color>.from({
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText: 'Cancelado',
|
||||||
|
enText: 'Canceled',
|
||||||
|
): FlutterFlowTheme.of(context).error,
|
||||||
|
}),
|
||||||
|
if (getStatus(visitaWrapItem['VAW_STATUS']) == status.finished)
|
||||||
|
Map<String, Color>.from({
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText: 'Finalizado',
|
||||||
|
enText: 'Finished',
|
||||||
|
): FlutterFlowTheme.of(context).success,
|
||||||
|
}),
|
||||||
|
if (getStatus(visitaWrapItem['VAW_STATUS']) == status.blocked)
|
||||||
|
Map<String, Color>.from({
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText: 'Bloqueado',
|
||||||
|
enText: 'Blocked',
|
||||||
|
): FlutterFlowTheme.of(context).error,
|
||||||
|
}),
|
||||||
|
if (getStatus(visitaWrapItem['VAW_STATUS']) == status.inactive)
|
||||||
|
Map<String, Color>.from({
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText: 'Inativo',
|
||||||
|
enText: 'Inactive',
|
||||||
|
): FlutterFlowTheme.of(context).warning,
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
|
@ -53,4 +53,4 @@ class DetailsComponentModel extends FlutterFlowModel<DetailsComponentWidget> {
|
||||||
textFieldFocusNodeStatus?.dispose();
|
textFieldFocusNodeStatus?.dispose();
|
||||||
textControllerStatus?.dispose();
|
textControllerStatus?.dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -16,6 +16,8 @@ import 'package:google_fonts/google_fonts.dart';
|
||||||
import 'forgot_password_template_component_model.dart';
|
import 'forgot_password_template_component_model.dart';
|
||||||
export 'forgot_password_template_component_model.dart';
|
export 'forgot_password_template_component_model.dart';
|
||||||
|
|
||||||
|
//
|
||||||
|
|
||||||
class ForgotPasswordTemplateComponentWidget extends StatefulWidget {
|
class ForgotPasswordTemplateComponentWidget extends StatefulWidget {
|
||||||
const ForgotPasswordTemplateComponentWidget({super.key});
|
const ForgotPasswordTemplateComponentWidget({super.key});
|
||||||
|
|
||||||
|
@ -81,7 +83,8 @@ class _ForgotPasswordTemplateComponentWidgetState
|
||||||
tablet: false,
|
tablet: false,
|
||||||
))
|
))
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 16.0, 8.0),
|
padding:
|
||||||
|
const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 16.0, 8.0),
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
splashColor: Colors.transparent,
|
splashColor: Colors.transparent,
|
||||||
focusColor: Colors.transparent,
|
focusColor: Colors.transparent,
|
||||||
|
@ -103,20 +106,20 @@ class _ForgotPasswordTemplateComponentWidgetState
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding:
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
const EdgeInsetsDirectional.fromSTEB(12.0, 0.0, 0.0, 0.0),
|
12.0, 0.0, 0.0, 0.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
'',
|
'',
|
||||||
style:
|
style:
|
||||||
FlutterFlowTheme.of(context).bodyMedium.override(
|
FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
fontFamily: 'Plus Jakarta Sans',
|
fontFamily: 'Plus Jakarta Sans',
|
||||||
color: const Color(0xFF15161E),
|
color: const Color(0xFF15161E),
|
||||||
fontSize: 14.0,
|
fontSize: 14.0,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap()
|
||||||
.containsKey('Plus Jakarta Sans'),
|
.containsKey('Plus Jakarta Sans'),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
@ -124,43 +127,46 @@ class _ForgotPasswordTemplateComponentWidgetState
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 0.0, 0.0),
|
padding:
|
||||||
|
const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 0.0, 0.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
FFLocalizations.of(context).getText(
|
FFLocalizations.of(context).getText(
|
||||||
'xxm3ajsy' /* ESQUECEU SUA SENHA? */,
|
'xxm3ajsy' /* ESQUECEU SUA SENHA? */,
|
||||||
),
|
),
|
||||||
style: FlutterFlowTheme.of(context).headlineMedium.override(
|
style: FlutterFlowTheme.of(context).headlineMedium.override(
|
||||||
fontFamily: 'Outfit',
|
fontFamily: 'Outfit',
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
fontSize: 24.0,
|
fontSize: 24.0,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey('Outfit'),
|
useGoogleFonts: GoogleFonts.asMap().containsKey('Outfit'),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(16.0, 4.0, 16.0, 4.0),
|
padding:
|
||||||
|
const EdgeInsetsDirectional.fromSTEB(16.0, 4.0, 16.0, 4.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
FFLocalizations.of(context).getText(
|
FFLocalizations.of(context).getText(
|
||||||
'wu2f7yzo' /* Não se preucupe nós vamos te a... */,
|
'wu2f7yzo' /* Não se preucupe nós vamos te a... */,
|
||||||
),
|
),
|
||||||
style: FlutterFlowTheme.of(context).labelMedium.override(
|
style: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
fontFamily: 'Plus Jakarta Sans',
|
fontFamily: 'Plus Jakarta Sans',
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
fontSize: 14.0,
|
fontSize: 14.0,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
useGoogleFonts:
|
useGoogleFonts:
|
||||||
GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Form(
|
Form(
|
||||||
key: _model.formKey,
|
key: _model.formKey,
|
||||||
autovalidateMode: AutovalidateMode.onUserInteraction,
|
autovalidateMode: AutovalidateMode.onUserInteraction,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(16.0, 12.0, 16.0, 0.0),
|
padding:
|
||||||
|
const EdgeInsetsDirectional.fromSTEB(16.0, 12.0, 16.0, 0.0),
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
|
@ -169,7 +175,7 @@ class _ForgotPasswordTemplateComponentWidgetState
|
||||||
onChanged: (_) => EasyDebounce.debounce(
|
onChanged: (_) => EasyDebounce.debounce(
|
||||||
'_model.emailAddressTextController',
|
'_model.emailAddressTextController',
|
||||||
const Duration(milliseconds: 500),
|
const Duration(milliseconds: 500),
|
||||||
() => setState(() {}),
|
() => setState(() {}),
|
||||||
),
|
),
|
||||||
autofocus: true,
|
autofocus: true,
|
||||||
autofillHints: const [AutofillHints.email],
|
autofillHints: const [AutofillHints.email],
|
||||||
|
@ -226,14 +232,14 @@ class _ForgotPasswordTemplateComponentWidgetState
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
fontFamily: 'Plus Jakarta Sans',
|
fontFamily: 'Plus Jakarta Sans',
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
fontSize: 14.0,
|
fontSize: 14.0,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap()
|
||||||
.containsKey('Plus Jakarta Sans'),
|
.containsKey('Plus Jakarta Sans'),
|
||||||
),
|
),
|
||||||
maxLines: null,
|
maxLines: null,
|
||||||
keyboardType: TextInputType.emailAddress,
|
keyboardType: TextInputType.emailAddress,
|
||||||
cursorColor: FlutterFlowTheme.of(context).primary,
|
cursorColor: FlutterFlowTheme.of(context).primary,
|
||||||
|
@ -246,64 +252,73 @@ class _ForgotPasswordTemplateComponentWidgetState
|
||||||
Align(
|
Align(
|
||||||
alignment: const AlignmentDirectional(0.0, 0.0),
|
alignment: const AlignmentDirectional(0.0, 0.0),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 24.0, 0.0, 0.0),
|
padding:
|
||||||
|
const EdgeInsetsDirectional.fromSTEB(0.0, 24.0, 0.0, 0.0),
|
||||||
child: FFButtonWidget(
|
child: FFButtonWidget(
|
||||||
onPressed: (_model.emailAddressTextController.text == '' || !ValidatorUtil.isValidEmail(_model.emailAddressTextController.text))
|
onPressed: (_model.emailAddressTextController.text == '' ||
|
||||||
|
!ValidatorUtil.isValidEmail(
|
||||||
|
_model.emailAddressTextController.text))
|
||||||
? null
|
? null
|
||||||
: () async {
|
: () async {
|
||||||
|
try {
|
||||||
|
_model.req = await PhpGroup.forgotPasswordCall.call(
|
||||||
|
email: _model.emailAddressTextController.text,
|
||||||
|
);
|
||||||
|
|
||||||
try {
|
if (PhpGroup.forgotPasswordCall
|
||||||
_model.req = await PhpGroup.forgotPasswordCall.call(
|
.error((_model.req?.jsonBody ?? '')) ==
|
||||||
email: _model.emailAddressTextController.text,
|
false) {
|
||||||
);
|
await DialogUtil.success(
|
||||||
|
context,
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: "Send E-mail Successful!",
|
||||||
|
ptText: "E-mail Enviado com Sucesso!"));
|
||||||
|
Navigator.pop(context);
|
||||||
|
} else {
|
||||||
|
await DialogUtil.error(
|
||||||
|
context,
|
||||||
|
PhpGroup.forgotPasswordCall
|
||||||
|
.msg((_model.req?.jsonBody ?? ''))!);
|
||||||
|
}
|
||||||
|
|
||||||
if (PhpGroup.forgotPasswordCall.error((_model.req?.jsonBody ?? '')) == false) {
|
setState(() {});
|
||||||
await DialogUtil.success(context, FFLocalizations.of(context).getVariableText(
|
} catch (error, stack) {
|
||||||
enText: "Send E-mail Successful!",
|
LogUtil.requestAPIFailed(
|
||||||
ptText: "E-mail Enviado com Sucesso!"
|
"iforgot.php",
|
||||||
));
|
_model.emailAddressTextController.text,
|
||||||
Navigator.pop(context);
|
"Recuperar Senha",
|
||||||
} else {
|
error,
|
||||||
await DialogUtil.error(context, PhpGroup.forgotPasswordCall.msg((_model.req?.jsonBody ?? ''))!);
|
stack);
|
||||||
}
|
await DialogUtil.errorDefault(context);
|
||||||
|
}
|
||||||
setState(() {});
|
},
|
||||||
|
|
||||||
} catch (error, stack) {
|
|
||||||
LogUtil.requestAPIFailed("iforgot.php", _model.emailAddressTextController.text, "Recuperar Senha", error, stack);
|
|
||||||
await DialogUtil.errorDefault(context);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
text: FFLocalizations.of(context).getText(
|
text: FFLocalizations.of(context).getText(
|
||||||
'74rnd5bu' /* Enviar */,
|
'74rnd5bu' /* Enviar */,
|
||||||
),
|
),
|
||||||
options: FFButtonOptions(
|
options: FFButtonOptions(
|
||||||
width: 270.0,
|
width: 270.0,
|
||||||
height: 50.0,
|
height: 50.0,
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
iconPadding:
|
0.0, 0.0, 0.0, 0.0),
|
||||||
const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
iconPadding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
|
0.0, 0.0, 0.0, 0.0),
|
||||||
color: FlutterFlowTheme.of(context).primary,
|
color: FlutterFlowTheme.of(context).primary,
|
||||||
textStyle: FlutterFlowTheme.of(context).titleSmall.override(
|
textStyle: FlutterFlowTheme.of(context).titleSmall.override(
|
||||||
fontFamily: 'Plus Jakarta Sans',
|
fontFamily: 'Plus Jakarta Sans',
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
fontSize: 16.0,
|
fontSize: 16.0,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap()
|
||||||
.containsKey('Plus Jakarta Sans'),
|
.containsKey('Plus Jakarta Sans'),
|
||||||
),
|
),
|
||||||
elevation: 3.0,
|
elevation: 3.0,
|
||||||
borderSide: const BorderSide(
|
borderSide: const BorderSide(
|
||||||
color: Colors.transparent,
|
color: Colors.transparent,
|
||||||
width: 1.0,
|
width: 1.0,
|
||||||
),
|
),
|
||||||
disabledColor:
|
disabledColor: FlutterFlowTheme.of(context).customColor5,
|
||||||
FlutterFlowTheme.of(
|
disabledTextColor: Colors.white,
|
||||||
context)
|
|
||||||
.customColor5,
|
|
||||||
disabledTextColor:
|
|
||||||
Colors.white,
|
|
||||||
),
|
),
|
||||||
showLoadingIndicator: true,
|
showLoadingIndicator: true,
|
||||||
),
|
),
|
||||||
|
|
|
@ -5,7 +5,6 @@ import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
||||||
import 'package:hub/flutter_flow/internationalization.dart';
|
import 'package:hub/flutter_flow/internationalization.dart';
|
||||||
|
|
||||||
|
|
||||||
import 'package:cached_network_image/cached_network_image.dart';
|
import 'package:cached_network_image/cached_network_image.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
|
@ -54,7 +53,6 @@ class _MessageNotificationModalTemplateComponentWidgetState
|
||||||
|
|
||||||
_model.textController3 ??= TextEditingController(text: widget.to);
|
_model.textController3 ??= TextEditingController(text: widget.to);
|
||||||
_model.textFieldFocusNode3 ??= FocusNode();
|
_model.textFieldFocusNode3 ??= FocusNode();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -73,7 +71,7 @@ class _MessageNotificationModalTemplateComponentWidgetState
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(10.0, 0.0, 10.0, 0.0),
|
padding: const EdgeInsetsDirectional.fromSTEB(10.0, 0.0, 10.0, 0.0),
|
||||||
child: Container(
|
child: Container(
|
||||||
width: MediaQuery.sizeOf(context).width * 0.9,
|
width: MediaQuery.sizeOf(context).width,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: FlutterFlowTheme.of(context).primaryBackground,
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
borderRadius: const BorderRadius.only(
|
borderRadius: const BorderRadius.only(
|
||||||
|
@ -88,7 +86,6 @@ class _MessageNotificationModalTemplateComponentWidgetState
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
|
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
24.0, 0.0, 24.0, 0.0),
|
24.0, 0.0, 24.0, 0.0),
|
||||||
|
@ -105,7 +102,6 @@ class _MessageNotificationModalTemplateComponentWidgetState
|
||||||
ptText: 'Mensagem',
|
ptText: 'Mensagem',
|
||||||
enText: 'Message',
|
enText: 'Message',
|
||||||
),
|
),
|
||||||
|
|
||||||
labelStyle: FlutterFlowTheme.of(context)
|
labelStyle: FlutterFlowTheme.of(context)
|
||||||
.labelMedium
|
.labelMedium
|
||||||
.override(
|
.override(
|
||||||
|
@ -163,7 +159,8 @@ class _MessageNotificationModalTemplateComponentWidgetState
|
||||||
obscureText: false,
|
obscureText: false,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
isDense: true,
|
isDense: true,
|
||||||
labelText: FFLocalizations.of(context).getVariableText(
|
labelText:
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
ptText: 'De',
|
ptText: 'De',
|
||||||
enText: 'From',
|
enText: 'From',
|
||||||
),
|
),
|
||||||
|
@ -278,8 +275,6 @@ class _MessageNotificationModalTemplateComponentWidgetState
|
||||||
_model.textController3Validator.asValidator(context),
|
_model.textController3Validator.asValidator(context),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
|
|
||||||
]
|
]
|
||||||
.divide(const SizedBox(height: 10.0))
|
.divide(const SizedBox(height: 10.0))
|
||||||
.addToStart(const SizedBox(height: 20.0))
|
.addToStart(const SizedBox(height: 20.0))
|
||||||
|
@ -290,4 +285,4 @@ class _MessageNotificationModalTemplateComponentWidgetState
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import 'dart:async';
|
||||||
import 'dart:developer';
|
import 'dart:developer';
|
||||||
|
|
||||||
import 'package:hub/components/molecular_components/throw_exception/throw_exception_widget.dart';
|
import 'package:hub/components/molecular_components/throw_exception/throw_exception_widget.dart';
|
||||||
|
@ -14,12 +15,20 @@ import 'regisiter_vistor_template_component_widget.dart';
|
||||||
class RegisiterVistorTemplateComponentModel
|
class RegisiterVistorTemplateComponentModel
|
||||||
extends FlutterFlowModel<RegisiterVistorTemplateComponentWidget> {
|
extends FlutterFlowModel<RegisiterVistorTemplateComponentWidget> {
|
||||||
/// State fields for stateful widgets in this page.
|
/// State fields for stateful widgets in this page.
|
||||||
|
Timer? _debounceTimer;
|
||||||
|
|
||||||
final unfocusNode = FocusNode();
|
final unfocusNode = FocusNode();
|
||||||
bool isDataUploading = false;
|
bool isDataUploading = false;
|
||||||
FFUploadedFile uploadedLocalFile =
|
FFUploadedFile uploadedLocalFile =
|
||||||
FFUploadedFile(bytes: Uint8List.fromList([]));
|
FFUploadedFile(bytes: Uint8List.fromList([]));
|
||||||
|
|
||||||
|
void debounce(Function() fn, Duration time) {
|
||||||
|
if (_debounceTimer != null) {
|
||||||
|
_debounceTimer!.cancel();
|
||||||
|
}
|
||||||
|
_debounceTimer = Timer(time, fn);
|
||||||
|
}
|
||||||
|
|
||||||
// State field(s) for TextField widget.
|
// State field(s) for TextField widget.
|
||||||
FocusNode? textFieldFocusNode1;
|
FocusNode? textFieldFocusNode1;
|
||||||
TextEditingController? textController1;
|
TextEditingController? textController1;
|
||||||
|
@ -35,7 +44,7 @@ class RegisiterVistorTemplateComponentModel
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<bool?> getVisitanteByDocument(
|
Future<bool> getVisitanteByDocument(
|
||||||
String document, BuildContext context) async {
|
String document, BuildContext context) async {
|
||||||
final response = await PhpGroup.getVisitorByDocCall.call(
|
final response = await PhpGroup.getVisitorByDocCall.call(
|
||||||
devUUID: FFAppState().devUUID,
|
devUUID: FFAppState().devUUID,
|
||||||
|
@ -44,12 +53,12 @@ class RegisiterVistorTemplateComponentModel
|
||||||
atividade: 'getVisitante',
|
atividade: 'getVisitante',
|
||||||
documento: document,
|
documento: document,
|
||||||
);
|
);
|
||||||
log('${response.jsonBody}');
|
|
||||||
if (response.jsonBody['visitante']['VTE_ID'] != '0' &&
|
if (response.jsonBody['visitante']['VTE_ID'] != '0' &&
|
||||||
response.jsonBody['error'] != 'false') {
|
response.jsonBody['error'] != 'false') {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return null;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// State field(s) for TextField widget.
|
// State field(s) for TextField widget.
|
||||||
|
|
|
@ -23,9 +23,10 @@ export 'regisiter_vistor_template_component_model.dart';
|
||||||
|
|
||||||
class RegisiterVistorTemplateComponentWidget extends StatefulWidget {
|
class RegisiterVistorTemplateComponentWidget extends StatefulWidget {
|
||||||
final String source;
|
final String source;
|
||||||
|
final String? doc;
|
||||||
|
|
||||||
const RegisiterVistorTemplateComponentWidget(
|
const RegisiterVistorTemplateComponentWidget(
|
||||||
{super.key, required this.source});
|
{super.key, required this.source, this.doc});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<RegisiterVistorTemplateComponentWidget> createState() =>
|
State<RegisiterVistorTemplateComponentWidget> createState() =>
|
||||||
|
@ -38,15 +39,22 @@ class _RegisiterVistorTemplateComponentWidgetState
|
||||||
|
|
||||||
final scaffoldKey = GlobalKey<ScaffoldState>();
|
final scaffoldKey = GlobalKey<ScaffoldState>();
|
||||||
|
|
||||||
|
bool _isVisitorRegistered = false;
|
||||||
|
BehaviorSubject<bool> visitorAlreadyRegistered = BehaviorSubject<bool>();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
|
|
||||||
|
visitorAlreadyRegistered = BehaviorSubject<bool>.seeded(false);
|
||||||
|
|
||||||
_model =
|
_model =
|
||||||
createModel(context, () => RegisiterVistorTemplateComponentModel());
|
createModel(context, () => RegisiterVistorTemplateComponentModel());
|
||||||
|
|
||||||
_model.textController1 ??= TextEditingController();
|
_model.textController1 ??= TextEditingController();
|
||||||
_model.textFieldFocusNode1 ??= FocusNode();
|
_model.textFieldFocusNode1 ??= FocusNode();
|
||||||
|
|
||||||
|
log('doc: ${widget.doc}');
|
||||||
_model.textController2 ??= TextEditingController();
|
_model.textController2 ??= TextEditingController();
|
||||||
_model.textFieldFocusNode2 ??= FocusNode();
|
_model.textFieldFocusNode2 ??= FocusNode();
|
||||||
_model.textController2?.addListener(_onTextChanged);
|
_model.textController2?.addListener(_onTextChanged);
|
||||||
|
@ -56,6 +64,10 @@ class _RegisiterVistorTemplateComponentWidgetState
|
||||||
|
|
||||||
_model.textController4 ??= TextEditingController();
|
_model.textController4 ??= TextEditingController();
|
||||||
_model.textFieldFocusNode4 ??= FocusNode();
|
_model.textFieldFocusNode4 ??= FocusNode();
|
||||||
|
|
||||||
|
WidgetsBinding.instance?.addPostFrameCallback((timeStamp) {
|
||||||
|
_model.textController2.text = widget.doc ?? '';
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -67,17 +79,40 @@ class _RegisiterVistorTemplateComponentWidgetState
|
||||||
}
|
}
|
||||||
|
|
||||||
void _onTextChanged() {
|
void _onTextChanged() {
|
||||||
log('changed');
|
|
||||||
setState(() {});
|
setState(() {});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool _isFormValid(BuildContext context) {
|
||||||
|
if (_model.uploadedLocalFile.bytes?.isEmpty ?? true) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_model.textController1.text.isEmpty ||
|
||||||
|
_model.textController1.text == '') {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_model.dropDownValue == null ||
|
||||||
|
_model.dropDownValue!.isEmpty ||
|
||||||
|
_model.dropDownValue == '') {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_model.textController2.text.isEmpty ||
|
||||||
|
_model.textController2.text == '') {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_isVisitorRegistered) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
BehaviorSubject<bool> visitorAlreadyRegistered = BehaviorSubject<bool>();
|
|
||||||
context.watch<FFAppState>();
|
context.watch<FFAppState>();
|
||||||
log(context
|
|
||||||
.describeWidget('RegisiterVistorTemplateComponentWidget')
|
|
||||||
.toString());
|
|
||||||
return Align(
|
return Align(
|
||||||
alignment: const AlignmentDirectional(0.0, 1.0),
|
alignment: const AlignmentDirectional(0.0, 1.0),
|
||||||
child: Container(
|
child: Container(
|
||||||
|
@ -123,133 +158,137 @@ class _RegisiterVistorTemplateComponentWidgetState
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
24.0, 0.0, 24.0, 0.0),
|
24.0, 0.0, 24.0, 0.0),
|
||||||
child: TextFormField(
|
child: Column(children: [
|
||||||
controller: _model.textController2,
|
TextFormField(
|
||||||
focusNode: _model.textFieldFocusNode2,
|
controller: _model.textController2,
|
||||||
autovalidateMode: AutovalidateMode.onUserInteraction,
|
focusNode: _model.textFieldFocusNode2,
|
||||||
autofocus: false,
|
autovalidateMode: AutovalidateMode.onUserInteraction,
|
||||||
textCapitalization: TextCapitalization.none,
|
autofocus: false,
|
||||||
autofillHints: const [AutofillHints.password],
|
textCapitalization: TextCapitalization.none,
|
||||||
keyboardType: TextInputType.number,
|
autofillHints: const [AutofillHints.password],
|
||||||
textInputAction: TextInputAction.next,
|
keyboardType: TextInputType.number,
|
||||||
obscureText: false,
|
textInputAction: TextInputAction.next,
|
||||||
decoration: InputDecoration(
|
obscureText: false,
|
||||||
isDense: true,
|
decoration: InputDecoration(
|
||||||
labelText: FFLocalizations.of(context).getText(
|
isDense: true,
|
||||||
'rl8tvwnr' /* Documento */,
|
labelText: FFLocalizations.of(context).getText(
|
||||||
|
'rl8tvwnr' /* Documento */,
|
||||||
|
),
|
||||||
|
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: OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: FlutterFlowTheme.of(context).customColor6,
|
||||||
|
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.document_scanner,
|
||||||
|
color: FlutterFlowTheme.of(context).accent1,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
labelStyle: FlutterFlowTheme.of(context)
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
.labelMedium
|
|
||||||
.override(
|
|
||||||
fontFamily:
|
fontFamily:
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily),
|
FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
),
|
),
|
||||||
hintStyle: FlutterFlowTheme.of(context)
|
onChanged: (value) {
|
||||||
.labelMedium
|
_model.debounce(() async {
|
||||||
.override(
|
var data = await _model.getVisitanteByDocument(
|
||||||
fontFamily:
|
value, context);
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily,
|
setState(() {
|
||||||
letterSpacing: 0.0,
|
_isVisitorRegistered = data;
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
});
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily),
|
}, const Duration(milliseconds: 500));
|
||||||
),
|
},
|
||||||
enabledBorder: OutlineInputBorder(
|
validator:
|
||||||
borderSide: BorderSide(
|
_model.textController2Validator.asValidator(context),
|
||||||
color: FlutterFlowTheme.of(context).customColor6,
|
inputFormatters: [
|
||||||
width: 0.5,
|
FilteringTextInputFormatter.allow(RegExp('[0-9]')),
|
||||||
),
|
],
|
||||||
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.document_scanner,
|
|
||||||
color: FlutterFlowTheme.of(context).accent1,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
_model.textController2.text.isEmpty
|
||||||
fontFamily:
|
? const SizedBox()
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily,
|
: _isVisitorRegistered == true
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
? Row(
|
||||||
letterSpacing: 0.0,
|
mainAxisSize: MainAxisSize.max,
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
children: [
|
||||||
),
|
Padding(
|
||||||
validator:
|
padding: const EdgeInsetsDirectional.only(
|
||||||
_model.textController2Validator.asValidator(context),
|
top: 5, start: 12),
|
||||||
inputFormatters: [
|
child: Text(
|
||||||
FilteringTextInputFormatter.allow(RegExp('[0-9]')),
|
FFLocalizations.of(context)
|
||||||
],
|
.getVariableText(
|
||||||
),
|
enText: 'Visitor already registered',
|
||||||
),
|
ptText: 'Visitante já cadastrado',
|
||||||
FutureBuilder(
|
),
|
||||||
future: _model.textController2.text.isNotEmpty
|
style: FlutterFlowTheme.of(context)
|
||||||
? _model.getVisitanteByDocument(
|
.labelSmall
|
||||||
_model.textController2.text, context)
|
.override(
|
||||||
: null,
|
fontFamily: 'Nunito',
|
||||||
builder: (BuildContext context, AsyncSnapshot snapshot) {
|
color: Theme.of(context)
|
||||||
if (snapshot.connectionState == ConnectionState.waiting) {
|
.brightness ==
|
||||||
return const SizedBox();
|
Brightness.dark
|
||||||
} else if (snapshot.hasError ||
|
? Color.alphaBlend(
|
||||||
snapshot.data == null ||
|
Colors.white
|
||||||
snapshot.data == '') {
|
.withOpacity(0.7),
|
||||||
visitorAlreadyRegistered.add(true);
|
Colors.red)
|
||||||
return const SizedBox();
|
: Color.alphaBlend(
|
||||||
} else {
|
Colors.black
|
||||||
visitorAlreadyRegistered.add(false);
|
.withOpacity(0.25),
|
||||||
return _model.textController2.text.isEmpty
|
Colors.red),
|
||||||
? const SizedBox()
|
fontSize: 13.0,
|
||||||
: Row(
|
letterSpacing: 0.0,
|
||||||
mainAxisSize: MainAxisSize.max,
|
)),
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
),
|
||||||
children: [
|
],
|
||||||
Padding(
|
)
|
||||||
padding: EdgeInsets.only(
|
: const SizedBox()
|
||||||
right: MediaQuery.sizeOf(context).width *
|
]),
|
||||||
0.1),
|
|
||||||
child: Text(
|
|
||||||
FFLocalizations.of(context)
|
|
||||||
.getVariableText(
|
|
||||||
enText: 'Visitor already registered',
|
|
||||||
ptText: 'Visitante já cadastrado',
|
|
||||||
),
|
|
||||||
style: FlutterFlowTheme.of(context)
|
|
||||||
.bodySmall
|
|
||||||
.override(
|
|
||||||
fontFamily: 'Nunito',
|
|
||||||
color: FlutterFlowTheme.of(context)
|
|
||||||
.error,
|
|
||||||
fontSize: 14.0,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
)),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
|
@ -334,119 +373,86 @@ class _RegisiterVistorTemplateComponentWidgetState
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding:
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 10.0),
|
24.0, 0.0, 24.0, 10.0),
|
||||||
child: Container(
|
child: Column(
|
||||||
width: MediaQuery.sizeOf(context).width * 0.95,
|
children: [
|
||||||
decoration: const BoxDecoration(),
|
FlutterFlowDropDown<String>(
|
||||||
child: Column(
|
controller: _model.dropDownValueController ??=
|
||||||
children: [
|
FormFieldController<String>(null),
|
||||||
|
options: [
|
||||||
|
FFLocalizations.of(context).getText(
|
||||||
|
'n8vddmcq' /* Visitante */,
|
||||||
|
),
|
||||||
|
FFLocalizations.of(context).getText(
|
||||||
|
'9luaa09e' /* Prestador de Serviço */,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
onChanged: (val) =>
|
||||||
|
setState(() => _model.dropDownValue = val),
|
||||||
|
width: MediaQuery.sizeOf(context).width * 0.9,
|
||||||
|
// height: 44.0,
|
||||||
|
textStyle: 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),
|
||||||
|
),
|
||||||
|
hintText: FFLocalizations.of(context).getText(
|
||||||
|
'pmezihb4' /* Selecione... */,
|
||||||
|
),
|
||||||
|
icon: Icon(
|
||||||
|
Icons.keyboard_arrow_down_rounded,
|
||||||
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
|
size: 24.0,
|
||||||
|
),
|
||||||
|
elevation: 2.0,
|
||||||
|
borderColor: FlutterFlowTheme.of(context).customColor6,
|
||||||
|
borderWidth: 0.5,
|
||||||
|
borderRadius: 8.0,
|
||||||
|
margin: const EdgeInsetsDirectional.fromSTEB(
|
||||||
|
16.0, 0.0, 16.0, 0.0),
|
||||||
|
hidesUnderline: true,
|
||||||
|
isOverButton: true,
|
||||||
|
isSearchable: false,
|
||||||
|
isMultiSelect: false,
|
||||||
|
),
|
||||||
|
if (_model.dropDownValue == null ||
|
||||||
|
_model.dropDownValue == '')
|
||||||
Row(
|
Row(
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
mainAxisSize: MainAxisSize.max,
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
padding: const EdgeInsetsDirectional.only(
|
||||||
0.0, 0.0, 0.0, 7.0),
|
top: 5, start: 15),
|
||||||
child: Text(
|
child: Text(
|
||||||
FFLocalizations.of(context).getText(
|
FFLocalizations.of(context).getVariableText(
|
||||||
'yp23q90m' /* Selecione o tipo: */,
|
enText: 'This field is required',
|
||||||
),
|
ptText: 'Este campo é obrigatório',
|
||||||
style: FlutterFlowTheme.of(context)
|
|
||||||
.bodyMedium
|
|
||||||
.override(
|
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
|
||||||
.containsKey(
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
|
||||||
0.0, 0.0, 0.0, 5.0),
|
|
||||||
child: FlutterFlowDropDown<String>(
|
|
||||||
controller: _model.dropDownValueController ??=
|
|
||||||
FormFieldController<String>(null),
|
|
||||||
options: [
|
|
||||||
FFLocalizations.of(context).getText(
|
|
||||||
'n8vddmcq' /* Visitante */,
|
|
||||||
),
|
),
|
||||||
FFLocalizations.of(context).getText(
|
style: FlutterFlowTheme.of(context)
|
||||||
'9luaa09e' /* Prestador de Serviço */,
|
.bodySmall
|
||||||
)
|
.override(
|
||||||
],
|
fontFamily: FlutterFlowTheme.of(context)
|
||||||
onChanged: (val) =>
|
.bodySmallFamily,
|
||||||
setState(() => _model.dropDownValue = val),
|
color: FlutterFlowTheme.of(context)
|
||||||
width: 200.0,
|
.customColor6,
|
||||||
height: 44.0,
|
letterSpacing: 0.0,
|
||||||
textStyle: FlutterFlowTheme.of(context)
|
useGoogleFonts: GoogleFonts.asMap()
|
||||||
.bodyMedium
|
.containsKey(
|
||||||
.override(
|
FlutterFlowTheme.of(context)
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
.bodySmallFamily),
|
||||||
.bodyMediumFamily,
|
)),
|
||||||
color: FlutterFlowTheme.of(context)
|
|
||||||
.primaryText,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
|
||||||
.containsKey(
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily),
|
|
||||||
),
|
|
||||||
hintText: FFLocalizations.of(context).getText(
|
|
||||||
'pmezihb4' /* Selecione... */,
|
|
||||||
),
|
|
||||||
icon: Icon(
|
|
||||||
Icons.keyboard_arrow_down_rounded,
|
|
||||||
color:
|
|
||||||
FlutterFlowTheme.of(context).primaryText,
|
|
||||||
size: 24.0,
|
|
||||||
),
|
|
||||||
elevation: 2.0,
|
|
||||||
borderColor:
|
|
||||||
FlutterFlowTheme.of(context).customColor6,
|
|
||||||
borderWidth: 0.5,
|
|
||||||
borderRadius: 8.0,
|
|
||||||
margin: const EdgeInsetsDirectional.fromSTEB(
|
|
||||||
16.0, 0.0, 16.0, 0.0),
|
|
||||||
hidesUnderline: true,
|
|
||||||
isOverButton: true,
|
|
||||||
isSearchable: false,
|
|
||||||
isMultiSelect: false,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
]
|
],
|
||||||
.divide(const SizedBox(width: 19.0))
|
|
||||||
.addToStart(const SizedBox(width: 30.0)),
|
|
||||||
),
|
),
|
||||||
if (_model.dropDownValue == null ||
|
],
|
||||||
_model.dropDownValue == '')
|
|
||||||
Align(
|
|
||||||
alignment: const AlignmentDirectional(0.4, 0),
|
|
||||||
child: Text(
|
|
||||||
FFLocalizations.of(context).getVariableText(
|
|
||||||
enText: 'This field is required',
|
|
||||||
ptText: 'Este campo é obrigatório',
|
|
||||||
),
|
|
||||||
style: FlutterFlowTheme.of(context)
|
|
||||||
.bodySmall
|
|
||||||
.override(
|
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
|
||||||
.bodySmallFamily,
|
|
||||||
color: FlutterFlowTheme.of(context)
|
|
||||||
.customColor6,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
|
||||||
.containsKey(
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.bodySmallFamily),
|
|
||||||
)),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Builder(
|
Builder(
|
||||||
|
@ -491,10 +497,11 @@ class _RegisiterVistorTemplateComponentWidgetState
|
||||||
allowPhoto: true,
|
allowPhoto: true,
|
||||||
includeDimensions: true,
|
includeDimensions: true,
|
||||||
);
|
);
|
||||||
if (selectedMedia != null &&
|
if (selectedMedia != null) {
|
||||||
selectedMedia.every((m) =>
|
// &&
|
||||||
validateFileFormat(
|
// selectedMedia.every((m) =>
|
||||||
m.storagePath, context))) {
|
// validateFileFormat(
|
||||||
|
// m.storagePath, context))) {
|
||||||
setState(() => _model.isDataUploading = true);
|
setState(() => _model.isDataUploading = true);
|
||||||
var selectedUploadedFiles =
|
var selectedUploadedFiles =
|
||||||
<FFUploadedFile>[];
|
<FFUploadedFile>[];
|
||||||
|
@ -793,119 +800,112 @@ class _RegisiterVistorTemplateComponentWidgetState
|
||||||
padding:
|
padding:
|
||||||
const EdgeInsetsDirectional.fromSTEB(0.0, 65.0, 0.0, 0.0),
|
const EdgeInsetsDirectional.fromSTEB(0.0, 65.0, 0.0, 0.0),
|
||||||
child: FFButtonWidget(
|
child: FFButtonWidget(
|
||||||
onPressed: (((_model.uploadedLocalFile.bytes?.isNotEmpty ??
|
onPressed: _isFormValid(context)
|
||||||
false)) &&
|
|
||||||
(_model.textController1.text != '') &&
|
|
||||||
(_model.dropDownValue != null &&
|
|
||||||
_model.dropDownValue != '') &&
|
|
||||||
(_model.textController2.text != ''))
|
|
||||||
? () async {
|
? () async {
|
||||||
log(visitorAlreadyRegistered.value.toString());
|
_model.imgBase64 =
|
||||||
if (visitorAlreadyRegistered.value == true) {
|
await actions.convertImageFileToBase64(
|
||||||
_model.imgBase64 =
|
_model.uploadedLocalFile,
|
||||||
await actions.convertImageFileToBase64(
|
);
|
||||||
_model.uploadedLocalFile,
|
_model.scheduleVisitor =
|
||||||
);
|
await PhpGroup.postScheduleVisitorCall
|
||||||
_model.scheduleVisitor =
|
.call(
|
||||||
await PhpGroup.postScheduleVisitorCall
|
devUUID: FFAppState().devUUID,
|
||||||
.call(
|
userUUID: FFAppState().userUUID,
|
||||||
devUUID: FFAppState().devUUID,
|
cliID: FFAppState().cliUUID,
|
||||||
userUUID: FFAppState().userUUID,
|
atividade: 'putVisitante',
|
||||||
cliID: FFAppState().cliUUID,
|
documento: _model.textController2.text,
|
||||||
atividade: 'putVisitante',
|
nome: _model.textController1.text,
|
||||||
documento: _model.textController2.text,
|
tipo: _model.dropDownValue ==
|
||||||
nome: _model.textController1.text,
|
FFLocalizations.of(context).getText(
|
||||||
tipo: _model.dropDownValue ==
|
'n8vddmcq' /* Visitante */,
|
||||||
FFLocalizations.of(context).getText(
|
)
|
||||||
'n8vddmcq' /* Visitante */,
|
? 'V'
|
||||||
)
|
: 'P',
|
||||||
? 'V'
|
foto: 'base64;jpeg,${_model.imgBase64}',
|
||||||
: 'P',
|
)
|
||||||
foto: 'base64;jpeg,${_model.imgBase64}',
|
.onError((e, s) async {
|
||||||
)
|
return await showAdaptiveDialog(
|
||||||
.onError((e, s) async {
|
context: context,
|
||||||
return await showAdaptiveDialog(
|
builder: (context) {
|
||||||
context: context,
|
return GestureDetector(
|
||||||
builder: (context) {
|
onTap: () => Navigator.pop(context),
|
||||||
return GestureDetector(
|
child: Padding(
|
||||||
onTap: () => Navigator.pop(context),
|
padding: MediaQuery.viewInsetsOf(context),
|
||||||
child: Padding(
|
child: Dialog(
|
||||||
padding:
|
backgroundColor: Colors.transparent,
|
||||||
MediaQuery.viewInsetsOf(context),
|
child: ThrowExceptionWidget(
|
||||||
child: Dialog(
|
msg: FFLocalizations.of(context)
|
||||||
backgroundColor: Colors.transparent,
|
.getVariableText(
|
||||||
child: ThrowExceptionWidget(
|
ptText:
|
||||||
msg: FFLocalizations.of(context)
|
'Você esqueceu de adicionar algum dado obrigatório. Verifique se a imagem, nome, tipo e documento foram preenchidos corretamente.',
|
||||||
.getVariableText(
|
enText:
|
||||||
ptText:
|
'You forgot to add some required data. Check if the image, name, type and document were filled in correctly.',
|
||||||
'Você esqueceu de adicionar algum dado obrigatório. Verifique se a imagem, nome, tipo e documento foram preenchidos corretamente.',
|
|
||||||
enText:
|
|
||||||
'You forgot to add some required data. Check if the image, name, type and document were filled in correctly.',
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
});
|
|
||||||
if (PhpGroup.postScheduleVisitorCall.error(
|
|
||||||
(_model.scheduleVisitor?.jsonBody ?? ''),
|
|
||||||
) ==
|
|
||||||
false) {
|
|
||||||
setState(() {
|
|
||||||
_model.textController1?.clear();
|
|
||||||
_model.textController2?.clear();
|
|
||||||
_model.textController3?.clear();
|
|
||||||
_model.textController4?.clear();
|
|
||||||
_model.dropDownValueController?.reset();
|
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
|
||||||
SnackBar(
|
|
||||||
content: Text(
|
|
||||||
FFLocalizations.of(context).getVariableText(
|
|
||||||
ptText:
|
|
||||||
'Visitante cadastrado com sucesso.',
|
|
||||||
enText:
|
|
||||||
'Visitor successfully registered.'),
|
|
||||||
style: TextStyle(
|
|
||||||
color:
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.info)),
|
|
||||||
backgroundColor:
|
|
||||||
FlutterFlowTheme.of(context).primary,
|
|
||||||
duration: const Duration(seconds: 3),
|
|
||||||
width: MediaQuery.of(context).size.width,
|
|
||||||
behavior: SnackBarBehavior.floating,
|
|
||||||
shape: const RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.only(
|
|
||||||
topLeft: Radius.circular(15),
|
|
||||||
topRight: Radius.circular(15),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
if (widget.source ==
|
},
|
||||||
'VisitorNotFoundComponent') {
|
);
|
||||||
Navigator.pop(context);
|
});
|
||||||
}
|
if (PhpGroup.postScheduleVisitorCall.error(
|
||||||
});
|
(_model.scheduleVisitor?.jsonBody ?? ''),
|
||||||
} else {
|
) ==
|
||||||
return DialogUtil.error(
|
false) {
|
||||||
context,
|
setState(() {
|
||||||
PhpGroup.postScheduleVisitorCall
|
_model.textController1?.clear();
|
||||||
.errorMsg(
|
_model.textController2?.clear();
|
||||||
_model.scheduleVisitor?.jsonBody)
|
_model.textController3?.clear();
|
||||||
.toString());
|
_model.textController4?.clear();
|
||||||
}
|
_model.dropDownValueController?.reset();
|
||||||
|
_model.uploadedLocalFile = FFUploadedFile(
|
||||||
|
bytes: Uint8List.fromList([]));
|
||||||
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
|
SnackBar(
|
||||||
|
content: Text(
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText:
|
||||||
|
'Visitante cadastrado com sucesso.',
|
||||||
|
enText:
|
||||||
|
'Visitor successfully registered.'),
|
||||||
|
style: TextStyle(
|
||||||
|
color: FlutterFlowTheme.of(context)
|
||||||
|
.info)),
|
||||||
|
backgroundColor:
|
||||||
|
FlutterFlowTheme.of(context).primary,
|
||||||
|
duration: const Duration(seconds: 3),
|
||||||
|
width: MediaQuery.of(context).size.width,
|
||||||
|
behavior: SnackBarBehavior.floating,
|
||||||
|
shape: const RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.only(
|
||||||
|
topLeft: Radius.circular(15),
|
||||||
|
topRight: Radius.circular(15),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
if (widget.source ==
|
||||||
|
'VisitorNotFoundComponent') {
|
||||||
|
Navigator.pop(context, true);
|
||||||
|
}
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
DialogUtil.error(
|
return DialogUtil.error(
|
||||||
context,
|
context,
|
||||||
FFLocalizations.of(context).getVariableText(
|
PhpGroup.postScheduleVisitorCall.errorMsg(
|
||||||
ptText:
|
_model
|
||||||
'Visitante já cadastrado. Verifique se o documento foi preenchido corretamente.',
|
.scheduleVisitor?.jsonBody) ==
|
||||||
enText:
|
null
|
||||||
'Visitor already registered. Check if the document was filled in correctly.',
|
? FFLocalizations.of(context)
|
||||||
));
|
.getVariableText(
|
||||||
|
ptText:
|
||||||
|
'Erro ao se conectar com o servidor',
|
||||||
|
enText: 'Error connecting to server',
|
||||||
|
)
|
||||||
|
: PhpGroup.postScheduleVisitorCall
|
||||||
|
.errorMsg(
|
||||||
|
_model.scheduleVisitor?.jsonBody)
|
||||||
|
.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
: null,
|
: null,
|
||||||
|
|
|
@ -99,8 +99,9 @@ class _SignInTemplateComponentWidgetState
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool _isFormInvalid() {
|
bool _isFormInvalid() {
|
||||||
if (_model.emailAddressTextController.text == '' || _model.passwordTextController.text == '') {
|
if (_model.emailAddressTextController.text == '' ||
|
||||||
|
_model.passwordTextController.text == '') {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -185,7 +186,8 @@ class _SignInTemplateComponentWidgetState
|
||||||
decoration: const BoxDecoration(),
|
decoration: const BoxDecoration(),
|
||||||
child: ClipRRect(
|
child: ClipRRect(
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
child: const AtomImageSvgTheme(filename: 'login', width: 600, height: 155),
|
child: const AtomImageSvgTheme(
|
||||||
|
filename: 'login', width: 600, height: 155),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Column(
|
Column(
|
||||||
|
@ -697,26 +699,37 @@ class _SignInTemplateComponentWidgetState
|
||||||
.fromSTEB(0.0, 0.0,
|
.fromSTEB(0.0, 0.0,
|
||||||
0.0, 16.0),
|
0.0, 16.0),
|
||||||
child: FFButtonWidget(
|
child: FFButtonWidget(
|
||||||
onPressed: _isFormInvalid()
|
onPressed:
|
||||||
? null
|
_isFormInvalid()
|
||||||
: () async {
|
? null
|
||||||
try {
|
: () async {
|
||||||
await action_blocks
|
try {
|
||||||
.singInLoginAction(
|
await action_blocks
|
||||||
context,
|
.singInLoginAction(
|
||||||
emailAdress: _model
|
context,
|
||||||
.emailAddressTextController
|
emailAdress: _model
|
||||||
.text,
|
.emailAddressTextController
|
||||||
password: _model
|
.text,
|
||||||
.passwordTextController
|
password: _model
|
||||||
.text,
|
.passwordTextController
|
||||||
);
|
.text,
|
||||||
setState(() {});
|
);
|
||||||
} catch (e, s) {
|
setState(
|
||||||
await DialogUtil.errorDefault(context);
|
() {});
|
||||||
LogUtil.requestAPIFailed('login.php', _model.emailAddressTextController.text, "Login", e, s);
|
} catch (e, s) {
|
||||||
}
|
await DialogUtil
|
||||||
},
|
.errorDefault(
|
||||||
|
context);
|
||||||
|
LogUtil.requestAPIFailed(
|
||||||
|
'login.php',
|
||||||
|
_model
|
||||||
|
.emailAddressTextController
|
||||||
|
.text,
|
||||||
|
"Login",
|
||||||
|
e,
|
||||||
|
s);
|
||||||
|
}
|
||||||
|
},
|
||||||
text: FFLocalizations.of(
|
text: FFLocalizations.of(
|
||||||
context)
|
context)
|
||||||
.getText(
|
.getText(
|
||||||
|
@ -773,7 +786,8 @@ class _SignInTemplateComponentWidgetState
|
||||||
const Color(
|
const Color(
|
||||||
0xE81AAB5F),
|
0xE81AAB5F),
|
||||||
),
|
),
|
||||||
showLoadingIndicator: true,
|
showLoadingIndicator:
|
||||||
|
true,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -866,15 +880,20 @@ class _SignInTemplateComponentWidgetState
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
await showModalBottomSheet(
|
await showModalBottomSheet(
|
||||||
isScrollControlled: true,
|
isScrollControlled: true,
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor:
|
||||||
|
Colors.transparent,
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: MediaQuery.viewInsetsOf(context),
|
padding:
|
||||||
child: const ForgotPasswordTemplateComponentWidget(),
|
MediaQuery.viewInsetsOf(
|
||||||
|
context),
|
||||||
|
child:
|
||||||
|
const ForgotPasswordTemplateComponentWidget(),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
).then((value) => safeSetState(() {}));
|
).then(
|
||||||
|
(value) => safeSetState(() {}));
|
||||||
},
|
},
|
||||||
child: RichText(
|
child: RichText(
|
||||||
textScaler: MediaQuery.of(context)
|
textScaler: MediaQuery.of(context)
|
||||||
|
|
|
@ -3,6 +3,7 @@ import 'dart:developer';
|
||||||
|
|
||||||
import 'package:hub/flutter_flow/nav/nav.dart';
|
import 'package:hub/flutter_flow/nav/nav.dart';
|
||||||
import 'package:hub/flutter_flow/nav/serialization_util.dart';
|
import 'package:hub/flutter_flow/nav/serialization_util.dart';
|
||||||
|
import 'package:hub/shared/utils/dialog_util.dart';
|
||||||
|
|
||||||
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';
|
||||||
|
@ -63,7 +64,6 @@ List<dynamic>? findVisitorById(List<dynamic>? jsonList, String? id) {
|
||||||
);
|
);
|
||||||
return foundItem != null ? [foundItem] : null;
|
return foundItem != null ? [foundItem] : null;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log("Error searching item: $e");
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -131,10 +131,10 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
||||||
context.watch<FFAppState>();
|
context.watch<FFAppState>();
|
||||||
|
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 35.0, 0.0, 0.0),
|
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 200.0, 0.0, 0.0),
|
||||||
child: Container(
|
child: Container(
|
||||||
width: double.infinity,
|
width: MediaQuery.of(context).size.width,
|
||||||
height: double.infinity,
|
height: MediaQuery.of(context).size.height,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: FlutterFlowTheme.of(context).primaryBackground,
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
borderRadius: const BorderRadius.only(
|
borderRadius: const BorderRadius.only(
|
||||||
|
@ -264,6 +264,10 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
||||||
focusNode: _model.textFieldFocusNode1,
|
focusNode: _model.textFieldFocusNode1,
|
||||||
autofocus: false,
|
autofocus: false,
|
||||||
obscureText: false,
|
obscureText: false,
|
||||||
|
showCursor: false,
|
||||||
|
enabled: false,
|
||||||
|
cursorColor: FlutterFlowTheme.of(context).primary,
|
||||||
|
readOnly: true,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
labelText: FFLocalizations.of(context).getText(
|
labelText: FFLocalizations.of(context).getText(
|
||||||
'9yu35pzg' /* Encerramento da Visita */,
|
'9yu35pzg' /* Encerramento da Visita */,
|
||||||
|
@ -348,6 +352,10 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
||||||
focusNode: _model.textFieldFocusNode2,
|
focusNode: _model.textFieldFocusNode2,
|
||||||
autofocus: false,
|
autofocus: false,
|
||||||
obscureText: false,
|
obscureText: false,
|
||||||
|
showCursor: false,
|
||||||
|
enabled: false,
|
||||||
|
cursorColor: FlutterFlowTheme.of(context).primary,
|
||||||
|
readOnly: true,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
labelText: FFLocalizations.of(context).getText(
|
labelText: FFLocalizations.of(context).getText(
|
||||||
'aj6scczp' /* Início */,
|
'aj6scczp' /* Início */,
|
||||||
|
@ -436,6 +444,10 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
||||||
focusNode: _model.textFieldFocusNode3,
|
focusNode: _model.textFieldFocusNode3,
|
||||||
autofocus: false,
|
autofocus: false,
|
||||||
obscureText: false,
|
obscureText: false,
|
||||||
|
showCursor: false,
|
||||||
|
enabled: false,
|
||||||
|
cursorColor: FlutterFlowTheme.of(context).primary,
|
||||||
|
readOnly: true,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
labelText: FFLocalizations.of(context).getText(
|
labelText: FFLocalizations.of(context).getText(
|
||||||
'rvi5z7wg' /* Término */,
|
'rvi5z7wg' /* Término */,
|
||||||
|
@ -534,6 +546,10 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
||||||
focusNode: _model.textFieldFocusNode4,
|
focusNode: _model.textFieldFocusNode4,
|
||||||
autofocus: false,
|
autofocus: false,
|
||||||
obscureText: false,
|
obscureText: false,
|
||||||
|
showCursor: false,
|
||||||
|
enabled: false,
|
||||||
|
cursorColor: FlutterFlowTheme.of(context).primary,
|
||||||
|
readOnly: true,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
labelText: FFLocalizations.of(context).getText(
|
labelText: FFLocalizations.of(context).getText(
|
||||||
'yxilg7ek' /* Motivo da Visita */,
|
'yxilg7ek' /* Motivo da Visita */,
|
||||||
|
@ -622,6 +638,10 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
||||||
focusNode: _model.textFieldFocusNode5,
|
focusNode: _model.textFieldFocusNode5,
|
||||||
autofocus: false,
|
autofocus: false,
|
||||||
obscureText: false,
|
obscureText: false,
|
||||||
|
showCursor: false,
|
||||||
|
enabled: false,
|
||||||
|
cursorColor: FlutterFlowTheme.of(context).primary,
|
||||||
|
readOnly: true,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
labelText: FFLocalizations.of(context).getText(
|
labelText: FFLocalizations.of(context).getText(
|
||||||
'dgr3pk3a' /* Nível de Acesso */,
|
'dgr3pk3a' /* Nível de Acesso */,
|
||||||
|
@ -714,6 +734,10 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
||||||
focusNode: _model.textFieldFocusNode6,
|
focusNode: _model.textFieldFocusNode6,
|
||||||
autofocus: false,
|
autofocus: false,
|
||||||
obscureText: false,
|
obscureText: false,
|
||||||
|
showCursor: false,
|
||||||
|
enabled: false,
|
||||||
|
cursorColor: FlutterFlowTheme.of(context).primary,
|
||||||
|
readOnly: true,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
labelText: FFLocalizations.of(context).getText(
|
labelText: FFLocalizations.of(context).getText(
|
||||||
'lppn9rxa' /* Observações da Visita */,
|
'lppn9rxa' /* Observações da Visita */,
|
||||||
|
@ -785,178 +809,150 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Align(
|
Builder(
|
||||||
alignment: const AlignmentDirectional(0.0, 1.0),
|
builder: (context) {
|
||||||
child: Padding(
|
if (widget.visitStatusStr == 'A') {
|
||||||
padding:
|
return Row(
|
||||||
const EdgeInsetsDirectional.fromSTEB(0.0, 6.0, 0.0, 0.0),
|
mainAxisSize: MainAxisSize.max,
|
||||||
child: Container(
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
width: double.infinity,
|
children: [
|
||||||
height: 35.0,
|
FlutterFlowIconButton(
|
||||||
decoration: BoxDecoration(
|
borderRadius: 20.0,
|
||||||
color: widget.visitStatusColor,
|
borderWidth: 1.0,
|
||||||
borderRadius: const BorderRadius.only(
|
buttonSize: 40.0,
|
||||||
bottomLeft: Radius.circular(0.0),
|
// fillColor: widget.visitStatusColor,
|
||||||
bottomRight: Radius.circular(0.0),
|
icon: Icon(
|
||||||
topLeft: Radius.circular(0.0),
|
Icons.block_sharp,
|
||||||
topRight: Radius.circular(0.0),
|
color: FlutterFlowTheme.of(context).error,
|
||||||
),
|
size: 24.0,
|
||||||
),
|
),
|
||||||
child: Builder(
|
onPressed: () async {
|
||||||
builder: (context) {
|
_model.deleteVisit =
|
||||||
if (widget.visitStatusStr == 'A') {
|
await PhpGroup.deleteVisitCall.call(
|
||||||
return Row(
|
devUUID: FFAppState().devUUID,
|
||||||
mainAxisSize: MainAxisSize.max,
|
userUUID: FFAppState().userUUID,
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
cliID: FFAppState().cliUUID,
|
||||||
children: [
|
atividade: 'cancelaVisita',
|
||||||
FlutterFlowIconButton(
|
idVisita: widget.visitIdStr,
|
||||||
borderRadius: 20.0,
|
);
|
||||||
borderWidth: 1.0,
|
|
||||||
buttonSize: 40.0,
|
|
||||||
icon: Icon(
|
|
||||||
Icons.block_sharp,
|
|
||||||
color: FlutterFlowTheme.of(context)
|
|
||||||
.primaryBackground,
|
|
||||||
size: 24.0,
|
|
||||||
),
|
|
||||||
onPressed: () async {
|
|
||||||
_model.deleteVisit =
|
|
||||||
await PhpGroup.deleteVisitCall.call(
|
|
||||||
devUUID: FFAppState().devUUID,
|
|
||||||
userUUID: FFAppState().userUUID,
|
|
||||||
cliID: FFAppState().cliUUID,
|
|
||||||
atividade: 'cancelaVisita',
|
|
||||||
idVisita: widget.visitIdStr,
|
|
||||||
);
|
|
||||||
|
|
||||||
if (PhpGroup.deleteVisitCall.error(
|
if (PhpGroup.deleteVisitCall.error(
|
||||||
(_model.deleteVisit?.jsonBody ?? ''),
|
(_model.deleteVisit?.jsonBody ?? ''),
|
||||||
) ==
|
) ==
|
||||||
false) {
|
false) {
|
||||||
Navigator.pop(context);
|
|
||||||
} else {
|
|
||||||
await showModalBottomSheet(
|
|
||||||
isScrollControlled: true,
|
|
||||||
backgroundColor: Colors.transparent,
|
|
||||||
enableDrag: false,
|
|
||||||
context: context,
|
|
||||||
builder: (context) {
|
|
||||||
return Padding(
|
|
||||||
padding:
|
|
||||||
MediaQuery.viewInsetsOf(context),
|
|
||||||
child: ThrowExceptionWidget(
|
|
||||||
msg: PhpGroup.deleteVisitCall.msg(
|
|
||||||
(_model.deleteVisit?.jsonBody ??
|
|
||||||
''),
|
|
||||||
)!,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
).then((value) => safeSetState(() {}));
|
|
||||||
}
|
|
||||||
|
|
||||||
setState(() {});
|
|
||||||
},
|
|
||||||
),
|
|
||||||
FlutterFlowIconButton(
|
|
||||||
borderColor: Colors.transparent,
|
|
||||||
borderRadius: 20.0,
|
|
||||||
borderWidth: 1.0,
|
|
||||||
buttonSize: 40.0,
|
|
||||||
icon: Icon(
|
|
||||||
Icons.share,
|
|
||||||
color: FlutterFlowTheme.of(context)
|
|
||||||
.primaryBackground,
|
|
||||||
size: 24.0,
|
|
||||||
),
|
|
||||||
onPressed: () {
|
|
||||||
log('IconButton pressed ...');
|
|
||||||
// Implement share functionality here
|
|
||||||
Share.share(
|
|
||||||
'Visita agendada para ${widget.visitStartDate} com término previsto para ${widget.visitEndDate}. Motivo: ${widget.visitReasonStr}. Nível de acesso: ${widget.visitLevelStr}. Observações: ${widget.visitObsStr}.',
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
} else if ((widget.visitStatusStr == 'C') ||
|
|
||||||
(widget.visitStatusStr == 'F') ||
|
|
||||||
(widget.visitStatusStr == 'B') ||
|
|
||||||
(widget.visitStatusStr == 'I')) {
|
|
||||||
return InkWell(
|
|
||||||
splashColor: Colors.transparent,
|
|
||||||
focusColor: Colors.transparent,
|
|
||||||
hoverColor: Colors.transparent,
|
|
||||||
highlightColor: Colors.transparent,
|
|
||||||
onTap: () async {
|
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
|
} else {
|
||||||
|
final error =
|
||||||
|
await DialogUtil.errorDefault(context);
|
||||||
|
await showModalBottomSheet(
|
||||||
|
isScrollControlled: true,
|
||||||
|
backgroundColor: Colors.transparent,
|
||||||
|
enableDrag: false,
|
||||||
|
context: context,
|
||||||
|
builder: (context) {
|
||||||
|
return Padding(
|
||||||
|
padding: MediaQuery.viewInsetsOf(context),
|
||||||
|
child: error,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
).then((value) => safeSetState(() {}));
|
||||||
|
}
|
||||||
|
|
||||||
context.pushNamed(
|
setState(() {});
|
||||||
'scheduleCompleteVisitPage',
|
},
|
||||||
queryParameters: {
|
),
|
||||||
'visitStartDateStr': serializeParam(
|
FlutterFlowIconButton(
|
||||||
dateTimeFormat(
|
borderColor: Colors.transparent,
|
||||||
'd/M/y H:mm:ss',
|
borderRadius: 20.0,
|
||||||
getCurrentTimestamp,
|
borderWidth: 1.0,
|
||||||
locale: FFLocalizations.of(context)
|
buttonSize: 40.0,
|
||||||
.languageCode,
|
icon: Icon(
|
||||||
),
|
Icons.share,
|
||||||
ParamType.String,
|
color: FlutterFlowTheme.of(context).accent1,
|
||||||
),
|
size: 24.0,
|
||||||
'visitEndDateStr': serializeParam(
|
),
|
||||||
'',
|
onPressed: () {
|
||||||
ParamType.String,
|
// Implement share functionality here
|
||||||
),
|
Share.share(
|
||||||
'visitReasonStr': serializeParam(
|
'Visita agendada para ${widget.visitStartDate} com término previsto para ${widget.visitEndDate}. Motivo: ${widget.visitReasonStr}. Nível de acesso: ${widget.visitLevelStr}. Observações: ${widget.visitObsStr}.',
|
||||||
widget.visitReasonStr,
|
);
|
||||||
ParamType.String,
|
},
|
||||||
),
|
),
|
||||||
'visitLevelStr': serializeParam(
|
],
|
||||||
widget.visitLevelStr,
|
);
|
||||||
ParamType.String,
|
} else if ((widget.visitStatusStr == 'C') ||
|
||||||
),
|
(widget.visitStatusStr == 'F') ||
|
||||||
'visitTempBol': serializeParam(
|
(widget.visitStatusStr == 'B') ||
|
||||||
widget.visitTempStr == 'Sim' ? true : false,
|
(widget.visitStatusStr == 'I')) {
|
||||||
ParamType.bool,
|
return InkWell(
|
||||||
),
|
splashColor: Colors.transparent,
|
||||||
'visitObsStr': serializeParam(
|
focusColor: Colors.transparent,
|
||||||
widget.visitObsStr,
|
hoverColor: Colors.transparent,
|
||||||
ParamType.String,
|
highlightColor: Colors.transparent,
|
||||||
),
|
onTap: () async {
|
||||||
'visitorStrList': serializeParam(
|
Navigator.pop(context);
|
||||||
widget.visitorStrList,
|
|
||||||
ParamType.String,
|
context.pushNamed(
|
||||||
),
|
'scheduleCompleteVisitPage',
|
||||||
'visitorJsonList': serializeParam(
|
queryParameters: {
|
||||||
filteredVisitorJsonList,
|
'visitStartDateStr': serializeParam(
|
||||||
ParamType.JSON,
|
dateTimeFormat(
|
||||||
isList: true,
|
'd/M/y H:mm:ss',
|
||||||
),
|
getCurrentTimestamp,
|
||||||
}.withoutNulls,
|
locale: FFLocalizations.of(context).languageCode,
|
||||||
);
|
),
|
||||||
},
|
ParamType.String,
|
||||||
child: Icon(
|
|
||||||
Icons.repeat,
|
|
||||||
color: FlutterFlowTheme.of(context).secondaryText,
|
|
||||||
size: 24.0,
|
|
||||||
),
|
),
|
||||||
);
|
'visitEndDateStr': serializeParam(
|
||||||
} else {
|
'',
|
||||||
return Container(
|
ParamType.String,
|
||||||
width: 100.0,
|
|
||||||
height: 100.0,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: FlutterFlowTheme.of(context)
|
|
||||||
.secondaryBackground,
|
|
||||||
),
|
),
|
||||||
);
|
'visitReasonStr': serializeParam(
|
||||||
}
|
widget.visitReasonStr,
|
||||||
|
ParamType.String,
|
||||||
|
),
|
||||||
|
'visitLevelStr': serializeParam(
|
||||||
|
widget.visitLevelStr,
|
||||||
|
ParamType.String,
|
||||||
|
),
|
||||||
|
'visitTempBol': serializeParam(
|
||||||
|
widget.visitTempStr == 'Sim' ? true : false,
|
||||||
|
ParamType.bool,
|
||||||
|
),
|
||||||
|
'visitObsStr': serializeParam(
|
||||||
|
widget.visitObsStr,
|
||||||
|
ParamType.String,
|
||||||
|
),
|
||||||
|
'visitorStrList': serializeParam(
|
||||||
|
widget.visitorStrList,
|
||||||
|
ParamType.String,
|
||||||
|
),
|
||||||
|
'visitorJsonList': serializeParam(
|
||||||
|
filteredVisitorJsonList,
|
||||||
|
ParamType.JSON,
|
||||||
|
isList: true,
|
||||||
|
),
|
||||||
|
}.withoutNulls,
|
||||||
|
);
|
||||||
},
|
},
|
||||||
),
|
child: Icon(
|
||||||
),
|
Icons.repeat,
|
||||||
),
|
color: widget.visitStatusColor,
|
||||||
|
size: 24.0,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return Container(
|
||||||
|
width: 100.0,
|
||||||
|
height: 100.0,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
),
|
),
|
||||||
],
|
].addToEnd(const SizedBox(height: 5.0)),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import 'dart:developer';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:hub/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart';
|
import 'package:hub/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart';
|
||||||
import 'package:hub/components/templates_components/view_visit_detail/view_visit_detail_widget.dart';
|
import 'package:hub/components/templates_components/view_visit_detail/view_visit_detail_widget.dart';
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
import 'dart:developer';
|
||||||
|
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
import 'package:hub/backend/api_requests/api_calls.dart';
|
import 'package:hub/backend/api_requests/api_calls.dart';
|
||||||
import 'package:hub/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart';
|
import 'package:hub/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart';
|
||||||
import 'package:hub/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart';
|
import 'package:hub/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart';
|
||||||
|
@ -34,7 +37,7 @@ class _VisitorSearchModalTemplateComponentWidgetState
|
||||||
late VisitorSearchModalTemplateComponentModel _model;
|
late VisitorSearchModalTemplateComponentModel _model;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void setState(VoidCallback callback) {
|
safeSetState(VoidCallback callback) {
|
||||||
super.setState(callback);
|
super.setState(callback);
|
||||||
_model.onUpdate();
|
_model.onUpdate();
|
||||||
}
|
}
|
||||||
|
@ -84,51 +87,8 @@ class _VisitorSearchModalTemplateComponentWidgetState
|
||||||
controller: _model.textController,
|
controller: _model.textController,
|
||||||
focusNode: _model.textFieldFocusNode,
|
focusNode: _model.textFieldFocusNode,
|
||||||
onFieldSubmitted: (_) async {
|
onFieldSubmitted: (_) async {
|
||||||
setState(() {
|
await addVisitor(context);
|
||||||
_model.textController?.text = _model.textController.text;
|
safeSetState(() {});
|
||||||
_model.textController?.selection = TextSelection.collapsed(
|
|
||||||
offset: _model.textController!.text.length);
|
|
||||||
});
|
|
||||||
_model.getVisitorByDoc =
|
|
||||||
await PhpGroup.getVisitorByDocCall.call(
|
|
||||||
devUUID: FFAppState().devUUID,
|
|
||||||
userUUID: FFAppState().userUUID,
|
|
||||||
cliID: FFAppState().cliUUID,
|
|
||||||
atividade: 'getVisitante',
|
|
||||||
documento: _model.textController.text,
|
|
||||||
);
|
|
||||||
|
|
||||||
if (PhpGroup.getVisitorByDocCall.vistanteId(
|
|
||||||
(_model.getVisitorByDoc?.jsonBody ?? ''),
|
|
||||||
) !=
|
|
||||||
'0') {
|
|
||||||
_model.addToVisitors(PhpGroup.getVisitorByDocCall.visitante(
|
|
||||||
(_model.getVisitorByDoc?.jsonBody ?? ''),
|
|
||||||
));
|
|
||||||
setState(() {});
|
|
||||||
_model.addToDocs(_model.textController.text);
|
|
||||||
setState(() {});
|
|
||||||
} else {
|
|
||||||
await showAdaptiveDialog(
|
|
||||||
useSafeArea: true,
|
|
||||||
context: context,
|
|
||||||
builder: (context) {
|
|
||||||
return Dialog(
|
|
||||||
child: Padding(
|
|
||||||
padding: MediaQuery.viewInsetsOf(context),
|
|
||||||
child: Container(
|
|
||||||
color: Colors.transparent,
|
|
||||||
// width: MediaQuery.of(context).size.height * 0.1,
|
|
||||||
// height:
|
|
||||||
// MediaQuery.of(context).size.height * 0.4,
|
|
||||||
child: const VisitorNotFoundComponentWidget()),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
).then((value) => safeSetState(() {}));
|
|
||||||
}
|
|
||||||
|
|
||||||
setState(() {});
|
|
||||||
},
|
},
|
||||||
autofocus: false,
|
autofocus: false,
|
||||||
textInputAction: TextInputAction.done,
|
textInputAction: TextInputAction.done,
|
||||||
|
@ -146,9 +106,6 @@ class _VisitorSearchModalTemplateComponentWidgetState
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||||
FlutterFlowTheme.of(context).labelMediumFamily),
|
FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
),
|
),
|
||||||
hintText: FFLocalizations.of(context).getText(
|
|
||||||
'8i1qszba' /* test */,
|
|
||||||
),
|
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color: FlutterFlowTheme.of(context).accent1,
|
color: FlutterFlowTheme.of(context).accent1,
|
||||||
|
@ -212,6 +169,9 @@ class _VisitorSearchModalTemplateComponentWidgetState
|
||||||
),
|
),
|
||||||
keyboardType: TextInputType.number,
|
keyboardType: TextInputType.number,
|
||||||
validator: _model.textControllerValidator.asValidator(context),
|
validator: _model.textControllerValidator.asValidator(context),
|
||||||
|
inputFormatters: [
|
||||||
|
FilteringTextInputFormatter.allow(RegExp('[0-9]')),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (_model.visitors.isNotEmpty && _model.visitors.length > 0)
|
if (_model.visitors.isNotEmpty && _model.visitors.length > 0)
|
||||||
|
@ -307,7 +267,7 @@ class _VisitorSearchModalTemplateComponentWidgetState
|
||||||
// ),
|
// ),
|
||||||
// );
|
// );
|
||||||
// },
|
// },
|
||||||
// ).then((value) => safeSetState(() {}));
|
// ).then((value) => safeSetState(() {}));
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
width: 100.0,
|
width: 100.0,
|
||||||
|
@ -396,7 +356,7 @@ class _VisitorSearchModalTemplateComponentWidgetState
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
_model.removeFromVisitors(
|
_model.removeFromVisitors(
|
||||||
visitorItem);
|
visitorItem);
|
||||||
setState(() {});
|
safeSetState(() {});
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
@ -427,19 +387,24 @@ class _VisitorSearchModalTemplateComponentWidgetState
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
children: [
|
children: [
|
||||||
FFButtonWidget(
|
FFButtonWidget(
|
||||||
onPressed: () async {
|
onPressed: MediaQuery.of(context).viewInsets.bottom > 0
|
||||||
await widget.getVisitors?.call(
|
? () async {
|
||||||
_model.visitors,
|
await addVisitor(context);
|
||||||
);
|
|
||||||
await widget.getDocs?.call(
|
safeSetState(() {});
|
||||||
_model.docs,
|
}
|
||||||
);
|
: () async {
|
||||||
Navigator.pop(context);
|
await sendVisitors(context);
|
||||||
},
|
},
|
||||||
text: FFLocalizations.of(context).getVariableText(
|
text: MediaQuery.of(context).viewInsets.bottom > 0
|
||||||
enText: 'Add',
|
? FFLocalizations.of(context).getVariableText(
|
||||||
ptText: 'Adicionar',
|
enText: 'Add',
|
||||||
),
|
ptText: 'Adicionar',
|
||||||
|
)
|
||||||
|
: FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'Submit',
|
||||||
|
ptText: 'Enviar',
|
||||||
|
),
|
||||||
options: FFButtonOptions(
|
options: FFButtonOptions(
|
||||||
width: MediaQuery.of(context).size.width * 0.3,
|
width: MediaQuery.of(context).size.width * 0.3,
|
||||||
height: MediaQuery.of(context).size.width * 0.1,
|
height: MediaQuery.of(context).size.width * 0.1,
|
||||||
|
@ -472,11 +437,70 @@ class _VisitorSearchModalTemplateComponentWidgetState
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
height: 10.0,
|
height: 20.0,
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> sendVisitors(BuildContext context) async {
|
||||||
|
await widget.getVisitors?.call(
|
||||||
|
_model.visitors,
|
||||||
|
);
|
||||||
|
await widget.getDocs?.call(
|
||||||
|
_model.docs,
|
||||||
|
);
|
||||||
|
Navigator.pop(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> addVisitor(BuildContext context) async {
|
||||||
|
safeSetState(() {
|
||||||
|
_model.textController?.text = _model.textController.text;
|
||||||
|
_model.textController?.selection =
|
||||||
|
TextSelection.collapsed(offset: _model.textController!.text.length);
|
||||||
|
});
|
||||||
|
_model.getVisitorByDoc = await PhpGroup.getVisitorByDocCall.call(
|
||||||
|
devUUID: FFAppState().devUUID,
|
||||||
|
userUUID: FFAppState().userUUID,
|
||||||
|
cliID: FFAppState().cliUUID,
|
||||||
|
atividade: 'getVisitante',
|
||||||
|
documento: _model.textController.text,
|
||||||
|
);
|
||||||
|
|
||||||
|
if (PhpGroup.getVisitorByDocCall.vistanteId(
|
||||||
|
(_model.getVisitorByDoc?.jsonBody ?? ''),
|
||||||
|
) !=
|
||||||
|
'0' &&
|
||||||
|
PhpGroup.getVisitorByDocCall
|
||||||
|
.error((_model.getVisitorByDoc?.jsonBody ?? '')) ==
|
||||||
|
false &&
|
||||||
|
PhpGroup.getVisitorByDocCall
|
||||||
|
.vistanteId((_model.getVisitorByDoc?.jsonBody ?? '')) !=
|
||||||
|
null) {
|
||||||
|
_model.addToVisitors(PhpGroup.getVisitorByDocCall.visitante(
|
||||||
|
(_model.getVisitorByDoc?.jsonBody ?? ''),
|
||||||
|
));
|
||||||
|
safeSetState(() {});
|
||||||
|
_model.addToDocs(_model.textController.text);
|
||||||
|
safeSetState(() {});
|
||||||
|
} else {
|
||||||
|
await showAdaptiveDialog(
|
||||||
|
useSafeArea: true,
|
||||||
|
context: context,
|
||||||
|
builder: (context) {
|
||||||
|
return Dialog(
|
||||||
|
child: VisitorNotFoundComponentWidget(
|
||||||
|
doc: _model.textController.text,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
).then((value) => safeSetState(() {
|
||||||
|
if (value != null) {
|
||||||
|
addVisitor(context);
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
|
|
||||||
|
|
||||||
import '/backend/schema/structs/index.dart';
|
import '/backend/schema/structs/index.dart';
|
||||||
import 'dart:developer';
|
import 'dart:developer';
|
||||||
import '/backend/schema/enums/enums.dart';
|
import '/backend/schema/enums/enums.dart';
|
||||||
|
@ -12,29 +10,14 @@ import 'package:flutter/material.dart';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
import 'package:device_info_plus/device_info_plus.dart';
|
import 'package:device_info_plus/device_info_plus.dart';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Future<String?> getDevUUID() async {
|
Future<String?> getDevUUID() async {
|
||||||
var deviceInfo = DeviceInfoPlugin();
|
var deviceInfo = DeviceInfoPlugin();
|
||||||
if (Platform.isIOS) {
|
if (Platform.isIOS) {
|
||||||
// import 'dart:io'
|
// import 'dart:io'
|
||||||
var iosDeviceInfo = await deviceInfo.iosInfo;
|
var iosDeviceInfo = await deviceInfo.iosInfo;
|
||||||
log('DeviceInfoPlugin => iosDeviceInfo.utsname.machine: ${iosDeviceInfo.utsname.machine}'); // e.g. "iPod7,1"
|
|
||||||
log('DeviceInfoPlugin => iosDeviceInfo.systemName: ${iosDeviceInfo.systemName}'); // e.g. "iOS"
|
|
||||||
log('DeviceInfoPlugin => iosDeviceInfo.systemVersion: ${iosDeviceInfo.systemVersion}'); // e.g. "13.3"
|
|
||||||
log('DeviceInfoPlugin => iosDeviceInfo.model: ${iosDeviceInfo.model}'); // e.g. "iPhone"
|
|
||||||
log('DeviceInfoPlugin => iosDeviceInfo.localizedModel: ${iosDeviceInfo.localizedModel}'); // e.g. "iPhone"
|
|
||||||
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;
|
||||||
// log('Running on ${androidDeviceInfo.androidId}'); // e.g. "A8E9F7C8-4D1F-4D97-9C3B-3A3D0F0F3E9E"
|
|
||||||
log('DeviceInfoPLugin => androidDeviceInfo.model: ${androidDeviceInfo.model}'); // e.g. "iPhone"
|
|
||||||
log('DeviceInfoPLugin => androidDeviceInfo.manufacturer: ${androidDeviceInfo.manufacturer}'); // e.g. "iPhone"
|
|
||||||
log('DeviceInfoPLugin => androidDeviceInfo.product: ${androidDeviceInfo.product}'); // e.g. "iPhone"
|
|
||||||
log('DeviceInfoPLugin => androidDeviceInfo.device: ${androidDeviceInfo.device}'); // 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,21 +27,9 @@ 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;
|
||||||
log('DeviceInfoPlugin => iosDeviceInfo.utsname.machine: ${iosDeviceInfo.utsname.machine}'); // e.g. "iPod7,1"
|
|
||||||
log('DeviceInfoPlugin => iosDeviceInfo.systemName: ${iosDeviceInfo.systemName}'); // e.g. "iOS"
|
|
||||||
log('DeviceInfoPlugin => iosDeviceInfo.systemVersion: ${iosDeviceInfo.systemVersion}'); // e.g. "13.3"
|
|
||||||
log('DeviceInfoPlugin => iosDeviceInfo.model: ${iosDeviceInfo.model}'); // e.g. "iPhone"
|
|
||||||
log('DeviceInfoPlugin => iosDeviceInfo.localizedModel: ${iosDeviceInfo.localizedModel}'); // e.g. "iPhone"
|
|
||||||
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;
|
||||||
// log('Running on ${androidDeviceInfo.androidId}'); // e.g. "A8E9F7C8-4D1F-4D97-9C3B-3A3D0F0F3E9E"
|
|
||||||
log('DeviceInfoPLugin => androidDeviceInfo.model: ${androidDeviceInfo.model}'); // e.g. "iPhone"
|
|
||||||
log('DeviceInfoPLugin => androidDeviceInfo.manufacturer: ${androidDeviceInfo.manufacturer}'); // e.g. "iPhone"
|
|
||||||
log('DeviceInfoPLugin => androidDeviceInfo.product: ${androidDeviceInfo.product}'); // e.g. "iPhone"
|
|
||||||
log('DeviceInfoPLugin => androidDeviceInfo.device: ${androidDeviceInfo.device}'); // 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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
|
@ -60,7 +60,6 @@
|
||||||
// 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) {
|
||||||
// log('image cropped');
|
|
||||||
// widget.callBackAction!.call(value!);
|
// widget.callBackAction!.call(value!);
|
||||||
// loading = false;
|
// loading = false;
|
||||||
// });
|
// });
|
||||||
|
@ -95,7 +94,6 @@
|
||||||
// setState(() {
|
// setState(() {
|
||||||
// loading = true;
|
// loading = true;
|
||||||
// });
|
// });
|
||||||
// log('Button pressed ...');
|
|
||||||
// _crop_controller.crop();
|
// _crop_controller.crop();
|
||||||
|
|
||||||
// //widget.loading = true;
|
// //widget.loading = true;
|
||||||
|
|
|
@ -5,6 +5,9 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:collection/collection.dart';
|
import 'package:collection/collection.dart';
|
||||||
import 'package:from_css_color/from_css_color.dart';
|
import 'package:from_css_color/from_css_color.dart';
|
||||||
|
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
||||||
|
import 'package:hub/flutter_flow/flutter_flow_widgets.dart';
|
||||||
|
import 'package:hub/flutter_flow/internationalization.dart';
|
||||||
import 'dart:math' show pow, pi, sin;
|
import 'dart:math' show pow, pi, sin;
|
||||||
import 'package:intl/intl.dart';
|
import 'package:intl/intl.dart';
|
||||||
import 'package:json_path/json_path.dart';
|
import 'package:json_path/json_path.dart';
|
||||||
|
@ -505,7 +508,8 @@ void setDarkModeSetting(BuildContext context, ThemeMode themeMode) =>
|
||||||
|
|
||||||
void showSnackbar(
|
void showSnackbar(
|
||||||
BuildContext context,
|
BuildContext context,
|
||||||
String message, {
|
String message,
|
||||||
|
bool error, {
|
||||||
bool loading = false,
|
bool loading = false,
|
||||||
int duration = 4,
|
int duration = 4,
|
||||||
}) {
|
}) {
|
||||||
|
@ -515,24 +519,101 @@ void showSnackbar(
|
||||||
content: Row(
|
content: Row(
|
||||||
children: [
|
children: [
|
||||||
if (loading)
|
if (loading)
|
||||||
const Padding(
|
Padding(
|
||||||
padding: EdgeInsetsDirectional.only(end: 10.0),
|
padding: const EdgeInsetsDirectional.only(end: 10.0),
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
height: 20,
|
height: 20,
|
||||||
width: 20,
|
width: 20,
|
||||||
child: CircularProgressIndicator(
|
child: CircularProgressIndicator(
|
||||||
color: Colors.white,
|
color: FlutterFlowTheme.of(context).info,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Text(message),
|
Text(
|
||||||
|
message,
|
||||||
|
style: TextStyle(
|
||||||
|
color: FlutterFlowTheme.of(context).info,
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
duration: Duration(seconds: duration),
|
duration: Duration(seconds: duration),
|
||||||
|
backgroundColor: error
|
||||||
|
? FlutterFlowTheme.of(context).error
|
||||||
|
: FlutterFlowTheme.of(context).success,
|
||||||
|
behavior: SnackBarBehavior.floating,
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(30),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void showAlertDialog(BuildContext context, String title, String content,
|
||||||
|
Future<void> Function() action) {
|
||||||
|
showDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (context) {
|
||||||
|
return AlertDialog(
|
||||||
|
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
|
title: Text(title),
|
||||||
|
content: Text(content),
|
||||||
|
actions: [
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
|
mainAxisSize: MainAxisSize.max,
|
||||||
|
children: [
|
||||||
|
FFButtonWidget(
|
||||||
|
onPressed: () => Navigator.pop(context),
|
||||||
|
options: FFButtonOptions(
|
||||||
|
width: MediaQuery.of(context).size.width * 0.3,
|
||||||
|
height: MediaQuery.of(context).size.height * 0.05,
|
||||||
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
|
textStyle: TextStyle(
|
||||||
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
|
),
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
|
width: 1,
|
||||||
|
),
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
elevation: 0,
|
||||||
|
),
|
||||||
|
text: FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'No',
|
||||||
|
ptText: 'Não',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
FFButtonWidget(
|
||||||
|
onPressed: () async {
|
||||||
|
action();
|
||||||
|
},
|
||||||
|
options: FFButtonOptions(
|
||||||
|
width: MediaQuery.of(context).size.width * 0.3,
|
||||||
|
height: MediaQuery.of(context).size.height * 0.05,
|
||||||
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
|
elevation: 0,
|
||||||
|
textStyle: TextStyle(
|
||||||
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
|
),
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
|
width: 1,
|
||||||
|
),
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
),
|
||||||
|
text: FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'Yes',
|
||||||
|
ptText: 'Sim',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
extension FFStringExt on String {
|
extension FFStringExt on String {
|
||||||
String maybeHandleOverflow({int? maxChars, String replacement = ''}) =>
|
String maybeHandleOverflow({int? maxChars, String replacement = ''}) =>
|
||||||
maxChars != null && length > maxChars
|
maxChars != null && length > maxChars
|
||||||
|
|
|
@ -76,19 +76,18 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) => GoRouter(
|
||||||
FFRoute(
|
FFRoute(
|
||||||
name: 'homePage',
|
name: 'homePage',
|
||||||
path: '/homePage',
|
path: '/homePage',
|
||||||
builder: (context, params) => params.isEmpty
|
builder: (context, params) =>
|
||||||
? const HomePageWidget()
|
params.isEmpty ? const HomePageWidget() : const HomePageWidget(),
|
||||||
: const HomePageWidget(),
|
|
||||||
),
|
),
|
||||||
|
// FFRoute(
|
||||||
|
// name: 'visitHistoryPage',
|
||||||
|
// path: '/visitHistoryPage',
|
||||||
|
// builder: (context, params) => const VisitHistoryPageWidget(),
|
||||||
|
// ),
|
||||||
FFRoute(
|
FFRoute(
|
||||||
name: 'visitHistoryPage',
|
name: 'messageHistoryPage',
|
||||||
path: '/visitHistoryPage',
|
path: '/messageHistoryPage',
|
||||||
builder: (context, params) => const VisitHistoryPageWidget(),
|
builder: (context, params) => const MessageHistoryPageWidget()),
|
||||||
),
|
|
||||||
FFRoute(
|
|
||||||
name: 'messageHistoryPage',
|
|
||||||
path: '/messageHistoryPage',
|
|
||||||
builder: (context, params) => const MessageHistoryPageWidget()),
|
|
||||||
FFRoute(
|
FFRoute(
|
||||||
name: 'registerVisitorPage',
|
name: 'registerVisitorPage',
|
||||||
path: '/registerVisitorPage',
|
path: '/registerVisitorPage',
|
||||||
|
@ -98,38 +97,10 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) => GoRouter(
|
||||||
name: 'scheduleCompleteVisitPage',
|
name: 'scheduleCompleteVisitPage',
|
||||||
path: '/scheduleCompleteVisitPage',
|
path: '/scheduleCompleteVisitPage',
|
||||||
builder: (context, params) => ScheduleCompleteVisitPageWidget(
|
builder: (context, params) => ScheduleCompleteVisitPageWidget(
|
||||||
// get current datatime picker dd/mm/aaaa hh:mm:ss
|
|
||||||
// visitStartDateStr: DateTime.now().toString(),
|
|
||||||
// post 1 day
|
|
||||||
// visitEndDateStr: DateTime.now().add(const Duration(days: 1)).toString(),
|
|
||||||
visitorStrList: params.getParam(
|
visitorStrList: params.getParam(
|
||||||
'visitorStrList',
|
'visitorStrList',
|
||||||
ParamType.String,
|
ParamType.String,
|
||||||
),
|
),
|
||||||
visitStartDateStr: params.getParam(
|
|
||||||
'visitStartDateStr',
|
|
||||||
ParamType.String,
|
|
||||||
),
|
|
||||||
visitEndDateStr: params.getParam(
|
|
||||||
'visitEndDateStr',
|
|
||||||
ParamType.String,
|
|
||||||
),
|
|
||||||
visitReasonStr: params.getParam(
|
|
||||||
'visitReasonStr',
|
|
||||||
ParamType.String,
|
|
||||||
),
|
|
||||||
visitLevelStr: params.getParam(
|
|
||||||
'visitLevelStr',
|
|
||||||
ParamType.String,
|
|
||||||
),
|
|
||||||
visitTempBol: params.getParam(
|
|
||||||
'visitTempBol',
|
|
||||||
ParamType.bool,
|
|
||||||
),
|
|
||||||
visitObsStr: params.getParam(
|
|
||||||
'visitObsStr',
|
|
||||||
ParamType.String,
|
|
||||||
),
|
|
||||||
visitorJsonList: params.getParam<dynamic>(
|
visitorJsonList: params.getParam<dynamic>(
|
||||||
'visitorJsonList',
|
'visitorJsonList',
|
||||||
ParamType.JSON,
|
ParamType.JSON,
|
||||||
|
@ -148,9 +119,12 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) => GoRouter(
|
||||||
path: '/fastPassPage',
|
path: '/fastPassPage',
|
||||||
builder: (context, params) => /*const*/ FastPassPageWidget(),
|
builder: (context, params) => /*const*/ FastPassPageWidget(),
|
||||||
),
|
),
|
||||||
FFRoute(name: 'preferencesSettings', path: '/preferencesSettings', builder: (context, params) => const PreferencesPageWidget(
|
FFRoute(
|
||||||
key: Key('preferencesSettings'),
|
name: 'preferencesSettings',
|
||||||
)),
|
path: '/preferencesSettings',
|
||||||
|
builder: (context, params) => const PreferencesPageWidget(
|
||||||
|
key: Key('preferencesSettings'),
|
||||||
|
)),
|
||||||
FFRoute(
|
FFRoute(
|
||||||
name: 'peopleOnThePropertyPage',
|
name: 'peopleOnThePropertyPage',
|
||||||
path: '/peopleOnThePropertyPage',
|
path: '/peopleOnThePropertyPage',
|
||||||
|
@ -397,4 +371,4 @@ extension GoRouterLocationExtension on GoRouter {
|
||||||
: routerDelegate.currentConfiguration;
|
: routerDelegate.currentConfiguration;
|
||||||
return matchList.uri.toString();
|
return matchList.uri.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,6 @@ import '../../flutter_flow/lat_lng.dart';
|
||||||
import '../../flutter_flow/place.dart';
|
import '../../flutter_flow/place.dart';
|
||||||
import '../../flutter_flow/uploaded_file.dart';
|
import '../../flutter_flow/uploaded_file.dart';
|
||||||
|
|
||||||
|
|
||||||
/// SERIALIZATION HELPERS
|
/// SERIALIZATION HELPERS
|
||||||
|
|
||||||
String dateTimeRangeToString(DateTimeRange dateTimeRange) {
|
String dateTimeRangeToString(DateTimeRange dateTimeRange) {
|
||||||
|
@ -85,7 +84,6 @@ String? serializeParam(
|
||||||
}
|
}
|
||||||
return data;
|
return data;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('Error serializing parameter: $e');
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -226,7 +224,6 @@ dynamic deserializeParam<T>(
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('Error deserializing parameter: $e');
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@ import 'package:video_player/video_player.dart';
|
||||||
import 'flutter_flow_theme.dart';
|
import 'flutter_flow_theme.dart';
|
||||||
import 'flutter_flow_util.dart';
|
import 'flutter_flow_util.dart';
|
||||||
|
|
||||||
const allowedFormats = {'image/png', 'image/jpeg', 'video/mp4', 'image/gif'};
|
const allowedFormats = {'image/png', 'image/jpeg'};
|
||||||
|
|
||||||
class SelectedFile {
|
class SelectedFile {
|
||||||
const SelectedFile({
|
const SelectedFile({
|
||||||
|
|
|
@ -20,17 +20,16 @@ void main() async {
|
||||||
DeviceOrientation.portraitUp,
|
DeviceOrientation.portraitUp,
|
||||||
DeviceOrientation.portraitDown,
|
DeviceOrientation.portraitDown,
|
||||||
]);
|
]);
|
||||||
await initializeApp();
|
await init();
|
||||||
runApp(ChangeNotifierProvider(
|
runApp(ChangeNotifierProvider(
|
||||||
create: (context) => FFAppState(),
|
create: (context) => FFAppState(),
|
||||||
child: const MyApp(),
|
child: const MyApp(),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> initializeApp() async {
|
Future<void> init() async {
|
||||||
await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);
|
await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);
|
||||||
FlutterError.onError = FirebaseCrashlytics.instance.recordFlutterError;
|
FlutterError.onError = FirebaseCrashlytics.instance.recordFlutterError;
|
||||||
|
|
||||||
await FlutterFlowTheme.initialize();
|
await FlutterFlowTheme.initialize();
|
||||||
await FFLocalizations.initialize();
|
await FFLocalizations.initialize();
|
||||||
final appState = FFAppState();
|
final appState = FFAppState();
|
||||||
|
|
|
@ -354,10 +354,8 @@ class _AcessHistoryPageWidgetState extends State<AcessHistoryPageWidget> {
|
||||||
Widget _accessHistoryCardMoleculeWidget(
|
Widget _accessHistoryCardMoleculeWidget(
|
||||||
BuildContext context, dynamic accessHistoryItem) {
|
BuildContext context, dynamic accessHistoryItem) {
|
||||||
return CardItemTemplateComponentWidget(
|
return CardItemTemplateComponentWidget(
|
||||||
imageHashMap: Map<String, String>.from({
|
imagePath:
|
||||||
'key': accessHistoryItem['PES_ID'] ?? '',
|
'https://freaccess.com.br/freaccess/getImage.php?cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${accessHistoryItem['PES_ID'] ?? ''}&tipo=${accessHistoryItem['PES_TIPO'] ?? ''}',
|
||||||
'value': accessHistoryItem['PES_TIPO'] ?? '',
|
|
||||||
}),
|
|
||||||
labelsHashMap: Map<String, String>.from({
|
labelsHashMap: Map<String, String>.from({
|
||||||
'Nome:': accessHistoryItem['PES_NOME'] ?? '',
|
'Nome:': accessHistoryItem['PES_NOME'] ?? '',
|
||||||
'Acesso:': accessHistoryItem['ACE_DATAHORA'] ?? '',
|
'Acesso:': accessHistoryItem['ACE_DATAHORA'] ?? '',
|
||||||
|
|
|
@ -298,9 +298,7 @@ class _HomePageWidgetState extends State<HomePageWidget> {
|
||||||
color: FlutterFlowTheme.of(context).info,
|
color: FlutterFlowTheme.of(context).info,
|
||||||
size: 24.0,
|
size: 24.0,
|
||||||
),
|
),
|
||||||
onPressed: () {
|
onPressed: () {},
|
||||||
log('IconButton pressed ...');
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -545,7 +543,7 @@ class _HomePageWidgetState extends State<HomePageWidget> {
|
||||||
),
|
),
|
||||||
FFButtonWidget(
|
FFButtonWidget(
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
FFAppState().isLogged = false;
|
FFAppState().deleteAll();
|
||||||
setState(() {});
|
setState(() {});
|
||||||
|
|
||||||
context.goNamed(
|
context.goNamed(
|
||||||
|
|
|
@ -12,6 +12,7 @@ import 'package:hub/flutter_flow/custom_functions.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_icon_button.dart';
|
import 'package:hub/flutter_flow/flutter_flow_icon_button.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
||||||
|
import 'package:hub/flutter_flow/flutter_flow_widgets.dart';
|
||||||
import 'package:hub/flutter_flow/nav/nav.dart';
|
import 'package:hub/flutter_flow/nav/nav.dart';
|
||||||
|
|
||||||
import 'package:cached_network_image/cached_network_image.dart';
|
import 'package:cached_network_image/cached_network_image.dart';
|
||||||
|
@ -21,7 +22,6 @@ import 'package:google_fonts/google_fonts.dart';
|
||||||
import 'package:hub/pages/liberation_history/liberation_history_model.dart';
|
import 'package:hub/pages/liberation_history/liberation_history_model.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
|
||||||
class LiberationHistoryWidget extends StatefulWidget {
|
class LiberationHistoryWidget extends StatefulWidget {
|
||||||
const LiberationHistoryWidget({super.key});
|
const LiberationHistoryWidget({super.key});
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ class _LiberationHistoryWidgetState extends State<LiberationHistoryWidget> {
|
||||||
|
|
||||||
void onUpdate(BuildContext context) {
|
void onUpdate(BuildContext context) {
|
||||||
_model.clearGetLiberationsCache();
|
_model.clearGetLiberationsCache();
|
||||||
setState(() {});
|
safeSetState(() {});
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -258,11 +258,9 @@ Widget liberationDynamicListView(
|
||||||
.where((item) => jsonToStr(getJsonField(
|
.where((item) => jsonToStr(getJsonField(
|
||||||
item,
|
item,
|
||||||
r'''$.VTE_NOME''',
|
r'''$.VTE_NOME''',
|
||||||
))
|
)).toLowerCase().contains(
|
||||||
.toLowerCase()
|
_model.textController.text.toLowerCase(),
|
||||||
.contains(
|
))
|
||||||
_model.textController.text.toLowerCase(),
|
|
||||||
))
|
|
||||||
.toList()
|
.toList()
|
||||||
: liberationHistory;
|
: liberationHistory;
|
||||||
|
|
||||||
|
@ -300,60 +298,126 @@ Widget liberationDynamicListView(
|
||||||
Widget liberationHistoryItemCard(
|
Widget liberationHistoryItemCard(
|
||||||
BuildContext context, dynamic liberationHistoryItem) {
|
BuildContext context, dynamic liberationHistoryItem) {
|
||||||
return CardItemTemplateComponentWidget(
|
return CardItemTemplateComponentWidget(
|
||||||
imageHashMap: Map<String, String>.from({
|
imagePath:
|
||||||
'key': liberationHistoryItem['VTE_ID'],
|
'https://freaccess.com.br/freaccess/getImage.php?cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${liberationHistoryItem['VTE_ID'] ?? ''}&tipo=E',
|
||||||
'value': 'E',
|
|
||||||
}),
|
|
||||||
labelsHashMap: Map<String, String>.from({
|
labelsHashMap: Map<String, String>.from({
|
||||||
'Nome:': liberationHistoryItem['VTE_NOME'],
|
'Nome:': liberationHistoryItem['VTE_NOME'],
|
||||||
'Data:': liberationHistoryItem['NOT_DTENVIO'],
|
'Data:': liberationHistoryItem['NOT_DTENVIO'],
|
||||||
'Motivo:': liberationHistoryItem['NOT_MOTIVO'],
|
'Motivo:': liberationHistoryItem['NOT_MOTIVO'],
|
||||||
}),
|
}),
|
||||||
statusHashMap: [liberationHistoryItem['NOT_STATUS'] == 'L'
|
statusHashMap: [
|
||||||
? Map<String, Color>.from({
|
liberationHistoryItem['NOT_STATUS'] == 'L'
|
||||||
FFLocalizations.of(context).getVariableText(
|
? Map<String, Color>.from({
|
||||||
ptText: 'Ativo',
|
FFLocalizations.of(context).getVariableText(
|
||||||
enText: 'Active',
|
ptText: 'Finalizado',
|
||||||
): FlutterFlowTheme.of(context).success,
|
enText: 'Finished',
|
||||||
})
|
): FlutterFlowTheme.of(context).success,
|
||||||
: liberationHistoryItem['NOT_STATUS'] == 'B'
|
})
|
||||||
? Map<String, Color>.from({
|
: liberationHistoryItem['NOT_STATUS'] == 'B'
|
||||||
FFLocalizations.of(context).getVariableText(
|
? Map<String, Color>.from({
|
||||||
ptText: 'Bloqueado',
|
FFLocalizations.of(context).getVariableText(
|
||||||
enText: 'Blocked',
|
ptText: 'Bloqueado',
|
||||||
): FlutterFlowTheme.of(context).error,
|
enText: 'Blocked',
|
||||||
})
|
): FlutterFlowTheme.of(context).error,
|
||||||
: Map<String, Color>.from({
|
})
|
||||||
FFLocalizations.of(context).getVariableText(
|
: Map<String, Color>.from({
|
||||||
ptText: 'Pendente',
|
FFLocalizations.of(context).getVariableText(
|
||||||
enText: 'Pending',
|
ptText: 'Ativo',
|
||||||
): FlutterFlowTheme.of(context).warning,
|
enText: 'Active',
|
||||||
})],
|
): FlutterFlowTheme.of(context).warning,
|
||||||
|
})
|
||||||
|
],
|
||||||
onTapCardItemAction: () async {
|
onTapCardItemAction: () async {
|
||||||
showModalBottomSheet(
|
showDialog(
|
||||||
isScrollControlled: true,
|
// isScrollControlled: true,
|
||||||
isDismissible: true,
|
// isDismissible: true,
|
||||||
backgroundColor: Colors.transparent,
|
// backgroundColor: Colors.transparent,
|
||||||
useSafeArea: true,
|
useSafeArea: true,
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
return DetailsComponentWidget(
|
return Dialog(
|
||||||
vteName: liberationHistoryItem['VTE_NOME'],
|
alignment: Alignment.center,
|
||||||
vteReason: liberationHistoryItem['NOT_MOTIVO'],
|
child: DetailsComponentWidget(
|
||||||
vawDate: liberationHistoryItem['NOT_STATUS'] == 'S'
|
// vteName: liberationHistoryItem['VTE_NOME'],
|
||||||
? liberationHistoryItem['NOT_DTENVIO']
|
// vteReason: liberationHistoryItem['NOT_MOTIVO'],
|
||||||
: liberationHistoryItem['NOT_DTRESPOSTA'],
|
// vawDate: liberationHistoryItem['NOT_STATUS'] == 'S'
|
||||||
vawStatus: liberationHistoryItem['NOT_STATUS'],
|
// ? liberationHistoryItem['NOT_DTENVIO']
|
||||||
vteMsg: liberationHistoryItem['NOT_MSGENVIO'],
|
// : liberationHistoryItem['NOT_DTRESPOSTA'],
|
||||||
vteUUID: liberationHistoryItem['VTE_ID'],
|
// vawStatus: liberationHistoryItem['NOT_STATUS'],
|
||||||
cliUUID: FFAppState().cliUUID,
|
// vteMsg: liberationHistoryItem['NOT_MSGENVIO'],
|
||||||
msgUUID: liberationHistoryItem['NOT_ID'],
|
// vteUUID: liberationHistoryItem['VTE_ID'],
|
||||||
vawDestino: liberationHistoryItem['NOT_DESTINO'],
|
// cliUUID: FFAppState().cliUUID,
|
||||||
vawUUID: liberationHistoryItem['NOT_ID'],
|
// msgUUID: liberationHistoryItem['NOT_ID'],
|
||||||
vawName: liberationHistoryItem['NOT_NOME'],
|
// vawDestino: liberationHistoryItem['NOT_DESTINO'],
|
||||||
vawRef: liberationHistoryItem['NOT_ID'],
|
// vawUUID: liberationHistoryItem['NOT_ID'],
|
||||||
changeStatusAction: changeStatusAction,
|
// vawName: liberationHistoryItem['NOT_NOME'],
|
||||||
// vteDocument: liberationHistoryItem['VTE_DOCUMENTO'],
|
// 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'],
|
||||||
|
}),
|
||||||
|
buttons: [
|
||||||
|
if (liberationHistoryItem['NOT_STATUS'] == 'S')
|
||||||
|
FlutterFlowIconButton(
|
||||||
|
icon: const Icon(Icons.done),
|
||||||
|
onPressed: () async {
|
||||||
|
Navigator.pop(context);
|
||||||
|
await answersRequest
|
||||||
|
.call(
|
||||||
|
context,
|
||||||
|
liberationHistoryItem['NOT_ID'].toString(),
|
||||||
|
'L',
|
||||||
|
'Mensagem',
|
||||||
|
liberationHistoryItem['VTE_ID'].toString(),
|
||||||
|
)
|
||||||
|
.then((value) {
|
||||||
|
if (value) {
|
||||||
|
return showSnackbar(
|
||||||
|
context,
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'Successfully resolved visit',
|
||||||
|
ptText: 'Visita resolvida com sucesso'),
|
||||||
|
false);
|
||||||
|
} else {
|
||||||
|
return showSnackbar(
|
||||||
|
context,
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'Error resolving visit',
|
||||||
|
ptText: 'Erro ao resolver visita'),
|
||||||
|
true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
statusHashMap: [
|
||||||
|
liberationHistoryItem['NOT_STATUS'] == 'L'
|
||||||
|
? Map<String, Color>.from({
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText: 'Finalizado',
|
||||||
|
enText: 'Finished',
|
||||||
|
): 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: 'Ativo',
|
||||||
|
enText: 'Active',
|
||||||
|
): FlutterFlowTheme.of(context).warning,
|
||||||
|
})
|
||||||
|
],
|
||||||
|
imagePath:
|
||||||
|
'https://freaccess.com.br/freaccess/getImage.php?cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${liberationHistoryItem['VTE_ID'] ?? ''}&tipo=E',
|
||||||
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
).then((_) {
|
).then((_) {
|
||||||
|
@ -362,9 +426,13 @@ Widget liberationHistoryItemCard(
|
||||||
|
|
||||||
_pushNotificationService.onMessageReceived.listen((received) {
|
_pushNotificationService.onMessageReceived.listen((received) {
|
||||||
if (received.data['click_action'] == 'cancel_request') {
|
if (received.data['click_action'] == 'cancel_request') {
|
||||||
log('Aprovado');
|
|
||||||
_pushNotificationService.dispose();
|
_pushNotificationService.dispose();
|
||||||
snackbar(context, opt: true);
|
showSnackbar(
|
||||||
|
context,
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'Successfully resolved visit',
|
||||||
|
ptText: 'Visita resolvida com sucesso'),
|
||||||
|
false);
|
||||||
context.pushReplacementNamed(
|
context.pushReplacementNamed(
|
||||||
'liberationHistory',
|
'liberationHistory',
|
||||||
extra: <String, dynamic>{
|
extra: <String, dynamic>{
|
||||||
|
@ -380,4 +448,4 @@ Widget liberationHistoryItemCard(
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,7 @@
|
||||||
// import 'dart:js_interop';
|
|
||||||
|
|
||||||
import 'dart:developer';
|
import 'dart:developer';
|
||||||
|
|
||||||
import 'package:hub/app_state.dart';
|
import 'package:hub/app_state.dart';
|
||||||
import 'package:hub/backend/api_requests/api_calls.dart';
|
import 'package:hub/backend/api_requests/api_calls.dart';
|
||||||
import 'package:hub/backend/api_requests/api_manager.dart';
|
|
||||||
|
|
||||||
import 'package:hub/flutter_flow/flutter_flow_icon_button.dart';
|
import 'package:hub/flutter_flow/flutter_flow_icon_button.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
||||||
|
@ -15,6 +12,8 @@ import 'package:hub/pages/message_history_page/message_history_page_model.dart';
|
||||||
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';
|
||||||
|
import 'package:hub/shared/utils/dialog_util.dart';
|
||||||
|
import 'package:hub/shared/utils/log_util.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
class MessageHistoryPageWidget extends StatefulWidget {
|
class MessageHistoryPageWidget extends StatefulWidget {
|
||||||
|
@ -31,16 +30,48 @@ class _MessageHistoryPageWidgetState extends State<MessageHistoryPageWidget>
|
||||||
|
|
||||||
final scaffoldKey = GlobalKey<ScaffoldState>();
|
final scaffoldKey = GlobalKey<ScaffoldState>();
|
||||||
|
|
||||||
|
late ScrollController _scrollController;
|
||||||
|
|
||||||
|
int _pageNumber = 1;
|
||||||
|
final int _pageSize = 10;
|
||||||
|
bool _hasData = false;
|
||||||
|
bool _loading = false;
|
||||||
|
|
||||||
|
String _destinyType = "P";
|
||||||
|
|
||||||
|
late Future<void> _messageFuture;
|
||||||
|
List<dynamic> _messageWrap = [];
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
_model = createModel(context, () => MessageHistoryPageModel());
|
_model = createModel(context, () => MessageHistoryPageModel());
|
||||||
|
|
||||||
_model.tabBarController = TabController(
|
_messageFuture = fetchMessage();
|
||||||
vsync: this,
|
|
||||||
length: 3,
|
_scrollController = ScrollController()
|
||||||
initialIndex: 1,
|
..addListener(() {
|
||||||
)..addListener(() => setState(() {}));
|
if (_scrollController.position.atEdge &&
|
||||||
|
_scrollController.position.pixels != 0) {
|
||||||
|
_loadMore();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
_model.tabBarController =
|
||||||
|
TabController(vsync: this, length: 3, initialIndex: 0)
|
||||||
|
..addListener(() {
|
||||||
|
if (_model.tabBarController?.index == 0) {
|
||||||
|
_destinyType = "P";
|
||||||
|
} else if (_model.tabBarController?.index == 1) {
|
||||||
|
_destinyType = "A";
|
||||||
|
} else {
|
||||||
|
_destinyType = "T";
|
||||||
|
}
|
||||||
|
|
||||||
|
_pageNumber = 1;
|
||||||
|
_messageWrap = [];
|
||||||
|
_messageFuture = fetchMessage();
|
||||||
|
});
|
||||||
|
|
||||||
_model.textController ??= TextEditingController();
|
_model.textController ??= TextEditingController();
|
||||||
_model.textFieldFocusNode ??= FocusNode();
|
_model.textFieldFocusNode ??= FocusNode();
|
||||||
|
@ -49,13 +80,13 @@ class _MessageHistoryPageWidgetState extends State<MessageHistoryPageWidget>
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
_model.dispose();
|
_model.dispose();
|
||||||
|
_scrollController.dispose();
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
void onUpdate(BuildContext context) {
|
void onUpdate(BuildContext context) {
|
||||||
_model.clearGetLiberationsCache();
|
_model.clearGetLiberationsCache();
|
||||||
setState(() {});
|
safeSetState(() {});
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -64,245 +95,302 @@ class _MessageHistoryPageWidgetState extends State<MessageHistoryPageWidget>
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
key: scaffoldKey,
|
key: scaffoldKey,
|
||||||
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
appBar: appBarMessage(context),
|
appBar: _appBar(context),
|
||||||
body: bodyMessage(context, _model),
|
body: _body(context),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
PreferredSizeWidget appBarMessage(BuildContext context) {
|
Future<ApiCallResponse?> fetchMessage() async {
|
||||||
return AppBar(
|
try {
|
||||||
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
setState(() => _loading = true);
|
||||||
automaticallyImplyLeading: false,
|
|
||||||
leading: FlutterFlowIconButton(
|
|
||||||
borderColor: Colors.transparent,
|
|
||||||
borderRadius: 30.0,
|
|
||||||
borderWidth: 1.0,
|
|
||||||
buttonSize: 60.0,
|
|
||||||
icon: Icon(
|
|
||||||
Icons.keyboard_arrow_left,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
|
||||||
size: 30.0,
|
|
||||||
),
|
|
||||||
onPressed: () async {
|
|
||||||
context.pop();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
title: Text(
|
|
||||||
FFLocalizations.of(context).getVariableText(
|
|
||||||
enText: 'Message History',
|
|
||||||
ptText: 'Histórico de Mensagens',
|
|
||||||
),
|
|
||||||
style: FlutterFlowTheme.of(context).headlineMedium.override(
|
|
||||||
fontFamily: 'Nunito',
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
|
||||||
fontSize: 17.0,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
actions: const [],
|
|
||||||
centerTitle: true,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget bodyMessage(BuildContext context, MessageHistoryPageModel _model) {
|
var response = await PhpGroup.getMessagesCall.call(
|
||||||
return SafeArea(
|
|
||||||
top: true,
|
|
||||||
child: Column(
|
|
||||||
mainAxisSize: MainAxisSize.max,
|
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
Align(
|
|
||||||
alignment: const Alignment(0.0, 0),
|
|
||||||
child: TabBar(
|
|
||||||
labelColor: FlutterFlowTheme.of(context).primaryText,
|
|
||||||
unselectedLabelColor: FlutterFlowTheme.of(context).primaryText,
|
|
||||||
labelStyle: FlutterFlowTheme.of(context).titleMedium.override(
|
|
||||||
fontFamily: FlutterFlowTheme.of(context).titleMediumFamily,
|
|
||||||
fontSize: 13.0,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
|
||||||
FlutterFlowTheme.of(context).titleMediumFamily),
|
|
||||||
),
|
|
||||||
unselectedLabelStyle: const TextStyle(),
|
|
||||||
indicatorColor: FlutterFlowTheme.of(context).primary,
|
|
||||||
padding: const EdgeInsets.all(4.0),
|
|
||||||
tabs: [
|
|
||||||
Tab(
|
|
||||||
text: FFLocalizations.of(context).getVariableText(
|
|
||||||
ptText: 'Pessoal',
|
|
||||||
enText: 'Personal',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Tab(
|
|
||||||
text: FFLocalizations.of(context).getVariableText(
|
|
||||||
enText: 'All',
|
|
||||||
ptText: 'Todos',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Tab(
|
|
||||||
text: FFLocalizations.of(context).getVariableText(
|
|
||||||
ptText: 'Global',
|
|
||||||
enText: 'Global',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
controller: _model.tabBarController,
|
|
||||||
onTap: (i) async {
|
|
||||||
[() async {}, () async {}][i]();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Expanded(
|
|
||||||
child: TabBarView(controller: _model.tabBarController, children: [
|
|
||||||
liberationDynamicListView(context, _model, 'P'),
|
|
||||||
liberationDynamicListView(context, _model, 'A'),
|
|
||||||
liberationDynamicListView(context, _model, 'T'),
|
|
||||||
])),
|
|
||||||
].addToStart(const SizedBox(height: 0)),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget liberationDynamicListView(
|
|
||||||
BuildContext context, MessageHistoryPageModel _model, String DestIndex) {
|
|
||||||
return Container(
|
|
||||||
width: double.infinity,
|
|
||||||
height: double.infinity,
|
|
||||||
decoration: const BoxDecoration(),
|
|
||||||
child: FutureBuilder<ApiCallResponse>(
|
|
||||||
future: PhpGroup.getMessagesCall
|
|
||||||
.call(
|
|
||||||
devUUID: FFAppState().devUUID.toString(),
|
devUUID: FFAppState().devUUID.toString(),
|
||||||
userUUID: FFAppState().userUUID.toString(),
|
userUUID: FFAppState().userUUID.toString(),
|
||||||
cliID: FFAppState().cliUUID.toString(),
|
cliID: FFAppState().cliUUID.toString(),
|
||||||
atividade: 'getMensagens',
|
atividade: 'getMensagens',
|
||||||
pageSize: '100',
|
pageSize: _pageSize.toString(),
|
||||||
pageNumber: '1',
|
pageNumber: _pageNumber.toString(),
|
||||||
tipoDestino: DestIndex,
|
tipoDestino: _destinyType,
|
||||||
)
|
);
|
||||||
.catchError((error) {
|
|
||||||
log('Error: ${error.toString()}');
|
|
||||||
return Future.delayed(Duration(seconds: 1), () {
|
|
||||||
return Center(
|
|
||||||
child: Text('Erro ao carregar mensagens'),
|
|
||||||
);
|
|
||||||
});
|
|
||||||
}),
|
|
||||||
builder: (context, snapshot) {
|
|
||||||
if (snapshot.connectionState == ConnectionState.waiting) {
|
|
||||||
return Center(
|
|
||||||
child: SizedBox(
|
|
||||||
width: 50.0,
|
|
||||||
height: 50.0,
|
|
||||||
child: SpinKitCircle(
|
|
||||||
color: FlutterFlowTheme.of(context).primary,
|
|
||||||
size: 50.0,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if (snapshot.hasError == true || snapshot.data == null) {
|
|
||||||
log('Error: ${snapshot.error.toString()}');
|
|
||||||
// log('Error: ${snapshot.data!.jsonBody['mensagens']}');
|
|
||||||
return const Center(
|
|
||||||
child: Text('Erro ao carregar mensagens'),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
final mensagens = snapshot.data!.jsonBody['mensagens'];
|
|
||||||
final totalRows = snapshot.data!.jsonBody['total_rows'];
|
|
||||||
if (totalRows == 0 || mensagens == null || mensagens.isEmpty) {
|
|
||||||
return const Center(
|
|
||||||
child: Text('Nenhuma mensagem encontrada'),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return ListView.builder(
|
|
||||||
itemCount: totalRows,
|
|
||||||
addAutomaticKeepAlives: false,
|
|
||||||
addRepaintBoundaries: true,
|
|
||||||
cacheExtent: 1000.0,
|
|
||||||
itemBuilder: (BuildContext context, int index) {
|
|
||||||
return messageHistoryItem(
|
|
||||||
context,
|
|
||||||
snapshot.data!.jsonBody['mensagens'][index],
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget messageHistoryItem(BuildContext context, dynamic jsonBody) {
|
final List<dynamic> messages = response.jsonBody['mensagens'] ?? [];
|
||||||
log(jsonBody.toString());
|
|
||||||
return Padding(
|
if (messages != null && messages.isNotEmpty) {
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 15),
|
setState(() {
|
||||||
child: Card(
|
_messageWrap.addAll(messages);
|
||||||
child: Container(
|
_hasData = true;
|
||||||
// height: 100,
|
_loading = false;
|
||||||
child: Padding(
|
});
|
||||||
padding: const EdgeInsets.all(8.0),
|
|
||||||
child: Column(
|
return response;
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
}
|
||||||
children: [
|
|
||||||
Row(
|
_showNoMoreDataSnackBar(context);
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
|
setState(() {
|
||||||
|
_hasData = false;
|
||||||
|
_loading = false;
|
||||||
|
});
|
||||||
|
return null;
|
||||||
|
} catch (e, s) {
|
||||||
|
DialogUtil.errorDefault(context);
|
||||||
|
LogUtil.requestAPIFailed(
|
||||||
|
"proccessRequest.php", "", "Consulta de Mensagems", e, s);
|
||||||
|
setState(() {
|
||||||
|
_hasData = false;
|
||||||
|
_loading = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void _loadMore() {
|
||||||
|
if (_hasData == true) {
|
||||||
|
_pageNumber++;
|
||||||
|
_messageFuture = fetchMessage();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
PreferredSizeWidget _appBar(BuildContext context) {
|
||||||
|
return AppBar(
|
||||||
|
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
|
automaticallyImplyLeading: false,
|
||||||
|
leading: FlutterFlowIconButton(
|
||||||
|
borderColor: Colors.transparent,
|
||||||
|
borderRadius: 30.0,
|
||||||
|
borderWidth: 1.0,
|
||||||
|
buttonSize: 60.0,
|
||||||
|
icon: Icon(
|
||||||
|
Icons.keyboard_arrow_left,
|
||||||
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
|
size: 30.0,
|
||||||
|
),
|
||||||
|
onPressed: () async {
|
||||||
|
context.pop();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
title: Text(
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'Message History',
|
||||||
|
ptText: 'Histórico de Mensagens',
|
||||||
|
),
|
||||||
|
style: FlutterFlowTheme.of(context).headlineMedium.override(
|
||||||
|
fontFamily: 'Nunito',
|
||||||
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
|
fontSize: 17.0,
|
||||||
|
letterSpacing: 0.0,
|
||||||
|
useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
actions: const [],
|
||||||
|
centerTitle: true,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _body(BuildContext context) {
|
||||||
|
return SafeArea(
|
||||||
|
top: true,
|
||||||
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.max,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Align(
|
||||||
|
alignment: const Alignment(0.0, 0),
|
||||||
|
child: TabBar(
|
||||||
|
labelColor: FlutterFlowTheme.of(context).primaryText,
|
||||||
|
unselectedLabelColor: FlutterFlowTheme.of(context).primaryText,
|
||||||
|
labelStyle: FlutterFlowTheme.of(context).titleMedium.override(
|
||||||
|
fontFamily: FlutterFlowTheme.of(context).titleMediumFamily,
|
||||||
|
fontSize: 13.0,
|
||||||
|
letterSpacing: 0.0,
|
||||||
|
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||||
|
FlutterFlowTheme.of(context).titleMediumFamily),
|
||||||
|
),
|
||||||
|
unselectedLabelStyle: const TextStyle(),
|
||||||
|
indicatorColor: FlutterFlowTheme.of(context).primary,
|
||||||
|
padding: const EdgeInsets.all(4.0),
|
||||||
|
tabs: [
|
||||||
|
Tab(
|
||||||
|
text: FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText: 'Pessoal',
|
||||||
|
enText: 'Personal',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Tab(
|
||||||
|
text: FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'All',
|
||||||
|
ptText: 'Todos',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Tab(
|
||||||
|
text: FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText: 'Global',
|
||||||
|
enText: 'Global',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
controller: _model.tabBarController,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
if (_hasData == false && _pageNumber <= 1 && _loading == false)
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
mainAxisSize: MainAxisSize.max,
|
||||||
children: [
|
children: [
|
||||||
Row(
|
Center(
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
child: Text(FFLocalizations.of(context).getVariableText(
|
||||||
mainAxisSize: MainAxisSize.max,
|
ptText: "Nenhuma mensagem encontrada!",
|
||||||
children: [
|
enText: "No message found")),
|
||||||
Padding(
|
)
|
||||||
padding: const EdgeInsets.only(left: 15.0),
|
|
||||||
child: Text(
|
|
||||||
jsonBody['MSG_DATE'].toString(),
|
|
||||||
style: TextStyle(
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
fontSize: 10,
|
|
||||||
color: FlutterFlowTheme.of(context).customColor6,
|
|
||||||
overflow: TextOverflow.ellipsis,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 15.0),
|
|
||||||
child: Text(
|
|
||||||
jsonBody['MSG_ORIGEM_DESC'].toString(),
|
|
||||||
style: TextStyle(
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
fontSize: 12,
|
|
||||||
color: FlutterFlowTheme.of(context).primary,
|
|
||||||
),
|
|
||||||
overflow: TextOverflow.fade,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Icon(
|
|
||||||
jsonBody['MSG_DESTINO_TP'] == 'T'
|
|
||||||
? Icons.group
|
|
||||||
: Icons.person,
|
|
||||||
color: FlutterFlowTheme.of(context).primary,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
SizedBox(height: 8),
|
)
|
||||||
Padding(
|
else if (_hasData == true || _pageNumber >= 1)
|
||||||
padding: const EdgeInsets.all(8.0),
|
Expanded(
|
||||||
child: Text(
|
child: FutureBuilder<void>(
|
||||||
jsonBody['MSG_TEXTO'].toString(),
|
future: _messageFuture,
|
||||||
|
builder: (context, snapshot) {
|
||||||
|
return ListView.builder(
|
||||||
|
shrinkWrap: true,
|
||||||
|
physics: const BouncingScrollPhysics(),
|
||||||
|
controller: _scrollController,
|
||||||
|
itemCount: _messageWrap.length,
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
final item = _messageWrap[index];
|
||||||
|
return _item(context, item);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
if (_hasData == true && _loading == true)
|
||||||
|
Container(
|
||||||
|
padding: const EdgeInsets.only(top: 15, bottom: 15),
|
||||||
|
child: Center(
|
||||||
|
child: CircularProgressIndicator(
|
||||||
|
valueColor: AlwaysStoppedAnimation<Color>(
|
||||||
|
FlutterFlowTheme.of(context).primary,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(height: 8),
|
)
|
||||||
],
|
].addToStart(const SizedBox(height: 0)),
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
);
|
||||||
);
|
}
|
||||||
|
|
||||||
|
void _showNoMoreDataSnackBar(BuildContext context) {
|
||||||
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
|
SnackBar(
|
||||||
|
content: Text(
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText: "Não há mais dados.", enText: "No more data."),
|
||||||
|
),
|
||||||
|
duration: const Duration(seconds: 3),
|
||||||
|
backgroundColor: FlutterFlowTheme.of(context).primary,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _item(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(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 15.0),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
mainAxisSize: MainAxisSize.max,
|
||||||
|
children: [
|
||||||
|
Icon(
|
||||||
|
jsonBody['MSG_DESTINO_TP'] == 'T'
|
||||||
|
? Icons.language
|
||||||
|
: jsonBody['MSG_DESTINO_TP'] == 'P'
|
||||||
|
? Icons.person
|
||||||
|
: Icons.home,
|
||||||
|
color: FlutterFlowTheme.of(context).primary,
|
||||||
|
size: 25,
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Text(
|
||||||
|
jsonBody['MSG_ORIGEM_DESC'].toString(),
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
fontSize: 15,
|
||||||
|
color: FlutterFlowTheme.of(context).primary,
|
||||||
|
),
|
||||||
|
overflow: TextOverflow.fade,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
].divide(const SizedBox(width: 10)),
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
mainAxisSize: MainAxisSize.max,
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(left: 5),
|
||||||
|
child: Icon(
|
||||||
|
Icons.history,
|
||||||
|
color:
|
||||||
|
FlutterFlowTheme.of(context).customColor6,
|
||||||
|
size: 15,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Text(
|
||||||
|
jsonBody['MSG_DATE'].toString(),
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
fontSize: 10,
|
||||||
|
color:
|
||||||
|
FlutterFlowTheme.of(context).customColor6,
|
||||||
|
),
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
].divide(const SizedBox(width: 15)),
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
mainAxisSize: MainAxisSize.max,
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(left: 5),
|
||||||
|
child: Icon(
|
||||||
|
Icons.message,
|
||||||
|
color:
|
||||||
|
FlutterFlowTheme.of(context).customColor6,
|
||||||
|
size: 15,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Text(
|
||||||
|
jsonBody['MSG_TEXTO'].toString(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
].divide(const SizedBox(width: 15)),
|
||||||
|
),
|
||||||
|
].divide(const SizedBox(height: 4)),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
].divide(
|
||||||
|
const SizedBox(height: 8),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@ import 'package:hub/components/templates_components/change_passs_qr_code_pass_ke
|
||||||
import 'package:hub/flutter_flow/flutter_flow_icon_button.dart';
|
import 'package:hub/flutter_flow/flutter_flow_icon_button.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
||||||
|
import 'package:hub/flutter_flow/flutter_flow_widgets.dart';
|
||||||
import 'package:hub/flutter_flow/nav/nav.dart';
|
import 'package:hub/flutter_flow/nav/nav.dart';
|
||||||
import 'package:share_plus/share_plus.dart';
|
import 'package:share_plus/share_plus.dart';
|
||||||
|
|
||||||
|
@ -38,202 +39,699 @@ class PreferencesPageModel with ChangeNotifier {
|
||||||
padding: MediaQuery.viewInsetsOf(context),
|
padding: MediaQuery.viewInsetsOf(context),
|
||||||
child: PassKeyTemplateWidget(
|
child: PassKeyTemplateWidget(
|
||||||
toggleActionStatus: (key) async {
|
toggleActionStatus: (key) async {
|
||||||
log(key);
|
|
||||||
FFAppState().fingerprintPass = key;
|
FFAppState().fingerprintPass = key;
|
||||||
FFAppState().fingerprint = true;
|
FFAppState().fingerprint = true;
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
).whenComplete(() => notifyListeners());
|
).then((value) {
|
||||||
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
|
SnackBar(
|
||||||
|
content: Text(
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'Fingerprint changed successfully',
|
||||||
|
ptText: 'Impressão digital alterada com sucesso',
|
||||||
|
),
|
||||||
|
style: TextStyle(color: FlutterFlowTheme.of(context).info)),
|
||||||
|
backgroundColor: FlutterFlowTheme.of(context).success,
|
||||||
|
duration: const Duration(seconds: 3),
|
||||||
|
behavior: SnackBarBehavior.floating,
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(30),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}).catchError((err, stack) {
|
||||||
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
|
SnackBar(
|
||||||
|
content: Text(
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText: 'Erro ao alterar impressão digital',
|
||||||
|
enText: 'Error changing fingerprint',
|
||||||
|
),
|
||||||
|
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());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void enablePerson(BuildContext context) {
|
void enablePerson(BuildContext context) {
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
Share.share(
|
Share.share(
|
||||||
FFAppState().userDevUUID,
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText:
|
||||||
|
'Este é o meu identificador de acesso: ${FFAppState().userDevUUID}',
|
||||||
|
enText: 'This is my access identifier: ${FFAppState().userDevUUID}',
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void toggleNotify(BuildContext context) {
|
void toggleNotify(BuildContext context) {
|
||||||
FFAppState().notify = !FFAppState().notify;
|
showDialog(
|
||||||
PhpGroup.changeNotifica
|
context: context,
|
||||||
.call(
|
builder: (context) {
|
||||||
userUUID: FFAppState().userUUID,
|
return AlertDialog(
|
||||||
devUUID: FFAppState().devUUID,
|
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
cliID: FFAppState().cliUUID,
|
title: Text(
|
||||||
atividade: 'updVisitado',
|
|
||||||
notifica: FFAppState().notify ? 'S' : 'N',
|
|
||||||
)
|
|
||||||
.catchError((err) {
|
|
||||||
log(err.toString());
|
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
|
||||||
SnackBar(
|
|
||||||
content: Text(
|
|
||||||
FFLocalizations.of(context).getVariableText(
|
FFLocalizations.of(context).getVariableText(
|
||||||
enText: 'Error changing notification',
|
enText: FFAppState().notify
|
||||||
ptText: 'Erro ao alterar notificação',
|
? 'Disable Access Notification'
|
||||||
|
: 'Access Notification',
|
||||||
|
ptText: FFAppState().notify
|
||||||
|
? 'Desativar notificação de acesso'
|
||||||
|
: 'Notificação de acesso'),
|
||||||
|
),
|
||||||
|
content: Text(
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText: FFAppState().notify
|
||||||
|
? 'Tem certeza que deseja desativar as suas notificações de acesso?'
|
||||||
|
: 'Tem certeza que deseja receber as suas notificações de acesso?',
|
||||||
|
enText: FFAppState().notify
|
||||||
|
? 'Are you sure you want to disable your access notifications?'
|
||||||
|
: 'Are you sure you want to receive your access notifications?'),
|
||||||
|
),
|
||||||
|
actions: [
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
|
mainAxisSize: MainAxisSize.max,
|
||||||
|
children: [
|
||||||
|
FFButtonWidget(
|
||||||
|
text: FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'No',
|
||||||
|
ptText: 'Não',
|
||||||
|
),
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.pop(context);
|
||||||
|
},
|
||||||
|
options: FFButtonOptions(
|
||||||
|
elevation: 0,
|
||||||
|
width: MediaQuery.of(context).size.width * 0.3,
|
||||||
|
height: MediaQuery.of(context).size.height * 0.05,
|
||||||
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
|
textStyle: TextStyle(
|
||||||
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
|
),
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
|
width: 1,
|
||||||
|
),
|
||||||
|
borderRadius: BorderRadius.circular(10)),
|
||||||
|
),
|
||||||
|
FFButtonWidget(
|
||||||
|
onPressed: () async {
|
||||||
|
try {
|
||||||
|
PhpGroup.changeNotifica
|
||||||
|
.call(
|
||||||
|
userUUID: FFAppState().userUUID,
|
||||||
|
devUUID: FFAppState().devUUID,
|
||||||
|
cliID: FFAppState().cliUUID,
|
||||||
|
atividade: 'updVisitado',
|
||||||
|
notifica: FFAppState().notify ? 'S' : 'N',
|
||||||
|
)
|
||||||
|
.then((value) {
|
||||||
|
if (value.jsonBody['error'] == false) {
|
||||||
|
Navigator.pop(context);
|
||||||
|
|
||||||
|
FFAppState().notify = !FFAppState().notify;
|
||||||
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
|
SnackBar(
|
||||||
|
content: Text(
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText:
|
||||||
|
'Notificação alterada com sucesso',
|
||||||
|
enText:
|
||||||
|
'Notification changed successfully',
|
||||||
|
),
|
||||||
|
style: TextStyle(
|
||||||
|
color:
|
||||||
|
FlutterFlowTheme.of(context).info)),
|
||||||
|
backgroundColor:
|
||||||
|
FlutterFlowTheme.of(context).success,
|
||||||
|
duration: const Duration(seconds: 3),
|
||||||
|
behavior: SnackBarBehavior.floating,
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(30),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
|
SnackBar(
|
||||||
|
content: Text(
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText: 'Erro ao alterar notificação',
|
||||||
|
enText: 'Error changing notification',
|
||||||
|
),
|
||||||
|
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),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}).catchError((err) {
|
||||||
|
Navigator.pop(context);
|
||||||
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
|
SnackBar(
|
||||||
|
content: Text(
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'Error changing notification',
|
||||||
|
ptText: 'Erro ao alterar notificação',
|
||||||
|
),
|
||||||
|
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());
|
||||||
|
} on Exception catch (e) {
|
||||||
|
log(e.toString());
|
||||||
|
Navigator.pop(context);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
text: FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'Yes',
|
||||||
|
ptText: 'Sim',
|
||||||
|
),
|
||||||
|
options: FFButtonOptions(
|
||||||
|
elevation: 0,
|
||||||
|
width: MediaQuery.of(context).size.width * 0.3,
|
||||||
|
height: MediaQuery.of(context).size.height * 0.05,
|
||||||
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
|
textStyle: TextStyle(
|
||||||
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
|
),
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
|
width: 1,
|
||||||
|
),
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
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();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
void localUnlink(BuildContext context) {
|
void localUnlink(BuildContext context) {
|
||||||
PhpGroup.resopndeVinculo
|
showDialog(
|
||||||
.call(
|
context: context,
|
||||||
userUUID: FFAppState().userUUID,
|
builder: (context) {
|
||||||
devUUID: FFAppState().devUUID,
|
return AlertDialog(
|
||||||
cliID: FFAppState().cliUUID,
|
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
tarefa: 'I',
|
title: Text(
|
||||||
)
|
|
||||||
.catchError((err) {
|
|
||||||
log(err.toString());
|
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
|
||||||
SnackBar(
|
|
||||||
content: Text(
|
|
||||||
FFLocalizations.of(context).getVariableText(
|
FFLocalizations.of(context).getVariableText(
|
||||||
enText: 'Error unlinking device',
|
enText: 'Unlink device',
|
||||||
ptText: 'Erro ao desvincular dispositivo',
|
ptText: 'Desvincular dispositivo',
|
||||||
),
|
),
|
||||||
style: TextStyle(color: FlutterFlowTheme.of(context).info)),
|
),
|
||||||
backgroundColor: FlutterFlowTheme.of(context).error,
|
content: Text(
|
||||||
duration: const Duration(seconds: 3),
|
FFLocalizations.of(context).getVariableText(
|
||||||
behavior: SnackBarBehavior.floating,
|
enText: 'Are you sure you want to unlink this device?',
|
||||||
shape: RoundedRectangleBorder(
|
ptText: 'Tem certeza que deseja desvincular este dispositivo?',
|
||||||
borderRadius: BorderRadius.circular(30),
|
),
|
||||||
),
|
),
|
||||||
),
|
actions: [
|
||||||
);
|
Row(
|
||||||
}).then(
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
(value) {
|
mainAxisSize: MainAxisSize.max,
|
||||||
FFAppState().deleteCliUUID();
|
children: [
|
||||||
FFAppState().deleteLocal();
|
FFButtonWidget(
|
||||||
FFAppState().deleteOwnerUUID();
|
text: FFLocalizations.of(context).getVariableText(
|
||||||
Navigator.pop(context);
|
enText: 'Cancel',
|
||||||
},
|
ptText: 'Cancelar',
|
||||||
);
|
),
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.pop(context);
|
||||||
|
},
|
||||||
|
options: FFButtonOptions(
|
||||||
|
width: MediaQuery.of(context).size.width * 0.3,
|
||||||
|
height: MediaQuery.of(context).size.height * 0.05,
|
||||||
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
|
textStyle: TextStyle(
|
||||||
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
|
),
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
|
width: 1,
|
||||||
|
),
|
||||||
|
borderRadius: BorderRadius.circular(10)),
|
||||||
|
),
|
||||||
|
FFButtonWidget(
|
||||||
|
onPressed: () async {
|
||||||
|
try {
|
||||||
|
await PhpGroup.resopndeVinculo
|
||||||
|
.call(
|
||||||
|
userUUID: FFAppState().userUUID,
|
||||||
|
devUUID: FFAppState().devUUID,
|
||||||
|
cliID: FFAppState().cliUUID,
|
||||||
|
tarefa: 'I',
|
||||||
|
)
|
||||||
|
.then((value) {
|
||||||
|
if (value.jsonBody['error'] == false) {
|
||||||
|
FFAppState().deleteCliUUID();
|
||||||
|
FFAppState().deleteLocal();
|
||||||
|
FFAppState().deleteOwnerUUID();
|
||||||
|
Navigator.pop(context);
|
||||||
|
Navigator.pop(context);
|
||||||
|
|
||||||
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
|
SnackBar(
|
||||||
|
content: Text(
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'Device unlinked successfully',
|
||||||
|
ptText:
|
||||||
|
'Dispositivo desvinculado com sucesso',
|
||||||
|
),
|
||||||
|
style: TextStyle(
|
||||||
|
color:
|
||||||
|
FlutterFlowTheme.of(context).info)),
|
||||||
|
backgroundColor:
|
||||||
|
FlutterFlowTheme.of(context).success,
|
||||||
|
duration: const Duration(seconds: 3),
|
||||||
|
behavior: SnackBarBehavior.floating,
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(30),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
// ignore: body_might_complete_normally_catch_error
|
||||||
|
.catchError((err, stack) {
|
||||||
|
Navigator.pop(context);
|
||||||
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
|
SnackBar(
|
||||||
|
content: Text(
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'Error unlinking device',
|
||||||
|
ptText: 'Erro ao desvincular dispositivo',
|
||||||
|
),
|
||||||
|
style: TextStyle(
|
||||||
|
color:
|
||||||
|
FlutterFlowTheme.of(context).info)),
|
||||||
|
backgroundColor:
|
||||||
|
FlutterFlowTheme.of(context).error,
|
||||||
|
duration: const Duration(seconds: 3),
|
||||||
|
behavior: SnackBarBehavior.floating,
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(30),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
notifyListeners();
|
||||||
|
} catch (err, stack) {
|
||||||
|
Navigator.pop(context);
|
||||||
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
|
SnackBar(
|
||||||
|
content: Text(
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'Error unlinking device',
|
||||||
|
ptText: 'Erro ao desvincular dispositivo',
|
||||||
|
),
|
||||||
|
style: TextStyle(
|
||||||
|
color: FlutterFlowTheme.of(context).info)),
|
||||||
|
backgroundColor: FlutterFlowTheme.of(context).error,
|
||||||
|
duration: const Duration(seconds: 3),
|
||||||
|
behavior: SnackBarBehavior.floating,
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(30),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
text: FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'Unlink',
|
||||||
|
ptText: 'Desvincular',
|
||||||
|
),
|
||||||
|
options: FFButtonOptions(
|
||||||
|
width: MediaQuery.of(context).size.width * 0.3,
|
||||||
|
height: MediaQuery.of(context).size.height * 0.05,
|
||||||
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
|
textStyle: TextStyle(
|
||||||
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
|
),
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
|
width: 1,
|
||||||
|
),
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
});
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
void deleteAccount(BuildContext context) {
|
void deleteAccount(BuildContext context) {
|
||||||
FFAppState().deleteAll();
|
showDialog(
|
||||||
FFAppState().isLogged = false;
|
context: context,
|
||||||
context.goNamed(
|
builder: (context) {
|
||||||
'welcomePage',
|
return AlertDialog(
|
||||||
extra: <String, dynamic>{
|
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
kTransitionInfoKey: const TransitionInfo(
|
title: Text(
|
||||||
hasTransition: true,
|
FFLocalizations.of(context).getVariableText(
|
||||||
transitionType: PageTransitionType.scale,
|
enText: 'Delete account',
|
||||||
alignment: Alignment.bottomCenter,
|
ptText: 'Deletar conta',
|
||||||
),
|
),
|
||||||
},
|
),
|
||||||
);
|
content: Text(
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'Are you sure you want to delete your account?',
|
||||||
|
ptText: 'Tem certeza que deseja deletar sua conta?',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
actions: [
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
|
mainAxisSize: MainAxisSize.max,
|
||||||
|
children: [
|
||||||
|
FFButtonWidget(
|
||||||
|
onPressed: () => Navigator.pop(context),
|
||||||
|
options: FFButtonOptions(
|
||||||
|
width: MediaQuery.of(context).size.width * 0.3,
|
||||||
|
height: MediaQuery.of(context).size.height * 0.05,
|
||||||
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
|
textStyle: TextStyle(
|
||||||
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
|
),
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
|
width: 1,
|
||||||
|
),
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
),
|
||||||
|
text: FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'Cancel',
|
||||||
|
ptText: 'Cancelar',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
FFButtonWidget(
|
||||||
|
onPressed: () async {
|
||||||
|
try {
|
||||||
|
await PhpGroup.deleteAccount
|
||||||
|
.call(
|
||||||
|
devUUID: FFAppState().devUUID,
|
||||||
|
userUUID: FFAppState().userUUID,
|
||||||
|
)
|
||||||
|
.then((value) {
|
||||||
|
if (value.jsonBody['error'] == false) {
|
||||||
|
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());
|
||||||
|
Navigator.pop(context);
|
||||||
|
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();
|
||||||
|
} catch (err, stack) {
|
||||||
|
Navigator.pop(context);
|
||||||
|
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),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
options: FFButtonOptions(
|
||||||
|
width: MediaQuery.of(context).size.width * 0.3,
|
||||||
|
height: MediaQuery.of(context).size.height * 0.05,
|
||||||
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
|
textStyle: TextStyle(
|
||||||
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
|
),
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
|
width: 1,
|
||||||
|
),
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
),
|
||||||
|
text: FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'Delete',
|
||||||
|
ptText: 'Deletar',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
});
|
||||||
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> togglePass(BuildContext context) async {
|
Future<void> togglePass(BuildContext context) async {
|
||||||
debugPrint('pass: ${FFAppState().pass}');
|
// if (FFAppState().pass) {
|
||||||
if (FFAppState().pass) {
|
// FFAppState().pass = false;
|
||||||
FFAppState().pass = false;
|
// FFAppState().deleteAccessPass();
|
||||||
FFAppState().deleteAccessPass();
|
// notifyListeners();
|
||||||
notifyListeners();
|
// } else {
|
||||||
} else {
|
await showModalBottomSheet(
|
||||||
await showModalBottomSheet(
|
isScrollControlled: true,
|
||||||
isScrollControlled: true,
|
backgroundColor: Colors.transparent,
|
||||||
backgroundColor: Colors.transparent,
|
useSafeArea: true,
|
||||||
useSafeArea: true,
|
context: context,
|
||||||
context: context,
|
builder: (context) {
|
||||||
builder: (context) {
|
return Padding(
|
||||||
return Padding(
|
padding: MediaQuery.viewInsetsOf(context),
|
||||||
padding: MediaQuery.viewInsetsOf(context),
|
child: PassKeyTemplateWidget(
|
||||||
child: PassKeyTemplateWidget(
|
toggleActionStatus: (key) async {
|
||||||
toggleActionStatus: (key) async {
|
FFAppState().accessPass = key;
|
||||||
FFAppState().accessPass = key;
|
notifyListeners();
|
||||||
notifyListeners();
|
await PhpGroup.changePass
|
||||||
debugPrint('key: $key');
|
.call(
|
||||||
await PhpGroup.changePass
|
userUUID: FFAppState().userUUID,
|
||||||
.call(
|
devUUID: FFAppState().devUUID,
|
||||||
userUUID: FFAppState().userUUID,
|
cliID: FFAppState().cliUUID,
|
||||||
devUUID: FFAppState().devUUID,
|
atividade: 'updVisitado',
|
||||||
cliID: FFAppState().cliUUID,
|
newSenha: FFAppState().accessPass,
|
||||||
atividade: 'updVisitado',
|
)
|
||||||
newSenha: FFAppState().accessPass,
|
.then((value) {
|
||||||
)
|
// var error = jsonDecode(value.jsonBody['error'].toString());
|
||||||
.then((value) {
|
if (jsonDecode(value.jsonBody['error'].toString()) == false) {
|
||||||
FFAppState().pass = true;
|
FFAppState().pass = true;
|
||||||
// var error = jsonDecode(value.jsonBody['error'].toString());
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
// log('${jsonDecode(value.jsonBody['error'].toString())}');
|
SnackBar(
|
||||||
if (jsonDecode(value.jsonBody['error'].toString()) == false) {
|
content: Text(
|
||||||
FFAppState().pass = true;
|
FFLocalizations.of(context).getVariableText(
|
||||||
} else {
|
enText: 'Access password changed successfully',
|
||||||
FFAppState().pass = false;
|
ptText: 'Senha de acesso alterada com sucesso',
|
||||||
}
|
),
|
||||||
}).onError((error, StackTrace) {
|
style: TextStyle(
|
||||||
FFAppState().pass = false;
|
color: FlutterFlowTheme.of(context).info)),
|
||||||
log(error.toString());
|
backgroundColor: FlutterFlowTheme.of(context).success,
|
||||||
log(StackTrace.toString());
|
duration: const Duration(seconds: 3),
|
||||||
}).whenComplete(() => notifyListeners());
|
behavior: SnackBarBehavior.floating,
|
||||||
},
|
shape: RoundedRectangleBorder(
|
||||||
),
|
borderRadius: BorderRadius.circular(30),
|
||||||
);
|
),
|
||||||
},
|
),
|
||||||
);
|
);
|
||||||
}
|
} else {
|
||||||
|
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),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
// FFAppState().pass = false;
|
||||||
|
}
|
||||||
|
}).catchError((error, StackTrace) {
|
||||||
|
// FFAppState().pass = false;
|
||||||
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
|
SnackBar(
|
||||||
|
content: Text(
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText: 'Erro ao alterar senha de acesso',
|
||||||
|
enText: 'Error changing access password',
|
||||||
|
),
|
||||||
|
style: TextStyle(
|
||||||
|
color: FlutterFlowTheme.of(context).info)),
|
||||||
|
backgroundColor: FlutterFlowTheme.of(context).error,
|
||||||
|
duration: const Duration(seconds: 3),
|
||||||
|
behavior: SnackBarBehavior.floating,
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(30),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}).whenComplete(() => notifyListeners());
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> togglePanic(BuildContext context) async {
|
Future<void> togglePanic(BuildContext context) async {
|
||||||
if (FFAppState().panic) {
|
await showModalBottomSheet(
|
||||||
FFAppState().panic = false;
|
isScrollControlled: true,
|
||||||
FFAppState().deletePanicPass();
|
backgroundColor: Colors.transparent,
|
||||||
notifyListeners();
|
useSafeArea: true,
|
||||||
} else {
|
context: context,
|
||||||
await showModalBottomSheet(
|
builder: (context) {
|
||||||
isScrollControlled: true,
|
return Padding(
|
||||||
backgroundColor: Colors.transparent,
|
padding: MediaQuery.viewInsetsOf(context),
|
||||||
useSafeArea: true,
|
child: PassKeyTemplateWidget(
|
||||||
context: context,
|
toggleActionStatus: (key) async {
|
||||||
builder: (context) {
|
FFAppState().panicPass = key;
|
||||||
return Padding(
|
notifyListeners();
|
||||||
padding: MediaQuery.viewInsetsOf(context),
|
await PhpGroup.changePanic
|
||||||
child: PassKeyTemplateWidget(
|
.call(
|
||||||
toggleActionStatus: (key) async {
|
userUUID: FFAppState().userUUID,
|
||||||
FFAppState().panicPass = key;
|
devUUID: FFAppState().devUUID,
|
||||||
notifyListeners();
|
cliID: FFAppState().cliUUID,
|
||||||
await PhpGroup.changePass
|
atividade: 'updVisitado',
|
||||||
.call(
|
newSenhaPanico: FFAppState().panicPass,
|
||||||
userUUID: FFAppState().userUUID,
|
)
|
||||||
devUUID: FFAppState().devUUID,
|
.then((value) {
|
||||||
cliID: FFAppState().cliUUID,
|
FFAppState().panic = true;
|
||||||
atividade: 'updVisitado',
|
if (jsonDecode(value.jsonBody['error'].toString()) == false) {
|
||||||
newSenha: FFAppState().panicPass,
|
|
||||||
)
|
|
||||||
.then((value) {
|
|
||||||
FFAppState().panic = true;
|
FFAppState().panic = true;
|
||||||
if (jsonDecode(value.jsonBody['error'].toString()) == false) {
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
FFAppState().panic = true;
|
SnackBar(
|
||||||
} else {
|
content: Text(
|
||||||
FFAppState().panic = false;
|
FFLocalizations.of(context).getVariableText(
|
||||||
}
|
enText: 'Panic password changed successfully',
|
||||||
}).onError((e, s) {
|
ptText: 'Senha de pânico alterada com sucesso',
|
||||||
FFAppState().panic = false;
|
),
|
||||||
log(e.toString());
|
style: TextStyle(
|
||||||
log(s.toString());
|
color: FlutterFlowTheme.of(context).info)),
|
||||||
}).whenComplete(() => notifyListeners());
|
backgroundColor: FlutterFlowTheme.of(context).success,
|
||||||
},
|
duration: const Duration(seconds: 3),
|
||||||
),
|
behavior: SnackBarBehavior.floating,
|
||||||
);
|
shape: RoundedRectangleBorder(
|
||||||
},
|
borderRadius: BorderRadius.circular(30),
|
||||||
);
|
),
|
||||||
}
|
),
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
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),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
// FFAppState().panic = false;
|
||||||
|
}
|
||||||
|
}).catchError((e, s) {
|
||||||
|
// FFAppState().panic = false;
|
||||||
|
|
||||||
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
|
SnackBar(
|
||||||
|
content: Text(
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText: 'Erro ao alterar senha de pânico',
|
||||||
|
enText: 'Error changing panic password',
|
||||||
|
),
|
||||||
|
style: TextStyle(
|
||||||
|
color: FlutterFlowTheme.of(context).info)),
|
||||||
|
backgroundColor: FlutterFlowTheme.of(context).error,
|
||||||
|
duration: const Duration(seconds: 3),
|
||||||
|
behavior: SnackBarBehavior.floating,
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(30),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}).whenComplete(() => notifyListeners());
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -16,7 +16,6 @@ import 'package:hub/flutter_flow/nav/nav.dart';
|
||||||
import 'package:hub/pages/qr_code_page/qr_code_page_model.dart';
|
import 'package:hub/pages/qr_code_page/qr_code_page_model.dart';
|
||||||
import 'package:percent_indicator/circular_percent_indicator.dart';
|
import 'package:percent_indicator/circular_percent_indicator.dart';
|
||||||
|
|
||||||
|
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
// import 'package:barcode_widget/barcode_widget.dart';
|
// import 'package:barcode_widget/barcode_widget.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
@ -27,81 +26,76 @@ import 'package:google_fonts/google_fonts.dart';
|
||||||
|
|
||||||
import 'package:qr_flutter/qr_flutter.dart';
|
import 'package:qr_flutter/qr_flutter.dart';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class QrCodePageWidget extends StatefulWidget {
|
class QrCodePageWidget extends StatefulWidget {
|
||||||
const QrCodePageWidget({super.key});
|
const QrCodePageWidget({super.key});
|
||||||
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<QrCodePageWidget> createState() => _QrCodePageWidgetState();
|
State<QrCodePageWidget> createState() => _QrCodePageWidgetState();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class _QrCodePageWidgetState extends State<QrCodePageWidget>
|
class _QrCodePageWidgetState extends State<QrCodePageWidget>
|
||||||
with TickerProviderStateMixin {
|
with TickerProviderStateMixin {
|
||||||
late QrCodePageModel _model;
|
late QrCodePageModel _model;
|
||||||
|
|
||||||
|
|
||||||
final scaffoldKey = GlobalKey<ScaffoldState>();
|
final scaffoldKey = GlobalKey<ScaffoldState>();
|
||||||
|
|
||||||
final animationsMap = <String, AnimationInfo>{};
|
final animationsMap = <String, AnimationInfo>{};
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
_model = createModel(context, () => QrCodePageModel());
|
_model = createModel(context, () => QrCodePageModel());
|
||||||
|
|
||||||
// On page load action.
|
// On page load action.
|
||||||
SchedulerBinding.instance.addPostFrameCallback((_) async {
|
SchedulerBinding.instance.addPostFrameCallback((_) async {
|
||||||
if (animationsMap['barcodeOnActionTriggerAnimation'] != null) {
|
if (animationsMap['barcodeOnActionTriggerAnimation'] != null) {
|
||||||
animationsMap['barcodeOnActionTriggerAnimation']!.controller.fling();
|
animationsMap['barcodeOnActionTriggerAnimation']!.controller.fling();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
animationsMap.addAll({
|
animationsMap.addAll({
|
||||||
'barcodeOnActionTriggerAnimation': AnimationInfo(
|
'barcodeOnActionTriggerAnimation': AnimationInfo(
|
||||||
trigger: AnimationTrigger.onActionTrigger,
|
trigger: AnimationTrigger.onActionTrigger,
|
||||||
applyInitialState: true,
|
applyInitialState: true,
|
||||||
effectsBuilder: () => [
|
effectsBuilder: () => [
|
||||||
VisibilityEffect(duration: 1.ms),
|
VisibilityEffect(duration: 1.ms),
|
||||||
BlurEffect(
|
BlurEffect(
|
||||||
curve: Curves.linear,
|
curve: Curves.linear,
|
||||||
delay: 0.0.ms,
|
delay: 0.0.ms,
|
||||||
duration: 600.0.ms,
|
duration: 600.0.ms,
|
||||||
begin: const Offset(0.0, 0.0),
|
begin: const Offset(0.0, 0.0),
|
||||||
end: const Offset(10.0, 10.0),
|
end: const Offset(10.0, 10.0),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
});
|
});
|
||||||
setupAnimations(
|
setupAnimations(
|
||||||
animationsMap.values.where((anim) =>
|
animationsMap.values.where((anim) =>
|
||||||
anim.trigger == AnimationTrigger.onActionTrigger ||
|
anim.trigger == AnimationTrigger.onActionTrigger ||
|
||||||
!anim.applyInitialState),
|
!anim.applyInitialState),
|
||||||
this,
|
this,
|
||||||
);
|
);
|
||||||
|
|
||||||
// // Adicionando um ouvinte de status à animação para reiniciá-la após a conclusão
|
// // Adicionando um ouvinte de status à animação para reiniciá-la após a conclusão
|
||||||
// animationsMap['barcodeOnActionTriggerAnimation']?.controller.addStatusListener((status) {
|
// animationsMap['barcodeOnActionTriggerAnimation']?.controller.addStatusListener((status) {
|
||||||
// if (status == AnimationStatus.completed) {
|
// if (status == AnimationStatus.completed) {
|
||||||
// animationsMap['barcodeOnActionTriggerAnimation']!.controller.reset();
|
// animationsMap['barcodeOnActionTriggerAnimation']!.controller.reset();
|
||||||
// animationsMap['barcodeOnActionTriggerAnimation']!.controller.forward();
|
// animationsMap['barcodeOnActionTriggerAnimation']!.controller.forward();
|
||||||
// }
|
// }
|
||||||
// });
|
// });
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
// Removendo o ouvinte antes de chamar super.dispose para evitar vazamentos de memória
|
// Removendo o ouvinte antes de chamar super.dispose para evitar vazamentos de memória
|
||||||
if (animationsMap['barcodeOnActionTriggerAnimation'] != null) {
|
if (animationsMap['barcodeOnActionTriggerAnimation'] != null) {
|
||||||
animationsMap['barcodeOnActionTriggerAnimation']!.controller.removeStatusListener((status) {});
|
animationsMap['barcodeOnActionTriggerAnimation']!
|
||||||
|
.controller
|
||||||
|
.removeStatusListener((status) {});
|
||||||
|
}
|
||||||
|
|
||||||
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
super.dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
@ -114,46 +108,46 @@ void dispose() {
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget buildBody(BuildContext context) {
|
Widget buildBody(BuildContext context) {
|
||||||
double screenWidth = MediaQuery.of(context).size.width;
|
double screenWidth = MediaQuery.of(context).size.width;
|
||||||
double screenHeight = MediaQuery.of(context).size.height;
|
double screenHeight = MediaQuery.of(context).size.height;
|
||||||
double smallerDimension = screenWidth < screenHeight ? screenWidth : screenHeight;
|
double smallerDimension =
|
||||||
double dimension = smallerDimension * 0.75;
|
screenWidth < screenHeight ? screenWidth : screenHeight;
|
||||||
double totalTimeInSeconds = 100.0;
|
double dimension = smallerDimension * 0.75;
|
||||||
|
double totalTimeInSeconds = 100.0;
|
||||||
return SafeArea(
|
return SafeArea(
|
||||||
// top: true,
|
// top: true,
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
children: [
|
children: [
|
||||||
if (_model.isAccess == true && _model.key != null)
|
if (_model.isAccess == true && _model.key != null)
|
||||||
Text(
|
Text(
|
||||||
FFLocalizations.of(context).getVariableText(
|
FFLocalizations.of(context).getVariableText(
|
||||||
ptText: 'Use esse QR Code para acesso',
|
ptText: 'Use esse QR Code para acesso',
|
||||||
enText: 'Use this QR Code for access',
|
enText: 'Use this QR Code for access',
|
||||||
),
|
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily,
|
|
||||||
fontSize: 20.0,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
Stack(
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
children: [
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
if (_model.isAccess == true && _model.key != null)
|
fontSize: 20.0,
|
||||||
|
letterSpacing: 0.0,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||||
|
FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Stack(
|
||||||
|
children: [
|
||||||
|
if (_model.isAccess == true && _model.key != null)
|
||||||
Align(
|
Align(
|
||||||
alignment: const AlignmentDirectional(0.0, 0.0),
|
alignment: const AlignmentDirectional(0.0, 0.0),
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: () {
|
onTap: () async {
|
||||||
|
safeSetState(() async {
|
||||||
safeSetState(() async {
|
_resetAnimationAndToggleAccess();
|
||||||
_resetAnimationAndToggleAccess();
|
});
|
||||||
FFAppState().fingerprint ? await _showBiometricsAuth(context) : await _showQrCodeBottomSheet(context);
|
FFAppState().fingerprint
|
||||||
});
|
? await _showBiometricsAuth(context)
|
||||||
|
: await _showQrCodeBottomSheet(context);
|
||||||
},
|
},
|
||||||
child: buildQrCode(
|
child: buildQrCode(
|
||||||
dimension: dimension,
|
dimension: dimension,
|
||||||
|
@ -164,260 +158,266 @@ void dispose() {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if(_model.isAccess == false && _model.key == null)
|
if (_model.isAccess == false && _model.key == null)
|
||||||
Align(
|
Align(
|
||||||
alignment: const AlignmentDirectional(0, 0),
|
alignment: const AlignmentDirectional(0, 0),
|
||||||
child: BarcodeWidget(
|
child: BarcodeWidget(
|
||||||
data: 'Barcode',
|
data: 'Barcode',
|
||||||
barcode: Barcode.qrCode(),
|
barcode: Barcode.qrCode(),
|
||||||
|
width: 300.0,
|
||||||
|
height: 200.0,
|
||||||
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
|
backgroundColor: Colors.transparent,
|
||||||
|
errorBuilder: (context, error) => const SizedBox(
|
||||||
width: 300.0,
|
width: 300.0,
|
||||||
height: 200.0,
|
height: 200.0,
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
|
||||||
backgroundColor: Colors.transparent,
|
|
||||||
errorBuilder: (context, error) => const SizedBox(
|
|
||||||
width: 300.0,
|
|
||||||
height: 200.0,
|
|
||||||
),
|
|
||||||
drawText: false,
|
|
||||||
).animateOnActionTrigger(
|
|
||||||
animationsMap['barcodeOnActionTriggerAnimation']!,
|
|
||||||
),
|
),
|
||||||
|
drawText: false,
|
||||||
|
).animateOnActionTrigger(
|
||||||
|
animationsMap['barcodeOnActionTriggerAnimation']!,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
if (_model.isAccess == false && _model.key == null)
|
if (_model.isAccess == false && _model.key == null)
|
||||||
Align(
|
Align(
|
||||||
alignment: const AlignmentDirectional(0.0, 0.0),
|
alignment: const AlignmentDirectional(0.0, 0.0),
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
splashColor: Colors.transparent,
|
splashColor: Colors.transparent,
|
||||||
focusColor: Colors.transparent,
|
focusColor: Colors.transparent,
|
||||||
hoverColor: Colors.transparent,
|
hoverColor: Colors.transparent,
|
||||||
highlightColor: Colors.transparent,
|
highlightColor: Colors.transparent,
|
||||||
onLongPress: () async {
|
onLongPress: () async {
|
||||||
await _model.qrCodeEncoder(
|
await _model.qrCodeEncoder(
|
||||||
context,
|
context,
|
||||||
key: _model.key,
|
key: _model.key,
|
||||||
);
|
);
|
||||||
setState(() {});
|
setState(() {});
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
width: 200.0,
|
width: 200.0,
|
||||||
height: 200.0,
|
height: 200.0,
|
||||||
decoration: const BoxDecoration(),
|
decoration: const BoxDecoration(),
|
||||||
child: Align(
|
child: Align(
|
||||||
alignment: const AlignmentDirectional(0.0, 0.0),
|
alignment: const AlignmentDirectional(0.0, 0.0),
|
||||||
child: FFButtonWidget(
|
child: FFButtonWidget(
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
FFAppState().fingerprint ? await _showBiometricsAuth(context) : await _showQrCodeBottomSheet(context);
|
FFAppState().fingerprint
|
||||||
},
|
? await _showBiometricsAuth(context)
|
||||||
text: FFLocalizations.of(context).getVariableText(
|
: await _showQrCodeBottomSheet(context);
|
||||||
ptText: 'Gerar QR Code',
|
},
|
||||||
enText: 'Generate QR Code',
|
text: FFLocalizations.of(context).getVariableText(
|
||||||
),
|
ptText: 'Gerar QR Code',
|
||||||
options: FFButtonOptions(
|
enText: 'Generate QR Code',
|
||||||
height: 40.0,
|
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
|
||||||
24.0, 0.0, 24.0, 0.0),
|
|
||||||
iconPadding: const EdgeInsetsDirectional.fromSTEB(
|
|
||||||
0.0, 0.0, 0.0, 0.0),
|
|
||||||
color: FlutterFlowTheme.of(context).primary,
|
|
||||||
textStyle: FlutterFlowTheme.of(context)
|
|
||||||
.titleSmall
|
|
||||||
.override(
|
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
|
||||||
.titleSmallFamily,
|
|
||||||
color: Colors.white,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
|
||||||
.containsKey(
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.titleSmallFamily),
|
|
||||||
),
|
|
||||||
elevation: 3.0,
|
|
||||||
borderSide: const BorderSide(
|
|
||||||
color: Colors.transparent,
|
|
||||||
width: 1.0,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
options: FFButtonOptions(
|
||||||
),
|
height: 40.0,
|
||||||
),
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
),
|
24.0, 0.0, 24.0, 0.0),
|
||||||
],
|
iconPadding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
),
|
0.0, 0.0, 0.0, 0.0),
|
||||||
if (_model.isAccess == true && _model.key != null)
|
color: FlutterFlowTheme.of(context).primary,
|
||||||
Container(
|
textStyle: FlutterFlowTheme.of(context)
|
||||||
width: 300.0,
|
.titleSmall
|
||||||
decoration: const BoxDecoration(),
|
.override(
|
||||||
child: Visibility(
|
fontFamily: FlutterFlowTheme.of(context)
|
||||||
visible: _model.isAccess == true,
|
.titleSmallFamily,
|
||||||
child: Text(
|
color: Colors.white,
|
||||||
FFLocalizations.of(context).getVariableText(
|
letterSpacing: 0.0,
|
||||||
ptText: 'Certifique-se de que o QRCode está visivel para o leitor',
|
useGoogleFonts: GoogleFonts.asMap()
|
||||||
enText: 'Make sure the QRCode is visible to the reader',
|
.containsKey(FlutterFlowTheme.of(context)
|
||||||
// '6z6kvmhl' /* Certifique-se de que o QRCode ... */,
|
.titleSmallFamily),
|
||||||
),
|
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
if (_model.isAccess == true && _model.key != null)
|
|
||||||
Container(
|
|
||||||
width: 250.0,
|
|
||||||
height: 80.0,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
borderRadius: BorderRadius.circular(100.0),
|
|
||||||
border: Border.all(
|
|
||||||
color: FlutterFlowTheme.of(context).primary,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
child: Row(
|
|
||||||
mainAxisSize: MainAxisSize.max,
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
|
||||||
10.0, 0.0, 0.0, 0.0),
|
|
||||||
child: Text(
|
|
||||||
FFLocalizations.of(context).getVariableText(
|
|
||||||
ptText: 'Expirando QR code em',
|
|
||||||
enText: 'Expiring QR code in',
|
|
||||||
// 'wkjkxd2e' /* Trocando QR code em */,
|
|
||||||
),
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: FlutterFlowTheme.of(context)
|
|
||||||
.bodyMedium
|
|
||||||
.override(
|
|
||||||
fontFamily: FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
fontWeight: FontWeight.w600,
|
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
|
||||||
.containsKey(FlutterFlowTheme.of(context)
|
|
||||||
.bodyMediumFamily),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Align(
|
|
||||||
alignment: const AlignmentDirectional(0.0, 0.0),
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
|
||||||
0.0, 0.0, 20.0, 0.0),
|
|
||||||
child: StreamBuilder<double>(
|
|
||||||
stream: getProgressValue(),
|
|
||||||
builder: (context, snapshot) {
|
|
||||||
if (snapshot.connectionState == ConnectionState.waiting) {
|
|
||||||
return CircularProgressIndicator();
|
|
||||||
} else if (snapshot.hasError) {
|
|
||||||
return Text('Error: ${snapshot.error}');
|
|
||||||
} else if (!snapshot.hasData) {
|
|
||||||
return Text('No data');
|
|
||||||
} else {
|
|
||||||
final progress = snapshot.data!;
|
|
||||||
return CircularPercentIndicator(
|
|
||||||
percent: progress,
|
|
||||||
restartAnimation: true,
|
|
||||||
reverse: false,
|
|
||||||
radius: 30.0,
|
|
||||||
lineWidth: 7.0,
|
|
||||||
animation: true,
|
|
||||||
animateFromLastPercent: true,
|
|
||||||
onAnimationEnd: () {
|
|
||||||
_resetAnimationAndToggleAccess();
|
|
||||||
},
|
|
||||||
progressColor: FlutterFlowTheme.of(context).primary,
|
|
||||||
backgroundColor: FlutterFlowTheme.of(context).primaryText,
|
|
||||||
center: Text(
|
|
||||||
'${(progress * totalTimeInSeconds / 5).toStringAsFixed(1)}s',
|
|
||||||
style: FlutterFlowTheme.of(context).headlineSmall.override(
|
|
||||||
fontFamily: FlutterFlowTheme.of(context).headlineSmallFamily,
|
|
||||||
fontSize: 14.0,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
|
||||||
FlutterFlowTheme.of(context).headlineSmallFamily),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
startAngle: 20.0,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
|
elevation: 3.0,
|
||||||
|
borderSide: const BorderSide(
|
||||||
|
color: Colors.transparent,
|
||||||
|
width: 1.0,
|
||||||
|
),
|
||||||
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
if (_model.isAccess == true && _model.key != null)
|
||||||
|
Container(
|
||||||
|
width: 300.0,
|
||||||
|
decoration: const BoxDecoration(),
|
||||||
|
child: Visibility(
|
||||||
|
visible: _model.isAccess == true,
|
||||||
|
child: Text(
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText:
|
||||||
|
'Certifique-se de que o QRCode está visivel para o leitor',
|
||||||
|
enText: 'Make sure the QRCode is visible to the reader',
|
||||||
|
// '6z6kvmhl' /* Certifique-se de que o QRCode ... */,
|
||||||
|
),
|
||||||
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
|
fontFamily:
|
||||||
|
FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
|
letterSpacing: 0.0,
|
||||||
|
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||||
|
FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
),
|
if (_model.isAccess == true && _model.key != null)
|
||||||
);
|
Container(
|
||||||
|
width: 250.0,
|
||||||
|
height: 80.0,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(100.0),
|
||||||
|
border: Border.all(
|
||||||
|
color: FlutterFlowTheme.of(context).primary,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
mainAxisSize: MainAxisSize.max,
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
|
10.0, 0.0, 0.0, 0.0),
|
||||||
|
child: Text(
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText: 'Expirando QR code em',
|
||||||
|
enText: 'Expiring QR code in',
|
||||||
|
// 'wkjkxd2e' /* Trocando QR code em */,
|
||||||
|
),
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
|
fontFamily:
|
||||||
|
FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
|
letterSpacing: 0.0,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||||
|
FlutterFlowTheme.of(context)
|
||||||
|
.bodyMediumFamily),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Align(
|
||||||
|
alignment: const AlignmentDirectional(0.0, 0.0),
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
|
0.0, 0.0, 20.0, 0.0),
|
||||||
|
child: StreamBuilder<double>(
|
||||||
|
stream: getProgressValue(),
|
||||||
|
builder: (context, snapshot) {
|
||||||
|
if (snapshot.connectionState ==
|
||||||
|
ConnectionState.waiting) {
|
||||||
|
return CircularProgressIndicator();
|
||||||
|
} else if (snapshot.hasError) {
|
||||||
|
return Text('Error: ${snapshot.error}');
|
||||||
|
} else if (!snapshot.hasData) {
|
||||||
|
return Text('No data');
|
||||||
|
} else {
|
||||||
|
final progress = snapshot.data!;
|
||||||
|
return CircularPercentIndicator(
|
||||||
|
percent: progress,
|
||||||
|
restartAnimation: true,
|
||||||
|
reverse: false,
|
||||||
|
radius: 30.0,
|
||||||
|
lineWidth: 7.0,
|
||||||
|
animation: true,
|
||||||
|
animateFromLastPercent: true,
|
||||||
|
onAnimationEnd: () {
|
||||||
|
_resetAnimationAndToggleAccess();
|
||||||
|
},
|
||||||
|
progressColor:
|
||||||
|
FlutterFlowTheme.of(context).primary,
|
||||||
|
backgroundColor:
|
||||||
|
FlutterFlowTheme.of(context).primaryText,
|
||||||
|
center: Text(
|
||||||
|
'${(progress * totalTimeInSeconds / 5).toStringAsFixed(1)}s',
|
||||||
|
style: FlutterFlowTheme.of(context)
|
||||||
|
.headlineSmall
|
||||||
|
.override(
|
||||||
|
fontFamily: FlutterFlowTheme.of(context)
|
||||||
|
.headlineSmallFamily,
|
||||||
|
fontSize: 14.0,
|
||||||
|
letterSpacing: 0.0,
|
||||||
|
useGoogleFonts: GoogleFonts.asMap()
|
||||||
|
.containsKey(
|
||||||
|
FlutterFlowTheme.of(context)
|
||||||
|
.headlineSmallFamily),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
startAngle: 20.0,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Future<void> _showBiometricsAuth(BuildContext context) async {
|
Future<void> _showBiometricsAuth(BuildContext context) async {
|
||||||
FFAppState().checkBiometrics()
|
FFAppState()
|
||||||
.then((value) => FFAppState().authenticateBiometric()
|
.checkBiometrics()
|
||||||
.then( (value) {
|
.then((value) => FFAppState().authenticateBiometric().then((value) {
|
||||||
safeSetState(() {
|
safeSetState(() {
|
||||||
if (animationsMap['barcodeOnActionTriggerAnimation'] != null) {
|
if (animationsMap['barcodeOnActionTriggerAnimation'] != null) {
|
||||||
animationsMap['barcodeOnActionTriggerAnimation']!.controller.stop();
|
animationsMap['barcodeOnActionTriggerAnimation']!
|
||||||
animationsMap['barcodeOnActionTriggerAnimation']!.controller.reverse();
|
.controller
|
||||||
}
|
.stop();
|
||||||
_model.isAccess = !_model.isAccess;
|
animationsMap['barcodeOnActionTriggerAnimation']!
|
||||||
_model.key = FFAppState().fingerprintPass;
|
.controller
|
||||||
});
|
.reverse();
|
||||||
} ))
|
}
|
||||||
.onError((error, StackTrace) {
|
_model.isAccess = !_model.isAccess;
|
||||||
_showQrCodeBottomSheet(context);
|
_model.key = FFAppState().fingerprintPass;
|
||||||
});
|
});
|
||||||
|
}))
|
||||||
|
.onError((error, StackTrace) {
|
||||||
|
_showQrCodeBottomSheet(context);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _showQrCodeBottomSheet(BuildContext context) async {
|
Future<void> _showQrCodeBottomSheet(BuildContext context) async {
|
||||||
await showModalBottomSheet(
|
await showModalBottomSheet(
|
||||||
isScrollControlled: true,
|
isScrollControlled: true,
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
useSafeArea: true,
|
useSafeArea: true,
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: () => _model
|
onTap: () => _model.unfocusNode.canRequestFocus
|
||||||
.unfocusNode.canRequestFocus
|
? FocusScope.of(context).requestFocus(_model.unfocusNode)
|
||||||
? FocusScope.of(context)
|
|
||||||
.requestFocus(_model.unfocusNode)
|
|
||||||
: FocusScope.of(context).unfocus(),
|
: FocusScope.of(context).unfocus(),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding:
|
padding: MediaQuery.viewInsetsOf(context),
|
||||||
MediaQuery.viewInsetsOf(context),
|
child: QrCodePassKeyTemplateComponentWidget(
|
||||||
child:
|
|
||||||
QrCodePassKeyTemplateComponentWidget(
|
|
||||||
toggleActionStatus: (key) async {
|
toggleActionStatus: (key) async {
|
||||||
log('Key: $key');
|
|
||||||
safeSetState(() {
|
safeSetState(() {
|
||||||
if (animationsMap['barcodeOnActionTriggerAnimation'] != null) {
|
if (animationsMap['barcodeOnActionTriggerAnimation'] !=
|
||||||
animationsMap['barcodeOnActionTriggerAnimation']!.controller.stop();
|
null) {
|
||||||
animationsMap['barcodeOnActionTriggerAnimation']!.controller.reverse();
|
animationsMap['barcodeOnActionTriggerAnimation']!
|
||||||
|
.controller
|
||||||
|
.stop();
|
||||||
|
animationsMap['barcodeOnActionTriggerAnimation']!
|
||||||
|
.controller
|
||||||
|
.reverse();
|
||||||
}
|
}
|
||||||
_model.isAccess = !_model.isAccess;
|
_model.isAccess = !_model.isAccess;
|
||||||
_model.key = key;
|
_model.key = key;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
)
|
).catchError((error) => safeSetState(() {
|
||||||
|
_resetAnimationAndToggleAccess();
|
||||||
.catchError((error) => safeSetState((){
|
|
||||||
log('Error: $error');
|
|
||||||
_resetAnimationAndToggleAccess();
|
|
||||||
}));
|
}));
|
||||||
unawaited(
|
unawaited(
|
||||||
() async {
|
() async {
|
||||||
|
@ -431,50 +431,50 @@ void dispose() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void _resetAnimationAndToggleAccess() {
|
void _resetAnimationAndToggleAccess() {
|
||||||
safeSetState(() {
|
safeSetState(() {
|
||||||
// Reinicia a animação
|
// Reinicia a animação
|
||||||
animationsMap['barcodeOnActionTriggerAnimation']!.controller.reset();
|
animationsMap['barcodeOnActionTriggerAnimation']!.controller.reset();
|
||||||
animationsMap['barcodeOnActionTriggerAnimation']!.controller.forward();
|
animationsMap['barcodeOnActionTriggerAnimation']!.controller.forward();
|
||||||
// Alterna o estado de acesso
|
// Alterna o estado de acesso
|
||||||
_model.isAccess = !_model.isAccess;
|
_model.isAccess = !_model.isAccess;
|
||||||
_model.key = null;
|
_model.key = null;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
AppBar buildAppBar(BuildContext context) {
|
AppBar buildAppBar(BuildContext context) {
|
||||||
return AppBar(
|
return AppBar(
|
||||||
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
automaticallyImplyLeading: false,
|
automaticallyImplyLeading: false,
|
||||||
leading: FlutterFlowIconButton(
|
leading: FlutterFlowIconButton(
|
||||||
borderColor: Colors.transparent,
|
borderColor: Colors.transparent,
|
||||||
borderRadius: 30.0,
|
borderRadius: 30.0,
|
||||||
borderWidth: 1.0,
|
borderWidth: 1.0,
|
||||||
buttonSize: 60.0,
|
buttonSize: 60.0,
|
||||||
icon: Icon(
|
icon: Icon(
|
||||||
Icons.keyboard_arrow_left,
|
Icons.keyboard_arrow_left,
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
size: 30.0,
|
size: 30.0,
|
||||||
),
|
|
||||||
onPressed: () async {
|
|
||||||
context.pop();
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
title: Text(
|
onPressed: () async {
|
||||||
FFLocalizations.of(context).getText(
|
context.pop();
|
||||||
'ku7jqe53' /* QR Code de Acesso */,
|
},
|
||||||
),
|
),
|
||||||
style: FlutterFlowTheme.of(context).headlineMedium.override(
|
title: Text(
|
||||||
fontFamily: FlutterFlowTheme.of(context).headlineMediumFamily,
|
FFLocalizations.of(context).getText(
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
'ku7jqe53' /* QR Code de Acesso */,
|
||||||
fontSize: 16.0,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
|
||||||
FlutterFlowTheme.of(context).headlineMediumFamily),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
actions: const [],
|
style: FlutterFlowTheme.of(context).headlineMedium.override(
|
||||||
centerTitle: true,
|
fontFamily: FlutterFlowTheme.of(context).headlineMediumFamily,
|
||||||
elevation: 0.0,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
);
|
fontSize: 16.0,
|
||||||
|
letterSpacing: 0.0,
|
||||||
|
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||||
|
FlutterFlowTheme.of(context).headlineMediumFamily),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
actions: const [],
|
||||||
|
centerTitle: true,
|
||||||
|
elevation: 0.0,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@ import 'package:hub/backend/api_requests/api_calls.dart';
|
||||||
import 'package:hub/backend/api_requests/api_manager.dart';
|
import 'package:hub/backend/api_requests/api_manager.dart';
|
||||||
|
|
||||||
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
||||||
|
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
||||||
import 'package:hub/flutter_flow/form_field_controller.dart';
|
import 'package:hub/flutter_flow/form_field_controller.dart';
|
||||||
import 'package:hub/flutter_flow/internationalization.dart';
|
import 'package:hub/flutter_flow/internationalization.dart';
|
||||||
import 'package:hub/flutter_flow/request_manager.dart';
|
import 'package:hub/flutter_flow/request_manager.dart';
|
||||||
|
@ -29,6 +30,31 @@ class ScheduleCompleteVisitPageModel
|
||||||
|
|
||||||
/// Local state fields for this page.
|
/// Local state fields for this page.
|
||||||
|
|
||||||
|
String convertDateFormat(String dateStr) {
|
||||||
|
try {
|
||||||
|
// Formato original
|
||||||
|
DateFormat originalFormat = DateFormat('d/M/y H:mm:ss');
|
||||||
|
// Novo formato
|
||||||
|
DateFormat newFormat = DateFormat('y-M-d H:mm:ss');
|
||||||
|
|
||||||
|
// Validate the input string format
|
||||||
|
if (!RegExp(r'^\d{1,2}/\d{1,2}/\d{4} \d{1,2}:\d{2}:\d{2}$')
|
||||||
|
.hasMatch(dateStr)) {
|
||||||
|
return 'Invalid date format';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Converte a string para DateTime
|
||||||
|
DateTime dateTime = originalFormat.parse(dateStr);
|
||||||
|
|
||||||
|
// Converte DateTime para a nova string formatada
|
||||||
|
String formattedDate = newFormat.format(dateTime);
|
||||||
|
return formattedDate;
|
||||||
|
} catch (e) {
|
||||||
|
// Handle the exception by returning an error message or a default value
|
||||||
|
return 'Invalid date format';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
List<dynamic> visitorJsonList = [];
|
List<dynamic> visitorJsonList = [];
|
||||||
void addToVisitorJsonList(dynamic item) => visitorJsonList.add(item);
|
void addToVisitorJsonList(dynamic item) => visitorJsonList.add(item);
|
||||||
void removeFromVisitorJsonList(dynamic item) => visitorJsonList.remove(item);
|
void removeFromVisitorJsonList(dynamic item) => visitorJsonList.remove(item);
|
||||||
|
@ -164,11 +190,21 @@ class ScheduleCompleteVisitPageModel
|
||||||
);
|
);
|
||||||
|
|
||||||
textFieldFocusNode1 = FocusNode();
|
textFieldFocusNode1 = FocusNode();
|
||||||
textController1 = TextEditingController();
|
textController1 = TextEditingController(
|
||||||
|
text: dateTimeFormat(
|
||||||
|
'd/M/y H:mm:ss',
|
||||||
|
DateTime.now().add(const Duration(minutes: 10)),
|
||||||
|
// locale: FFLocalizations.of(context).languageCode,
|
||||||
|
));
|
||||||
textController1Validator = _textController1Validator;
|
textController1Validator = _textController1Validator;
|
||||||
|
|
||||||
textFieldFocusNode2 = FocusNode();
|
textFieldFocusNode2 = FocusNode();
|
||||||
textController2 = TextEditingController();
|
textController2 = TextEditingController(
|
||||||
|
text: dateTimeFormat(
|
||||||
|
'd/M/y H:mm:ss',
|
||||||
|
DateTime.now().add(const Duration(days: 1)),
|
||||||
|
// locale: FFLocalizations.of(context).languageCode,
|
||||||
|
));
|
||||||
textController2Validator = _textController2Validator;
|
textController2Validator = _textController2Validator;
|
||||||
|
|
||||||
textFieldFocusNode3 = FocusNode();
|
textFieldFocusNode3 = FocusNode();
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -53,7 +53,6 @@
|
||||||
// imageHashMap: imageKeyValue,
|
// imageHashMap: imageKeyValue,
|
||||||
// onTapCardItemAction: () async {
|
// onTapCardItemAction: () async {
|
||||||
// // Ação ao tocar no card
|
// // Ação ao tocar no card
|
||||||
// log('Card tapped');
|
|
||||||
// },
|
// },
|
||||||
// );
|
// );
|
||||||
// }),
|
// }),
|
||||||
|
|
|
@ -1,108 +1 @@
|
||||||
|
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:hub/backend/api_requests/api_manager.dart';
|
|
||||||
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
|
||||||
import 'package:hub/flutter_flow/form_field_controller.dart';
|
|
||||||
import 'package:hub/flutter_flow/request_manager.dart';
|
|
||||||
import 'package:hub/pages/visit_history_page/visit_history_page_widget.dart';
|
|
||||||
|
|
||||||
class VisitHistoryPageModel extends FlutterFlowModel<VisitHistoryPageWidget> {
|
|
||||||
final _visitHistoryManager = FutureRequestManager<ApiCallResponse>();
|
|
||||||
Future<ApiCallResponse> visitHistory({
|
|
||||||
String? uniqueQueryKey,
|
|
||||||
bool? overrideCache,
|
|
||||||
required Future<ApiCallResponse> Function() requestFn,
|
|
||||||
}) =>
|
|
||||||
_visitHistoryManager.performRequest(
|
|
||||||
uniqueQueryKey: uniqueQueryKey,
|
|
||||||
overrideCache: overrideCache,
|
|
||||||
requestFn: requestFn,
|
|
||||||
);
|
|
||||||
void clearVisitHistoryCache() => _visitHistoryManager.clear();
|
|
||||||
void clearVisitHistoryCacheKey(String? uniqueKey) =>
|
|
||||||
_visitHistoryManager.clearRequest(uniqueKey);
|
|
||||||
|
|
||||||
/// Local state fields for this page.
|
|
||||||
|
|
||||||
List<dynamic> visitorJsonList = [];
|
|
||||||
void addToVisitorJsonList(dynamic item) => visitorJsonList.add(item);
|
|
||||||
void removeFromVisitorJsonList(dynamic item) => visitorJsonList.remove(item);
|
|
||||||
void removeAtIndexFromVisitorJsonList(int index) =>
|
|
||||||
visitorJsonList.removeAt(index);
|
|
||||||
void insertAtIndexInVisitorJsonList(int index, dynamic item) =>
|
|
||||||
visitorJsonList.insert(index, item);
|
|
||||||
void updateVisitorJsonListAtIndex(int index, Function(dynamic) updateFn) =>
|
|
||||||
visitorJsonList[index] = updateFn(visitorJsonList[index]);
|
|
||||||
|
|
||||||
String visitorStrList = '0';
|
|
||||||
|
|
||||||
/// State fields for stateful widgets in this page.
|
|
||||||
|
|
||||||
final unfocusNode = FocusNode();
|
|
||||||
// State field(s) for TabBar widget.
|
|
||||||
TabController? tabBarController;
|
|
||||||
int get tabBarCurrentIndex =>
|
|
||||||
tabBarController != null ? tabBarController!.index : 0;
|
|
||||||
|
|
||||||
// State field(s) for TextField widget.
|
|
||||||
FocusNode? textFieldFocusNode1;
|
|
||||||
TextEditingController? textController1;
|
|
||||||
String? Function(BuildContext, String?)? textController1Validator;
|
|
||||||
DateTime? datePicked1;
|
|
||||||
// State field(s) for TextField widget.
|
|
||||||
FocusNode? textFieldFocusNode2;
|
|
||||||
TextEditingController? textController2;
|
|
||||||
String? Function(BuildContext, String?)? textController2Validator;
|
|
||||||
DateTime? datePicked2;
|
|
||||||
// State field(s) for DropDown widget.
|
|
||||||
String? dropDownValue1;
|
|
||||||
FormFieldController<String>? dropDownValueController1;
|
|
||||||
// State field(s) for DropDown widget.
|
|
||||||
String? dropDownValue2;
|
|
||||||
FormFieldController<String>? dropDownValueController2;
|
|
||||||
// State field(s) for Switch widget.
|
|
||||||
bool? switchValue;
|
|
||||||
// State field(s) for TextField widget.
|
|
||||||
FocusNode? textFieldFocusNode3;
|
|
||||||
TextEditingController? textController3;
|
|
||||||
String? Function(BuildContext, String?)? textController3Validator;
|
|
||||||
|
|
||||||
@override
|
|
||||||
void initState(BuildContext context) {}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void dispose() {
|
|
||||||
unfocusNode.dispose();
|
|
||||||
tabBarController?.dispose();
|
|
||||||
textFieldFocusNode1?.dispose();
|
|
||||||
textController1?.dispose();
|
|
||||||
|
|
||||||
textFieldFocusNode2?.dispose();
|
|
||||||
textController2?.dispose();
|
|
||||||
|
|
||||||
textFieldFocusNode3?.dispose();
|
|
||||||
textController3?.dispose();
|
|
||||||
|
|
||||||
clearVisitHistoryCache();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Action blocks.
|
|
||||||
Future getVisitorsActionPage(
|
|
||||||
BuildContext context, {
|
|
||||||
List<dynamic>? visitorsJsonList,
|
|
||||||
}) async {
|
|
||||||
visitorJsonList = visitorsJsonList!.toList().cast<dynamic>();
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<bool> toggleCurrentSelectionHeader(
|
|
||||||
BuildContext context, {
|
|
||||||
required bool? toggleIndexValue,
|
|
||||||
}) async {
|
|
||||||
if (toggleIndexValue == true) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,757 +1,199 @@
|
||||||
import 'dart:developer';
|
import 'dart:developer';
|
||||||
|
|
||||||
import 'package:cached_network_image/cached_network_image.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/scheduler.dart';
|
import 'package:hub/actions/actions.dart';
|
||||||
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
import 'package:hub/app_state.dart';
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
|
||||||
import 'package:hub/backend/api_requests/api_calls.dart';
|
import 'package:hub/backend/api_requests/api_calls.dart';
|
||||||
|
import 'package:hub/backend/api_requests/api_manager.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/card_item_template_component/card_item_template_component_widget.dart';
|
||||||
import 'package:hub/flutter_flow/custom_functions.dart';
|
import 'package:hub/components/templates_components/details_component/details_component_action.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_icon_button.dart';
|
|
||||||
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
||||||
import 'package:hub/flutter_flow/nav/nav.dart';
|
import 'package:hub/flutter_flow/internationalization.dart';
|
||||||
|
import 'package:hub/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart';
|
||||||
|
|
||||||
import 'package:hub/pages/visit_history_page/visit_history_page_model.dart';
|
class VisitHistoryWidget extends StatefulWidget {
|
||||||
import 'package:provider/provider.dart';
|
VisitHistoryWidget({
|
||||||
|
Key? key,
|
||||||
|
}) : super(key: key);
|
||||||
class VisitHistoryPageWidget extends StatefulWidget {
|
|
||||||
const VisitHistoryPageWidget({
|
|
||||||
super.key,
|
|
||||||
this.visitorStrList,
|
|
||||||
this.visitStartDateStr,
|
|
||||||
this.visitEndDateStr,
|
|
||||||
this.visitReasonStr,
|
|
||||||
this.visitLevelStr,
|
|
||||||
this.visitTempBol,
|
|
||||||
this.visitObsStr,
|
|
||||||
this.visitorJsonList,
|
|
||||||
});
|
|
||||||
|
|
||||||
final String? visitorStrList;
|
|
||||||
final String? visitStartDateStr;
|
|
||||||
final String? visitEndDateStr;
|
|
||||||
final String? visitReasonStr;
|
|
||||||
final String? visitLevelStr;
|
|
||||||
final bool? visitTempBol;
|
|
||||||
final String? visitObsStr;
|
|
||||||
final List<dynamic>? visitorJsonList;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<VisitHistoryPageWidget> createState() => _VisitHistoryPageWidgetState();
|
_VisitHistoryWidgetState createState() => _VisitHistoryWidgetState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _VisitHistoryPageWidgetState extends State<VisitHistoryPageWidget>
|
class _VisitHistoryWidgetState extends State<VisitHistoryWidget> {
|
||||||
with TickerProviderStateMixin {
|
List<dynamic> visitaWrap = [];
|
||||||
late VisitHistoryPageModel _model;
|
var pageNumber = 1;
|
||||||
int _visitHistoryLoadingIdx = 0;
|
late Future<void> visitFuture;
|
||||||
final int _visitHistoryLoadingCount = 10;
|
|
||||||
List<dynamic> _visitHistoryList = [];
|
|
||||||
ScrollController _visitHistoryController = ScrollController();
|
|
||||||
|
|
||||||
final scaffoldKey = GlobalKey<ScaffoldState>();
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
_model = createModel(context, () => VisitHistoryPageModel());
|
visitFuture = _fetchVisits();
|
||||||
|
}
|
||||||
|
|
||||||
// On page load action.
|
Future<ApiCallResponse?> _fetchVisits() async {
|
||||||
SchedulerBinding.instance.addPostFrameCallback((_) async {
|
try {
|
||||||
if ((widget.visitorStrList != null && widget.visitorStrList != '') &&
|
var response = await ScheduleCompleteVisitPageModel().visitHistory(
|
||||||
((widget.visitorJsonList != null &&
|
requestFn: () => PhpGroup.getVisitsCall.call(
|
||||||
(widget.visitorJsonList)!.isNotEmpty) !=
|
devUUID: FFAppState().devUUID,
|
||||||
null)) {
|
userUUID: FFAppState().userUUID,
|
||||||
_model.visitorJsonList = widget.visitorJsonList!
|
cliID: FFAppState().cliUUID,
|
||||||
.where((e) =>
|
atividade: 'getVisitas',
|
||||||
widget.visitorStrList ==
|
pageSize: 10,
|
||||||
getJsonField(
|
pageNumber: pageNumber,
|
||||||
e,
|
),
|
||||||
r'''$.VTE_DOCUMENTO''',
|
);
|
||||||
).toString().toString())
|
|
||||||
.toList()
|
var newVisits = response.jsonBody['visitas']
|
||||||
.toList()
|
as List<dynamic>?; // Ajuste conforme a estrutura da resposta
|
||||||
.cast<dynamic>();
|
if (newVisits != null && newVisits.isNotEmpty) {
|
||||||
_model.visitorStrList = widget.visitorStrList!;
|
safeSetState(() {
|
||||||
setState(() {});
|
visitaWrap.addAll(newVisits);
|
||||||
|
});
|
||||||
|
return response;
|
||||||
} else {
|
} else {
|
||||||
return;
|
log('No new visits found');
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
});
|
} catch (err) {
|
||||||
|
log('Erro ao carregar mais visitas: $err');
|
||||||
_model.tabBarController = TabController(
|
|
||||||
vsync: this,
|
|
||||||
length: 2,
|
|
||||||
initialIndex: 0,
|
|
||||||
)..addListener(() => setState(() {}));
|
|
||||||
_model.textController1 ??= TextEditingController();
|
|
||||||
_model.textFieldFocusNode1 ??= FocusNode();
|
|
||||||
|
|
||||||
_model.textController2 ??= TextEditingController();
|
|
||||||
_model.textFieldFocusNode2 ??= FocusNode();
|
|
||||||
|
|
||||||
_model.switchValue = true;
|
|
||||||
_model.textController3 ??= TextEditingController();
|
|
||||||
_model.textFieldFocusNode3 ??= FocusNode();
|
|
||||||
}
|
|
||||||
|
|
||||||
void _loadMoreVisitHistory() async {
|
|
||||||
// Simulate fetching data from an API or database
|
|
||||||
Future<List<String>> fetchVisitHistory(int start, int limit) async {
|
|
||||||
// Simulate network delay
|
|
||||||
await Future.delayed(Duration(seconds: 1));
|
|
||||||
// Generate a list of visit history items
|
|
||||||
return List.generate(limit, (index) => "Item ${start + index}");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Calculate the start index for the next batch of items to load
|
|
||||||
final int start = _visitHistoryLoadingIdx * _visitHistoryLoadingCount;
|
|
||||||
// Fetch the next batch of items
|
|
||||||
final List<String> newItems =
|
|
||||||
await fetchVisitHistory(start, _visitHistoryLoadingCount);
|
|
||||||
|
|
||||||
// If new items were fetched, add them to the list and update the index
|
|
||||||
if (newItems.isNotEmpty) {
|
|
||||||
_visitHistoryList.addAll(newItems);
|
|
||||||
_visitHistoryLoadingIdx++;
|
|
||||||
setState(() {});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void_scrollListener() {
|
void _loadMoreVisits() {
|
||||||
if (_visitHistoryController.position.pixels ==
|
pageNumber++;
|
||||||
_visitHistoryController.position.maxScrollExtent) {
|
visitFuture = _fetchVisits();
|
||||||
_loadMoreVisitHistory();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void dispose() {
|
|
||||||
_model.dispose();
|
|
||||||
|
|
||||||
super.dispose();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
context.watch<FFAppState>();
|
return FutureBuilder<void>(
|
||||||
|
future: visitFuture,
|
||||||
|
builder: (context, snapshot) {
|
||||||
|
if (snapshot.connectionState == ConnectionState.waiting &&
|
||||||
|
visitaWrap.isEmpty) {
|
||||||
|
return Center(
|
||||||
|
child: CircularProgressIndicator(
|
||||||
|
valueColor: AlwaysStoppedAnimation<Color>(
|
||||||
|
FlutterFlowTheme.of(context).primary,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
} else if (snapshot.hasError) {
|
||||||
|
return Center(child: Text('Error: ${snapshot.error}'));
|
||||||
|
} else if (visitaWrap.isEmpty) {
|
||||||
|
return Center(
|
||||||
|
child: Text(
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText: 'Nenhum visitante foi encontrado',
|
||||||
|
enText: 'No visitors found',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return GestureDetector(
|
return ListView.builder(
|
||||||
onTap: () => _model.unfocusNode.canRequestFocus
|
itemCount: visitaWrap.length + 1,
|
||||||
? FocusScope.of(context).requestFocus(_model.unfocusNode)
|
shrinkWrap: true,
|
||||||
: FocusScope.of(context).unfocus(),
|
physics: const BouncingScrollPhysics(),
|
||||||
child: Scaffold(
|
itemBuilder: (context, index) {
|
||||||
key: scaffoldKey,
|
if (index == visitaWrap.length) {
|
||||||
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
_loadMoreVisits();
|
||||||
appBar: appBarScheduleCompleteVisit(context),
|
return Center(
|
||||||
body:
|
child: CircularProgressIndicator(
|
||||||
bodyScheduleCompleteVisit(context, _model, setState, safeSetState),
|
valueColor: AlwaysStoppedAnimation<Color>(
|
||||||
),
|
FlutterFlowTheme.of(context).primary,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
final visitaWrapItem = visitaWrap[index];
|
||||||
|
|
||||||
|
return CardItemTemplateComponentWidget(
|
||||||
|
imagePath:
|
||||||
|
'https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${visitaWrapItem['VTE_DOCUMENTO'] ?? ''}&tipo=E',
|
||||||
|
labelsHashMap: {
|
||||||
|
'Nome:': visitaWrapItem['VTE_NOME'] ?? '',
|
||||||
|
'Inicio:': visitaWrapItem['VAW_DTINICIO'] ?? '',
|
||||||
|
'Fim:': visitaWrapItem['VAW_DTFIM'] ?? '',
|
||||||
|
},
|
||||||
|
statusHashMap: [
|
||||||
|
if (getStatus(visitaWrapItem['VAW_STATUS']) == status.active)
|
||||||
|
{
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText: 'Ativo',
|
||||||
|
enText: 'Active',
|
||||||
|
): FlutterFlowTheme.of(context).warning,
|
||||||
|
},
|
||||||
|
if (getStatus(visitaWrapItem['VAW_STATUS']) == status.finished)
|
||||||
|
{
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText: 'Finalizado',
|
||||||
|
enText: 'Finished',
|
||||||
|
): FlutterFlowTheme.of(context).success,
|
||||||
|
},
|
||||||
|
if (getStatus(visitaWrapItem['VAW_STATUS']) == status.unknown)
|
||||||
|
{
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText: 'Desconhecido',
|
||||||
|
enText: 'Unknown',
|
||||||
|
): FlutterFlowTheme.of(context).alternate,
|
||||||
|
},
|
||||||
|
if (getStatus(visitaWrapItem['VAW_STATUS']) == status.canceled)
|
||||||
|
{
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText: 'Cancelado',
|
||||||
|
enText: 'Canceled',
|
||||||
|
): FlutterFlowTheme.of(context).error,
|
||||||
|
},
|
||||||
|
if (getStatus(visitaWrapItem['VAW_STATUS']) == status.blocked)
|
||||||
|
{
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText: 'Bloqueado',
|
||||||
|
enText: 'Blocked',
|
||||||
|
): FlutterFlowTheme.of(context).error,
|
||||||
|
},
|
||||||
|
if (getStatus(visitaWrapItem['VAW_STATUS']) == status.inactive)
|
||||||
|
{
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText: 'Inativo',
|
||||||
|
enText: 'Inactive',
|
||||||
|
): FlutterFlowTheme.of(context).error,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
onTapCardItemAction: () async {
|
||||||
|
await showDialog(
|
||||||
|
useSafeArea: true,
|
||||||
|
context: context,
|
||||||
|
builder: (context) {
|
||||||
|
return Dialog(
|
||||||
|
alignment: Alignment.center,
|
||||||
|
child: buildDetails(
|
||||||
|
visitaWrapItem,
|
||||||
|
context,
|
||||||
|
changeStatusAction,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
).whenComplete(() {
|
||||||
|
// updateVisitFuture();
|
||||||
|
_fetchVisits().then((response) {
|
||||||
|
safeSetState(() {
|
||||||
|
visitaWrap = PhpGroup.getVisitsCall
|
||||||
|
.visitasList(response!.jsonBody)
|
||||||
|
?.toList() ??
|
||||||
|
[];
|
||||||
|
visitFuture = Future.value(response);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}).catchError((err, stack) {});
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PreferredSizeWidget appBarScheduleCompleteVisit(BuildContext context) {
|
|
||||||
return AppBar(
|
|
||||||
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
|
||||||
automaticallyImplyLeading: false,
|
|
||||||
leading: FlutterFlowIconButton(
|
|
||||||
borderColor: Colors.transparent,
|
|
||||||
borderRadius: 30.0,
|
|
||||||
borderWidth: 1.0,
|
|
||||||
buttonSize: 60.0,
|
|
||||||
icon: Icon(
|
|
||||||
Icons.keyboard_arrow_left,
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
|
||||||
size: 30.0,
|
|
||||||
),
|
|
||||||
onPressed: () async {
|
|
||||||
context.pop();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
title: Text(
|
|
||||||
FFLocalizations.of(context).getText(
|
|
||||||
'61lcxdgm' /* Agendar Visita */,
|
|
||||||
),
|
|
||||||
style: FlutterFlowTheme.of(context).headlineMedium.override(
|
|
||||||
fontFamily: 'Nunito',
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
|
||||||
fontSize: 15.0,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
actions: const [],
|
|
||||||
centerTitle: true,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget bodyScheduleCompleteVisit(BuildContext context,
|
|
||||||
VisitHistoryPageModel _model, Function setState, Function safeSetState) {
|
|
||||||
return SafeArea(
|
|
||||||
top: true,
|
|
||||||
child: visitHistory(context, _model, safeSetState),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget visitHistory(
|
|
||||||
BuildContext context,
|
|
||||||
VisitHistoryPageModel _model,
|
|
||||||
Function safeSetState,
|
|
||||||
) {
|
|
||||||
return Container(
|
|
||||||
width: double.infinity,
|
|
||||||
height: 900.0,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
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>(
|
|
||||||
future: _model.visitHistory(
|
|
||||||
requestFn: () => PhpGroup.getVisitsCall.call(
|
|
||||||
devUUID: FFAppState().devUUID,
|
|
||||||
userUUID: FFAppState().userUUID,
|
|
||||||
cliID: FFAppState().cliUUID,
|
|
||||||
atividade: 'getVisitas',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
builder: (context, snapshot) {
|
|
||||||
// Customize what your widget looks like when it's loading.
|
|
||||||
if (!snapshot.hasData) {
|
|
||||||
return Center(
|
|
||||||
child: SizedBox(
|
|
||||||
width: 50.0,
|
|
||||||
height: 50.0,
|
|
||||||
child: SpinKitCircle(
|
|
||||||
color: FlutterFlowTheme.of(context).primary,
|
|
||||||
size: 50.0,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
final wrapGetVisitsResponse = snapshot.data!;
|
|
||||||
return Builder(
|
|
||||||
builder: (context) {
|
|
||||||
final visitaWrap = PhpGroup.getVisitsCall
|
|
||||||
.visitasList(
|
|
||||||
wrapGetVisitsResponse.jsonBody,
|
|
||||||
)
|
|
||||||
?.toList() ??
|
|
||||||
[];
|
|
||||||
return ListView.builder(
|
|
||||||
itemCount: visitaWrap.length,
|
|
||||||
shrinkWrap: true,
|
|
||||||
scrollDirection: Axis.vertical,
|
|
||||||
physics: const BouncingScrollPhysics(),
|
|
||||||
addAutomaticKeepAlives: true,
|
|
||||||
cacheExtent: 1000.0,
|
|
||||||
addRepaintBoundaries: true,
|
|
||||||
addSemanticIndexes: true,
|
|
||||||
itemBuilder: (context, index) {
|
|
||||||
final visitaWrapItem = visitaWrap[index];
|
|
||||||
// visitaWrap.length, (visitaWrapIndex) {
|
|
||||||
|
|
||||||
return InkWell(
|
|
||||||
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)
|
|
||||||
.secondaryBackground,
|
|
||||||
elevation: 5.0,
|
|
||||||
shape: RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
|
||||||
),
|
|
||||||
child: Container(
|
|
||||||
width: 350.0,
|
|
||||||
height: 115.0,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: FlutterFlowTheme.of(context)
|
|
||||||
.secondaryBackground,
|
|
||||||
),
|
|
||||||
child: Row(
|
|
||||||
mainAxisSize: MainAxisSize.max,
|
|
||||||
mainAxisAlignment:
|
|
||||||
MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
child: Container(
|
|
||||||
width: 100.0,
|
|
||||||
height: 100.0,
|
|
||||||
decoration: const BoxDecoration(),
|
|
||||||
child: Column(
|
|
||||||
mainAxisSize: MainAxisSize.max,
|
|
||||||
children: [
|
|
||||||
Row(
|
|
||||||
mainAxisSize: MainAxisSize.max,
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
FFLocalizations.of(context)
|
|
||||||
.getText(
|
|
||||||
'i46frqyi' /* Visitante: */,
|
|
||||||
),
|
|
||||||
style:
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.bodyMedium
|
|
||||||
.override(
|
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(
|
|
||||||
context)
|
|
||||||
.bodyMediumFamily,
|
|
||||||
fontSize: 12.5,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
fontWeight:
|
|
||||||
FontWeight.bold,
|
|
||||||
useGoogleFonts: GoogleFonts
|
|
||||||
.asMap()
|
|
||||||
.containsKey(
|
|
||||||
FlutterFlowTheme.of(
|
|
||||||
context)
|
|
||||||
.bodyMediumFamily),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Align(
|
|
||||||
alignment:
|
|
||||||
const AlignmentDirectional(
|
|
||||||
-1.0, -1.0),
|
|
||||||
child: Text(
|
|
||||||
getJsonField(
|
|
||||||
visitaWrapItem,
|
|
||||||
r'''$.VTE_NOME''',
|
|
||||||
).toString(),
|
|
||||||
style: FlutterFlowTheme.of(
|
|
||||||
context)
|
|
||||||
.bodyMedium
|
|
||||||
.override(
|
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(
|
|
||||||
context)
|
|
||||||
.bodyMediumFamily,
|
|
||||||
fontSize: 12.5,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
useGoogleFonts: GoogleFonts
|
|
||||||
.asMap()
|
|
||||||
.containsKey(
|
|
||||||
FlutterFlowTheme.of(
|
|
||||||
context)
|
|
||||||
.bodyMediumFamily),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
].addToStart(
|
|
||||||
const SizedBox(width: 10.0)),
|
|
||||||
),
|
|
||||||
Row(
|
|
||||||
mainAxisSize: MainAxisSize.max,
|
|
||||||
mainAxisAlignment:
|
|
||||||
MainAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
FFLocalizations.of(context)
|
|
||||||
.getText(
|
|
||||||
'73b1kj59' /* Início em: */,
|
|
||||||
),
|
|
||||||
style:
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.bodyMedium
|
|
||||||
.override(
|
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(
|
|
||||||
context)
|
|
||||||
.bodyMediumFamily,
|
|
||||||
fontSize: 12.5,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
fontWeight:
|
|
||||||
FontWeight.bold,
|
|
||||||
useGoogleFonts: GoogleFonts
|
|
||||||
.asMap()
|
|
||||||
.containsKey(
|
|
||||||
FlutterFlowTheme.of(
|
|
||||||
context)
|
|
||||||
.bodyMediumFamily),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
getJsonField(
|
|
||||||
visitaWrapItem,
|
|
||||||
r'''$.VAW_DTINICIO''',
|
|
||||||
).toString(),
|
|
||||||
style:
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.bodyMedium
|
|
||||||
.override(
|
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(
|
|
||||||
context)
|
|
||||||
.bodyMediumFamily,
|
|
||||||
fontSize: 12.5,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
useGoogleFonts: GoogleFonts
|
|
||||||
.asMap()
|
|
||||||
.containsKey(
|
|
||||||
FlutterFlowTheme.of(
|
|
||||||
context)
|
|
||||||
.bodyMediumFamily),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
].addToStart(
|
|
||||||
const SizedBox(width: 10.0)),
|
|
||||||
),
|
|
||||||
Row(
|
|
||||||
mainAxisSize: MainAxisSize.max,
|
|
||||||
mainAxisAlignment:
|
|
||||||
MainAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
FFLocalizations.of(context)
|
|
||||||
.getText(
|
|
||||||
'klzzrfbn' /* Fim em: */,
|
|
||||||
),
|
|
||||||
style:
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.bodyMedium
|
|
||||||
.override(
|
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(
|
|
||||||
context)
|
|
||||||
.bodyMediumFamily,
|
|
||||||
fontSize: 12.5,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
fontWeight:
|
|
||||||
FontWeight.bold,
|
|
||||||
useGoogleFonts: GoogleFonts
|
|
||||||
.asMap()
|
|
||||||
.containsKey(
|
|
||||||
FlutterFlowTheme.of(
|
|
||||||
context)
|
|
||||||
.bodyMediumFamily),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
getJsonField(
|
|
||||||
visitaWrapItem,
|
|
||||||
r'''$.VAW_DTFIM''',
|
|
||||||
).toString(),
|
|
||||||
style:
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.bodyMedium
|
|
||||||
.override(
|
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(
|
|
||||||
context)
|
|
||||||
.bodyMediumFamily,
|
|
||||||
fontSize: 12.5,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
useGoogleFonts: GoogleFonts
|
|
||||||
.asMap()
|
|
||||||
.containsKey(
|
|
||||||
FlutterFlowTheme.of(
|
|
||||||
context)
|
|
||||||
.bodyMediumFamily),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
].addToStart(
|
|
||||||
const SizedBox(width: 10.0)),
|
|
||||||
),
|
|
||||||
Align(
|
|
||||||
alignment:
|
|
||||||
const AlignmentDirectional(
|
|
||||||
-1.0, 0.0),
|
|
||||||
child: Padding(
|
|
||||||
padding:
|
|
||||||
const EdgeInsetsDirectional
|
|
||||||
.fromSTEB(
|
|
||||||
10.0, 0.0, 0.0, 0.0),
|
|
||||||
child: Container(
|
|
||||||
width: 200.0,
|
|
||||||
height: 27.0,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: valueOrDefault<Color>(
|
|
||||||
() {
|
|
||||||
if (jsonToStr(
|
|
||||||
getJsonField(
|
|
||||||
visitaWrapItem,
|
|
||||||
r'''$.VAW_STATUS''',
|
|
||||||
)) ==
|
|
||||||
'\"A\"') {
|
|
||||||
return FlutterFlowTheme
|
|
||||||
.of(context)
|
|
||||||
.success;
|
|
||||||
} else if ((
|
|
||||||
jsonToStr(
|
|
||||||
getJsonField(
|
|
||||||
visitaWrapItem,
|
|
||||||
r'''$.VAW_STATUS''',
|
|
||||||
)) ==
|
|
||||||
'\"C\"') ||
|
|
||||||
(jsonToStr(
|
|
||||||
getJsonField(
|
|
||||||
visitaWrapItem,
|
|
||||||
r'''$.VAW_STATUS''',
|
|
||||||
)) ==
|
|
||||||
'\"F\"') ||
|
|
||||||
(jsonToStr(
|
|
||||||
getJsonField(
|
|
||||||
visitaWrapItem,
|
|
||||||
r'''$.VAW_STATUS''',
|
|
||||||
)) ==
|
|
||||||
'\"B\"') ||
|
|
||||||
(jsonToStr(
|
|
||||||
getJsonField(
|
|
||||||
visitaWrapItem,
|
|
||||||
r'''$.VAW_STATUS''',
|
|
||||||
)) ==
|
|
||||||
'\"I\"')) {
|
|
||||||
return FlutterFlowTheme
|
|
||||||
.of(context)
|
|
||||||
.error;
|
|
||||||
} else if (
|
|
||||||
jsonToStr(
|
|
||||||
getJsonField(
|
|
||||||
visitaWrapItem,
|
|
||||||
r'''$.VAW_STATUS''',
|
|
||||||
)) ==
|
|
||||||
'\"I\"') {
|
|
||||||
return FlutterFlowTheme
|
|
||||||
.of(context)
|
|
||||||
.warning;
|
|
||||||
} else {
|
|
||||||
return FlutterFlowTheme
|
|
||||||
.of(context)
|
|
||||||
.primary;
|
|
||||||
}
|
|
||||||
}(),
|
|
||||||
FlutterFlowTheme.of(context)
|
|
||||||
.primary,
|
|
||||||
),
|
|
||||||
borderRadius:
|
|
||||||
BorderRadius.circular(
|
|
||||||
5.0),
|
|
||||||
),
|
|
||||||
child: Align(
|
|
||||||
alignment:
|
|
||||||
const AlignmentDirectional(
|
|
||||||
0.0, 0.0),
|
|
||||||
child: Text(
|
|
||||||
() {
|
|
||||||
if (jsonToStr(
|
|
||||||
getJsonField(
|
|
||||||
visitaWrapItem,
|
|
||||||
r'''$.VAW_STATUS''',
|
|
||||||
)) ==
|
|
||||||
'\"A\"') {
|
|
||||||
return FFLocalizations
|
|
||||||
.of(context)
|
|
||||||
.getVariableText(
|
|
||||||
ptText: 'Ativo',
|
|
||||||
enText: 'Active',
|
|
||||||
);
|
|
||||||
} else if ((
|
|
||||||
jsonToStr(
|
|
||||||
getJsonField(
|
|
||||||
visitaWrapItem,
|
|
||||||
r'''$.VAW_STATUS''',
|
|
||||||
)) ==
|
|
||||||
'\"F\"') ||
|
|
||||||
(jsonToStr(
|
|
||||||
getJsonField(
|
|
||||||
visitaWrapItem,
|
|
||||||
r'''$.VAW_STATUS''',
|
|
||||||
)) ==
|
|
||||||
'\"C\"') ||
|
|
||||||
(jsonToStr(
|
|
||||||
getJsonField(
|
|
||||||
visitaWrapItem,
|
|
||||||
r'''$.VAW_STATUS''',
|
|
||||||
)) ==
|
|
||||||
'\"B\"') ||
|
|
||||||
(jsonToStr(
|
|
||||||
getJsonField(
|
|
||||||
visitaWrapItem,
|
|
||||||
r'''$.VAW_STATUS''',
|
|
||||||
)) ==
|
|
||||||
'\"I\"')) {
|
|
||||||
return FFLocalizations
|
|
||||||
.of(context)
|
|
||||||
.getVariableText(
|
|
||||||
ptText: 'Cancelado',
|
|
||||||
enText: 'Canceled',
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
return FFLocalizations
|
|
||||||
.of(context)
|
|
||||||
.getVariableText(
|
|
||||||
ptText: 'Pendente',
|
|
||||||
enText: 'Pending',
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}(),
|
|
||||||
style: FlutterFlowTheme.of(
|
|
||||||
context)
|
|
||||||
.bodyMedium
|
|
||||||
.override(
|
|
||||||
fontFamily:
|
|
||||||
FlutterFlowTheme.of(
|
|
||||||
context)
|
|
||||||
.bodyMediumFamily,
|
|
||||||
color: FlutterFlowTheme
|
|
||||||
.of(context)
|
|
||||||
.info,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
useGoogleFonts: GoogleFonts
|
|
||||||
.asMap()
|
|
||||||
.containsKey(
|
|
||||||
FlutterFlowTheme.of(
|
|
||||||
context)
|
|
||||||
.bodyMediumFamily),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
].divide(const SizedBox(height: 3.0)),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
ClipRRect(
|
|
||||||
borderRadius: BorderRadius.circular(0.0),
|
|
||||||
child: CachedNetworkImage(
|
|
||||||
fadeInDuration:
|
|
||||||
const Duration(milliseconds: 500),
|
|
||||||
fadeOutDuration:
|
|
||||||
const Duration(milliseconds: 500),
|
|
||||||
imageUrl: valueOrDefault<String>(
|
|
||||||
'https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField(
|
|
||||||
visitaWrapItem,
|
|
||||||
r'''$.VTE_DOCUMENTO''',
|
|
||||||
).toString()}&tipo=E',
|
|
||||||
'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg',
|
|
||||||
),
|
|
||||||
fit: BoxFit.cover,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
);
|
|
||||||
},
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
24
pubspec.lock
24
pubspec.lock
|
@ -137,6 +137,22 @@ packages:
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.18.0"
|
version: "1.18.0"
|
||||||
|
connectivity_plus:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: connectivity_plus
|
||||||
|
sha256: "2056db5241f96cdc0126bd94459fc4cdc13876753768fc7a31c425e50a7177d0"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "6.0.5"
|
||||||
|
connectivity_plus_platform_interface:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: connectivity_plus_platform_interface
|
||||||
|
sha256: "42657c1715d48b167930d5f34d00222ac100475f73d10162ddf43e714932f204"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.1"
|
||||||
crop_your_image:
|
crop_your_image:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
@ -941,6 +957,14 @@ packages:
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.0"
|
version: "1.0.0"
|
||||||
|
nm:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: nm
|
||||||
|
sha256: "2c9aae4127bdc8993206464fcc063611e0e36e72018696cd9631023a31b24254"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "0.5.0"
|
||||||
octo_image:
|
octo_image:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
23
pubspec.yaml
23
pubspec.yaml
|
@ -3,7 +3,7 @@ description: A new Flutter project.
|
||||||
|
|
||||||
# The following line prevents the package from being accidentally published to
|
# The following line prevents the package from being accidentally published to
|
||||||
# pub.dev using `pub publish`. This is preferred for private packages.
|
# pub.dev using `pub publish`. This is preferred for private packages.
|
||||||
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
publish_to: "none" # Remove this line if you wish to publish to pub.dev
|
||||||
|
|
||||||
# The following defines the version and build number for your application.
|
# The following defines the version and build number for your application.
|
||||||
# A version number is three numbers separated by dots, like 1.2.43
|
# A version number is three numbers separated by dots, like 1.2.43
|
||||||
|
@ -29,7 +29,7 @@ dependencies:
|
||||||
barcode_widget: 2.0.3
|
barcode_widget: 2.0.3
|
||||||
cached_network_image: 3.3.1
|
cached_network_image: 3.3.1
|
||||||
firebase_core: 3.1.0
|
firebase_core: 3.1.0
|
||||||
flutter_inappwebview: ^6.0.0
|
flutter_inappwebview: ^6.0.0
|
||||||
webview_flutter: ^4.8.0
|
webview_flutter: ^4.8.0
|
||||||
rxdart: ^0.27.7
|
rxdart: ^0.27.7
|
||||||
collection: 1.18.0
|
collection: 1.18.0
|
||||||
|
@ -48,6 +48,7 @@ dependencies:
|
||||||
flutter_cache_manager: 3.3.2
|
flutter_cache_manager: 3.3.2
|
||||||
flutter_plugin_android_lifecycle: 2.0.20
|
flutter_plugin_android_lifecycle: 2.0.20
|
||||||
share_plus: ^9.0.0
|
share_plus: ^9.0.0
|
||||||
|
connectivity_plus: ^6.0.5
|
||||||
flutter_secure_storage: 9.2.2
|
flutter_secure_storage: 9.2.2
|
||||||
flutter_secure_storage_linux: 1.2.1
|
flutter_secure_storage_linux: 1.2.1
|
||||||
flutter_secure_storage_macos: 3.1.2
|
flutter_secure_storage_macos: 3.1.2
|
||||||
|
@ -87,7 +88,7 @@ dependencies:
|
||||||
shared_preferences_web: 2.3.0
|
shared_preferences_web: 2.3.0
|
||||||
sqflite: 2.3.3+1
|
sqflite: 2.3.3+1
|
||||||
synchronized: 3.1.0+1
|
synchronized: 3.1.0+1
|
||||||
responsive_framework: 1.4.0
|
responsive_framework: 1.4.0
|
||||||
timeago: 3.6.1
|
timeago: 3.6.1
|
||||||
url_launcher: 6.3.0
|
url_launcher: 6.3.0
|
||||||
url_launcher_android: 6.3.3
|
url_launcher_android: 6.3.3
|
||||||
|
@ -99,7 +100,6 @@ dependencies:
|
||||||
video_player_platform_interface: 6.2.2
|
video_player_platform_interface: 6.2.2
|
||||||
video_player_web: 2.3.1
|
video_player_web: 2.3.1
|
||||||
|
|
||||||
|
|
||||||
# The following adds the Cupertino Icons font to your application.
|
# The following adds the Cupertino Icons font to your application.
|
||||||
# Use with the CupertinoIcons class for iOS style icons.
|
# Use with the CupertinoIcons class for iOS style icons.
|
||||||
cupertino_icons: ^1.0.0
|
cupertino_icons: ^1.0.0
|
||||||
|
@ -123,24 +123,20 @@ dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
|
|
||||||
|
|
||||||
flutter_launcher_icons:
|
flutter_launcher_icons:
|
||||||
android: 'launcher_icon'
|
android: "launcher_icon"
|
||||||
ios: true
|
ios: true
|
||||||
web:
|
web:
|
||||||
generate: true
|
generate: true
|
||||||
image_path: 'assets/images/app_launcher_icon.svg'
|
image_path: "assets/images/app_launcher_icon.svg"
|
||||||
adaptive_icon_background: 'assets/images/adaptive_background_icon.svg'
|
adaptive_icon_background: "assets/images/adaptive_background_icon.svg"
|
||||||
adaptive_icon_foreground: 'assets/images/adaptive_foreground_icon.svg'
|
adaptive_icon_foreground: "assets/images/adaptive_foreground_icon.svg"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# For information on the generic Dart part of this file, see the
|
# For information on the generic Dart part of this file, see the
|
||||||
# following page: https://dart.dev/tools/pub/pubspec
|
# following page: https://dart.dev/tools/pub/pubspec
|
||||||
|
|
||||||
# The following section is specific to Flutter.
|
# The following section is specific to Flutter.
|
||||||
flutter:
|
flutter:
|
||||||
|
|
||||||
# The following line ensures that the Material Icons font is
|
# The following line ensures that the Material Icons font is
|
||||||
# included with your application, so that you can use the icons in
|
# included with your application, so that you can use the icons in
|
||||||
# the material Icons class.
|
# the material Icons class.
|
||||||
|
@ -158,7 +154,7 @@ flutter:
|
||||||
- assets/rive_animations/
|
- assets/rive_animations/
|
||||||
- assets/pdfs/
|
- assets/pdfs/
|
||||||
fonts:
|
fonts:
|
||||||
- family: 'SF Pro'
|
- family: "SF Pro"
|
||||||
fonts:
|
fonts:
|
||||||
- asset: assets/fonts/SFPRODISPLAYREGULAR.OTF
|
- asset: assets/fonts/SFPRODISPLAYREGULAR.OTF
|
||||||
- asset: assets/fonts/SFPRODISPLAYMEDIUM.OTF
|
- asset: assets/fonts/SFPRODISPLAYMEDIUM.OTF
|
||||||
|
@ -173,7 +169,6 @@ flutter:
|
||||||
fonts:
|
fonts:
|
||||||
- asset: assets/fonts/menu.ttf
|
- asset: assets/fonts/menu.ttf
|
||||||
|
|
||||||
|
|
||||||
# An image asset can refer to one or more resolution-specific "variants", see
|
# An image asset can refer to one or more resolution-specific "variants", see
|
||||||
# https://flutter.dev/assets-and-images/#resolution-aware.
|
# https://flutter.dev/assets-and-images/#resolution-aware.
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Encontra e remove todos os arquivos com final :Zone.Identifier
|
||||||
|
find . -type f -name '*:Zone.Identifier' -exec rm -f {} +
|
||||||
|
|
||||||
|
echo "Todos os arquivos :Zone.Identifier foram removidos."
|
Loading…
Reference in New Issue