milestone: indexação
This commit is contained in:
parent
618ad783da
commit
f63dd994cf
|
@ -1,209 +0,0 @@
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:flutter/services.dart';
|
|
||||||
import 'package:flutter_test/flutter_test.dart';
|
|
||||||
import 'package:hub/flutter_flow/random_data_util.dart';
|
|
||||||
import 'package:hub/initialization.dart';
|
|
||||||
import 'package:hub/main.dart';
|
|
||||||
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
|
||||||
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
|
||||||
import 'package:integration_test/integration_test.dart';
|
|
||||||
|
|
||||||
late WidgetTester widget;
|
|
||||||
|
|
||||||
void main() {
|
|
||||||
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
|
|
||||||
|
|
||||||
group(
|
|
||||||
'Initialization',
|
|
||||||
() {
|
|
||||||
group('Navigation', () {
|
|
||||||
setUpAll(() async => await initializeApp().then((_) async => await StorageHelper().set(SecureStorageKey.isLogged.value, 'false')));
|
|
||||||
testWidgets('Test Welcome', (WidgetTester tester) async {
|
|
||||||
widget = tester;
|
|
||||||
await _testWelcome();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
group('Terms of Use', () {
|
|
||||||
// Add tests for Terms of Use here
|
|
||||||
});
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
group('Authentication', () {
|
|
||||||
group('Sign in', () {
|
|
||||||
setUpAll(() async => await initializeApp().then((_) async => await StorageHelper().set(SecureStorageKey.isLogged.value, 'false')));
|
|
||||||
testWidgets('Test Sign In', (WidgetTester tester) async {
|
|
||||||
widget = tester;
|
|
||||||
await _testSignIn();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
group('Sign up', () {
|
|
||||||
setUpAll(() async => await initializeApp().then((_) async => await StorageHelper().set(SecureStorageKey.isLogged.value, 'false')));
|
|
||||||
testWidgets('Test Sign Up', (WidgetTester tester) async {
|
|
||||||
widget = tester;
|
|
||||||
await _testSignUp();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
group('Sign Out', () {
|
|
||||||
// Add tests for Sign Out here
|
|
||||||
});
|
|
||||||
group('Forgot Password', () {
|
|
||||||
// setUpAll(() async => await initializeApp().then((_) => StorageUtil().isLogged = false));
|
|
||||||
// testWidgets('Test Forgot Password', (WidgetTester tester) async {
|
|
||||||
// widget = tester;
|
|
||||||
// await _testForgotPassword();
|
|
||||||
// });
|
|
||||||
});
|
|
||||||
});
|
|
||||||
group('Localization', () {
|
|
||||||
// Add tests for Localization here
|
|
||||||
});
|
|
||||||
group('Networking', () {
|
|
||||||
// Add tests for Networking here
|
|
||||||
});
|
|
||||||
group('Functionality', () {
|
|
||||||
// Add tests for Functionality here
|
|
||||||
});
|
|
||||||
group('Usability', () {
|
|
||||||
// Add tests for Usability here
|
|
||||||
});
|
|
||||||
group('Performance', () {
|
|
||||||
// Add tests for Performance here
|
|
||||||
});
|
|
||||||
group('Security', () {
|
|
||||||
// Add tests for Security here
|
|
||||||
});
|
|
||||||
group('Accessibility', () {
|
|
||||||
// Add tests for Accessibility here
|
|
||||||
});
|
|
||||||
group('Compatibility', () {
|
|
||||||
// Add tests for Compatibility here
|
|
||||||
});
|
|
||||||
group('Internationalization', () {
|
|
||||||
// Add tests for Internationalization here
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<void> _testWelcome() async {
|
|
||||||
await widget.pumpWidget(const App());
|
|
||||||
await widget.pumpAndSettle();
|
|
||||||
await _navigateToSignIn();
|
|
||||||
await _navigateToSignUp();
|
|
||||||
await widget.pumpAndSettle();
|
|
||||||
await widget.pumpWidget(const App());
|
|
||||||
await widget.pumpAndSettle();
|
|
||||||
await _navigateToSignUp();
|
|
||||||
await _navigateToSignIn();
|
|
||||||
await widget.pumpAndSettle();
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<void> _testSignIn() async {
|
|
||||||
await widget.pumpWidget(const App());
|
|
||||||
await _navigateToSignIn();
|
|
||||||
await _auth({'emailTextFormField': 'erro@exemplo.com', 'passwordTextFormField': '12345678'});
|
|
||||||
await _auth({'emailTextFormField': 'email_app@exemplo.com', 'passwordTextFormField': '12345678'});
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<void> _testSignUp() async {
|
|
||||||
await widget.pumpWidget(const App());
|
|
||||||
await _navigateToSignUp();
|
|
||||||
|
|
||||||
var credentials = {'nameTextFormField': 'app', 'emailTextFormField': 'email_app@exemplo.com', 'passwordTextFormField': '12345678'};
|
|
||||||
await _auth(credentials);
|
|
||||||
|
|
||||||
var name = randomString(7, 7, true, true, true);
|
|
||||||
var email = '$name@example.com';
|
|
||||||
var password = '12345678';
|
|
||||||
credentials = {'nameTextFormField': name, 'emailTextFormField': email, 'passwordTextFormField': password};
|
|
||||||
await _navigateToSignUp();
|
|
||||||
await _auth(credentials);
|
|
||||||
credentials = {'emailTextFormField': email, 'passwordTextFormField': password};
|
|
||||||
await _auth(credentials);
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<void> _testForgotPassword() async {
|
|
||||||
await widget.pumpWidget(const App());
|
|
||||||
await _navigateToSignIn();
|
|
||||||
await _recoveryPassword();
|
|
||||||
|
|
||||||
var addr = randomString(5, 5, true, true, true);
|
|
||||||
var credentials = {'recoveryTextFormField': '$addr@exemple.com'};
|
|
||||||
await _send(credentials);
|
|
||||||
|
|
||||||
await Future.delayed(const Duration(seconds: 2));
|
|
||||||
|
|
||||||
await _recoveryPassword();
|
|
||||||
credentials = {'recoveryTextFormField': 'email_app@exemple.com'};
|
|
||||||
await _send(credentials);
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<void> _recoveryPassword() async {
|
|
||||||
await widget.pumpAndSettle();
|
|
||||||
final Finder forgotPassword = find.byKey(const ValueKey<String>('ForgotPassword'));
|
|
||||||
if (forgotPassword.evaluate().isNotEmpty) await widget.tap(forgotPassword);
|
|
||||||
await widget.ensureVisible(forgotPassword);
|
|
||||||
await widget.pumpAndSettle();
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<void> _navigateBackUsingSystemGesture() async => IntegrationTestWidgetsFlutterBinding.instance.keyboard.isLogicalKeyPressed(LogicalKeyboardKey.escape);
|
|
||||||
Future<void> _navigateToSignUp() async {
|
|
||||||
await widget.pumpAndSettle();
|
|
||||||
final Finder navToSignUp = find.byKey(const ValueKey<String>('toggleSignUpPage'));
|
|
||||||
if (navToSignUp.evaluate().isNotEmpty) {
|
|
||||||
await widget.tap(navToSignUp);
|
|
||||||
await widget.pumpAndSettle();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<void> _navigateToSignIn() async {
|
|
||||||
await widget.pumpAndSettle();
|
|
||||||
final Finder navToSignIn = find.byKey(const ValueKey<String>('toggleSignInPage'));
|
|
||||||
expect(navToSignIn, findsOneWidget);
|
|
||||||
if (navToSignIn.evaluate().isNotEmpty) {
|
|
||||||
await widget.tap(navToSignIn);
|
|
||||||
await widget.pumpAndSettle();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<void> _auth(Map<String, dynamic> credentials) async {
|
|
||||||
await _enterCredentials(credentials);
|
|
||||||
await _submit('SubmitButtonWidget');
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<void> _send(Map<String, dynamic> credentials) async {
|
|
||||||
await _enterCredentials(credentials);
|
|
||||||
await _submit('SendButtonWidget');
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<void> _enterCredentials(Map<String, dynamic> credentials) async {
|
|
||||||
await widget.pumpAndSettle();
|
|
||||||
for (var entry in credentials.entries) {
|
|
||||||
final Finder field = find.byKey(ValueKey<String>(entry.key));
|
|
||||||
await widget.pumpAndSettle();
|
|
||||||
expect(field, findsOneWidget);
|
|
||||||
await widget.enterText(field, entry.value);
|
|
||||||
await widget.pumpAndSettle();
|
|
||||||
}
|
|
||||||
await widget.pumpAndSettle();
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<void> _submit(String key) async {
|
|
||||||
await widget.pumpAndSettle();
|
|
||||||
final Finder submitButton = find.byKey(ValueKey<String>(key));
|
|
||||||
await widget.pumpAndSettle();
|
|
||||||
if (submitButton.evaluate().isNotEmpty) {
|
|
||||||
await widget.tap(submitButton);
|
|
||||||
await widget.pumpAndSettle();
|
|
||||||
}
|
|
||||||
|
|
||||||
final Finder throwExceptionWidget = find.byKey(const ValueKey<String>('ThrowExceptionWidget'));
|
|
||||||
await widget.pumpAndSettle();
|
|
||||||
if (throwExceptionWidget.evaluate().isNotEmpty) {
|
|
||||||
await widget.ensureVisible(throwExceptionWidget);
|
|
||||||
await widget.tap(throwExceptionWidget);
|
|
||||||
await widget.pumpAndSettle();
|
|
||||||
} else {
|
|
||||||
await _navigateBackUsingSystemGesture();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,45 +0,0 @@
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:flutter_test/flutter_test.dart';
|
|
||||||
import 'package:hub/components/templates_components/card_item_template_component/card_item_template_component_widget.dart';
|
|
||||||
import 'package:hub/initialization.dart';
|
|
||||||
import 'package:hub/main.dart' as app;
|
|
||||||
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
|
||||||
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
|
||||||
import 'package:integration_test/integration_test.dart';
|
|
||||||
|
|
||||||
void main() {
|
|
||||||
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
|
|
||||||
|
|
||||||
group('ProvisionalHistoryPage Integration Test', () {
|
|
||||||
setUpAll(() async => await initializeApp().then((_) async {
|
|
||||||
await StorageHelper().set(SecureStorageKey.isLogged.value, 'true');
|
|
||||||
await StorageHelper().set(SecureStorageKey.haveLocal.value, 'true');
|
|
||||||
await StorageHelper().set(KeychainStorageKey.devUUID.value, 'b5c3818753e76d85');
|
|
||||||
await StorageHelper().set(KeychainStorageKey.userUUID.value, '649c45d7514a28.85876308');
|
|
||||||
await StorageHelper().set(KeychainStorageKey.clientUUID.value, '7');
|
|
||||||
}));
|
|
||||||
|
|
||||||
testWidgets('Filter Provisional History', (WidgetTester tester) async {
|
|
||||||
app.main();
|
|
||||||
await tester.pumpAndSettle();
|
|
||||||
|
|
||||||
final Finder menuButton = find.byIcon(Icons.person_search_outlined);
|
|
||||||
await tester.tap(menuButton);
|
|
||||||
await tester.pumpAndSettle();
|
|
||||||
|
|
||||||
final Finder filterButton = find.byIcon(Icons.filter_list);
|
|
||||||
await tester.tap(filterButton);
|
|
||||||
await tester.pumpAndSettle();
|
|
||||||
|
|
||||||
final Finder activeFilterOption = find.text('Active');
|
|
||||||
await tester.tap(activeFilterOption);
|
|
||||||
await tester.pumpAndSettle();
|
|
||||||
|
|
||||||
final Finder applyFilterButton = find.text('Apply');
|
|
||||||
await tester.tap(applyFilterButton);
|
|
||||||
await tester.pumpAndSettle();
|
|
||||||
|
|
||||||
expect(find.byType(CardItemTemplateComponentWidget), findsWidgets);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
|
@ -1,3 +0,0 @@
|
||||||
export '/backend/schema/util/schema_util.dart';
|
|
||||||
|
|
||||||
export 'device_struct.dart';
|
|
|
@ -1,16 +1,15 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:hub/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_model.dart';
|
import 'package:hub/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_model.dart';
|
||||||
import 'package:hub/components/templates_components/card_item_template_component/card_item_template_component_widget.dart';
|
import 'package:hub/components/templates_components/card_item_template_component/card_item_template_component_widget.dart';
|
||||||
|
import 'package:hub/features/backend/index.dart';
|
||||||
|
import 'package:hub/features/storage/index.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/nav/nav.dart';
|
||||||
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
|
||||||
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
|
||||||
import 'package:hub/shared/utils/dialog_util.dart';
|
import 'package:hub/shared/utils/dialog_util.dart';
|
||||||
import 'package:hub/shared/utils/limited_text_size.dart';
|
import 'package:hub/shared/utils/limited_text_size.dart';
|
||||||
import 'package:hub/shared/utils/log_util.dart';
|
import 'package:hub/shared/utils/log_util.dart';
|
||||||
|
|
||||||
import '../../../shared/services/authentication/authentication_service.dart';
|
|
||||||
import '/backend/api_requests/api_calls.dart';
|
|
||||||
import '/flutter_flow/flutter_flow_theme.dart';
|
import '/flutter_flow/flutter_flow_theme.dart';
|
||||||
|
|
||||||
class BottomArrowLinkedLocalsComponentWidget extends StatefulWidget {
|
class BottomArrowLinkedLocalsComponentWidget extends StatefulWidget {
|
||||||
|
@ -105,10 +104,10 @@ class _BottomArrowLinkedLocalsComponentWidgetState extends State<BottomArrowLink
|
||||||
if (isEnabled) {
|
if (isEnabled) {
|
||||||
final local = locals[0];
|
final local = locals[0];
|
||||||
|
|
||||||
await StorageHelper().set(KeychainStorageKey.clientName.value, local['CLI_NOME']);
|
await StorageHelper().set(ProfileStorageKey.clientName.key, local['CLI_NOME']);
|
||||||
await StorageHelper().set(KeychainStorageKey.ownerName.value, local['CLU_OWNER_DSC']);
|
await StorageHelper().set(ProfileStorageKey.ownerName.key, local['CLU_OWNER_DSC']);
|
||||||
await StorageHelper().set(KeychainStorageKey.clientUUID.value, local['CLI_ID']);
|
await StorageHelper().set(ProfileStorageKey.clientUUID.key, local['CLI_ID']);
|
||||||
await StorageHelper().set(KeychainStorageKey.ownerUUID.value, local['CLU_OWNER_ID']);
|
await StorageHelper().set(ProfileStorageKey.ownerUUID.key, local['CLU_OWNER_ID']);
|
||||||
|
|
||||||
context.pop();
|
context.pop();
|
||||||
return widget.response;
|
return widget.response;
|
||||||
|
@ -138,17 +137,13 @@ class _BottomArrowLinkedLocalsComponentWidgetState extends State<BottomArrowLink
|
||||||
|
|
||||||
Future<dynamic> _fetchResponseLink(String status, String cliID) async {
|
Future<dynamic> _fetchResponseLink(String status, String cliID) async {
|
||||||
try {
|
try {
|
||||||
await StorageHelper().set(KeychainStorageKey.clientUUID.value, cliID);
|
await StorageHelper().set(ProfileStorageKey.clientUUID.key, cliID);
|
||||||
var response = await PhpGroup.resopndeVinculo.call(tarefa: status);
|
var response = await PhpGroup.resopndeVinculo.call(tarefa: status);
|
||||||
|
|
||||||
if (response.jsonBody['error'] == false) {
|
if (response.jsonBody['error'] == false) {
|
||||||
return {
|
return {'error': false, 'error_msg': FFLocalizations.of(context).getVariableText(ptText: "Vínculo Ativado com Sucesso", enText: "Link Activated Successfully")};
|
||||||
'error': false,
|
|
||||||
'error_msg': FFLocalizations.of(context)
|
|
||||||
.getVariableText(ptText: "Vínculo Ativado com Sucesso", enText: "Link Activated Successfully")
|
|
||||||
};
|
|
||||||
} else {
|
} else {
|
||||||
await StorageHelper().set(KeychainStorageKey.clientUUID.value, '');
|
await StorageHelper().set(ProfileStorageKey.clientUUID.key, '');
|
||||||
return response.jsonBody;
|
return response.jsonBody;
|
||||||
}
|
}
|
||||||
} catch (e, s) {
|
} catch (e, s) {
|
||||||
|
@ -156,9 +151,8 @@ class _BottomArrowLinkedLocalsComponentWidgetState extends State<BottomArrowLink
|
||||||
LogUtil.requestAPIFailed('responderVinculo.php', '', 'Responder Vínculo', e, s);
|
LogUtil.requestAPIFailed('responderVinculo.php', '', 'Responder Vínculo', e, s);
|
||||||
return {
|
return {
|
||||||
'error': true,
|
'error': true,
|
||||||
'error_msg': FFLocalizations.of(context).getVariableText(
|
'error_msg': FFLocalizations.of(context)
|
||||||
ptText: "Falha ao efetuar operação, Tente Novamente mais tarde.",
|
.getVariableText(ptText: "Falha ao efetuar operação, Tente Novamente mais tarde.", enText: "Failed to perform operation, please try again later.")
|
||||||
enText: "Failed to perform operation, please try again later.")
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -168,24 +162,18 @@ class _BottomArrowLinkedLocalsComponentWidgetState extends State<BottomArrowLink
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, String> _labelsHashMap(dynamic local) {
|
Map<String, String> _labelsHashMap(dynamic local) {
|
||||||
return Map<String, String>.from({
|
return Map<String, String>.from(
|
||||||
'${local['CLI_PREFIXO']}:': local['CLI_NOME'],
|
{'${local['CLI_PREFIXO']}:': local['CLI_NOME'], '${FFLocalizations.of(context).getVariableText(ptText: 'Propriedade', enText: 'Property')}:': local['CLU_OWNER_DSC']});
|
||||||
'${FFLocalizations.of(context).getVariableText(ptText: 'Propriedade', enText: 'Property')}:':
|
|
||||||
local['CLU_OWNER_DSC']
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, Color> _statusHashMap(dynamic local) {
|
Map<String, Color> _statusHashMap(dynamic local) {
|
||||||
return Map<String, Color>.from({
|
return Map<String, Color>.from({
|
||||||
if (local['CLU_STATUS'] == 'A')
|
if (local['CLU_STATUS'] == 'A')
|
||||||
FFLocalizations.of(context).getVariableText(ptText: 'Ativo', enText: 'Active'):
|
FFLocalizations.of(context).getVariableText(ptText: 'Ativo', enText: 'Active'): FlutterFlowTheme.of(context).success
|
||||||
FlutterFlowTheme.of(context).success
|
|
||||||
else if (local['CLU_STATUS'] == 'B')
|
else if (local['CLU_STATUS'] == 'B')
|
||||||
FFLocalizations.of(context).getVariableText(ptText: 'Bloqueado', enText: 'Blocked'):
|
FFLocalizations.of(context).getVariableText(ptText: 'Bloqueado', enText: 'Blocked'): FlutterFlowTheme.of(context).error
|
||||||
FlutterFlowTheme.of(context).error
|
|
||||||
else
|
else
|
||||||
FFLocalizations.of(context).getVariableText(ptText: 'Pendente', enText: 'Pending'):
|
FFLocalizations.of(context).getVariableText(ptText: 'Pendente', enText: 'Pending'): FlutterFlowTheme.of(context).warning
|
||||||
FlutterFlowTheme.of(context).warning
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -196,10 +184,10 @@ class _BottomArrowLinkedLocalsComponentWidgetState extends State<BottomArrowLink
|
||||||
statusHashMap: [_statusHashMap(local)],
|
statusHashMap: [_statusHashMap(local)],
|
||||||
onTapCardItemAction: () async {
|
onTapCardItemAction: () async {
|
||||||
if (local['CLU_STATUS'] == 'A') {
|
if (local['CLU_STATUS'] == 'A') {
|
||||||
await StorageHelper().set(KeychainStorageKey.clientUUID.value, local['CLI_ID']);
|
await StorageHelper().set(ProfileStorageKey.clientUUID.key, local['CLI_ID']);
|
||||||
await StorageHelper().set(KeychainStorageKey.clientName.value, local['CLI_NOME']);
|
await StorageHelper().set(ProfileStorageKey.clientName.key, local['CLI_NOME']);
|
||||||
await StorageHelper().set(KeychainStorageKey.ownerName.value, local['CLU_OWNER_DSC']);
|
await StorageHelper().set(ProfileStorageKey.ownerName.key, local['CLU_OWNER_DSC']);
|
||||||
await StorageHelper().set(KeychainStorageKey.ownerUUID.value, local['CLU_OWNER_ID']);
|
await StorageHelper().set(ProfileStorageKey.ownerUUID.key, local['CLU_OWNER_ID']);
|
||||||
|
|
||||||
context.pop(true);
|
context.pop(true);
|
||||||
return true;
|
return true;
|
||||||
|
@ -222,9 +210,7 @@ class _BottomArrowLinkedLocalsComponentWidgetState extends State<BottomArrowLink
|
||||||
showAlertDialog(
|
showAlertDialog(
|
||||||
context,
|
context,
|
||||||
FFLocalizations.of(context).getVariableText(ptText: 'Ativar Vínculo', enText: 'Activate Link'),
|
FFLocalizations.of(context).getVariableText(ptText: 'Ativar Vínculo', enText: 'Activate Link'),
|
||||||
FFLocalizations.of(context).getVariableText(
|
FFLocalizations.of(context).getVariableText(ptText: 'Deseja aceitar o vínculo a $localName?', enText: 'Do you wish to accept the link to $localName?'),
|
||||||
ptText: 'Deseja aceitar o vínculo a $localName?',
|
|
||||||
enText: 'Do you wish to accept the link to $localName?'),
|
|
||||||
() async {
|
() async {
|
||||||
var response = await _fetchResponseLink('A', local['CLI_ID']);
|
var response = await _fetchResponseLink('A', local['CLI_ID']);
|
||||||
context.pop();
|
context.pop();
|
||||||
|
@ -277,8 +263,7 @@ class _BottomArrowLinkedLocalsComponentWidgetState extends State<BottomArrowLink
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: height - (height * 0.5),
|
height: height - (height * 0.5),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: FlutterFlowTheme.of(context).primaryBackground,
|
color: FlutterFlowTheme.of(context).primaryBackground, borderRadius: const BorderRadius.only(topLeft: Radius.circular(25), topRight: Radius.circular(25))),
|
||||||
borderRadius: const BorderRadius.only(topLeft: Radius.circular(25), topRight: Radius.circular(25))),
|
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
@ -290,8 +275,7 @@ class _BottomArrowLinkedLocalsComponentWidgetState extends State<BottomArrowLink
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
children: [
|
children: [
|
||||||
Center(
|
Center(
|
||||||
child: Text(FFLocalizations.of(context)
|
child: Text(FFLocalizations.of(context).getVariableText(ptText: "Nenhum Local Encontrado.", enText: "No local found")),
|
||||||
.getVariableText(ptText: "Nenhum Local Encontrado.", enText: "No local found")),
|
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:hub/backend/api_requests/api_manager.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/features/backend/index.dart';
|
||||||
|
import 'package:hub/features/storage/index.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
||||||
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
|
||||||
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
|
||||||
|
|
||||||
// ignore: unused_import
|
// ignore: unused_import
|
||||||
import 'package:intl/intl.dart';
|
import 'package:intl/intl.dart';
|
||||||
|
@ -57,9 +56,9 @@ class ScheduleVisitDetailModel extends FlutterFlowModel<ScheduleVisitDetailWidge
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> initDB() async {
|
Future<void> initDB() async {
|
||||||
devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||||
userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||||
cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
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';
|
||||||
import 'package:hub/backend/api_requests/api_calls.dart';
|
|
||||||
import 'package:hub/components/organism_components/schedule_visit_detail/schedule_visit_detail_model.dart';
|
import 'package:hub/components/organism_components/schedule_visit_detail/schedule_visit_detail_model.dart';
|
||||||
|
import 'package:hub/features/backend/index.dart';
|
||||||
import 'package:hub/flutter_flow/custom_functions.dart';
|
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';
|
||||||
|
@ -199,15 +199,13 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
|
||||||
),
|
),
|
||||||
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
|
||||||
),
|
),
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
|
@ -241,8 +239,7 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
|
||||||
),
|
),
|
||||||
validator: _model.textController1Validator.asValidator(context),
|
validator: _model.textController1Validator.asValidator(context),
|
||||||
),
|
),
|
||||||
|
@ -273,8 +270,7 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
.containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
|
||||||
),
|
),
|
||||||
hintText: FFLocalizations.of(context).getText(
|
hintText: FFLocalizations.of(context).getText(
|
||||||
'0cp1e31d' /* dd/mm/yyyy */,
|
'0cp1e31d' /* dd/mm/yyyy */,
|
||||||
|
@ -283,8 +279,7 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
.containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
|
||||||
),
|
),
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
|
@ -319,8 +314,7 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
.containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
|
||||||
),
|
),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
validator: _model.textController2Validator.asValidator(context),
|
validator: _model.textController2Validator.asValidator(context),
|
||||||
|
@ -345,8 +339,7 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
.containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
|
||||||
),
|
),
|
||||||
hintText: FFLocalizations.of(context).getText(
|
hintText: FFLocalizations.of(context).getText(
|
||||||
'kqralft4' /* dd/mm/yyyy */,
|
'kqralft4' /* dd/mm/yyyy */,
|
||||||
|
@ -355,8 +348,7 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
.containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
|
||||||
),
|
),
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
|
@ -391,8 +383,7 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
.containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
|
||||||
),
|
),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
validator: _model.textController3Validator.asValidator(context),
|
validator: _model.textController3Validator.asValidator(context),
|
||||||
|
@ -426,8 +417,7 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
.containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
|
||||||
),
|
),
|
||||||
hintText: FFLocalizations.of(context).getText(
|
hintText: FFLocalizations.of(context).getText(
|
||||||
'47oezdm6' /* Motivo */,
|
'47oezdm6' /* Motivo */,
|
||||||
|
@ -436,8 +426,7 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
.containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
|
||||||
),
|
),
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
|
@ -471,8 +460,7 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
.containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
|
||||||
),
|
),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
validator: _model.textController4Validator.asValidator(context),
|
validator: _model.textController4Validator.asValidator(context),
|
||||||
|
@ -497,8 +485,7 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
.containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
|
||||||
),
|
),
|
||||||
hintText: FFLocalizations.of(context).getText(
|
hintText: FFLocalizations.of(context).getText(
|
||||||
'3emmbbfv' /* Nível de Acesso */,
|
'3emmbbfv' /* Nível de Acesso */,
|
||||||
|
@ -507,8 +494,7 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
.containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
|
||||||
),
|
),
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
|
@ -542,8 +528,7 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
.containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
|
||||||
),
|
),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
validator: _model.textController5Validator.asValidator(context),
|
validator: _model.textController5Validator.asValidator(context),
|
||||||
|
@ -572,15 +557,13 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
|
||||||
),
|
),
|
||||||
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
|
||||||
),
|
),
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
|
@ -614,8 +597,7 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
|
||||||
),
|
),
|
||||||
validator: _model.textController6Validator.asValidator(context),
|
validator: _model.textController6Validator.asValidator(context),
|
||||||
),
|
),
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:hub/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_widget.dart';
|
import 'package:hub/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_widget.dart';
|
||||||
|
import 'package:hub/features/storage/index.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
||||||
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
|
||||||
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
|
||||||
|
|
||||||
class UpArrowLinkedLocalsComponentModel extends FlutterFlowModel<UpArrowLinkedLocalsComponentWidget> {
|
class UpArrowLinkedLocalsComponentModel extends FlutterFlowModel<UpArrowLinkedLocalsComponentWidget> {
|
||||||
late final String devUUID;
|
late final String devUUID;
|
||||||
|
@ -16,10 +15,10 @@ class UpArrowLinkedLocalsComponentModel extends FlutterFlowModel<UpArrowLinkedLo
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> initDB() async {
|
Future<void> initDB() async {
|
||||||
devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||||
userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||||
cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||||
cliName = (await StorageHelper().get(KeychainStorageKey.clientName.value)) ?? '';
|
cliName = (await StorageHelper().get(ProfileStorageKey.clientName.key)) ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -2,8 +2,8 @@ import 'package:cached_network_image/cached_network_image.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/backend/api_requests/api_calls.dart';
|
|
||||||
import 'package:hub/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_model.dart';
|
import 'package:hub/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_model.dart';
|
||||||
|
import 'package:hub/features/backend/index.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/nav/nav.dart';
|
||||||
|
@ -166,8 +166,7 @@ class _UpArrowLinkedLocalsComponentWidgetState extends State<UpArrowLinkedLocals
|
||||||
topRight: Radius.circular(25.0),
|
topRight: Radius.circular(25.0),
|
||||||
),
|
),
|
||||||
child: CachedNetworkImage(
|
child: CachedNetworkImage(
|
||||||
imageUrl:
|
imageUrl: "https://freaccess.com.br/freaccess/Images/Clients/${getJsonField(
|
||||||
"https://freaccess.com.br/freaccess/Images/Clients/${getJsonField(
|
|
||||||
eachLocalsItem,
|
eachLocalsItem,
|
||||||
r'''$.CLI_ID''',
|
r'''$.CLI_ID''',
|
||||||
).toString()}.png",
|
).toString()}.png",
|
||||||
|
@ -189,8 +188,7 @@ class _UpArrowLinkedLocalsComponentWidgetState extends State<UpArrowLinkedLocals
|
||||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
.containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
@ -1,14 +1,12 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:hub/features/backend/index.dart';
|
||||||
|
import 'package:hub/features/storage/index.dart';
|
||||||
import 'package:hub/flutter_flow/nav/nav.dart';
|
import 'package:hub/flutter_flow/nav/nav.dart';
|
||||||
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
|
||||||
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
|
||||||
|
|
||||||
import '/backend/api_requests/api_calls.dart';
|
|
||||||
import '/flutter_flow/flutter_flow_util.dart';
|
import '/flutter_flow/flutter_flow_util.dart';
|
||||||
import 'access_notification_modal_template_component_widget.dart' show AccessNotificationModalTemplateComponentWidget;
|
import 'access_notification_modal_template_component_widget.dart' show AccessNotificationModalTemplateComponentWidget;
|
||||||
|
|
||||||
class AccessNotificationModalTemplateComponentModel
|
class AccessNotificationModalTemplateComponentModel extends FlutterFlowModel<AccessNotificationModalTemplateComponentWidget> {
|
||||||
extends FlutterFlowModel<AccessNotificationModalTemplateComponentWidget> {
|
|
||||||
late final String devUUID;
|
late final String devUUID;
|
||||||
late final String userUUID;
|
late final String userUUID;
|
||||||
late final String cliUUID;
|
late final String cliUUID;
|
||||||
|
@ -32,9 +30,9 @@ class AccessNotificationModalTemplateComponentModel
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> initDB() async {
|
Future<void> initDB() async {
|
||||||
devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||||
userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||||
cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -2,9 +2,8 @@ import 'package:easy_debounce/easy_debounce.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
|
import 'package:hub/features/storage/index.dart';
|
||||||
import 'package:hub/flutter_flow/nav/nav.dart';
|
import 'package:hub/flutter_flow/nav/nav.dart';
|
||||||
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
|
||||||
import 'package:hub/shared/helpers/storage/storage_helper.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';
|
||||||
|
@ -148,8 +147,7 @@ class _PassKeyTemplateWidgetState extends State<PassKeyTemplateWidget> {
|
||||||
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).getVariableText(
|
FFLocalizations.of(context).getVariableText(enText: 'Enter your password to continue', ptText: 'Digite sua senha para continuar'),
|
||||||
enText: 'Enter your password to continue', ptText: 'Digite sua senha para continuar'),
|
|
||||||
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,
|
||||||
|
@ -246,9 +244,7 @@ class _PassKeyTemplateWidgetState extends State<PassKeyTemplateWidget> {
|
||||||
),
|
),
|
||||||
focusNode: FocusNode(skipTraversal: true),
|
focusNode: FocusNode(skipTraversal: true),
|
||||||
child: Icon(
|
child: Icon(
|
||||||
_model.keyTextFieldVisibility1
|
_model.keyTextFieldVisibility1 ? Icons.visibility_outlined : Icons.visibility_off_outlined,
|
||||||
? Icons.visibility_outlined
|
|
||||||
: Icons.visibility_off_outlined,
|
|
||||||
color: FlutterFlowTheme.of(context).accent1,
|
color: FlutterFlowTheme.of(context).accent1,
|
||||||
size: 22.0,
|
size: 22.0,
|
||||||
),
|
),
|
||||||
|
@ -288,9 +284,7 @@ class _PassKeyTemplateWidgetState extends State<PassKeyTemplateWidget> {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
await widget.toggleActionStatus?.call(
|
await widget.toggleActionStatus?.call(
|
||||||
_model.keyTextFieldTextController1.text.isEmpty
|
_model.keyTextFieldTextController1.text.isEmpty ? _model.keyTextFieldTextController2.text : _model.keyTextFieldTextController1.text,
|
||||||
? _model.keyTextFieldTextController2.text
|
|
||||||
: _model.keyTextFieldTextController1.text,
|
|
||||||
);
|
);
|
||||||
// Navigator.pop(context, true);
|
// Navigator.pop(context, true);
|
||||||
context.pop(true);
|
context.pop(true);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
|
import 'package:hub/features/backend/index.dart';
|
||||||
import 'package:hub/shared/utils/validator_util.dart';
|
import 'package:hub/shared/utils/validator_util.dart';
|
||||||
|
|
||||||
import '/backend/api_requests/api_calls.dart';
|
|
||||||
import '/flutter_flow/flutter_flow_util.dart';
|
import '/flutter_flow/flutter_flow_util.dart';
|
||||||
import 'forgot_password_template_component_widget.dart' show ForgotPasswordTemplateComponentWidget;
|
import 'forgot_password_template_component_widget.dart' show ForgotPasswordTemplateComponentWidget;
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import 'package:easy_debounce/easy_debounce.dart';
|
import 'package:easy_debounce/easy_debounce.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';
|
||||||
|
import 'package:hub/features/authentication/index.dart';
|
||||||
import 'package:hub/flutter_flow/nav/nav.dart';
|
import 'package:hub/flutter_flow/nav/nav.dart';
|
||||||
import 'package:hub/shared/services/authentication/authentication_service.dart';
|
|
||||||
import 'package:hub/shared/utils/limited_text_size.dart';
|
import 'package:hub/shared/utils/limited_text_size.dart';
|
||||||
import 'package:hub/shared/utils/validator_util.dart';
|
import 'package:hub/shared/utils/validator_util.dart';
|
||||||
|
|
||||||
|
@ -237,8 +237,7 @@ class _ForgotPasswordTemplateComponentWidgetState extends State<ForgotPasswordTe
|
||||||
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(
|
||||||
key: const ValueKey<String>('SendButtonWidget'),
|
key: const ValueKey<String>('SendButtonWidget'),
|
||||||
onPressed: (_model.emailAddressTextController.text == '' ||
|
onPressed: (_model.emailAddressTextController.text == '' || !ValidatorUtil.isValidEmail(_model.emailAddressTextController.text))
|
||||||
!ValidatorUtil.isValidEmail(_model.emailAddressTextController.text))
|
|
||||||
? null
|
? null
|
||||||
: () async => await AuthenticationService.forgotPassword(
|
: () async => await AuthenticationService.forgotPassword(
|
||||||
context,
|
context,
|
||||||
|
|
|
@ -1,11 +1,9 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:hub/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_widget.dart';
|
import 'package:hub/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_widget.dart';
|
||||||
|
import 'package:hub/features/storage/index.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
||||||
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
|
||||||
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
|
||||||
|
|
||||||
class LiberationHistoryItemDetailsTemplateComponentModel
|
class LiberationHistoryItemDetailsTemplateComponentModel extends FlutterFlowModel<LiberationHistoryItemDetailsTemplateComponentWidget> {
|
||||||
extends FlutterFlowModel<LiberationHistoryItemDetailsTemplateComponentWidget> {
|
|
||||||
late final String devUUID;
|
late final String devUUID;
|
||||||
late final String userUUID;
|
late final String userUUID;
|
||||||
late final String cliUUID;
|
late final String cliUUID;
|
||||||
|
@ -27,9 +25,9 @@ class LiberationHistoryItemDetailsTemplateComponentModel
|
||||||
void initState(BuildContext context) {}
|
void initState(BuildContext context) {}
|
||||||
|
|
||||||
Future<void> initDatabase() async {
|
Future<void> initDatabase() async {
|
||||||
devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||||
userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||||
cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
import 'dart:developer';
|
import 'dart:developer';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:hub/backend/api_requests/api_manager.dart';
|
|
||||||
import 'package:hub/components/templates_components/provisional_schedule_template/provisional_shcedule_template_widget.dart';
|
import 'package:hub/components/templates_components/provisional_schedule_template/provisional_shcedule_template_widget.dart';
|
||||||
|
import 'package:hub/features/backend/index.dart';
|
||||||
|
import 'package:hub/features/storage/index.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
||||||
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
|
||||||
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
|
||||||
|
|
||||||
class ScheduleProvisionalVisitPageModel extends FlutterFlowModel<ScheduleProvisionalVisitPageWidget> {
|
class ScheduleProvisionalVisitPageModel extends FlutterFlowModel<ScheduleProvisionalVisitPageWidget> {
|
||||||
String cliUUID = '';
|
String cliUUID = '';
|
||||||
|
@ -88,8 +87,7 @@ class ScheduleProvisionalVisitPageModel extends FlutterFlowModel<ScheduleProvisi
|
||||||
personNameTextController ??= TextEditingController();
|
personNameTextController ??= TextEditingController();
|
||||||
personNameFocusNode ??= FocusNode();
|
personNameFocusNode ??= FocusNode();
|
||||||
|
|
||||||
dateTimeTextController ??= TextEditingController(
|
dateTimeTextController ??= TextEditingController(text: DateFormat('dd/MM/yyyy HH:mm:ss').format(DateTime.now().add(const Duration(days: 1))));
|
||||||
text: DateFormat('dd/MM/yyyy HH:mm:ss').format(DateTime.now().add(const Duration(days: 1))));
|
|
||||||
dateTimeFocusNode ??= FocusNode();
|
dateTimeFocusNode ??= FocusNode();
|
||||||
|
|
||||||
notesTextController ??= TextEditingController();
|
notesTextController ??= TextEditingController();
|
||||||
|
@ -137,11 +135,11 @@ class ScheduleProvisionalVisitPageModel extends FlutterFlowModel<ScheduleProvisi
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> init() async {
|
Future<void> init() async {
|
||||||
devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||||
userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||||
cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||||
ownerName = (await StorageHelper().get(KeychainStorageKey.ownerName.value)) ?? '';
|
ownerName = (await StorageHelper().get(ProfileStorageKey.ownerName.key)) ?? '';
|
||||||
ownerUUID = (await StorageHelper().get(KeychainStorageKey.ownerUUID.value)) ?? '';
|
ownerUUID = (await StorageHelper().get(ProfileStorageKey.ownerUUID.key)) ?? '';
|
||||||
setState?.call();
|
setState?.call();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,11 +4,11 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
import 'package:hub/components/templates_components/provisional_schedule_template/provisional_schedule_template_model.dart';
|
import 'package:hub/components/templates_components/provisional_schedule_template/provisional_schedule_template_model.dart';
|
||||||
|
import 'package:hub/features/backend/index.dart';
|
||||||
import 'package:hub/shared/utils/dialog_util.dart';
|
import 'package:hub/shared/utils/dialog_util.dart';
|
||||||
import 'package:hub/shared/utils/limited_text_size.dart';
|
import 'package:hub/shared/utils/limited_text_size.dart';
|
||||||
import 'package:hub/shared/utils/log_util.dart';
|
import 'package:hub/shared/utils/log_util.dart';
|
||||||
|
|
||||||
import '/backend/api_requests/api_calls.dart';
|
|
||||||
import '/flutter_flow/flutter_flow_theme.dart';
|
import '/flutter_flow/flutter_flow_theme.dart';
|
||||||
import '/flutter_flow/flutter_flow_util.dart';
|
import '/flutter_flow/flutter_flow_util.dart';
|
||||||
import '/flutter_flow/flutter_flow_widgets.dart';
|
import '/flutter_flow/flutter_flow_widgets.dart';
|
||||||
|
@ -75,8 +75,7 @@ class _ScheduleProvisionalVisitPageWidgetState extends State<ScheduleProvisional
|
||||||
fontSize: limitedHeaderFontSize,
|
fontSize: limitedHeaderFontSize,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -101,8 +100,7 @@ class _ScheduleProvisionalVisitPageWidgetState extends State<ScheduleProvisional
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
.containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
|
||||||
fontSize: limitedSubHeaderFontSize,
|
fontSize: limitedSubHeaderFontSize,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -140,8 +138,7 @@ class _ScheduleProvisionalVisitPageWidgetState extends State<ScheduleProvisional
|
||||||
child: CachedNetworkImage(
|
child: CachedNetworkImage(
|
||||||
fadeInDuration: const Duration(milliseconds: 200),
|
fadeInDuration: const Duration(milliseconds: 200),
|
||||||
fadeOutDuration: const Duration(milliseconds: 200),
|
fadeOutDuration: const Duration(milliseconds: 200),
|
||||||
imageUrl:
|
imageUrl: 'https://freaccess.com.br/freaccess/Images/Clients/${model.cliUUID}.png',
|
||||||
'https://freaccess.com.br/freaccess/Images/Clients/${model.cliUUID}.png',
|
|
||||||
width: 35.0,
|
width: 35.0,
|
||||||
height: 35.0,
|
height: 35.0,
|
||||||
fit: BoxFit.contain,
|
fit: BoxFit.contain,
|
||||||
|
@ -159,8 +156,7 @@ class _ScheduleProvisionalVisitPageWidgetState extends State<ScheduleProvisional
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
.containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
|
||||||
fontSize: limitedBodyFontSize,
|
fontSize: limitedBodyFontSize,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -192,8 +188,7 @@ class _ScheduleProvisionalVisitPageWidgetState extends State<ScheduleProvisional
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
.containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
|
||||||
fontSize: limitedSubHeaderFontSize,
|
fontSize: limitedSubHeaderFontSize,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -231,16 +226,14 @@ class _ScheduleProvisionalVisitPageWidgetState extends State<ScheduleProvisional
|
||||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
.containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
),
|
),
|
||||||
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
.containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
),
|
),
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
|
@ -280,8 +273,7 @@ class _ScheduleProvisionalVisitPageWidgetState extends State<ScheduleProvisional
|
||||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
.containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
),
|
),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
|
@ -325,8 +317,7 @@ class _ScheduleProvisionalVisitPageWidgetState extends State<ScheduleProvisional
|
||||||
labelStyle: FlutterFlowTheme.of(context).bodyMedium.override(
|
labelStyle: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
.containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
),
|
),
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
|
@ -365,8 +356,7 @@ class _ScheduleProvisionalVisitPageWidgetState extends State<ScheduleProvisional
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
.containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
),
|
),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
|
@ -392,25 +382,18 @@ class _ScheduleProvisionalVisitPageWidgetState extends State<ScheduleProvisional
|
||||||
child!,
|
child!,
|
||||||
headerBackgroundColor: FlutterFlowTheme.of(context).primary,
|
headerBackgroundColor: FlutterFlowTheme.of(context).primary,
|
||||||
headerForegroundColor: FlutterFlowTheme.of(context).info,
|
headerForegroundColor: FlutterFlowTheme.of(context).info,
|
||||||
headerTextStyle:
|
headerTextStyle: FlutterFlowTheme.of(context).headlineLarge.override(
|
||||||
FlutterFlowTheme.of(context).headlineLarge.override(
|
fontFamily: FlutterFlowTheme.of(context).headlineLargeFamily,
|
||||||
fontFamily:
|
fontSize: 32.0,
|
||||||
FlutterFlowTheme.of(context).headlineLargeFamily,
|
letterSpacing: 0.0,
|
||||||
fontSize: 32.0,
|
fontWeight: FontWeight.w600,
|
||||||
letterSpacing: 0.0,
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).headlineLargeFamily),
|
||||||
fontWeight: FontWeight.w600,
|
),
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
pickerBackgroundColor: FlutterFlowTheme.of(context).secondaryBackground,
|
||||||
FlutterFlowTheme.of(context).headlineLargeFamily),
|
|
||||||
),
|
|
||||||
pickerBackgroundColor:
|
|
||||||
FlutterFlowTheme.of(context).secondaryBackground,
|
|
||||||
pickerForegroundColor: FlutterFlowTheme.of(context).primaryText,
|
pickerForegroundColor: FlutterFlowTheme.of(context).primaryText,
|
||||||
selectedDateTimeBackgroundColor:
|
selectedDateTimeBackgroundColor: FlutterFlowTheme.of(context).primary,
|
||||||
FlutterFlowTheme.of(context).primary,
|
selectedDateTimeForegroundColor: FlutterFlowTheme.of(context).info,
|
||||||
selectedDateTimeForegroundColor:
|
actionButtonForegroundColor: FlutterFlowTheme.of(context).primaryText,
|
||||||
FlutterFlowTheme.of(context).info,
|
|
||||||
actionButtonForegroundColor:
|
|
||||||
FlutterFlowTheme.of(context).primaryText,
|
|
||||||
iconSize: 24.0,
|
iconSize: 24.0,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
@ -427,27 +410,19 @@ class _ScheduleProvisionalVisitPageWidgetState extends State<ScheduleProvisional
|
||||||
child!,
|
child!,
|
||||||
headerBackgroundColor: FlutterFlowTheme.of(context).primary,
|
headerBackgroundColor: FlutterFlowTheme.of(context).primary,
|
||||||
headerForegroundColor: FlutterFlowTheme.of(context).info,
|
headerForegroundColor: FlutterFlowTheme.of(context).info,
|
||||||
headerTextStyle:
|
headerTextStyle: FlutterFlowTheme.of(context).headlineLarge.override(
|
||||||
FlutterFlowTheme.of(context).headlineLarge.override(
|
fontFamily: FlutterFlowTheme.of(context).headlineLargeFamily,
|
||||||
fontFamily:
|
fontSize: 32.0,
|
||||||
FlutterFlowTheme.of(context).headlineLargeFamily,
|
letterSpacing: 0.0,
|
||||||
fontSize: 32.0,
|
fontWeight: FontWeight.w600,
|
||||||
letterSpacing: 0.0,
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).headlineLargeFamily),
|
||||||
fontWeight: FontWeight.w600,
|
),
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
pickerBackgroundColor: FlutterFlowTheme.of(context).secondaryBackground,
|
||||||
FlutterFlowTheme.of(context).headlineLargeFamily),
|
|
||||||
),
|
|
||||||
pickerBackgroundColor:
|
|
||||||
FlutterFlowTheme.of(context).secondaryBackground,
|
|
||||||
pickerForegroundColor: FlutterFlowTheme.of(context).info,
|
pickerForegroundColor: FlutterFlowTheme.of(context).info,
|
||||||
selectedDateTimeBackgroundColor:
|
selectedDateTimeBackgroundColor: FlutterFlowTheme.of(context).primary,
|
||||||
FlutterFlowTheme.of(context).primary,
|
pickerDialForegroundColor: FlutterFlowTheme.of(context).primaryText,
|
||||||
pickerDialForegroundColor:
|
selectedDateTimeForegroundColor: FlutterFlowTheme.of(context).info,
|
||||||
FlutterFlowTheme.of(context).primaryText,
|
actionButtonForegroundColor: FlutterFlowTheme.of(context).primaryText,
|
||||||
selectedDateTimeForegroundColor:
|
|
||||||
FlutterFlowTheme.of(context).info,
|
|
||||||
actionButtonForegroundColor:
|
|
||||||
FlutterFlowTheme.of(context).primaryText,
|
|
||||||
iconSize: 24.0,
|
iconSize: 24.0,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
@ -473,8 +448,7 @@ class _ScheduleProvisionalVisitPageWidgetState extends State<ScheduleProvisional
|
||||||
locale: FFLocalizations.of(context).languageCode,
|
locale: FFLocalizations.of(context).languageCode,
|
||||||
);
|
);
|
||||||
|
|
||||||
model.dateTimeTextController?.selection = TextSelection.collapsed(
|
model.dateTimeTextController?.selection = TextSelection.collapsed(offset: model.dateTimeTextController!.text.length);
|
||||||
offset: model.dateTimeTextController!.text.length);
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
|
@ -530,16 +504,14 @@ class _ScheduleProvisionalVisitPageWidgetState extends State<ScheduleProvisional
|
||||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
fontFamily: 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).bodyMediumFamily),
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
),
|
),
|
||||||
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
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).labelMediumFamily),
|
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
),
|
),
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
|
@ -579,8 +551,7 @@ class _ScheduleProvisionalVisitPageWidgetState extends State<ScheduleProvisional
|
||||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
.containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
),
|
),
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
|
@ -607,29 +578,24 @@ class _ScheduleProvisionalVisitPageWidgetState extends State<ScheduleProvisional
|
||||||
: () async {
|
: () async {
|
||||||
try {
|
try {
|
||||||
model.provVisitSchedule = await PhpGroup.postProvVisitSchedulingCall.call(
|
model.provVisitSchedule = await PhpGroup.postProvVisitSchedulingCall.call(
|
||||||
data: DateFormat('dd/MM/yyyy HH:mm:ss').format(DateFormat('dd/MM/yyyy HH:mm:ss')
|
data: DateFormat('dd/MM/yyyy HH:mm:ss')
|
||||||
.parse(model.dateTimeTextController.text)
|
.format(DateFormat('dd/MM/yyyy HH:mm:ss').parse(model.dateTimeTextController.text).add(const Duration(hours: 3))),
|
||||||
.add(const Duration(hours: 3))),
|
|
||||||
motivo: model.notesTextController.text,
|
motivo: model.notesTextController.text,
|
||||||
nome: model.personNameTextController.text,
|
nome: model.personNameTextController.text,
|
||||||
proID: model.ownerUUID,
|
proID: model.ownerUUID,
|
||||||
);
|
);
|
||||||
if (PhpGroup.postProvVisitSchedulingCall
|
if (PhpGroup.postProvVisitSchedulingCall.error((model.provVisitSchedule?.jsonBody ?? '')) == false) {
|
||||||
.error((model.provVisitSchedule?.jsonBody ?? '')) ==
|
|
||||||
false) {
|
|
||||||
await DialogUtil.success(
|
await DialogUtil.success(
|
||||||
context,
|
context,
|
||||||
FFLocalizations.of(context).getVariableText(
|
FFLocalizations.of(context)
|
||||||
ptText: "Agendamento Provisório Realizado com Sucesso!",
|
.getVariableText(ptText: "Agendamento Provisório Realizado com Sucesso!", enText: "Provisional Scheduling Successfully Completed"));
|
||||||
enText: "Provisional Scheduling Successfully Completed"));
|
|
||||||
safeSetState(() {
|
safeSetState(() {
|
||||||
model.dateTimeTextController?.clear();
|
model.dateTimeTextController?.clear();
|
||||||
model.personNameTextController?.clear();
|
model.personNameTextController?.clear();
|
||||||
model.notesTextController?.clear();
|
model.notesTextController?.clear();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
var message = PhpGroup.postProvVisitSchedulingCall
|
var message = PhpGroup.postProvVisitSchedulingCall.msg((model.provVisitSchedule?.jsonBody ?? ''));
|
||||||
.msg((model.provVisitSchedule?.jsonBody ?? ''));
|
|
||||||
if (message != null) {
|
if (message != null) {
|
||||||
await DialogUtil.error(context, message);
|
await DialogUtil.error(context, message);
|
||||||
} else {
|
} else {
|
||||||
|
@ -639,8 +605,7 @@ class _ScheduleProvisionalVisitPageWidgetState extends State<ScheduleProvisional
|
||||||
setState(() {});
|
setState(() {});
|
||||||
} catch (e, s) {
|
} catch (e, s) {
|
||||||
await DialogUtil.errorDefault(context);
|
await DialogUtil.errorDefault(context);
|
||||||
LogUtil.requestAPIFailed(
|
LogUtil.requestAPIFailed("processRequest.php", "", "Cadastrar Visita Provisória", e, s);
|
||||||
"processRequest.php", "", "Cadastrar Visita Provisória", e, s);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
showLoadingIndicator: true,
|
showLoadingIndicator: true,
|
||||||
|
@ -654,8 +619,7 @@ class _ScheduleProvisionalVisitPageWidgetState extends State<ScheduleProvisional
|
||||||
fontFamily: FlutterFlowTheme.of(context).titleSmallFamily,
|
fontFamily: FlutterFlowTheme.of(context).titleSmallFamily,
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).titleSmallFamily),
|
||||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).titleSmallFamily),
|
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
),
|
),
|
||||||
elevation: 3.0,
|
elevation: 3.0,
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
import 'package:hub/features/backend/index.dart';
|
||||||
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
import 'package:hub/features/storage/index.dart';
|
||||||
|
|
||||||
import 'package:hub/shared/utils/validator_util.dart';
|
import 'package:hub/shared/utils/validator_util.dart';
|
||||||
|
|
||||||
import '/backend/api_requests/api_calls.dart';
|
|
||||||
import '/flutter_flow/flutter_flow_util.dart';
|
import '/flutter_flow/flutter_flow_util.dart';
|
||||||
import '/flutter_flow/form_field_controller.dart';
|
import '/flutter_flow/form_field_controller.dart';
|
||||||
import 'regisiter_vistor_template_component_widget.dart';
|
import 'regisiter_vistor_template_component_widget.dart';
|
||||||
|
@ -129,9 +129,9 @@ class RegisiterVistorTemplateComponentModel extends FlutterFlowModel<RegisiterVi
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> initializeDatabase() async {
|
Future<void> initializeDatabase() async {
|
||||||
devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||||
userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||||
cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,13 +3,13 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
import 'package:hub/components/atomic_components/shared_components_atoms/media_upload_button.dart';
|
import 'package:hub/components/atomic_components/shared_components_atoms/media_upload_button.dart';
|
||||||
|
import 'package:hub/features/backend/index.dart';
|
||||||
import 'package:hub/shared/utils/dialog_util.dart';
|
import 'package:hub/shared/utils/dialog_util.dart';
|
||||||
import 'package:hub/shared/utils/image_util.dart';
|
import 'package:hub/shared/utils/image_util.dart';
|
||||||
import 'package:hub/shared/utils/limited_text_size.dart';
|
import 'package:hub/shared/utils/limited_text_size.dart';
|
||||||
import 'package:hub/shared/utils/validator_util.dart';
|
import 'package:hub/shared/utils/validator_util.dart';
|
||||||
import 'package:rxdart/rxdart.dart';
|
import 'package:rxdart/rxdart.dart';
|
||||||
|
|
||||||
import '/backend/api_requests/api_calls.dart';
|
|
||||||
import '/flutter_flow/flutter_flow_drop_down.dart';
|
import '/flutter_flow/flutter_flow_drop_down.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';
|
||||||
|
@ -103,9 +103,7 @@ class _RegisiterVistorTemplateComponentWidgetState extends State<RegisiterVistor
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_model.textController4.text.isNotEmpty &&
|
if (_model.textController4.text.isNotEmpty && _model.textController4.text != '' && ValidatorUtil.isValidEmail(_model.textController4.text) == false) {
|
||||||
_model.textController4.text != '' &&
|
|
||||||
ValidatorUtil.isValidEmail(_model.textController4.text) == false) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -153,8 +151,7 @@ class _RegisiterVistorTemplateComponentWidgetState extends State<RegisiterVistor
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
|
||||||
fontSize: limitedHeaderFontSize,
|
fontSize: limitedHeaderFontSize,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -184,15 +181,13 @@ class _RegisiterVistorTemplateComponentWidgetState extends State<RegisiterVistor
|
||||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
),
|
),
|
||||||
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
),
|
),
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
|
@ -236,8 +231,7 @@ class _RegisiterVistorTemplateComponentWidgetState extends State<RegisiterVistor
|
||||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
),
|
),
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
|
@ -249,10 +243,7 @@ class _RegisiterVistorTemplateComponentWidgetState extends State<RegisiterVistor
|
||||||
}, const Duration(milliseconds: 500));
|
}, const Duration(milliseconds: 500));
|
||||||
},
|
},
|
||||||
validator: _model.textController2Validator.asValidator(context),
|
validator: _model.textController2Validator.asValidator(context),
|
||||||
inputFormatters: [
|
inputFormatters: [FilteringTextInputFormatter.allow(RegExp('[0-9]')), LengthLimitingTextInputFormatter(20)],
|
||||||
FilteringTextInputFormatter.allow(RegExp('[0-9]')),
|
|
||||||
LengthLimitingTextInputFormatter(20)
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
_model.textController2.text.isEmpty
|
_model.textController2.text.isEmpty
|
||||||
? const SizedBox()
|
? const SizedBox()
|
||||||
|
@ -306,16 +297,14 @@ class _RegisiterVistorTemplateComponentWidgetState extends State<RegisiterVistor
|
||||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
),
|
),
|
||||||
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
),
|
),
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
|
@ -359,8 +348,7 @@ class _RegisiterVistorTemplateComponentWidgetState extends State<RegisiterVistor
|
||||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
),
|
),
|
||||||
maxLines: null,
|
maxLines: null,
|
||||||
|
@ -391,8 +379,7 @@ class _RegisiterVistorTemplateComponentWidgetState extends State<RegisiterVistor
|
||||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
),
|
),
|
||||||
hintText: FFLocalizations.of(context).getVariableText(
|
hintText: FFLocalizations.of(context).getVariableText(
|
||||||
|
@ -430,8 +417,7 @@ class _RegisiterVistorTemplateComponentWidgetState extends State<RegisiterVistor
|
||||||
fontFamily: FlutterFlowTheme.of(context).bodySmallFamily,
|
fontFamily: FlutterFlowTheme.of(context).bodySmallFamily,
|
||||||
color: FlutterFlowTheme.of(context).customColor6,
|
color: FlutterFlowTheme.of(context).customColor6,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodySmallFamily),
|
||||||
.containsKey(FlutterFlowTheme.of(context).bodySmallFamily),
|
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
)),
|
)),
|
||||||
),
|
),
|
||||||
|
@ -497,8 +483,7 @@ class _RegisiterVistorTemplateComponentWidgetState extends State<RegisiterVistor
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
|
||||||
fontSize: limitedSubHeaderFontSize,
|
fontSize: limitedSubHeaderFontSize,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -516,10 +501,7 @@ class _RegisiterVistorTemplateComponentWidgetState extends State<RegisiterVistor
|
||||||
|
|
||||||
maxLength: 25,
|
maxLength: 25,
|
||||||
keyboardType: TextInputType.phone,
|
keyboardType: TextInputType.phone,
|
||||||
inputFormatters: [
|
inputFormatters: [FilteringTextInputFormatter.allow(RegExp('[0-9, +, -, (, )]')), LengthLimitingTextInputFormatter(25)],
|
||||||
FilteringTextInputFormatter.allow(RegExp('[0-9, +, -, (, )]')),
|
|
||||||
LengthLimitingTextInputFormatter(25)
|
|
||||||
],
|
|
||||||
obscureText: false,
|
obscureText: false,
|
||||||
|
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
|
@ -531,16 +513,14 @@ class _RegisiterVistorTemplateComponentWidgetState extends State<RegisiterVistor
|
||||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
),
|
),
|
||||||
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
),
|
),
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
|
@ -580,8 +560,7 @@ class _RegisiterVistorTemplateComponentWidgetState extends State<RegisiterVistor
|
||||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
),
|
),
|
||||||
// validator:
|
// validator:
|
||||||
|
@ -613,16 +592,14 @@ class _RegisiterVistorTemplateComponentWidgetState extends State<RegisiterVistor
|
||||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
),
|
),
|
||||||
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
),
|
),
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
|
@ -662,8 +639,7 @@ class _RegisiterVistorTemplateComponentWidgetState extends State<RegisiterVistor
|
||||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
),
|
),
|
||||||
keyboardType: TextInputType.emailAddress,
|
keyboardType: TextInputType.emailAddress,
|
||||||
|
@ -707,14 +683,12 @@ class _RegisiterVistorTemplateComponentWidgetState extends State<RegisiterVistor
|
||||||
_model.uploadedLocalFile = FFUploadedFile(bytes: Uint8List.fromList([]));
|
_model.uploadedLocalFile = FFUploadedFile(bytes: Uint8List.fromList([]));
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
SnackBar(
|
SnackBar(
|
||||||
content: Text(
|
content:
|
||||||
FFLocalizations.of(context).getVariableText(
|
Text(FFLocalizations.of(context).getVariableText(ptText: 'Visitante cadastrado com sucesso.', enText: 'Visitor successfully registered.'),
|
||||||
ptText: 'Visitante cadastrado com sucesso.',
|
style: TextStyle(
|
||||||
enText: 'Visitor successfully registered.'),
|
color: FlutterFlowTheme.of(context).info,
|
||||||
style: TextStyle(
|
fontSize: limitedInputFontSize,
|
||||||
color: FlutterFlowTheme.of(context).info,
|
)),
|
||||||
fontSize: limitedInputFontSize,
|
|
||||||
)),
|
|
||||||
backgroundColor: FlutterFlowTheme.of(context).primary,
|
backgroundColor: FlutterFlowTheme.of(context).primary,
|
||||||
duration: const Duration(seconds: 3),
|
duration: const Duration(seconds: 3),
|
||||||
width: MediaQuery.of(context).size.width,
|
width: MediaQuery.of(context).size.width,
|
||||||
|
@ -740,9 +714,7 @@ class _RegisiterVistorTemplateComponentWidgetState extends State<RegisiterVistor
|
||||||
ptText: 'Erro ao se conectar com o servidor',
|
ptText: 'Erro ao se conectar com o servidor',
|
||||||
enText: 'Error connecting to server',
|
enText: 'Error connecting to server',
|
||||||
)
|
)
|
||||||
: PhpGroup.postScheduleVisitorCall
|
: PhpGroup.postScheduleVisitorCall.errorMsg(_model.scheduleVisitor?.jsonBody).toString());
|
||||||
.errorMsg(_model.scheduleVisitor?.jsonBody)
|
|
||||||
.toString());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
: null,
|
: null,
|
||||||
|
@ -759,8 +731,7 @@ class _RegisiterVistorTemplateComponentWidgetState extends State<RegisiterVistor
|
||||||
fontFamily: FlutterFlowTheme.of(context).titleSmallFamily,
|
fontFamily: FlutterFlowTheme.of(context).titleSmallFamily,
|
||||||
color: FlutterFlowTheme.of(context).info,
|
color: FlutterFlowTheme.of(context).info,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).titleSmallFamily),
|
||||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).titleSmallFamily),
|
|
||||||
fontSize: limitedInputFontSize,
|
fontSize: limitedInputFontSize,
|
||||||
),
|
),
|
||||||
borderSide: const BorderSide(
|
borderSide: const BorderSide(
|
||||||
|
@ -776,10 +747,7 @@ class _RegisiterVistorTemplateComponentWidgetState extends State<RegisiterVistor
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
]
|
].divide(const SizedBox(height: 10.0)).addToStart(const SizedBox(height: 30.0)).addToEnd(const SizedBox(height: 30.0)),
|
||||||
.divide(const SizedBox(height: 10.0))
|
|
||||||
.addToStart(const SizedBox(height: 30.0))
|
|
||||||
.addToEnd(const SizedBox(height: 30.0)),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
@ -3,7 +3,8 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_animate/flutter_animate.dart';
|
import 'package:flutter_animate/flutter_animate.dart';
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
import 'package:hub/components/atomic_components/shared_components_atoms/atom_image_svg_theme.dart';
|
import 'package:hub/components/atomic_components/shared_components_atoms/atom_image_svg_theme.dart';
|
||||||
import 'package:hub/shared/components/atoms/term_of_use/atom_terms_of_use.dart';
|
import 'package:hub/components/atomic_components/term_of_use/atom_terms_of_use.dart';
|
||||||
|
import 'package:hub/features/authentication/index.dart';
|
||||||
import 'package:hub/shared/utils/dialog_util.dart';
|
import 'package:hub/shared/utils/dialog_util.dart';
|
||||||
import 'package:hub/shared/utils/limited_text_size.dart';
|
import 'package:hub/shared/utils/limited_text_size.dart';
|
||||||
import 'package:hub/shared/utils/log_util.dart';
|
import 'package:hub/shared/utils/log_util.dart';
|
||||||
|
@ -14,7 +15,6 @@ import '/flutter_flow/flutter_flow_animations.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';
|
||||||
import '/flutter_flow/flutter_flow_widgets.dart';
|
import '/flutter_flow/flutter_flow_widgets.dart';
|
||||||
import '../../../shared/services/authentication/authentication_service.dart';
|
|
||||||
import 'sign_in_template_component_model.dart';
|
import 'sign_in_template_component_model.dart';
|
||||||
|
|
||||||
export 'sign_in_template_component_model.dart';
|
export 'sign_in_template_component_model.dart';
|
||||||
|
|
|
@ -3,9 +3,10 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_animate/flutter_animate.dart';
|
import 'package:flutter_animate/flutter_animate.dart';
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
import 'package:hub/components/atomic_components/shared_components_atoms/atom_image_svg_theme.dart';
|
import 'package:hub/components/atomic_components/shared_components_atoms/atom_image_svg_theme.dart';
|
||||||
import 'package:hub/shared/components/atoms/term_of_use/atom_terms_of_use.dart';
|
import 'package:hub/components/atomic_components/term_of_use/atom_terms_of_use.dart';
|
||||||
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
import 'package:hub/features/authentication/index.dart';
|
||||||
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
import 'package:hub/features/storage/index.dart';
|
||||||
|
|
||||||
import 'package:hub/shared/utils/limited_text_size.dart';
|
import 'package:hub/shared/utils/limited_text_size.dart';
|
||||||
import 'package:hub/shared/utils/validator_util.dart';
|
import 'package:hub/shared/utils/validator_util.dart';
|
||||||
|
|
||||||
|
@ -13,7 +14,6 @@ import '/flutter_flow/flutter_flow_animations.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';
|
||||||
import '/flutter_flow/flutter_flow_widgets.dart';
|
import '/flutter_flow/flutter_flow_widgets.dart';
|
||||||
import '../../../shared/services/authentication/authentication_service.dart';
|
|
||||||
import 'sign_up_template_component_model.dart';
|
import 'sign_up_template_component_model.dart';
|
||||||
|
|
||||||
export 'sign_up_template_component_model.dart';
|
export 'sign_up_template_component_model.dart';
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
import 'package:hub/features/backend/index.dart';
|
||||||
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
import 'package:hub/features/storage/index.dart';
|
||||||
|
|
||||||
import '/backend/api_requests/api_calls.dart';
|
|
||||||
import '/flutter_flow/flutter_flow_util.dart';
|
import '/flutter_flow/flutter_flow_util.dart';
|
||||||
import 'view_visit_detail_widget.dart' show ViewVisitDetailWidget;
|
import 'view_visit_detail_widget.dart' show ViewVisitDetailWidget;
|
||||||
|
|
||||||
|
@ -37,9 +36,9 @@ class ViewVisitDetailModel extends FlutterFlowModel<ViewVisitDetailWidget> {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> initializeDatabase() async {
|
Future<void> initializeDatabase() async {
|
||||||
devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||||
userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||||
cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
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';
|
||||||
|
import 'package:hub/features/backend/index.dart';
|
||||||
import 'package:hub/flutter_flow/nav/nav.dart';
|
import 'package:hub/flutter_flow/nav/nav.dart';
|
||||||
import 'package:hub/shared/utils/dialog_util.dart';
|
import 'package:hub/shared/utils/dialog_util.dart';
|
||||||
import 'package:share_plus/share_plus.dart';
|
import 'package:share_plus/share_plus.dart';
|
||||||
|
|
||||||
import '/backend/api_requests/api_calls.dart';
|
|
||||||
import '/flutter_flow/flutter_flow_icon_button.dart';
|
import '/flutter_flow/flutter_flow_icon_button.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';
|
||||||
|
@ -85,8 +85,7 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
||||||
// }
|
// }
|
||||||
// });
|
// });
|
||||||
|
|
||||||
_model.textController1 =
|
_model.textController1 = TextEditingController(text: widget.visitTempStr == 'null' ? '' : widget.visitTempStr ?? '');
|
||||||
TextEditingController(text: widget.visitTempStr == 'null' ? '' : widget.visitTempStr ?? '');
|
|
||||||
_model.textFieldFocusNode1 ??= FocusNode();
|
_model.textFieldFocusNode1 ??= FocusNode();
|
||||||
|
|
||||||
_model.textController2 ??= TextEditingController(text: widget.visitStartDate);
|
_model.textController2 ??= TextEditingController(text: widget.visitStartDate);
|
||||||
|
@ -257,15 +256,13 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
||||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
|
||||||
),
|
),
|
||||||
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
|
||||||
),
|
),
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
|
@ -299,8 +296,7 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
|
||||||
),
|
),
|
||||||
validator: _model.textController1Validator.asValidator(context),
|
validator: _model.textController1Validator.asValidator(context),
|
||||||
),
|
),
|
||||||
|
@ -332,8 +328,7 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
||||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
.containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
|
||||||
),
|
),
|
||||||
hintText: FFLocalizations.of(context).getText(
|
hintText: FFLocalizations.of(context).getText(
|
||||||
'ub084nhy' /* dd/mm/yyyy */,
|
'ub084nhy' /* dd/mm/yyyy */,
|
||||||
|
@ -342,8 +337,7 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
||||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
.containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
|
||||||
),
|
),
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
|
@ -377,8 +371,7 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
|
||||||
),
|
),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
validator: _model.textController2Validator.asValidator(context),
|
validator: _model.textController2Validator.asValidator(context),
|
||||||
|
@ -405,8 +398,7 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
||||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
.containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
|
||||||
),
|
),
|
||||||
hintText: FFLocalizations.of(context).getText(
|
hintText: FFLocalizations.of(context).getText(
|
||||||
'ixs67mrz' /* dd/mm/yyyy */,
|
'ixs67mrz' /* dd/mm/yyyy */,
|
||||||
|
@ -415,8 +407,7 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
||||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
.containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
|
||||||
),
|
),
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
|
@ -450,8 +441,7 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
|
||||||
),
|
),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
validator: _model.textController3Validator.asValidator(context),
|
validator: _model.textController3Validator.asValidator(context),
|
||||||
|
@ -487,8 +477,7 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
||||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
.containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
|
||||||
),
|
),
|
||||||
hintText: FFLocalizations.of(context).getText(
|
hintText: FFLocalizations.of(context).getText(
|
||||||
'ypeydbem' /* Motivo */,
|
'ypeydbem' /* Motivo */,
|
||||||
|
@ -497,8 +486,7 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
||||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
.containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
|
||||||
),
|
),
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
|
@ -532,8 +520,7 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
|
||||||
),
|
),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
validator: _model.textController4Validator.asValidator(context),
|
validator: _model.textController4Validator.asValidator(context),
|
||||||
|
@ -560,8 +547,7 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
||||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
.containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
|
||||||
),
|
),
|
||||||
hintText: FFLocalizations.of(context).getText(
|
hintText: FFLocalizations.of(context).getText(
|
||||||
'rs3d4gb8' /* Nível de Acesso */,
|
'rs3d4gb8' /* Nível de Acesso */,
|
||||||
|
@ -570,8 +556,7 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
||||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
.containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
|
||||||
),
|
),
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
|
@ -605,8 +590,7 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
|
||||||
),
|
),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
validator: _model.textController5Validator.asValidator(context),
|
validator: _model.textController5Validator.asValidator(context),
|
||||||
|
@ -637,15 +621,13 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
||||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
|
||||||
),
|
),
|
||||||
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
|
||||||
),
|
),
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
|
@ -679,8 +661,7 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
|
||||||
),
|
),
|
||||||
validator: _model.textController6Validator.asValidator(context),
|
validator: _model.textController6Validator.asValidator(context),
|
||||||
),
|
),
|
||||||
|
@ -754,10 +735,7 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
} else if ((widget.visitStatusStr == 'C') ||
|
} else if ((widget.visitStatusStr == 'C') || (widget.visitStatusStr == 'F') || (widget.visitStatusStr == 'B') || (widget.visitStatusStr == 'I')) {
|
||||||
(widget.visitStatusStr == 'F') ||
|
|
||||||
(widget.visitStatusStr == 'B') ||
|
|
||||||
(widget.visitStatusStr == 'I')) {
|
|
||||||
return InkWell(
|
return InkWell(
|
||||||
splashColor: Colors.transparent,
|
splashColor: Colors.transparent,
|
||||||
focusColor: Colors.transparent,
|
focusColor: Colors.transparent,
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:hub/backend/api_requests/api_manager.dart';
|
|
||||||
import 'package:hub/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart';
|
import 'package:hub/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart';
|
||||||
|
import 'package:hub/features/backend/index.dart';
|
||||||
|
import 'package:hub/features/storage/index.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
||||||
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
|
||||||
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
|
||||||
|
|
||||||
class VisitorSearchModalTemplateComponentModel extends FlutterFlowModel<VisitorSearchModalTemplateComponentWidget> {
|
class VisitorSearchModalTemplateComponentModel extends FlutterFlowModel<VisitorSearchModalTemplateComponentWidget> {
|
||||||
late final String devUUID;
|
late final String devUUID;
|
||||||
|
@ -35,9 +34,9 @@ class VisitorSearchModalTemplateComponentModel extends FlutterFlowModel<VisitorS
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> initDatabase() async {
|
Future<void> initDatabase() async {
|
||||||
devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||||
userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||||
cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,12 @@
|
||||||
import 'dart:developer';
|
|
||||||
|
|
||||||
import 'package:cached_network_image/cached_network_image.dart';
|
import 'package:cached_network_image/cached_network_image.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:fluttertoast/fluttertoast.dart';
|
import 'package:fluttertoast/fluttertoast.dart';
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
import 'package:hub/backend/api_requests/api_calls.dart';
|
|
||||||
import 'package:hub/components/atomic_components/shared_components_atoms/toast.dart';
|
import 'package:hub/components/atomic_components/shared_components_atoms/toast.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_search_modal_template_component/visitor_search_modal_template_component_model.dart';
|
import 'package:hub/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_model.dart';
|
||||||
|
import 'package:hub/features/backend/index.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';
|
||||||
|
@ -30,8 +28,7 @@ class VisitorSearchModalTemplateComponentWidget extends StatefulWidget {
|
||||||
State<VisitorSearchModalTemplateComponentWidget> createState() => _VisitorSearchModalTemplateComponentWidgetState();
|
State<VisitorSearchModalTemplateComponentWidget> createState() => _VisitorSearchModalTemplateComponentWidgetState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _VisitorSearchModalTemplateComponentWidgetState extends State<VisitorSearchModalTemplateComponentWidget>
|
class _VisitorSearchModalTemplateComponentWidgetState extends State<VisitorSearchModalTemplateComponentWidget> with TickerProviderStateMixin {
|
||||||
with TickerProviderStateMixin {
|
|
||||||
late VisitorSearchModalTemplateComponentModel _model;
|
late VisitorSearchModalTemplateComponentModel _model;
|
||||||
|
|
||||||
safeSetState(VoidCallback callback) {
|
safeSetState(VoidCallback callback) {
|
||||||
|
@ -106,34 +103,22 @@ class _VisitorSearchModalTemplateComponentWidgetState extends State<VisitorSearc
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(color: FlutterFlowTheme.of(context).accent1, width: 0.5),
|
borderSide: BorderSide(color: FlutterFlowTheme.of(context).accent1, width: 0.5),
|
||||||
borderRadius: const BorderRadius.only(
|
borderRadius: const BorderRadius.only(
|
||||||
bottomLeft: Radius.circular(15.0),
|
bottomLeft: Radius.circular(15.0), bottomRight: Radius.circular(15.0), topLeft: Radius.circular(15.0), topRight: Radius.circular(15.0)),
|
||||||
bottomRight: Radius.circular(15.0),
|
|
||||||
topLeft: Radius.circular(15.0),
|
|
||||||
topRight: Radius.circular(15.0)),
|
|
||||||
),
|
),
|
||||||
focusedBorder: OutlineInputBorder(
|
focusedBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(color: FlutterFlowTheme.of(context).primary, width: 0.5),
|
borderSide: BorderSide(color: FlutterFlowTheme.of(context).primary, width: 0.5),
|
||||||
borderRadius: const BorderRadius.only(
|
borderRadius: const BorderRadius.only(
|
||||||
bottomLeft: Radius.circular(15.0),
|
bottomLeft: Radius.circular(15.0), bottomRight: Radius.circular(15.0), topLeft: Radius.circular(15.0), topRight: Radius.circular(15.0)),
|
||||||
bottomRight: Radius.circular(15.0),
|
|
||||||
topLeft: Radius.circular(15.0),
|
|
||||||
topRight: Radius.circular(15.0)),
|
|
||||||
),
|
),
|
||||||
errorBorder: OutlineInputBorder(
|
errorBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(color: FlutterFlowTheme.of(context).error, width: 0.5),
|
borderSide: BorderSide(color: FlutterFlowTheme.of(context).error, width: 0.5),
|
||||||
borderRadius: const BorderRadius.only(
|
borderRadius: const BorderRadius.only(
|
||||||
bottomLeft: Radius.circular(15.0),
|
bottomLeft: Radius.circular(15.0), bottomRight: Radius.circular(15.0), topLeft: Radius.circular(15.0), topRight: Radius.circular(15.0)),
|
||||||
bottomRight: Radius.circular(15.0),
|
|
||||||
topLeft: Radius.circular(15.0),
|
|
||||||
topRight: Radius.circular(15.0)),
|
|
||||||
),
|
),
|
||||||
focusedErrorBorder: OutlineInputBorder(
|
focusedErrorBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(color: FlutterFlowTheme.of(context).error, width: 0.5),
|
borderSide: BorderSide(color: FlutterFlowTheme.of(context).error, width: 0.5),
|
||||||
borderRadius: const BorderRadius.only(
|
borderRadius: const BorderRadius.only(
|
||||||
bottomLeft: Radius.circular(15.0),
|
bottomLeft: Radius.circular(15.0), bottomRight: Radius.circular(15.0), topLeft: Radius.circular(15.0), topRight: Radius.circular(15.0)),
|
||||||
bottomRight: Radius.circular(15.0),
|
|
||||||
topLeft: Radius.circular(15.0),
|
|
||||||
topRight: Radius.circular(15.0)),
|
|
||||||
),
|
),
|
||||||
filled: true,
|
filled: true,
|
||||||
fillColor: FlutterFlowTheme.of(context).primaryBackground,
|
fillColor: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
|
@ -163,8 +148,7 @@ class _VisitorSearchModalTemplateComponentWidgetState extends State<VisitorSearc
|
||||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
|
||||||
fontSize: limitedHeaderFontSize,
|
fontSize: limitedHeaderFontSize,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -176,8 +160,7 @@ class _VisitorSearchModalTemplateComponentWidgetState extends State<VisitorSearc
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts:
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
|
||||||
fontSize: limitedHeaderFontSize,
|
fontSize: limitedHeaderFontSize,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -250,8 +233,7 @@ class _VisitorSearchModalTemplateComponentWidgetState extends State<VisitorSearc
|
||||||
style: FlutterFlowTheme.of(context).bodyLarge.override(
|
style: FlutterFlowTheme.of(context).bodyLarge.override(
|
||||||
fontFamily: FlutterFlowTheme.of(context).bodyLargeFamily,
|
fontFamily: FlutterFlowTheme.of(context).bodyLargeFamily,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyLargeFamily),
|
||||||
.containsKey(FlutterFlowTheme.of(context).bodyLargeFamily),
|
|
||||||
fontSize: limitedBodyFontSize,
|
fontSize: limitedBodyFontSize,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -263,8 +245,7 @@ class _VisitorSearchModalTemplateComponentWidgetState extends State<VisitorSearc
|
||||||
borderRadius: 20.0,
|
borderRadius: 20.0,
|
||||||
borderWidth: 1.0,
|
borderWidth: 1.0,
|
||||||
buttonSize: 40.0,
|
buttonSize: 40.0,
|
||||||
icon: Icon(Icons.close,
|
icon: Icon(Icons.close, color: FlutterFlowTheme.of(context).customColor6, size: 20.0),
|
||||||
color: FlutterFlowTheme.of(context).customColor6, size: 20.0),
|
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
_model.removeFromVisitors(visitorItem);
|
_model.removeFromVisitors(visitorItem);
|
||||||
_model.removeFromDocs(docItem);
|
_model.removeFromDocs(docItem);
|
||||||
|
@ -324,11 +305,8 @@ class _VisitorSearchModalTemplateComponentWidgetState extends State<VisitorSearc
|
||||||
),
|
),
|
||||||
elevation: 3.0,
|
elevation: 3.0,
|
||||||
borderSide: const BorderSide(color: Colors.transparent, width: 1.0),
|
borderSide: const BorderSide(color: Colors.transparent, width: 1.0),
|
||||||
borderRadius: const BorderRadius.only(
|
borderRadius:
|
||||||
bottomLeft: Radius.circular(15),
|
const BorderRadius.only(bottomLeft: Radius.circular(15), bottomRight: Radius.circular(15), topLeft: Radius.circular(15), topRight: Radius.circular(15)),
|
||||||
bottomRight: Radius.circular(15),
|
|
||||||
topLeft: Radius.circular(15),
|
|
||||||
topRight: Radius.circular(15)),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
@ -350,8 +328,7 @@ class _VisitorSearchModalTemplateComponentWidgetState extends State<VisitorSearc
|
||||||
_model.textController?.text = _model.textController.text;
|
_model.textController?.text = _model.textController.text;
|
||||||
_model.textController?.selection = TextSelection.collapsed(offset: _model.textController!.text.length);
|
_model.textController?.selection = TextSelection.collapsed(offset: _model.textController!.text.length);
|
||||||
});
|
});
|
||||||
_model.getVisitorByDoc =
|
_model.getVisitorByDoc = await PhpGroup.getVisitorByDocCall.call(documento: _model.textController.text.replaceFirst(RegExp(r'^0+'), ''));
|
||||||
await PhpGroup.getVisitorByDocCall.call(documento: _model.textController.text.replaceFirst(RegExp(r'^0+'), ''));
|
|
||||||
|
|
||||||
if (PhpGroup.getVisitorByDocCall.vistanteId((_model.getVisitorByDoc?.jsonBody ?? '')) != '0' &&
|
if (PhpGroup.getVisitorByDocCall.vistanteId((_model.getVisitorByDoc?.jsonBody ?? '')) != '0' &&
|
||||||
PhpGroup.getVisitorByDocCall.error((_model.getVisitorByDoc?.jsonBody ?? '')) == false &&
|
PhpGroup.getVisitorByDocCall.error((_model.getVisitorByDoc?.jsonBody ?? '')) == false &&
|
||||||
|
@ -365,8 +342,7 @@ class _VisitorSearchModalTemplateComponentWidgetState extends State<VisitorSearc
|
||||||
safeSetState(() {});
|
safeSetState(() {});
|
||||||
} else if (existDoc == true) {
|
} else if (existDoc == true) {
|
||||||
ToastUtil.showToast(
|
ToastUtil.showToast(
|
||||||
message: FFLocalizations.of(context)
|
message: FFLocalizations.of(context).getVariableText(ptText: 'Visitante já adicionado!', enText: 'Visitor already added!'),
|
||||||
.getVariableText(ptText: 'Visitante já adicionado!', enText: 'Visitor already added!'),
|
|
||||||
gravity: ToastGravity.TOP,
|
gravity: ToastGravity.TOP,
|
||||||
backgroundColor: Colors.red,
|
backgroundColor: Colors.red,
|
||||||
fontSize: LimitedFontSizeUtil.getBodyFontSize(context));
|
fontSize: LimitedFontSizeUtil.getBodyFontSize(context));
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
export 'anotations.dart';
|
|
@ -0,0 +1 @@
|
||||||
|
export 'services/index.dart';
|
|
@ -1,3 +1,4 @@
|
||||||
export 'data/index.dart';
|
export 'data/index.dart';
|
||||||
export 'domain/index.dart';
|
export 'domain/index.dart';
|
||||||
export 'presentation/index.dart';
|
export 'presentation/index.dart';
|
||||||
|
export 'application/index.dart';
|
||||||
|
|
|
@ -1,25 +1,18 @@
|
||||||
import 'dart:developer';
|
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:hub/features/backend/index.dart';
|
||||||
import 'package:hub/features/home/presentation/pages/home_page.dart';
|
import 'package:hub/features/locals/index.dart';
|
||||||
|
import 'package:hub/features/modules/data/repositories/license_repository_impl.dart';
|
||||||
|
import 'package:hub/features/storage/index.dart';
|
||||||
|
|
||||||
import 'package:hub/flutter_flow/nav/nav.dart';
|
import 'package:hub/flutter_flow/nav/nav.dart';
|
||||||
import 'package:hub/shared/components/molecules/modules/data/repositories/license_repository_impl.dart';
|
import 'package:hub/shared/utils/device_util.dart';
|
||||||
import 'package:hub/shared/helpers/database/database_helper.dart';
|
import 'package:hub/shared/utils/dialog_util.dart';
|
||||||
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
import 'package:hub/shared/utils/log_util.dart';
|
||||||
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
|
||||||
|
|
||||||
import 'package:hub/shared/utils/snackbar_util.dart';
|
import 'package:hub/shared/utils/snackbar_util.dart';
|
||||||
|
|
||||||
import '../../../backend/api_requests/api_calls.dart';
|
|
||||||
import '../../../flutter_flow/flutter_flow_util.dart';
|
import '../../../flutter_flow/flutter_flow_util.dart';
|
||||||
import '../../../flutter_flow/random_data_util.dart';
|
import '../../../flutter_flow/random_data_util.dart';
|
||||||
import '../../components/molecules/locals/data/index.dart';
|
|
||||||
import '../../components/molecules/locals/index.dart';
|
|
||||||
import '../../components/molecules/menu/index.dart';
|
|
||||||
import '../../utils/device_util.dart';
|
|
||||||
import '../../utils/dialog_util.dart';
|
|
||||||
import '../../utils/log_util.dart';
|
|
||||||
|
|
||||||
class AuthenticationService {
|
class AuthenticationService {
|
||||||
static Future<void> login(BuildContext context) async {
|
static Future<void> login(BuildContext context) async {
|
||||||
|
@ -74,7 +67,7 @@ class AuthenticationService {
|
||||||
if ((email != '') && (passwd != '')) {
|
if ((email != '') && (passwd != '')) {
|
||||||
await StorageHelper().set(SecureStorageKey.email.value, email);
|
await StorageHelper().set(SecureStorageKey.email.value, email);
|
||||||
await StorageHelper().set(SecureStorageKey.password.value, passwd);
|
await StorageHelper().set(SecureStorageKey.password.value, passwd);
|
||||||
await StorageHelper().set(KeychainStorageKey.devUUID.value, devUUID!);
|
await StorageHelper().set(ProfileStorageKey.devUUID.key, devUUID!);
|
||||||
response = await callback.call();
|
response = await callback.call();
|
||||||
|
|
||||||
if (response.jsonBody['error'] == false) {
|
if (response.jsonBody['error'] == false) {
|
||||||
|
@ -83,10 +76,10 @@ class AuthenticationService {
|
||||||
userDevUUID = response.jsonBody['user']['dev_id'];
|
userDevUUID = response.jsonBody['user']['dev_id'];
|
||||||
userName = response.jsonBody['user']['name'];
|
userName = response.jsonBody['user']['name'];
|
||||||
|
|
||||||
await StorageHelper().set(KeychainStorageKey.userUUID.value, userUUID);
|
await StorageHelper().set(ProfileStorageKey.userUUID.key, userUUID);
|
||||||
await StorageHelper().set(KeychainStorageKey.userDevUUID.value, userDevUUID);
|
await StorageHelper().set(ProfileStorageKey.userDevUUID.key, userDevUUID);
|
||||||
await StorageHelper().set(KeychainStorageKey.status.value, status);
|
await StorageHelper().set(ProfileStorageKey.status.key, status);
|
||||||
await StorageHelper().set(KeychainStorageKey.userName.value, userName);
|
await StorageHelper().set(ProfileStorageKey.userName.key, userName);
|
||||||
|
|
||||||
await login(context);
|
await login(context);
|
||||||
} else {
|
} else {
|
||||||
|
@ -113,9 +106,7 @@ class AuthenticationService {
|
||||||
}) async {
|
}) async {
|
||||||
try {
|
try {
|
||||||
ApiCallResponse? response;
|
ApiCallResponse? response;
|
||||||
if ((email != null && email != '') &&
|
if ((email != null && email != '') && (passwd != null && passwd != '' && passwd.length > 7) && (name != null && name != '')) {
|
||||||
(passwd != null && passwd != '' && passwd.length > 7) &&
|
|
||||||
(name != null && name != '')) {
|
|
||||||
response = await PhpGroup.registerCall.call(
|
response = await PhpGroup.registerCall.call(
|
||||||
name: name,
|
name: name,
|
||||||
password: passwd,
|
password: passwd,
|
||||||
|
@ -153,7 +144,7 @@ class AuthenticationService {
|
||||||
await StorageHelper().clean(Storage.databaseStorage);
|
await StorageHelper().clean(Storage.databaseStorage);
|
||||||
await StorageHelper().clean(Storage.secureStorage);
|
await StorageHelper().clean(Storage.secureStorage);
|
||||||
await LicenseRepositoryImpl().cleanLicense();
|
await LicenseRepositoryImpl().cleanLicense();
|
||||||
DatabaseStorage.isInitialized = false;
|
DatabaseService.isInitialized = false;
|
||||||
await StorageHelper().init();
|
await StorageHelper().init();
|
||||||
|
|
||||||
context.go('/welcomePage', extra: extra);
|
context.go('/welcomePage', extra: extra);
|
||||||
|
@ -163,8 +154,7 @@ class AuthenticationService {
|
||||||
try {
|
try {
|
||||||
final ApiCallResponse? response;
|
final ApiCallResponse? response;
|
||||||
final ForgotPasswordCall callback = PhpGroup.forgotPasswordCall;
|
final ForgotPasswordCall callback = PhpGroup.forgotPasswordCall;
|
||||||
final String message = FFLocalizations.of(context)
|
final String message = FFLocalizations.of(context).getVariableText(enText: "Send E-mail Successful!", ptText: "E-mail Enviado com Sucesso!");
|
||||||
.getVariableText(enText: "Send E-mail Successful!", ptText: "E-mail Enviado com Sucesso!");
|
|
||||||
|
|
||||||
response = await callback.call(email: email);
|
response = await callback.call(email: email);
|
||||||
|
|
||||||
|
@ -184,8 +174,7 @@ class AuthenticationService {
|
||||||
|
|
||||||
static Future<bool> changePassword(BuildContext context, String email, String password, String token) async {
|
static Future<bool> changePassword(BuildContext context, String email, String password, String token) async {
|
||||||
try {
|
try {
|
||||||
final ApiCallResponse response =
|
final ApiCallResponse response = await PhpGroup.changePasswordCall.call(email: email, psswd: password, token: token);
|
||||||
await PhpGroup.changePasswordCall.call(email: email, psswd: password, token: token);
|
|
||||||
|
|
||||||
if (response.jsonBody['error'] == false) {
|
if (response.jsonBody['error'] == false) {
|
||||||
final String message = FFLocalizations.of(context).getVariableText(
|
final String message = FFLocalizations.of(context).getVariableText(
|
||||||
|
@ -216,7 +205,6 @@ class AuthenticationService {
|
||||||
ptText: 'Conta deletada com sucesso',
|
ptText: 'Conta deletada com sucesso',
|
||||||
);
|
);
|
||||||
return await signOut(context);
|
return await signOut(context);
|
||||||
|
|
||||||
}
|
}
|
||||||
}).catchError((err) {
|
}).catchError((err) {
|
||||||
context.pop();
|
context.pop();
|
||||||
|
@ -224,8 +212,8 @@ class AuthenticationService {
|
||||||
enText: 'Error deleting account',
|
enText: 'Error deleting account',
|
||||||
ptText: 'Erro ao deletar conta',
|
ptText: 'Erro ao deletar conta',
|
||||||
);
|
);
|
||||||
SnackBarUtil.showSnackBar(context, content);
|
SnackBarUtil.showSnackBar(context, content);
|
||||||
return;
|
return;
|
||||||
});
|
});
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
context.pop();
|
context.pop();
|
|
@ -0,0 +1 @@
|
||||||
|
export 'authentication_service.dart';
|
|
@ -3,9 +3,9 @@ import 'dart:convert';
|
||||||
import 'dart:developer';
|
import 'dart:developer';
|
||||||
|
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:hub/backend/notifications/firebase_messaging_service.dart';
|
import 'package:hub/features/notifications/index.dart';
|
||||||
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
import 'package:hub/features/storage/index.dart';
|
||||||
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
|
||||||
import 'package:hub/shared/utils/log_util.dart';
|
import 'package:hub/shared/utils/log_util.dart';
|
||||||
import 'package:hub/shared/utils/validator_util.dart';
|
import 'package:hub/shared/utils/validator_util.dart';
|
||||||
|
|
||||||
|
@ -65,9 +65,9 @@ class PhpGroup {
|
||||||
class GetProvSchedules {
|
class GetProvSchedules {
|
||||||
Future<ApiCallResponse> call(final String page, final String status) async {
|
Future<ApiCallResponse> call(final String page, final String status) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||||
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||||
const String atividade = 'getAgendamentoProv';
|
const String atividade = 'getAgendamentoProv';
|
||||||
const String pageSize = '10';
|
const String pageSize = '10';
|
||||||
final bool isFiltered = status != '' && status != '.*';
|
final bool isFiltered = status != '' && status != '.*';
|
||||||
|
@ -100,9 +100,9 @@ class GetProvSchedules {
|
||||||
class GetOpenedVisits {
|
class GetOpenedVisits {
|
||||||
Future<ApiCallResponse> call(final String page) async {
|
Future<ApiCallResponse> call(final String page) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||||
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||||
const String atividade = 'getOpenedVisits';
|
const String atividade = 'getOpenedVisits';
|
||||||
const String pageSize = '10';
|
const String pageSize = '10';
|
||||||
return await ApiManager.instance.makeApiCall(
|
return await ApiManager.instance.makeApiCall(
|
||||||
|
@ -132,9 +132,9 @@ class GetOpenedVisits {
|
||||||
class GetResidentsByProperty {
|
class GetResidentsByProperty {
|
||||||
Future<ApiCallResponse> call(final String page) async {
|
Future<ApiCallResponse> call(final String page) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
final String devUUID = await StorageHelper().get(KeychainStorageKey.devUUID.value) ?? '';
|
final String devUUID = await StorageHelper().get(ProfileStorageKey.devUUID.key) ?? '';
|
||||||
final String userUUID = await StorageHelper().get(KeychainStorageKey.userUUID.value) ?? '';
|
final String userUUID = await StorageHelper().get(ProfileStorageKey.userUUID.key) ?? '';
|
||||||
final String cliID = await StorageHelper().get(KeychainStorageKey.clientUUID.value) ?? '';
|
final String cliID = await StorageHelper().get(ProfileStorageKey.clientUUID.key) ?? '';
|
||||||
const String atividade = 'getResidentsByProperty';
|
const String atividade = 'getResidentsByProperty';
|
||||||
const String pageSize = '10';
|
const String pageSize = '10';
|
||||||
return await ApiManager.instance.makeApiCall(
|
return await ApiManager.instance.makeApiCall(
|
||||||
|
@ -163,9 +163,9 @@ class GetResidentsByProperty {
|
||||||
class GetVehiclesByProperty {
|
class GetVehiclesByProperty {
|
||||||
Future<ApiCallResponse> call(final String page) async {
|
Future<ApiCallResponse> call(final String page) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||||
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||||
const String atividade = 'getVehiclesByProperty';
|
const String atividade = 'getVehiclesByProperty';
|
||||||
const String pageSize = '10';
|
const String pageSize = '10';
|
||||||
return await ApiManager.instance.makeApiCall(
|
return await ApiManager.instance.makeApiCall(
|
||||||
|
@ -196,9 +196,9 @@ class GetVehiclesByProperty {
|
||||||
class GetLicense {
|
class GetLicense {
|
||||||
Future<ApiCallResponse> call() async {
|
Future<ApiCallResponse> call() async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||||
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||||
|
|
||||||
return await ApiManager.instance.makeApiCall(
|
return await ApiManager.instance.makeApiCall(
|
||||||
callName: 'getLicense',
|
callName: 'getLicense',
|
||||||
|
@ -227,8 +227,8 @@ class GetLicense {
|
||||||
class UnregisterDevice {
|
class UnregisterDevice {
|
||||||
Future<ApiCallResponse> call() async {
|
Future<ApiCallResponse> call() async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||||
|
|
||||||
return await ApiManager.instance.makeApiCall(
|
return await ApiManager.instance.makeApiCall(
|
||||||
callName: 'unregisterDevice',
|
callName: 'unregisterDevice',
|
||||||
|
@ -255,9 +255,9 @@ class UnregisterDevice {
|
||||||
class DeletePet {
|
class DeletePet {
|
||||||
Future<ApiCallResponse> call({final int? petID = 0}) async {
|
Future<ApiCallResponse> call({final int? petID = 0}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||||
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||||
const String atividade = 'excluirPet';
|
const String atividade = 'excluirPet';
|
||||||
|
|
||||||
return await ApiManager.instance.makeApiCall(
|
return await ApiManager.instance.makeApiCall(
|
||||||
|
@ -300,9 +300,9 @@ class UpdatePet {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||||
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||||
const String atividade = 'atualizarPet';
|
const String atividade = 'atualizarPet';
|
||||||
|
|
||||||
return await ApiManager.instance.makeApiCall(
|
return await ApiManager.instance.makeApiCall(
|
||||||
|
@ -346,9 +346,9 @@ class GetPets {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||||
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||||
const String atividade = 'consultaPets';
|
const String atividade = 'consultaPets';
|
||||||
|
|
||||||
return await ApiManager.instance.makeApiCall(
|
return await ApiManager.instance.makeApiCall(
|
||||||
|
@ -380,9 +380,9 @@ class GetPetPhoto {
|
||||||
Future<ApiCallResponse> call({final int? petId}) async {
|
Future<ApiCallResponse> call({final int? petId}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||||
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||||
const String atividade = 'consultaFotoPet';
|
const String atividade = 'consultaFotoPet';
|
||||||
|
|
||||||
return await ApiManager.instance.makeApiCall(
|
return await ApiManager.instance.makeApiCall(
|
||||||
|
@ -423,9 +423,9 @@ class RegisterPet {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||||
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||||
const String atividade = 'cadastrarPet';
|
const String atividade = 'cadastrarPet';
|
||||||
|
|
||||||
return await ApiManager.instance.makeApiCall(
|
return await ApiManager.instance.makeApiCall(
|
||||||
|
@ -468,9 +468,9 @@ class BuscaEnconcomendas {
|
||||||
final String? adresseeType,
|
final String? adresseeType,
|
||||||
final String? status,
|
final String? status,
|
||||||
}) async {
|
}) async {
|
||||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||||
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||||
const String atividade = 'getEncomendas';
|
const String atividade = 'getEncomendas';
|
||||||
|
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
@ -512,9 +512,9 @@ class CancelaVisita {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||||
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||||
const String atividade = 'cancelaVisita';
|
const String atividade = 'cancelaVisita';
|
||||||
|
|
||||||
return await ApiManager.instance.makeApiCall(
|
return await ApiManager.instance.makeApiCall(
|
||||||
|
@ -546,8 +546,8 @@ class CancelaVisita {
|
||||||
|
|
||||||
class DeleteAccount {
|
class DeleteAccount {
|
||||||
Future<ApiCallResponse> call() async {
|
Future<ApiCallResponse> call() async {
|
||||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||||
|
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
return await ApiManager.instance.makeApiCall(
|
return await ApiManager.instance.makeApiCall(
|
||||||
|
@ -578,9 +578,9 @@ class ChangePanic {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||||
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||||
const String atividade = 'updVisitado';
|
const String atividade = 'updVisitado';
|
||||||
|
|
||||||
return await ApiManager.instance.makeApiCall(
|
return await ApiManager.instance.makeApiCall(
|
||||||
|
@ -614,9 +614,9 @@ class ChangePass {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||||
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||||
const String atividade = 'updVisitado';
|
const String atividade = 'updVisitado';
|
||||||
|
|
||||||
return await ApiManager.instance.makeApiCall(
|
return await ApiManager.instance.makeApiCall(
|
||||||
|
@ -650,9 +650,9 @@ class RespondeVinculo {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||||
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||||
|
|
||||||
return await ApiManager.instance.makeApiCall(
|
return await ApiManager.instance.makeApiCall(
|
||||||
callName: 'respondeVinculo',
|
callName: 'respondeVinculo',
|
||||||
|
@ -684,9 +684,9 @@ class ChangeNotifica {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||||
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||||
const String atividade = 'updVisitado';
|
const String atividade = 'updVisitado';
|
||||||
|
|
||||||
return await ApiManager.instance.makeApiCall(
|
return await ApiManager.instance.makeApiCall(
|
||||||
|
@ -718,10 +718,10 @@ class UpdateIDE {
|
||||||
Future<ApiCallResponse> call() async {
|
Future<ApiCallResponse> call() async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||||
final String cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
final String cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||||
final String newIde = (await StorageHelper().get(KeychainStorageKey.userDevUUID.value)) ?? '';
|
final String newIde = (await StorageHelper().get(ProfileStorageKey.userDevUUID.key)) ?? '';
|
||||||
const String atividade = 'updVisitado';
|
const String atividade = 'updVisitado';
|
||||||
|
|
||||||
return await ApiManager.instance.makeApiCall(
|
return await ApiManager.instance.makeApiCall(
|
||||||
|
@ -753,8 +753,8 @@ class UpdToken {
|
||||||
Future<ApiCallResponse> call() async {
|
Future<ApiCallResponse> call() async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||||
final String token = (await StorageHelper().get(SecureStorageKey.token.value)) ?? '';
|
final String token = (await StorageHelper().get(SecureStorageKey.token.value)) ?? '';
|
||||||
|
|
||||||
return await ApiManager.instance.makeApiCall(
|
return await ApiManager.instance.makeApiCall(
|
||||||
|
@ -782,7 +782,7 @@ class UpdToken {
|
||||||
class LoginCall {
|
class LoginCall {
|
||||||
Future<ApiCallResponse> call() async {
|
Future<ApiCallResponse> call() async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||||
final String email = (await StorageHelper().get(SecureStorageKey.email.value)) ?? '';
|
final String email = (await StorageHelper().get(SecureStorageKey.email.value)) ?? '';
|
||||||
final String password = (await StorageHelper().get(SecureStorageKey.password.value)) ?? '';
|
final String password = (await StorageHelper().get(SecureStorageKey.password.value)) ?? '';
|
||||||
final String type = (await StorageHelper().get(SecureStorageKey.deviceType.value)) ?? '';
|
final String type = (await StorageHelper().get(SecureStorageKey.deviceType.value)) ?? '';
|
||||||
|
@ -869,9 +869,9 @@ class ChangePasswordCall {
|
||||||
required final String psswd,
|
required final String psswd,
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||||
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||||
|
|
||||||
return await ApiManager.instance.makeApiCall(
|
return await ApiManager.instance.makeApiCall(
|
||||||
callName: 'changePassword',
|
callName: 'changePassword',
|
||||||
|
@ -930,8 +930,8 @@ class GetLocalsCall {
|
||||||
Future<ApiCallResponse> call() async {
|
Future<ApiCallResponse> call() async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = await StorageHelper().get(KeychainStorageKey.devUUID.value) ?? '';
|
final String devUUID = await StorageHelper().get(ProfileStorageKey.devUUID.key) ?? '';
|
||||||
final String userUUID = await StorageHelper().get(KeychainStorageKey.userUUID.value) ?? '';
|
final String userUUID = await StorageHelper().get(ProfileStorageKey.userUUID.key) ?? '';
|
||||||
|
|
||||||
return await ApiManager.instance
|
return await ApiManager.instance
|
||||||
.makeApiCall(
|
.makeApiCall(
|
||||||
|
@ -972,9 +972,9 @@ class PostScheduleVisitorCall {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||||
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||||
const String atividade = 'putVisitante';
|
const String atividade = 'putVisitante';
|
||||||
|
|
||||||
return await ApiManager.instance.makeApiCall(
|
return await ApiManager.instance.makeApiCall(
|
||||||
|
@ -1027,9 +1027,9 @@ class PostScheduleVisitCall {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||||
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||||
const String atividade = 'putVisita';
|
const String atividade = 'putVisita';
|
||||||
|
|
||||||
return await ApiManager.instance.makeApiCall(
|
return await ApiManager.instance.makeApiCall(
|
||||||
|
@ -1081,9 +1081,9 @@ class GetScheduleVisitCall {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||||
final String cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
final String cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||||
const String atividade = 'getVisitas';
|
const String atividade = 'getVisitas';
|
||||||
|
|
||||||
return await ApiManager.instance.makeApiCall(
|
return await ApiManager.instance.makeApiCall(
|
||||||
|
@ -1355,32 +1355,34 @@ class GetDadosCall {
|
||||||
Future<ApiCallResponse> call() async {
|
Future<ApiCallResponse> call() async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||||
final String cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
final String cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||||
const String atividade = 'getDados';
|
const String atividade = 'getDados';
|
||||||
|
|
||||||
return await ApiManager.instance.makeApiCall(
|
return await ApiManager.instance
|
||||||
callName: 'getDados',
|
.makeApiCall(
|
||||||
apiUrl: '$baseUrl/processRequest.php',
|
callName: 'getDados',
|
||||||
callType: ApiCallType.POST,
|
apiUrl: '$baseUrl/processRequest.php',
|
||||||
headers: {
|
callType: ApiCallType.POST,
|
||||||
'Content-Type': 'application/x-www-form-urlencoded',
|
headers: {
|
||||||
},
|
'Content-Type': 'application/x-www-form-urlencoded',
|
||||||
params: {
|
},
|
||||||
'devUUID': devUUID,
|
params: {
|
||||||
'userUUID': userUUID,
|
'devUUID': devUUID,
|
||||||
'cliID': cliUUID,
|
'userUUID': userUUID,
|
||||||
'atividade': atividade,
|
'cliID': cliUUID,
|
||||||
},
|
'atividade': atividade,
|
||||||
bodyType: BodyType.X_WWW_FORM_URL_ENCODED,
|
},
|
||||||
returnBody: true,
|
bodyType: BodyType.X_WWW_FORM_URL_ENCODED,
|
||||||
encodeBodyUtf8: false,
|
returnBody: true,
|
||||||
decodeUtf8: false,
|
encodeBodyUtf8: false,
|
||||||
cache: false,
|
decodeUtf8: false,
|
||||||
isStreamingApi: false,
|
cache: false,
|
||||||
alwaysAllowBody: false,
|
isStreamingApi: false,
|
||||||
).timeout(const Duration(seconds: 30));
|
alwaysAllowBody: false,
|
||||||
|
)
|
||||||
|
.timeout(const Duration(seconds: 30));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool? errorBolean(dynamic response) => castToType<bool>(getJsonField(
|
bool? errorBolean(dynamic response) => castToType<bool>(getJsonField(
|
||||||
|
@ -1588,9 +1590,9 @@ class GetVisitorByDocCall {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||||
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||||
const String atividade = 'getVisitante';
|
const String atividade = 'getVisitante';
|
||||||
|
|
||||||
return await ApiManager.instance.makeApiCall(
|
return await ApiManager.instance.makeApiCall(
|
||||||
|
@ -1642,9 +1644,9 @@ class GetFotoVisitanteCall {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||||
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||||
const String atividade = 'getFotoVisitante';
|
const String atividade = 'getFotoVisitante';
|
||||||
|
|
||||||
return await ApiManager.instance.makeApiCall(
|
return await ApiManager.instance.makeApiCall(
|
||||||
|
@ -1681,9 +1683,9 @@ class PostProvVisitSchedulingCall {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||||
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||||
const String atividade = 'putAgendamentoProv';
|
const String atividade = 'putAgendamentoProv';
|
||||||
|
|
||||||
return await ApiManager.instance.makeApiCall(
|
return await ApiManager.instance.makeApiCall(
|
||||||
|
@ -1730,9 +1732,9 @@ class GetVisitsCall {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||||
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||||
const String atividade = 'getVisitas';
|
const String atividade = 'getVisitas';
|
||||||
|
|
||||||
return await ApiManager.instance.makeApiCall(
|
return await ApiManager.instance.makeApiCall(
|
||||||
|
@ -1993,9 +1995,9 @@ class DeleteVisitCall {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||||
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||||
const String atividade = 'cancelaVisita';
|
const String atividade = 'cancelaVisita';
|
||||||
|
|
||||||
return await ApiManager.instance.makeApiCall(
|
return await ApiManager.instance.makeApiCall(
|
||||||
|
@ -2036,10 +2038,10 @@ class GetPessoasLocalCall {
|
||||||
Future<ApiCallResponse> call() async {
|
Future<ApiCallResponse> call() async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||||
final String ownerUUID = (await StorageHelper().get(KeychainStorageKey.ownerUUID.value)) ?? '';
|
final String ownerUUID = (await StorageHelper().get(ProfileStorageKey.ownerUUID.key)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||||
final String cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
final String cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||||
|
|
||||||
return await ApiManager.instance.makeApiCall(
|
return await ApiManager.instance.makeApiCall(
|
||||||
callName: 'getPessoasLocal',
|
callName: 'getPessoasLocal',
|
||||||
|
@ -2102,9 +2104,9 @@ class RespondeSolicitacaoCall {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||||
final String cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
final String cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||||
const String atividade = 'respondeSolicitacao';
|
const String atividade = 'respondeSolicitacao';
|
||||||
|
|
||||||
return await ApiManager.instance.makeApiCall(
|
return await ApiManager.instance.makeApiCall(
|
||||||
|
@ -2152,9 +2154,9 @@ class GetAccessCall {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||||
final String cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
final String cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||||
const String atividade = 'getAcessos';
|
const String atividade = 'getAcessos';
|
||||||
|
|
||||||
return await ApiManager.instance.makeApiCall(
|
return await ApiManager.instance.makeApiCall(
|
||||||
|
@ -2401,9 +2403,9 @@ class GetLiberationsCall {
|
||||||
final StreamController<ApiCallResponse> controller = StreamController();
|
final StreamController<ApiCallResponse> controller = StreamController();
|
||||||
|
|
||||||
Future.microtask(() async {
|
Future.microtask(() async {
|
||||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||||
final String cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
final String cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||||
const String atividade = 'getSolicitacoes';
|
const String atividade = 'getSolicitacoes';
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -2593,9 +2595,9 @@ class GetMessagesCall {
|
||||||
}) async {
|
}) async {
|
||||||
final String baseUrl = PhpGroup.getBaseUrl();
|
final String baseUrl = PhpGroup.getBaseUrl();
|
||||||
|
|
||||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||||
final String cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
final String cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||||
const String atividade = 'getMensagens';
|
const String atividade = 'getMensagens';
|
||||||
|
|
||||||
return await ApiManager.instance.makeApiCall(
|
return await ApiManager.instance.makeApiCall(
|
|
@ -0,0 +1,3 @@
|
||||||
|
export 'api_calls.dart';
|
||||||
|
export 'api_manager.dart';
|
||||||
|
export 'get_streamed_response.dart';
|
|
@ -0,0 +1,2 @@
|
||||||
|
export 'api_requests/index.dart';
|
||||||
|
export 'schema/index.dart';
|
|
@ -0,0 +1 @@
|
||||||
|
export 'enums.dart';
|
|
@ -0,0 +1,3 @@
|
||||||
|
export 'enums/index.dart';
|
||||||
|
export 'structs/index.dart';
|
||||||
|
export 'util/index.dart';
|
|
@ -1,5 +1,6 @@
|
||||||
// ignore_for_file: unnecessary_getters_setters
|
// ignore_for_file: unnecessary_getters_setters
|
||||||
|
|
||||||
|
import 'package:hub/features/backend/index.dart';
|
||||||
import 'package:hub/flutter_flow/nav/nav.dart';
|
import 'package:hub/flutter_flow/nav/nav.dart';
|
||||||
|
|
||||||
import 'index.dart';
|
import 'index.dart';
|
||||||
|
@ -40,8 +41,7 @@ class DeviceStruct extends BaseStruct {
|
||||||
description: data['description'] as String?,
|
description: data['description'] as String?,
|
||||||
);
|
);
|
||||||
|
|
||||||
static DeviceStruct? maybeFromMap(dynamic data) =>
|
static DeviceStruct? maybeFromMap(dynamic data) => data is Map ? DeviceStruct.fromMap(data.cast<String, dynamic>()) : null;
|
||||||
data is Map ? DeviceStruct.fromMap(data.cast<String, dynamic>()) : null;
|
|
||||||
|
|
||||||
Map<String, dynamic> toMap() => {
|
Map<String, dynamic> toMap() => {
|
||||||
'devUUID': _devUUID,
|
'devUUID': _devUUID,
|
||||||
|
@ -88,10 +88,7 @@ class DeviceStruct extends BaseStruct {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool operator ==(Object other) {
|
bool operator ==(Object other) {
|
||||||
return other is DeviceStruct &&
|
return other is DeviceStruct && devUUID == other.devUUID && version == other.version && description == other.description;
|
||||||
devUUID == other.devUUID &&
|
|
||||||
version == other.version &&
|
|
||||||
description == other.description;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
|
@ -0,0 +1 @@
|
||||||
|
export 'device_struct.dart';
|
|
@ -0,0 +1 @@
|
||||||
|
export 'schema_util.dart';
|
|
@ -1,8 +1,6 @@
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:hub/features/backend/index.dart';
|
||||||
import 'package:from_css_color/from_css_color.dart';
|
|
||||||
import 'package:hub/backend/schema/enums/enums.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/serialization_util.dart';
|
import 'package:hub/flutter_flow/nav/serialization_util.dart';
|
||||||
|
|
||||||
|
@ -35,9 +33,7 @@ dynamic deserializeStructParam<T>(
|
||||||
if (paramValues is! Iterable) {
|
if (paramValues is! Iterable) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return paramValues
|
return paramValues.map<T>((e) => deserializeStructParam<T>(e, paramType, false, structBuilder: structBuilder)).toList();
|
||||||
.map<T>((e) => deserializeStructParam<T>(e, paramType, false, structBuilder: structBuilder))
|
|
||||||
.toList();
|
|
||||||
} else if (param is Map<String, dynamic>) {
|
} else if (param is Map<String, dynamic>) {
|
||||||
return structBuilder(param);
|
return structBuilder(param);
|
||||||
} else {
|
} else {
|
|
@ -1,10 +1,9 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:hub/backend/api_requests/api_manager.dart';
|
import 'package:hub/features/backend/index.dart';
|
||||||
import 'package:hub/features/history/index.dart';
|
import 'package:hub/features/history/index.dart';
|
||||||
|
import 'package:hub/features/storage/index.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
||||||
import 'package:hub/flutter_flow/request_manager.dart';
|
import 'package:hub/flutter_flow/request_manager.dart';
|
||||||
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
|
||||||
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
|
||||||
|
|
||||||
class AcessHistoryPageModel extends FlutterFlowModel<AccessHistoryScreen> {
|
class AcessHistoryPageModel extends FlutterFlowModel<AccessHistoryScreen> {
|
||||||
late final String devUUID;
|
late final String devUUID;
|
||||||
|
@ -32,9 +31,9 @@ class AcessHistoryPageModel extends FlutterFlowModel<AccessHistoryScreen> {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> initDatabase() async {
|
Future<void> initDatabase() async {
|
||||||
devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||||
userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||||
cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
import 'package:hub/features/storage/index.dart';
|
||||||
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
|
||||||
|
|
||||||
class ProvisionalHistoryEvent {}
|
class ProvisionalHistoryEvent {}
|
||||||
|
|
||||||
|
@ -44,9 +43,9 @@ class ProvisionalHistoryBloc extends Bloc<ProvisionalHistoryEvent, ProvisionalHi
|
||||||
Emitter<ProvisionalHistoryStateBloc> emit,
|
Emitter<ProvisionalHistoryStateBloc> emit,
|
||||||
) async {
|
) async {
|
||||||
emit(state.copyWith(isLoading: true));
|
emit(state.copyWith(isLoading: true));
|
||||||
final devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
final devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||||
final userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
final userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||||
final cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
final cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||||
emit(state.copyWith(devUUID: devUUID, userUUID: userUUID, cliUUID: cliUUID, isLoading: false));
|
emit(state.copyWith(devUUID: devUUID, userUUID: userUUID, cliUUID: cliUUID, isLoading: false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,8 +3,8 @@ import 'dart:async';
|
||||||
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/backend/api_requests/api_calls.dart';
|
|
||||||
import 'package:hub/components/templates_components/card_item_template_component/card_item_template_component_widget.dart';
|
import 'package:hub/components/templates_components/card_item_template_component/card_item_template_component_widget.dart';
|
||||||
|
import 'package:hub/features/backend/index.dart';
|
||||||
import 'package:hub/features/history/index.dart';
|
import 'package:hub/features/history/index.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';
|
||||||
|
|
|
@ -4,8 +4,8 @@ import 'dart:developer';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
import 'package:hub/backend/api_requests/api_calls.dart';
|
|
||||||
import 'package:hub/components/templates_components/card_item_template_component/card_item_template_component_widget.dart';
|
import 'package:hub/components/templates_components/card_item_template_component/card_item_template_component_widget.dart';
|
||||||
|
import 'package:hub/features/backend/index.dart';
|
||||||
import 'package:hub/features/history/index.dart';
|
import 'package:hub/features/history/index.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';
|
||||||
|
|
|
@ -1,11 +1,9 @@
|
||||||
|
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
import 'package:hub/features/locals/index.dart';
|
||||||
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
import 'package:hub/features/storage/index.dart';
|
||||||
|
|
||||||
import '../../../../shared/components/molecules/locals/index.dart';
|
|
||||||
import 'index.dart';
|
import 'index.dart';
|
||||||
|
|
||||||
class HomeBloc extends Bloc<HomeEvent, HomeState> {
|
class HomeBloc extends Bloc<HomeEvent, HomeState> {
|
||||||
|
@ -16,13 +14,13 @@ class HomeBloc extends Bloc<HomeEvent, HomeState> {
|
||||||
_completer = LocalsRepositoryImpl.license.stream.listen((v) {
|
_completer = LocalsRepositoryImpl.license.stream.listen((v) {
|
||||||
add(HomeEvent());
|
add(HomeEvent());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _onHomeEvent(HomeEvent event, Emitter<HomeState> emit) async {
|
Future<void> _onHomeEvent(HomeEvent event, Emitter<HomeState> emit) async {
|
||||||
final devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
final devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||||
final userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
final userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||||
final cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
final cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||||
final userName = (await StorageHelper().get(KeychainStorageKey.userName.value)) ?? '';
|
final userName = (await StorageHelper().get(ProfileStorageKey.userName.key)) ?? '';
|
||||||
final userEmail = (await StorageHelper().get(SecureStorageKey.email.value)) ?? '';
|
final userEmail = (await StorageHelper().get(SecureStorageKey.email.value)) ?? '';
|
||||||
|
|
||||||
emit(state.copyWith(
|
emit(state.copyWith(
|
||||||
|
@ -34,5 +32,3 @@ class HomeBloc extends Bloc<HomeEvent, HomeState> {
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2,12 +2,12 @@ import 'package:flutter/gestures.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';
|
||||||
import 'package:hub/features/home/presentation/widgets/drawer_widget.dart';
|
import 'package:hub/features/home/presentation/widgets/drawer_widget.dart';
|
||||||
|
import 'package:hub/features/menu/index.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/shared/components/molecules/locals/index.dart';
|
import 'package:hub/features/locals/index.dart';
|
||||||
import 'package:hub/shared/components/molecules/menu/index.dart';
|
|
||||||
|
|
||||||
class HomePageWidget extends StatefulWidget {
|
class HomePageWidget extends StatefulWidget {
|
||||||
const HomePageWidget(this.update, {super.key});
|
const HomePageWidget(this.update, {super.key});
|
||||||
|
|
|
@ -2,12 +2,12 @@ import 'package:cached_network_image/cached_network_image.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
import 'package:hub/features/home/index.dart';
|
import 'package:hub/features/home/index.dart';
|
||||||
|
import 'package:hub/features/menu/index.dart';
|
||||||
|
import 'package:hub/features/modules/data/index.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/shared/components/molecules/locals/index.dart';
|
import 'package:hub/features/locals/index.dart';
|
||||||
import 'package:hub/shared/components/molecules/menu/index.dart';
|
|
||||||
import 'package:hub/shared/components/molecules/modules/index.dart';
|
|
||||||
|
|
||||||
class DrawerWidget extends StatelessWidget {
|
class DrawerWidget extends StatelessWidget {
|
||||||
const DrawerWidget({super.key});
|
const DrawerWidget({super.key});
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
import 'package:hub/features/storage/index.dart';
|
||||||
|
|
||||||
|
abstract class LocalsLocalDataSource {
|
||||||
|
Future<void> unlinkLocal();
|
||||||
|
}
|
||||||
|
|
||||||
|
class LocalsLocalDataSourceImpl {
|
||||||
|
Future<void> unlinkLocal() async {
|
||||||
|
await StorageHelper().set(ProfileStorageKey.clientUUID.key, '');
|
||||||
|
await StorageHelper().set(ProfileStorageKey.clientName.key, '');
|
||||||
|
await StorageHelper().set(ProfileStorageKey.ownerName.key, '');
|
||||||
|
}
|
||||||
|
}
|
|
@ -3,26 +3,23 @@
|
||||||
import 'dart:developer';
|
import 'dart:developer';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:hub/backend/api_requests/api_calls.dart';
|
|
||||||
import 'package:hub/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart';
|
import 'package:hub/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart';
|
||||||
|
import 'package:hub/features/authentication/index.dart';
|
||||||
|
import 'package:hub/features/backend/index.dart';
|
||||||
|
import 'package:hub/features/modules/data/index.dart';
|
||||||
|
import 'package:hub/features/storage/index.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:hub/flutter_flow/nav/nav.dart';
|
import 'package:hub/flutter_flow/nav/nav.dart';
|
||||||
import 'package:hub/shared/components/molecules/locals/index.dart';
|
import 'package:hub/features/locals/index.dart';
|
||||||
import 'package:hub/shared/components/molecules/modules/index.dart';
|
|
||||||
|
|
||||||
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
|
||||||
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
|
||||||
import 'package:hub/shared/services/authentication/authentication_service.dart';
|
|
||||||
import 'package:hub/shared/utils/dialog_util.dart';
|
|
||||||
import 'package:hub/shared/utils/snackbar_util.dart';
|
import 'package:hub/shared/utils/snackbar_util.dart';
|
||||||
|
|
||||||
abstract class LocalsRemoteDataSource {
|
abstract class LocalsRemoteDataSource {
|
||||||
Future<void> linkLocal(BuildContext context);
|
Future<void> linkLocal(BuildContext context);
|
||||||
Future<bool> checkLocals(BuildContext context);
|
Future<bool> checkLocals(BuildContext context);
|
||||||
Future<bool> processLocals(BuildContext context) ;
|
Future<bool> processLocals(BuildContext context);
|
||||||
Future<bool> processData(BuildContext context);
|
Future<bool> processData(BuildContext context);
|
||||||
Future<bool> selectLocal(BuildContext context, ApiCallResponse? response) ;
|
Future<bool> selectLocal(BuildContext context, ApiCallResponse? response);
|
||||||
Future<void> detachLocal(BuildContext context);
|
Future<void> detachLocal(BuildContext context);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,8 +57,8 @@ class LocalsRemoteDataSourceImpl implements LocalsRemoteDataSource {
|
||||||
await StorageHelper().set(SecureStorageKey.haveLocal.value, true);
|
await StorageHelper().set(SecureStorageKey.haveLocal.value, true);
|
||||||
await StorageHelper().set(SecureStorageKey.isLogged.value, true);
|
await StorageHelper().set(SecureStorageKey.isLogged.value, true);
|
||||||
await WidgetsBinding.instance.endOfFrame;
|
await WidgetsBinding.instance.endOfFrame;
|
||||||
await StorageHelper().set(KeychainStorageKey.clientUUID.value, '');
|
await StorageHelper().set(ProfileStorageKey.clientUUID.key, '');
|
||||||
await StorageHelper().set(KeychainStorageKey.ownerUUID.value, '');
|
await StorageHelper().set(ProfileStorageKey.ownerUUID.key, '');
|
||||||
StorageHelper().context?.go('/homePage');
|
StorageHelper().context?.go('/homePage');
|
||||||
}
|
}
|
||||||
} catch (e, s) {
|
} catch (e, s) {
|
||||||
|
@ -71,7 +68,7 @@ class LocalsRemoteDataSourceImpl implements LocalsRemoteDataSource {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<bool> processLocals(BuildContext context) async {
|
Future<bool> processLocals(BuildContext context) async {
|
||||||
log('() => processLocals');
|
log('() => processLocals');
|
||||||
try {
|
try {
|
||||||
final GetLocalsCall callback = PhpGroup.getLocalsCall;
|
final GetLocalsCall callback = PhpGroup.getLocalsCall;
|
||||||
final ApiCallResponse response = await callback.call();
|
final ApiCallResponse response = await callback.call();
|
||||||
|
@ -145,8 +142,8 @@ class LocalsRemoteDataSourceImpl implements LocalsRemoteDataSource {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<bool> checkLocals(BuildContext context) async {
|
Future<bool> checkLocals(BuildContext context) async {
|
||||||
String cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
String cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||||
String cliName = (await StorageHelper().get(KeychainStorageKey.clientName.value)) ?? '';
|
String cliName = (await StorageHelper().get(ProfileStorageKey.clientName.key)) ?? '';
|
||||||
return cliUUID.isEmpty && cliName.isEmpty;
|
return cliUUID.isEmpty && cliName.isEmpty;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -219,9 +216,9 @@ class LocalsRemoteDataSourceImpl implements LocalsRemoteDataSource {
|
||||||
|
|
||||||
await PhpGroup.resopndeVinculo.call(tarefa: 'I').then((value) async {
|
await PhpGroup.resopndeVinculo.call(tarefa: 'I').then((value) async {
|
||||||
if (value.jsonBody['error'] == false) {
|
if (value.jsonBody['error'] == false) {
|
||||||
await StorageHelper().set(KeychainStorageKey.clientName.value, '');
|
await StorageHelper().set(ProfileStorageKey.clientName.key, '');
|
||||||
await StorageHelper().set(KeychainStorageKey.ownerName.value, '');
|
await StorageHelper().set(ProfileStorageKey.ownerName.key, '');
|
||||||
await StorageHelper().set(KeychainStorageKey.clientUUID.value, '');
|
await StorageHelper().set(ProfileStorageKey.clientUUID.key, '');
|
||||||
context.pop();
|
context.pop();
|
||||||
context.go('/homePage', extra: {'update': LocalsRepositoryImpl().update});
|
context.go('/homePage', extra: {'update': LocalsRepositoryImpl().update});
|
||||||
SnackBarUtil.showSnackBar(context, content);
|
SnackBarUtil.showSnackBar(context, content);
|
||||||
|
@ -244,6 +241,4 @@ class LocalsRemoteDataSourceImpl implements LocalsRemoteDataSource {
|
||||||
SnackBarUtil.showSnackBar(context, content, isError: true);
|
SnackBarUtil.showSnackBar(context, content, isError: true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -2,12 +2,12 @@ import 'dart:developer';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
import 'package:hub/backend/notifications/firebase_messaging_service.dart';
|
import 'package:hub/features/locals/index.dart';
|
||||||
import 'package:hub/shared/components/molecules/locals/index.dart';
|
import 'package:hub/features/menu/index.dart';
|
||||||
import 'package:hub/shared/components/molecules/menu/presentation/blocs/menu_bloc.dart';
|
import 'package:hub/features/modules/data/index.dart';
|
||||||
import 'package:hub/shared/components/molecules/modules/index.dart';
|
import 'package:hub/features/notifications/index.dart';
|
||||||
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
import 'package:hub/features/storage/index.dart';
|
||||||
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
|
||||||
import 'package:hub/shared/utils/dialog_util.dart';
|
import 'package:hub/shared/utils/dialog_util.dart';
|
||||||
import 'package:rxdart/rxdart.dart';
|
import 'package:rxdart/rxdart.dart';
|
||||||
|
|
||||||
|
@ -32,18 +32,18 @@ class LocalsRepositoryImpl implements LocalsRepository {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> select(BuildContext context) async {
|
Future<void> select(BuildContext context) async {
|
||||||
await localDataSource.unlinkLocal();
|
await localDataSource.unlinkLocal();
|
||||||
await update(context);
|
await update(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> check(BuildContext context) async {
|
Future<void> check(BuildContext context) async {
|
||||||
final String? cliUUID = await StorageHelper().get(KeychainStorageKey.clientUUID.value);
|
final String? cliUUID = await StorageHelper().get(ProfileStorageKey.clientUUID.key);
|
||||||
final String? ownerUUID = await StorageHelper().get(KeychainStorageKey.ownerUUID.value);
|
final String? ownerUUID = await StorageHelper().get(ProfileStorageKey.ownerUUID.key);
|
||||||
final bool haveCli = cliUUID != null && cliUUID.isNotEmpty;
|
final bool haveCli = cliUUID != null && cliUUID.isNotEmpty;
|
||||||
final bool haveOwner = ownerUUID != null && ownerUUID.isNotEmpty;
|
final bool haveOwner = ownerUUID != null && ownerUUID.isNotEmpty;
|
||||||
if (!haveCli && !haveOwner) {
|
if (!haveCli && !haveOwner) {
|
||||||
await update(context);
|
await update(context);
|
||||||
await FirebaseMessagingService().updateDeviceToken();
|
await FirebaseMessagingService().updateDeviceToken();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,16 +69,14 @@ class LocalsRepositoryImpl implements LocalsRepository {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _handleUpdateError(BuildContext context) async {
|
Future<void> _handleUpdateError(BuildContext context) async {
|
||||||
await StorageHelper().set(KeychainStorageKey.clientUUID.value, '');
|
await StorageHelper().set(ProfileStorageKey.clientUUID.key, '');
|
||||||
const String errorMsg = 'Erro ao atualizar locais';
|
const String errorMsg = 'Erro ao atualizar locais';
|
||||||
await DialogUtil.error(context, errorMsg);
|
await DialogUtil.error(context, errorMsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _notifyBlocs(BuildContext context) async {
|
Future<void> _notifyBlocs(BuildContext context) async {
|
||||||
|
|
||||||
context.read<LocalProfileBloc>().add(LocalProfileEvent());
|
context.read<LocalProfileBloc>().add(LocalProfileEvent());
|
||||||
context.read<MenuBloc>().add(MenuEvent());
|
context.read<MenuBloc>().add(MenuEvent());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
|
@ -3,16 +3,12 @@ import 'dart:developer';
|
||||||
|
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:hub/features/storage/index.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
||||||
import 'package:hub/flutter_flow/nav/nav.dart';
|
import 'package:hub/flutter_flow/nav/nav.dart';
|
||||||
import 'package:hub/shared/components/molecules/locals/index.dart';
|
import 'package:hub/features/locals/index.dart';
|
||||||
import 'package:hub/shared/components/molecules/menu/index.dart';
|
|
||||||
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
|
||||||
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
|
||||||
|
|
||||||
class LocalProfileEvent {
|
class LocalProfileEvent {}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
class LocalProfileState {
|
class LocalProfileState {
|
||||||
final String cliName;
|
final String cliName;
|
||||||
|
@ -22,7 +18,6 @@ class LocalProfileState {
|
||||||
LocalProfileState({this.cliName = '', this.cliUUID = '', this.ownerName = ''});
|
LocalProfileState({this.cliName = '', this.cliUUID = '', this.ownerName = ''});
|
||||||
|
|
||||||
LocalProfileState copyWith({String? cliName, String? ownerName, String? cliUUID}) {
|
LocalProfileState copyWith({String? cliName, String? ownerName, String? cliUUID}) {
|
||||||
|
|
||||||
return LocalProfileState(
|
return LocalProfileState(
|
||||||
cliName: cliName ?? this.cliName,
|
cliName: cliName ?? this.cliName,
|
||||||
ownerName: ownerName ?? this.ownerName,
|
ownerName: ownerName ?? this.ownerName,
|
||||||
|
@ -42,9 +37,9 @@ class LocalProfileBloc extends Bloc<LocalProfileEvent, LocalProfileState> {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _onLocalProfileEvent(LocalProfileEvent event, Emitter<LocalProfileState> emit) async {
|
Future<void> _onLocalProfileEvent(LocalProfileEvent event, Emitter<LocalProfileState> emit) async {
|
||||||
final cliName = (await StorageHelper().get(KeychainStorageKey.clientName.value)) ?? '';
|
final cliName = (await StorageHelper().get(ProfileStorageKey.clientName.key)) ?? '';
|
||||||
final ownerName = (await StorageHelper().get(KeychainStorageKey.ownerName.value)) ?? '';
|
final ownerName = (await StorageHelper().get(ProfileStorageKey.ownerName.key)) ?? '';
|
||||||
final cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
final cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||||
emit(state.copyWith(cliName: cliName, cliUUID: cliUUID, ownerName: ownerName));
|
emit(state.copyWith(cliName: cliName, cliUUID: cliUUID, ownerName: ownerName));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,9 +63,9 @@ class LocalProfileComponentModel extends FlutterFlowModel<LocalProfileComponentW
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> getData() async {
|
Future<void> getData() async {
|
||||||
cliName = (await StorageHelper().get(KeychainStorageKey.clientName.value)) ?? '';
|
cliName = (await StorageHelper().get(ProfileStorageKey.clientName.key)) ?? '';
|
||||||
ownerName = (await StorageHelper().get(KeychainStorageKey.ownerName.value)) ?? '';
|
ownerName = (await StorageHelper().get(ProfileStorageKey.ownerName.key)) ?? '';
|
||||||
cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||||
setStateCallback?.call();
|
setStateCallback?.call();
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,258 @@
|
||||||
|
import 'package:cached_network_image/cached_network_image.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
|
import 'package:hub/features/modules/index.dart';
|
||||||
|
import 'package:hub/flutter_flow/custom_functions.dart';
|
||||||
|
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
||||||
|
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
||||||
|
import 'package:hub/features/locals/index.dart';
|
||||||
|
|
||||||
|
class LocalProfileComponentWidget extends StatefulWidget {
|
||||||
|
const LocalProfileComponentWidget({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<LocalProfileComponentWidget> createState() => _LocalProfileComponentWidgetState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _LocalProfileComponentWidgetState extends State<LocalProfileComponentWidget> {
|
||||||
|
bool _isLoading = false;
|
||||||
|
|
||||||
|
Future retrieveProfileInfo() async {
|
||||||
|
setState(() {
|
||||||
|
_isLoading = true;
|
||||||
|
});
|
||||||
|
await LocalsRepositoryImpl().select(context);
|
||||||
|
setState(() {
|
||||||
|
_isLoading = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return StreamBuilder<LicenseStatus>(
|
||||||
|
stream: LocalsRepositoryImpl.stream,
|
||||||
|
builder: (context, snapshot) {
|
||||||
|
final textScaler = MediaQuery.textScalerOf(context);
|
||||||
|
final double baseFontSize = 14.0;
|
||||||
|
final double scaledFontSize = baseFontSize * textScaler.scale(1);
|
||||||
|
final double limitedFontSize = scaledFontSize > 20 ? 12 : scaledFontSize;
|
||||||
|
if (snapshot.connectionState == ConnectionState.waiting) {
|
||||||
|
return const Center(child: CircularProgressIndicator());
|
||||||
|
} else if (snapshot.hasError) {
|
||||||
|
return Center(child: Text('Error: ${snapshot.error}'));
|
||||||
|
} else if (!snapshot.hasData || snapshot.data! == false) {
|
||||||
|
return BlocBuilder<LocalProfileBloc, LocalProfileState>(
|
||||||
|
builder: (context, state) {
|
||||||
|
return _buildDefaultLocalProfile(context, limitedFontSize);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return BlocBuilder<LocalProfileBloc, LocalProfileState>(
|
||||||
|
builder: (context, state) {
|
||||||
|
return _buildAsyncLocalProfile(context, state, limitedFontSize);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Container _buildDefaultLocalProfile(BuildContext context, double limitedFontSize) {
|
||||||
|
return Container(
|
||||||
|
decoration: const BoxDecoration(),
|
||||||
|
child: Align(
|
||||||
|
alignment: const AlignmentDirectional(0.0, -1.0),
|
||||||
|
child: Material(
|
||||||
|
color: Colors.transparent,
|
||||||
|
elevation: 0.0,
|
||||||
|
child: Container(
|
||||||
|
width: double.infinity,
|
||||||
|
height: 119.0,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: FlutterFlowTheme.of(context).primary,
|
||||||
|
border: Border.all(
|
||||||
|
color: FlutterFlowTheme.of(context).primary,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
mainAxisSize: MainAxisSize.max,
|
||||||
|
children: [
|
||||||
|
Align(
|
||||||
|
alignment: const AlignmentDirectional(-1.0, 0.0),
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(2.0),
|
||||||
|
child: InkWell(
|
||||||
|
splashColor: Colors.transparent,
|
||||||
|
focusColor: Colors.transparent,
|
||||||
|
hoverColor: Colors.transparent,
|
||||||
|
highlightColor: Colors.transparent,
|
||||||
|
onTap: _isLoading ? null : retrieveProfileInfo,
|
||||||
|
child: ClipRRect(
|
||||||
|
borderRadius: BorderRadius.circular(200.0),
|
||||||
|
child: CachedNetworkImage(
|
||||||
|
imageBuilder: (context, imageProvider) => Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
image: DecorationImage(
|
||||||
|
image: imageProvider,
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
imageUrl: 'assets/images/home.png',
|
||||||
|
width: 80.0,
|
||||||
|
height: 80.0,
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
alignment: const Alignment(0.0, 0.0),
|
||||||
|
placeholder: (context, url) => Image.asset('assets/images/home.png'),
|
||||||
|
errorListener: (_) => Image.asset('assets/images/home.png'),
|
||||||
|
errorWidget: (_, __, ___) => Image.asset('assets/images/home.png'),
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Tooltip(
|
||||||
|
message: FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText: 'SEM LOCAL VINCULADO',
|
||||||
|
enText: 'NO LINKED LOCAL',
|
||||||
|
),
|
||||||
|
child: Text(
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText: 'SEM LOCAL VINCULADO',
|
||||||
|
enText: 'NO LINKED LOCAL',
|
||||||
|
),
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
maxLines: 1,
|
||||||
|
style: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
|
fontFamily: 'Nunito',
|
||||||
|
color: FlutterFlowTheme.of(context).info,
|
||||||
|
fontSize: limitedFontSize,
|
||||||
|
letterSpacing: 0.0,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
].divide(const SizedBox(width: 20.0)).addToStart(const SizedBox(width: 20.0)).addToEnd(const SizedBox(width: 20.0)),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Container _buildAsyncLocalProfile(BuildContext context, LocalProfileState state, double limitedFontSize) {
|
||||||
|
return Container(
|
||||||
|
decoration: const BoxDecoration(),
|
||||||
|
child: Align(
|
||||||
|
alignment: const AlignmentDirectional(0.0, -1.0),
|
||||||
|
child: Material(
|
||||||
|
color: Colors.transparent,
|
||||||
|
elevation: 0.0,
|
||||||
|
child: Container(
|
||||||
|
width: double.infinity,
|
||||||
|
height: 119.0,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: FlutterFlowTheme.of(context).primary,
|
||||||
|
border: Border.all(
|
||||||
|
color: FlutterFlowTheme.of(context).primary,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
mainAxisSize: MainAxisSize.max,
|
||||||
|
children: [
|
||||||
|
Align(
|
||||||
|
alignment: const AlignmentDirectional(-1.0, 0.0),
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(2.0),
|
||||||
|
child: InkWell(
|
||||||
|
splashColor: Colors.transparent,
|
||||||
|
focusColor: Colors.transparent,
|
||||||
|
hoverColor: Colors.transparent,
|
||||||
|
highlightColor: Colors.transparent,
|
||||||
|
onTap: _isLoading ? null : retrieveProfileInfo,
|
||||||
|
child: ClipRRect(
|
||||||
|
borderRadius: BorderRadius.circular(200.0),
|
||||||
|
child: CachedNetworkImage(
|
||||||
|
imageBuilder: (context, imageProvider) => Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
image: DecorationImage(
|
||||||
|
image: imageProvider,
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
imageUrl: valueOrDefault('https://freaccess.com.br/freaccess/Images/Clients/${state.cliUUID}.png', 'assets/images/home.png'),
|
||||||
|
width: 80.0,
|
||||||
|
height: 80.0,
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
alignment: const Alignment(0.0, 0.0),
|
||||||
|
placeholder: (context, url) => Image.asset('assets/images/home.png'),
|
||||||
|
errorListener: (_) => Image.asset('assets/images/home.png'),
|
||||||
|
errorWidget: (_, __, ___) => Image.asset('assets/images/home.png'),
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Tooltip(
|
||||||
|
message: valueOrDefault<String>(
|
||||||
|
convertToUppercase(state.cliName),
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText: 'SEM LOCAL VINCULADO',
|
||||||
|
enText: 'NO LINKED LOCAL',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Text(
|
||||||
|
valueOrDefault<String>(
|
||||||
|
convertToUppercase(state.cliName),
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText: 'SEM LOCAL VINCULADO',
|
||||||
|
enText: 'NO LINKED LOCAL',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
maxLines: 1,
|
||||||
|
style: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
|
fontFamily: 'Nunito',
|
||||||
|
color: FlutterFlowTheme.of(context).info,
|
||||||
|
fontSize: limitedFontSize,
|
||||||
|
letterSpacing: 0.0,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Tooltip(
|
||||||
|
message: valueOrDefault<String>(' ' + state.ownerName, ''),
|
||||||
|
child: Text(
|
||||||
|
valueOrDefault<String>(state.ownerName.length > 30 ? '${state.ownerName.substring(0, 20)}...' : state.ownerName, ''),
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
maxLines: 1,
|
||||||
|
style: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
|
fontFamily: 'Nunito',
|
||||||
|
color: FlutterFlowTheme.of(context).info,
|
||||||
|
fontSize: limitedFontSize,
|
||||||
|
letterSpacing: 0.0,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
].divide(const SizedBox(width: 20.0)).addToStart(const SizedBox(width: 20.0)).addToEnd(const SizedBox(width: 20.0)),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,21 +1,18 @@
|
||||||
|
|
||||||
|
|
||||||
import 'dart:developer';
|
import 'dart:developer';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:hub/backend/api_requests/api_calls.dart';
|
import 'package:hub/features/backend/index.dart';
|
||||||
|
import 'package:hub/features/storage/index.dart';
|
||||||
import 'package:hub/flutter_flow/internationalization.dart';
|
import 'package:hub/flutter_flow/internationalization.dart';
|
||||||
import 'package:hub/shared/components/molecules/locals/index.dart';
|
import 'package:hub/features/locals/index.dart';
|
||||||
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
|
||||||
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
|
||||||
import 'package:hub/shared/utils/dialog_util.dart';
|
import 'package:hub/shared/utils/dialog_util.dart';
|
||||||
import 'package:hub/shared/utils/log_util.dart';
|
import 'package:hub/shared/utils/log_util.dart';
|
||||||
|
|
||||||
class LocalUtil {
|
class LocalUtil {
|
||||||
|
|
||||||
static void handleError(BuildContext context, String errorMsg) async {
|
static void handleError(BuildContext context, String errorMsg) async {
|
||||||
final String devUUID = await StorageHelper().get(KeychainStorageKey.devUUID.value) ?? '';
|
final String devUUID = await StorageHelper().get(ProfileStorageKey.devUUID.key) ?? '';
|
||||||
final String userUUID = await StorageHelper().get(KeychainStorageKey.userUUID.value) ?? '';
|
final String userUUID = await StorageHelper().get(ProfileStorageKey.userUUID.key) ?? '';
|
||||||
final bool isAuthenticated = userUUID.isNotEmpty && devUUID.isNotEmpty;
|
final bool isAuthenticated = userUUID.isNotEmpty && devUUID.isNotEmpty;
|
||||||
final bool isDevLinked = !errorMsg.contains('Esse dispositivo nao pertence a esse usuario');
|
final bool isDevLinked = !errorMsg.contains('Esse dispositivo nao pertence a esse usuario');
|
||||||
log('() => isLinked: $errorMsg');
|
log('() => isLinked: $errorMsg');
|
||||||
|
@ -42,17 +39,17 @@ class LocalUtil {
|
||||||
static Future<bool> handleUnavailable(BuildContext context, List<dynamic> locals) async {
|
static Future<bool> handleUnavailable(BuildContext context, List<dynamic> locals) async {
|
||||||
log('() => isUnavailable');
|
log('() => isUnavailable');
|
||||||
try {
|
try {
|
||||||
await StorageHelper().set(KeychainStorageKey.clientUUID.value, locals[0]['CLI_ID']);
|
await StorageHelper().set(ProfileStorageKey.clientUUID.key, locals[0]['CLI_ID']);
|
||||||
await StorageHelper().set(KeychainStorageKey.ownerUUID.value, locals[0]['CLU_OWNER_ID']);
|
await StorageHelper().set(ProfileStorageKey.ownerUUID.key, locals[0]['CLU_OWNER_ID']);
|
||||||
await StorageHelper().set(KeychainStorageKey.clientName.value, locals[0]['CLI_NOME']);
|
await StorageHelper().set(ProfileStorageKey.clientName.key, locals[0]['CLI_NOME']);
|
||||||
await StorageHelper().set(KeychainStorageKey.ownerName.value, locals[0]['CLU_OWNER_DSC']);
|
await StorageHelper().set(ProfileStorageKey.ownerName.key, locals[0]['CLU_OWNER_DSC']);
|
||||||
|
|
||||||
var response = await PhpGroup.resopndeVinculo.call(tarefa: 'A');
|
var response = await PhpGroup.resopndeVinculo.call(tarefa: 'A');
|
||||||
if (response.jsonBody['error'] == true) {
|
if (response.jsonBody['error'] == true) {
|
||||||
await StorageHelper().set(KeychainStorageKey.clientUUID.value, '');
|
await StorageHelper().set(ProfileStorageKey.clientUUID.key, '');
|
||||||
await StorageHelper().set(KeychainStorageKey.ownerUUID.value, '');
|
await StorageHelper().set(ProfileStorageKey.ownerUUID.key, '');
|
||||||
await StorageHelper().set(KeychainStorageKey.clientName.value, '');
|
await StorageHelper().set(ProfileStorageKey.clientName.key, '');
|
||||||
await StorageHelper().set(KeychainStorageKey.ownerName.value, '');
|
await StorageHelper().set(ProfileStorageKey.ownerName.key, '');
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -67,11 +64,11 @@ class LocalUtil {
|
||||||
|
|
||||||
static Future<bool> handleEnabled(BuildContext context, dynamic local) async {
|
static Future<bool> handleEnabled(BuildContext context, dynamic local) async {
|
||||||
log('() => isEnabled');
|
log('() => isEnabled');
|
||||||
await StorageHelper().set(KeychainStorageKey.clientUUID.value, local['CLI_ID']);
|
await StorageHelper().set(ProfileStorageKey.clientUUID.key, local['CLI_ID']);
|
||||||
await StorageHelper().set(KeychainStorageKey.ownerUUID.value, local['CLU_OWNER_ID']);
|
await StorageHelper().set(ProfileStorageKey.ownerUUID.key, local['CLU_OWNER_ID']);
|
||||||
await StorageHelper().set(KeychainStorageKey.clientName.value, local['CLI_NOME']);
|
await StorageHelper().set(ProfileStorageKey.clientName.key, local['CLI_NOME']);
|
||||||
await StorageHelper().set(KeychainStorageKey.ownerName.value, local['CLU_OWNER_DSC']);
|
await StorageHelper().set(ProfileStorageKey.ownerName.key, local['CLU_OWNER_DSC']);
|
||||||
await StorageHelper().set(KeychainStorageKey.userName.value, local['USU_NOME']);
|
await StorageHelper().set(ProfileStorageKey.userName.key, local['USU_NOME']);
|
||||||
return await LocalsRemoteDataSourceImpl().processData(context);
|
return await LocalsRemoteDataSourceImpl().processData(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -84,16 +81,15 @@ class LocalUtil {
|
||||||
|
|
||||||
static Future<bool> updateStorageUtil(Map<String, dynamic> jsonBody) async {
|
static Future<bool> updateStorageUtil(Map<String, dynamic> jsonBody) async {
|
||||||
try {
|
try {
|
||||||
await StorageHelper().set(KeychainStorageKey.whatsapp.value, jsonBody['whatsapp'] ?? false);
|
await StorageHelper().set(LocalsStorageKey.whatsapp.key, jsonBody['whatsapp'] ?? false);
|
||||||
await StorageHelper().set(KeychainStorageKey.provisional.value, jsonBody['provisional'] ?? false);
|
await StorageHelper().set(LocalsStorageKey.provisional.key, jsonBody['provisional'] ?? false);
|
||||||
await StorageHelper().set(KeychainStorageKey.pets.value, jsonBody['pet'] ?? false);
|
await StorageHelper().set(LocalsStorageKey.pets.key, jsonBody['pet'] ?? false);
|
||||||
await StorageHelper().set(KeychainStorageKey.petAmount.value,
|
await StorageHelper().set(LocalsStorageKey.petAmount.key, jsonBody['petAmountRegister']?.toString().isEmpty ?? true ? '0' : jsonBody['petAmountRegister'].toString());
|
||||||
jsonBody['petAmountRegister']?.toString().isEmpty ?? true ? '0' : jsonBody['petAmountRegister'].toString());
|
await StorageHelper().set(ProfileStorageKey.userName.key, jsonBody['visitado']['VDO_NOME'] ?? '');
|
||||||
await StorageHelper().set(KeychainStorageKey.userName.value, jsonBody['visitado']['VDO_NOME'] ?? '');
|
await StorageHelper().set(ProfileStorageKey.userEmail.key, jsonBody['visitado']['VDO_EMAIL'] ?? '');
|
||||||
await StorageHelper().set(KeychainStorageKey.userEmail.value, jsonBody['visitado']['VDO_EMAIL'] ?? '');
|
|
||||||
|
|
||||||
final bool isNewVersion = jsonBody['newVersion'] ?? false;
|
final bool isNewVersion = jsonBody['newVersion'] ?? false;
|
||||||
await StorageHelper().set(KeychainStorageKey.isNewVersion.value, isNewVersion);
|
await StorageHelper().set(LocalsStorageKey.isNewVersion.key, isNewVersion);
|
||||||
return isNewVersion;
|
return isNewVersion;
|
||||||
} catch (e, s) {
|
} catch (e, s) {
|
||||||
log('Error in _updateStorageUtil: $e', stackTrace: s);
|
log('Error in _updateStorageUtil: $e', stackTrace: s);
|
||||||
|
@ -106,7 +102,7 @@ class LocalUtil {
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<bool> isInactived(List<dynamic> locals) async {
|
static Future<bool> isInactived(List<dynamic> locals) async {
|
||||||
String cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
String cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||||
return locals.where((local) => local['CLI_ID'] != cliUUID && local['CLU_STATUS'] == 'A').isNotEmpty;
|
return locals.where((local) => local['CLI_ID'] != cliUUID && local['CLU_STATUS'] == 'A').isNotEmpty;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -115,22 +111,21 @@ class LocalUtil {
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<bool> isUnselected() async {
|
static Future<bool> isUnselected() async {
|
||||||
String cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
String cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||||
String cliName = (await StorageHelper().get(KeychainStorageKey.clientName.value)) ?? '';
|
String cliName = (await StorageHelper().get(ProfileStorageKey.clientName.key)) ?? '';
|
||||||
String ownerUUID = (await StorageHelper().get(KeychainStorageKey.ownerUUID.value)) ?? '';
|
String ownerUUID = (await StorageHelper().get(ProfileStorageKey.ownerUUID.key)) ?? '';
|
||||||
return cliUUID.isEmpty && cliName.isEmpty && ownerUUID.isEmpty;
|
return cliUUID.isEmpty && cliName.isEmpty && ownerUUID.isEmpty;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<bool> isSelected(bool isInactived) async {
|
static Future<bool> isSelected(bool isInactived) async {
|
||||||
String cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
String cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||||
String cliName = (await StorageHelper().get(KeychainStorageKey.clientName.value)) ?? '';
|
String cliName = (await StorageHelper().get(ProfileStorageKey.clientName.key)) ?? '';
|
||||||
return cliUUID.isNotEmpty && cliName.isNotEmpty && isInactived;
|
return cliUUID.isNotEmpty && cliName.isNotEmpty && isInactived;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<bool> isAvailable() async {
|
static Future<bool> isAvailable() async {
|
||||||
String cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
String cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||||
String cliName = (await StorageHelper().get(KeychainStorageKey.clientName.value)) ?? '';
|
String cliName = (await StorageHelper().get(ProfileStorageKey.clientName.key)) ?? '';
|
||||||
return cliUUID.isNotEmpty && cliName.isNotEmpty;
|
return cliUUID.isNotEmpty && cliName.isNotEmpty;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,18 +1,16 @@
|
||||||
|
|
||||||
|
|
||||||
import 'dart:developer';
|
import 'dart:developer';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:hub/features/authentication/index.dart';
|
||||||
|
import 'package:hub/features/menu/index.dart';
|
||||||
import 'package:hub/flutter_flow/nav/nav.dart';
|
import 'package:hub/flutter_flow/nav/nav.dart';
|
||||||
import 'package:hub/shared/components/molecules/menu/index.dart';
|
|
||||||
import 'package:hub/shared/extensions/dialog_extensions.dart';
|
import 'package:hub/shared/extensions/dialog_extensions.dart';
|
||||||
import 'package:hub/shared/services/authentication/authentication_service.dart';
|
|
||||||
import 'package:hub/shared/utils/path_util.dart';
|
import 'package:hub/shared/utils/path_util.dart';
|
||||||
|
|
||||||
import '../../../modules/domain/entities/index.dart';
|
import '../../../modules/domain/entities/index.dart';
|
||||||
|
|
||||||
abstract class MenuLocalDataSource {
|
abstract class MenuLocalDataSource {
|
||||||
Future<MenuItem?> addMenuEntry(EnumMenuItem item, List<MenuItem?> entries, IconData icon, String text, Function() action);
|
Future<MenuItem?> addMenuEntry(EnumMenuItem item, List<MenuItem?> entries, IconData icon, String text, Function() action);
|
||||||
Future<bool> processDisplayDefault(EnumMenuItem item, MenuEntry opt, List<MenuItem?> entries);
|
Future<bool> processDisplayDefault(EnumMenuItem item, MenuEntry opt, List<MenuItem?> entries);
|
||||||
Future<void> handleMenu(EnumMenuItem item, EnumDisplay display, MenuEntry opt, List<MenuItem?> entries);
|
Future<void> handleMenu(EnumMenuItem item, EnumDisplay display, MenuEntry opt, List<MenuItem?> entries);
|
||||||
Future<bool> processStartDate(String startDate, MenuEntry entry);
|
Future<bool> processStartDate(String startDate, MenuEntry entry);
|
||||||
|
@ -44,9 +42,8 @@ class MenuLocalDataSourceImpl implements MenuLocalDataSource {
|
||||||
await AuthenticationService.signOut(navigatorKey.currentContext!);
|
await AuthenticationService.signOut(navigatorKey.currentContext!);
|
||||||
});
|
});
|
||||||
return true;
|
return true;
|
||||||
|
} else
|
||||||
}
|
return false;
|
||||||
else return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -82,7 +79,7 @@ class MenuLocalDataSourceImpl implements MenuLocalDataSource {
|
||||||
log('Error processing start date for module ${opt.key}: $e');
|
log('Error processing start date for module ${opt.key}: $e');
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<bool> processExpirationDate(String expirationDate, MenuEntry opt) async {
|
Future<bool> processExpirationDate(String expirationDate, MenuEntry opt) async {
|
||||||
|
@ -95,7 +92,4 @@ class MenuLocalDataSourceImpl implements MenuLocalDataSource {
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,23 +1,12 @@
|
||||||
|
|
||||||
|
|
||||||
import 'dart:convert';
|
|
||||||
import 'dart:developer';
|
import 'dart:developer';
|
||||||
|
|
||||||
|
import 'package:hub/features/menu/index.dart';
|
||||||
|
import 'package:hub/features/modules/index.dart';
|
||||||
import 'package:hub/flutter_flow/custom_functions.dart';
|
import 'package:hub/flutter_flow/custom_functions.dart';
|
||||||
import 'package:hub/main.dart';
|
|
||||||
import 'package:hub/shared/components/molecules/menu/data/data_sources/menu_local_data_source.dart';
|
|
||||||
import 'package:hub/shared/components/molecules/menu/domain/respositories/menu_repository.dart';
|
|
||||||
import 'package:hub/shared/components/molecules/menu/index.dart';
|
|
||||||
import 'package:hub/shared/components/molecules/modules/index.dart';
|
|
||||||
import 'package:hub/shared/extensions/string_extensions.dart';
|
|
||||||
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
|
||||||
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
|
||||||
|
|
||||||
|
|
||||||
class MenuRepositoryImpl implements MenuRepository {
|
class MenuRepositoryImpl implements MenuRepository {
|
||||||
final MenuLocalDataSource menuDataSource = MenuLocalDataSourceImpl();
|
final MenuLocalDataSource menuDataSource = MenuLocalDataSourceImpl();
|
||||||
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<List<MenuItem?>> generateMenuEntries(List<MenuEntry> menuEntries, EnumMenuItem item) async {
|
Future<List<MenuItem?>> generateMenuEntries(List<MenuEntry> menuEntries, EnumMenuItem item) async {
|
||||||
List<MenuItem?> entries = [];
|
List<MenuItem?> entries = [];
|
||||||
|
@ -55,8 +44,6 @@ class MenuRepositoryImpl implements MenuRepository {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<EnumDisplay> processDisplay(Map<String, dynamic> module, bool isNewVersion) async {
|
Future<EnumDisplay> processDisplay(Map<String, dynamic> module, bool isNewVersion) async {
|
||||||
|
|
||||||
|
|
||||||
if (await _shouldUpdateDisplay(module, isNewVersion)) {
|
if (await _shouldUpdateDisplay(module, isNewVersion)) {
|
||||||
final displayValue = module['display'] == EnumDisplay.active ? 'VISIVEL' : 'INVISIVEL';
|
final displayValue = module['display'] == EnumDisplay.active ? 'VISIVEL' : 'INVISIVEL';
|
||||||
await LicenseLocalDataSourceImpl().setDisplayByKey(['FRE-HUB-ABOUT-PROPERTY'], displayValue);
|
await LicenseLocalDataSourceImpl().setDisplayByKey(['FRE-HUB-ABOUT-PROPERTY'], displayValue);
|
||||||
|
@ -67,13 +54,7 @@ class MenuRepositoryImpl implements MenuRepository {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<bool> _shouldUpdateDisplay(Map<String, dynamic> module, bool isNewVersion) async {
|
Future<bool> _shouldUpdateDisplay(Map<String, dynamic> module, bool isNewVersion) async {
|
||||||
const keysToCheck = [
|
const keysToCheck = [LicenseKeys.residents, LicenseKeys.vehicles, LicenseKeys.openedVisits];
|
||||||
LicenseKeys.residents,
|
|
||||||
LicenseKeys.vehicles,
|
|
||||||
LicenseKeys.openedVisits
|
|
||||||
];
|
|
||||||
return isNewVersion && keysToCheck.any((key) => module['key'] == key.value);
|
return isNewVersion && keysToCheck.any((key) => module['key'] == key.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,5 +1,5 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:hub/shared/components/molecules/menu/index.dart';
|
import 'package:hub/features/menu/index.dart';
|
||||||
|
|
||||||
enum EnumMenuItem {
|
enum EnumMenuItem {
|
||||||
button,
|
button,
|
||||||
|
@ -30,7 +30,6 @@ abstract class MenuItem extends StatefulWidget {
|
||||||
final String title;
|
final String title;
|
||||||
final IconData icon;
|
final IconData icon;
|
||||||
|
|
||||||
|
|
||||||
factory MenuItem.create(
|
factory MenuItem.create(
|
||||||
EnumMenuItem type, {
|
EnumMenuItem type, {
|
||||||
Key? key,
|
Key? key,
|
|
@ -0,0 +1 @@
|
||||||
|
export 'menu_repository.dart';
|
|
@ -0,0 +1,5 @@
|
||||||
|
import 'package:hub/features/menu/index.dart';
|
||||||
|
|
||||||
|
abstract class MenuRepository {
|
||||||
|
Future<List<MenuItem?>> generateMenuEntries(List<MenuEntry> menuEntries, EnumMenuItem item);
|
||||||
|
}
|
|
@ -1,17 +1,9 @@
|
||||||
|
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:developer';
|
|
||||||
|
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
import 'package:hub/flutter_flow/nav/nav.dart';
|
import 'package:hub/features/menu/index.dart';
|
||||||
import 'package:hub/shared/components/molecules/locals/index.dart';
|
import 'package:hub/features/modules/index.dart';
|
||||||
|
import 'package:hub/features/locals/index.dart';
|
||||||
import 'package:hub/shared/components/molecules/menu/data/repositories/menu_repository_impl.dart';
|
|
||||||
import 'package:hub/shared/components/molecules/menu/index.dart';
|
|
||||||
import 'package:hub/shared/components/molecules/modules/index.dart';
|
|
||||||
|
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
|
||||||
|
|
||||||
|
|
||||||
class MenuEvent {}
|
class MenuEvent {}
|
||||||
|
|
||||||
|
@ -54,6 +46,4 @@ class MenuBloc extends Bloc<MenuEvent, MenuState> {
|
||||||
_completer.cancel();
|
_completer.cancel();
|
||||||
return super.close();
|
return super.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue