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: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/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/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/limited_text_size.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';
|
||||
|
||||
class BottomArrowLinkedLocalsComponentWidget extends StatefulWidget {
|
||||
|
@ -105,10 +104,10 @@ class _BottomArrowLinkedLocalsComponentWidgetState extends State<BottomArrowLink
|
|||
if (isEnabled) {
|
||||
final local = locals[0];
|
||||
|
||||
await StorageHelper().set(KeychainStorageKey.clientName.value, local['CLI_NOME']);
|
||||
await StorageHelper().set(KeychainStorageKey.ownerName.value, local['CLU_OWNER_DSC']);
|
||||
await StorageHelper().set(KeychainStorageKey.clientUUID.value, local['CLI_ID']);
|
||||
await StorageHelper().set(KeychainStorageKey.ownerUUID.value, local['CLU_OWNER_ID']);
|
||||
await StorageHelper().set(ProfileStorageKey.clientName.key, local['CLI_NOME']);
|
||||
await StorageHelper().set(ProfileStorageKey.ownerName.key, local['CLU_OWNER_DSC']);
|
||||
await StorageHelper().set(ProfileStorageKey.clientUUID.key, local['CLI_ID']);
|
||||
await StorageHelper().set(ProfileStorageKey.ownerUUID.key, local['CLU_OWNER_ID']);
|
||||
|
||||
context.pop();
|
||||
return widget.response;
|
||||
|
@ -138,17 +137,13 @@ class _BottomArrowLinkedLocalsComponentWidgetState extends State<BottomArrowLink
|
|||
|
||||
Future<dynamic> _fetchResponseLink(String status, String cliID) async {
|
||||
try {
|
||||
await StorageHelper().set(KeychainStorageKey.clientUUID.value, cliID);
|
||||
await StorageHelper().set(ProfileStorageKey.clientUUID.key, cliID);
|
||||
var response = await PhpGroup.resopndeVinculo.call(tarefa: status);
|
||||
|
||||
if (response.jsonBody['error'] == false) {
|
||||
return {
|
||||
'error': false,
|
||||
'error_msg': FFLocalizations.of(context)
|
||||
.getVariableText(ptText: "Vínculo Ativado com Sucesso", enText: "Link Activated Successfully")
|
||||
};
|
||||
return {'error': false, 'error_msg': FFLocalizations.of(context).getVariableText(ptText: "Vínculo Ativado com Sucesso", enText: "Link Activated Successfully")};
|
||||
} else {
|
||||
await StorageHelper().set(KeychainStorageKey.clientUUID.value, '');
|
||||
await StorageHelper().set(ProfileStorageKey.clientUUID.key, '');
|
||||
return response.jsonBody;
|
||||
}
|
||||
} catch (e, s) {
|
||||
|
@ -156,9 +151,8 @@ class _BottomArrowLinkedLocalsComponentWidgetState extends State<BottomArrowLink
|
|||
LogUtil.requestAPIFailed('responderVinculo.php', '', 'Responder Vínculo', e, s);
|
||||
return {
|
||||
'error': true,
|
||||
'error_msg': FFLocalizations.of(context).getVariableText(
|
||||
ptText: "Falha ao efetuar operação, Tente Novamente mais tarde.",
|
||||
enText: "Failed to perform operation, please try again later.")
|
||||
'error_msg': FFLocalizations.of(context)
|
||||
.getVariableText(ptText: "Falha ao efetuar operação, Tente Novamente mais tarde.", enText: "Failed to perform operation, please try again later.")
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -168,24 +162,18 @@ class _BottomArrowLinkedLocalsComponentWidgetState extends State<BottomArrowLink
|
|||
}
|
||||
|
||||
Map<String, String> _labelsHashMap(dynamic local) {
|
||||
return Map<String, String>.from({
|
||||
'${local['CLI_PREFIXO']}:': local['CLI_NOME'],
|
||||
'${FFLocalizations.of(context).getVariableText(ptText: 'Propriedade', enText: 'Property')}:':
|
||||
local['CLU_OWNER_DSC']
|
||||
});
|
||||
return Map<String, String>.from(
|
||||
{'${local['CLI_PREFIXO']}:': local['CLI_NOME'], '${FFLocalizations.of(context).getVariableText(ptText: 'Propriedade', enText: 'Property')}:': local['CLU_OWNER_DSC']});
|
||||
}
|
||||
|
||||
Map<String, Color> _statusHashMap(dynamic local) {
|
||||
return Map<String, Color>.from({
|
||||
if (local['CLU_STATUS'] == 'A')
|
||||
FFLocalizations.of(context).getVariableText(ptText: 'Ativo', enText: 'Active'):
|
||||
FlutterFlowTheme.of(context).success
|
||||
FFLocalizations.of(context).getVariableText(ptText: 'Ativo', enText: 'Active'): FlutterFlowTheme.of(context).success
|
||||
else if (local['CLU_STATUS'] == 'B')
|
||||
FFLocalizations.of(context).getVariableText(ptText: 'Bloqueado', enText: 'Blocked'):
|
||||
FlutterFlowTheme.of(context).error
|
||||
FFLocalizations.of(context).getVariableText(ptText: 'Bloqueado', enText: 'Blocked'): FlutterFlowTheme.of(context).error
|
||||
else
|
||||
FFLocalizations.of(context).getVariableText(ptText: 'Pendente', enText: 'Pending'):
|
||||
FlutterFlowTheme.of(context).warning
|
||||
FFLocalizations.of(context).getVariableText(ptText: 'Pendente', enText: 'Pending'): FlutterFlowTheme.of(context).warning
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -196,10 +184,10 @@ class _BottomArrowLinkedLocalsComponentWidgetState extends State<BottomArrowLink
|
|||
statusHashMap: [_statusHashMap(local)],
|
||||
onTapCardItemAction: () async {
|
||||
if (local['CLU_STATUS'] == 'A') {
|
||||
await StorageHelper().set(KeychainStorageKey.clientUUID.value, local['CLI_ID']);
|
||||
await StorageHelper().set(KeychainStorageKey.clientName.value, local['CLI_NOME']);
|
||||
await StorageHelper().set(KeychainStorageKey.ownerName.value, local['CLU_OWNER_DSC']);
|
||||
await StorageHelper().set(KeychainStorageKey.ownerUUID.value, local['CLU_OWNER_ID']);
|
||||
await StorageHelper().set(ProfileStorageKey.clientUUID.key, local['CLI_ID']);
|
||||
await StorageHelper().set(ProfileStorageKey.clientName.key, local['CLI_NOME']);
|
||||
await StorageHelper().set(ProfileStorageKey.ownerName.key, local['CLU_OWNER_DSC']);
|
||||
await StorageHelper().set(ProfileStorageKey.ownerUUID.key, local['CLU_OWNER_ID']);
|
||||
|
||||
context.pop(true);
|
||||
return true;
|
||||
|
@ -222,9 +210,7 @@ class _BottomArrowLinkedLocalsComponentWidgetState extends State<BottomArrowLink
|
|||
showAlertDialog(
|
||||
context,
|
||||
FFLocalizations.of(context).getVariableText(ptText: 'Ativar Vínculo', enText: 'Activate Link'),
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
ptText: 'Deseja aceitar o vínculo a $localName?',
|
||||
enText: 'Do you wish to accept the link to $localName?'),
|
||||
FFLocalizations.of(context).getVariableText(ptText: 'Deseja aceitar o vínculo a $localName?', enText: 'Do you wish to accept the link to $localName?'),
|
||||
() async {
|
||||
var response = await _fetchResponseLink('A', local['CLI_ID']);
|
||||
context.pop();
|
||||
|
@ -277,8 +263,7 @@ class _BottomArrowLinkedLocalsComponentWidgetState extends State<BottomArrowLink
|
|||
width: double.infinity,
|
||||
height: height - (height * 0.5),
|
||||
decoration: BoxDecoration(
|
||||
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||
borderRadius: const BorderRadius.only(topLeft: Radius.circular(25), topRight: Radius.circular(25))),
|
||||
color: FlutterFlowTheme.of(context).primaryBackground, borderRadius: const BorderRadius.only(topLeft: Radius.circular(25), topRight: Radius.circular(25))),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
|
@ -290,8 +275,7 @@ class _BottomArrowLinkedLocalsComponentWidgetState extends State<BottomArrowLink
|
|||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Center(
|
||||
child: Text(FFLocalizations.of(context)
|
||||
.getVariableText(ptText: "Nenhum Local Encontrado.", enText: "No local found")),
|
||||
child: Text(FFLocalizations.of(context).getVariableText(ptText: "Nenhum Local Encontrado.", enText: "No local found")),
|
||||
)
|
||||
],
|
||||
),
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
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/features/backend/index.dart';
|
||||
import 'package:hub/features/storage/index.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
|
||||
import 'package:intl/intl.dart';
|
||||
|
@ -57,9 +56,9 @@ class ScheduleVisitDetailModel extends FlutterFlowModel<ScheduleVisitDetailWidge
|
|||
}
|
||||
|
||||
Future<void> initDB() async {
|
||||
devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||
userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||
cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||
devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||
userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||
cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:flutter/material.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/features/backend/index.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_theme.dart';
|
||||
|
@ -199,15 +199,13 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
|||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
|
@ -241,8 +239,7 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
|||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
),
|
||||
validator: _model.textController1Validator.asValidator(context),
|
||||
),
|
||||
|
@ -273,8 +270,7 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
|||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
hintText: FFLocalizations.of(context).getText(
|
||||
'0cp1e31d' /* dd/mm/yyyy */,
|
||||
|
@ -283,8 +279,7 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
|||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
|
@ -319,8 +314,7 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
|||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
letterSpacing: 0.0,
|
||||
fontSize: 12,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
validator: _model.textController2Validator.asValidator(context),
|
||||
|
@ -345,8 +339,7 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
|||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
hintText: FFLocalizations.of(context).getText(
|
||||
'kqralft4' /* dd/mm/yyyy */,
|
||||
|
@ -355,8 +348,7 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
|||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
|
@ -391,8 +383,7 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
|||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
letterSpacing: 0.0,
|
||||
fontSize: 12,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
validator: _model.textController3Validator.asValidator(context),
|
||||
|
@ -426,8 +417,7 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
|||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
hintText: FFLocalizations.of(context).getText(
|
||||
'47oezdm6' /* Motivo */,
|
||||
|
@ -436,8 +426,7 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
|||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
|
@ -471,8 +460,7 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
|||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
validator: _model.textController4Validator.asValidator(context),
|
||||
|
@ -497,8 +485,7 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
|||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
hintText: FFLocalizations.of(context).getText(
|
||||
'3emmbbfv' /* Nível de Acesso */,
|
||||
|
@ -507,8 +494,7 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
|||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
|
@ -542,8 +528,7 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
|||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
validator: _model.textController5Validator.asValidator(context),
|
||||
|
@ -572,15 +557,13 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
|||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
|
@ -614,8 +597,7 @@ class _ScheduleVisitDetailWidgetState extends State<ScheduleVisitDetailWidget> {
|
|||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
),
|
||||
validator: _model.textController6Validator.asValidator(context),
|
||||
),
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
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/features/storage/index.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> {
|
||||
late final String devUUID;
|
||||
|
@ -16,10 +15,10 @@ class UpArrowLinkedLocalsComponentModel extends FlutterFlowModel<UpArrowLinkedLo
|
|||
}
|
||||
|
||||
Future<void> initDB() async {
|
||||
devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||
userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||
cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||
cliName = (await StorageHelper().get(KeychainStorageKey.clientName.value)) ?? '';
|
||||
devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||
userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||
cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||
cliName = (await StorageHelper().get(ProfileStorageKey.clientName.key)) ?? '';
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
|
@ -2,8 +2,8 @@ import 'package:cached_network_image/cached_network_image.dart';
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_spinkit/flutter_spinkit.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/features/backend/index.dart';
|
||||
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
||||
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
||||
import 'package:hub/flutter_flow/nav/nav.dart';
|
||||
|
@ -166,8 +166,7 @@ class _UpArrowLinkedLocalsComponentWidgetState extends State<UpArrowLinkedLocals
|
|||
topRight: Radius.circular(25.0),
|
||||
),
|
||||
child: CachedNetworkImage(
|
||||
imageUrl:
|
||||
"https://freaccess.com.br/freaccess/Images/Clients/${getJsonField(
|
||||
imageUrl: "https://freaccess.com.br/freaccess/Images/Clients/${getJsonField(
|
||||
eachLocalsItem,
|
||||
r'''$.CLI_ID''',
|
||||
).toString()}.png",
|
||||
|
@ -189,8 +188,7 @@ class _UpArrowLinkedLocalsComponentWidgetState extends State<UpArrowLinkedLocals
|
|||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
@ -1,14 +1,12 @@
|
|||
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/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 'access_notification_modal_template_component_widget.dart' show AccessNotificationModalTemplateComponentWidget;
|
||||
|
||||
class AccessNotificationModalTemplateComponentModel
|
||||
extends FlutterFlowModel<AccessNotificationModalTemplateComponentWidget> {
|
||||
class AccessNotificationModalTemplateComponentModel extends FlutterFlowModel<AccessNotificationModalTemplateComponentWidget> {
|
||||
late final String devUUID;
|
||||
late final String userUUID;
|
||||
late final String cliUUID;
|
||||
|
@ -32,9 +30,9 @@ class AccessNotificationModalTemplateComponentModel
|
|||
}
|
||||
|
||||
Future<void> initDB() async {
|
||||
devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||
userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||
cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||
devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||
userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||
cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
|
@ -2,9 +2,8 @@ import 'package:easy_debounce/easy_debounce.dart';
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.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/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_util.dart';
|
||||
|
@ -148,8 +147,7 @@ class _PassKeyTemplateWidgetState extends State<PassKeyTemplateWidget> {
|
|||
Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(16.0, 4.0, 16.0, 4.0),
|
||||
child: Text(
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
enText: 'Enter your password to continue', ptText: 'Digite sua senha para continuar'),
|
||||
FFLocalizations.of(context).getVariableText(enText: 'Enter your password to continue', ptText: 'Digite sua senha para continuar'),
|
||||
style: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: 'Plus Jakarta Sans',
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
|
@ -246,9 +244,7 @@ class _PassKeyTemplateWidgetState extends State<PassKeyTemplateWidget> {
|
|||
),
|
||||
focusNode: FocusNode(skipTraversal: true),
|
||||
child: Icon(
|
||||
_model.keyTextFieldVisibility1
|
||||
? Icons.visibility_outlined
|
||||
: Icons.visibility_off_outlined,
|
||||
_model.keyTextFieldVisibility1 ? Icons.visibility_outlined : Icons.visibility_off_outlined,
|
||||
color: FlutterFlowTheme.of(context).accent1,
|
||||
size: 22.0,
|
||||
),
|
||||
|
@ -288,9 +284,7 @@ class _PassKeyTemplateWidgetState extends State<PassKeyTemplateWidget> {
|
|||
return;
|
||||
}
|
||||
await widget.toggleActionStatus?.call(
|
||||
_model.keyTextFieldTextController1.text.isEmpty
|
||||
? _model.keyTextFieldTextController2.text
|
||||
: _model.keyTextFieldTextController1.text,
|
||||
_model.keyTextFieldTextController1.text.isEmpty ? _model.keyTextFieldTextController2.text : _model.keyTextFieldTextController1.text,
|
||||
);
|
||||
// Navigator.pop(context, true);
|
||||
context.pop(true);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import 'package:hub/features/backend/index.dart';
|
||||
import 'package:hub/shared/utils/validator_util.dart';
|
||||
|
||||
import '/backend/api_requests/api_calls.dart';
|
||||
import '/flutter_flow/flutter_flow_util.dart';
|
||||
import 'forgot_password_template_component_widget.dart' show ForgotPasswordTemplateComponentWidget;
|
||||
import 'package:flutter/material.dart';
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import 'package:easy_debounce/easy_debounce.dart';
|
||||
import 'package:flutter/material.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/shared/services/authentication/authentication_service.dart';
|
||||
import 'package:hub/shared/utils/limited_text_size.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),
|
||||
child: FFButtonWidget(
|
||||
key: const ValueKey<String>('SendButtonWidget'),
|
||||
onPressed: (_model.emailAddressTextController.text == '' ||
|
||||
!ValidatorUtil.isValidEmail(_model.emailAddressTextController.text))
|
||||
onPressed: (_model.emailAddressTextController.text == '' || !ValidatorUtil.isValidEmail(_model.emailAddressTextController.text))
|
||||
? null
|
||||
: () async => await AuthenticationService.forgotPassword(
|
||||
context,
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
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/features/storage/index.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
|
||||
extends FlutterFlowModel<LiberationHistoryItemDetailsTemplateComponentWidget> {
|
||||
class LiberationHistoryItemDetailsTemplateComponentModel extends FlutterFlowModel<LiberationHistoryItemDetailsTemplateComponentWidget> {
|
||||
late final String devUUID;
|
||||
late final String userUUID;
|
||||
late final String cliUUID;
|
||||
|
@ -27,9 +25,9 @@ class LiberationHistoryItemDetailsTemplateComponentModel
|
|||
void initState(BuildContext context) {}
|
||||
|
||||
Future<void> initDatabase() async {
|
||||
devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||
userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||
cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||
devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||
userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||
cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||
;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
import 'dart:developer';
|
||||
|
||||
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/features/backend/index.dart';
|
||||
import 'package:hub/features/storage/index.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> {
|
||||
String cliUUID = '';
|
||||
|
@ -88,8 +87,7 @@ class ScheduleProvisionalVisitPageModel extends FlutterFlowModel<ScheduleProvisi
|
|||
personNameTextController ??= TextEditingController();
|
||||
personNameFocusNode ??= FocusNode();
|
||||
|
||||
dateTimeTextController ??= TextEditingController(
|
||||
text: DateFormat('dd/MM/yyyy HH:mm:ss').format(DateTime.now().add(const Duration(days: 1))));
|
||||
dateTimeTextController ??= TextEditingController(text: DateFormat('dd/MM/yyyy HH:mm:ss').format(DateTime.now().add(const Duration(days: 1))));
|
||||
dateTimeFocusNode ??= FocusNode();
|
||||
|
||||
notesTextController ??= TextEditingController();
|
||||
|
@ -137,11 +135,11 @@ class ScheduleProvisionalVisitPageModel extends FlutterFlowModel<ScheduleProvisi
|
|||
}
|
||||
|
||||
Future<void> init() async {
|
||||
devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||
userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||
cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||
ownerName = (await StorageHelper().get(KeychainStorageKey.ownerName.value)) ?? '';
|
||||
ownerUUID = (await StorageHelper().get(KeychainStorageKey.ownerUUID.value)) ?? '';
|
||||
devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||
userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||
cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||
ownerName = (await StorageHelper().get(ProfileStorageKey.ownerName.key)) ?? '';
|
||||
ownerUUID = (await StorageHelper().get(ProfileStorageKey.ownerUUID.key)) ?? '';
|
||||
setState?.call();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import 'package:flutter/material.dart';
|
|||
import 'package:flutter/services.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/features/backend/index.dart';
|
||||
import 'package:hub/shared/utils/dialog_util.dart';
|
||||
import 'package:hub/shared/utils/limited_text_size.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_util.dart';
|
||||
import '/flutter_flow/flutter_flow_widgets.dart';
|
||||
|
@ -75,8 +75,7 @@ class _ScheduleProvisionalVisitPageWidgetState extends State<ScheduleProvisional
|
|||
fontSize: limitedHeaderFontSize,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -101,8 +100,7 @@ class _ScheduleProvisionalVisitPageWidgetState extends State<ScheduleProvisional
|
|||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
fontSize: limitedSubHeaderFontSize,
|
||||
),
|
||||
),
|
||||
|
@ -140,8 +138,7 @@ class _ScheduleProvisionalVisitPageWidgetState extends State<ScheduleProvisional
|
|||
child: CachedNetworkImage(
|
||||
fadeInDuration: const Duration(milliseconds: 200),
|
||||
fadeOutDuration: const Duration(milliseconds: 200),
|
||||
imageUrl:
|
||||
'https://freaccess.com.br/freaccess/Images/Clients/${model.cliUUID}.png',
|
||||
imageUrl: 'https://freaccess.com.br/freaccess/Images/Clients/${model.cliUUID}.png',
|
||||
width: 35.0,
|
||||
height: 35.0,
|
||||
fit: BoxFit.contain,
|
||||
|
@ -159,8 +156,7 @@ class _ScheduleProvisionalVisitPageWidgetState extends State<ScheduleProvisional
|
|||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
fontSize: limitedBodyFontSize,
|
||||
),
|
||||
),
|
||||
|
@ -192,8 +188,7 @@ class _ScheduleProvisionalVisitPageWidgetState extends State<ScheduleProvisional
|
|||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
fontSize: limitedSubHeaderFontSize,
|
||||
),
|
||||
),
|
||||
|
@ -231,16 +226,14 @@ class _ScheduleProvisionalVisitPageWidgetState extends State<ScheduleProvisional
|
|||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
fontSize: limitedInputFontSize,
|
||||
),
|
||||
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
fontSize: limitedInputFontSize,
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
|
@ -280,8 +273,7 @@ class _ScheduleProvisionalVisitPageWidgetState extends State<ScheduleProvisional
|
|||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
fontSize: limitedInputFontSize,
|
||||
),
|
||||
textAlign: TextAlign.start,
|
||||
|
@ -325,8 +317,7 @@ class _ScheduleProvisionalVisitPageWidgetState extends State<ScheduleProvisional
|
|||
labelStyle: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
fontSize: limitedInputFontSize,
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
|
@ -365,8 +356,7 @@ class _ScheduleProvisionalVisitPageWidgetState extends State<ScheduleProvisional
|
|||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
fontSize: limitedInputFontSize,
|
||||
),
|
||||
textAlign: TextAlign.start,
|
||||
|
@ -392,25 +382,18 @@ class _ScheduleProvisionalVisitPageWidgetState extends State<ScheduleProvisional
|
|||
child!,
|
||||
headerBackgroundColor: FlutterFlowTheme.of(context).primary,
|
||||
headerForegroundColor: FlutterFlowTheme.of(context).info,
|
||||
headerTextStyle:
|
||||
FlutterFlowTheme.of(context).headlineLarge.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context).headlineLargeFamily,
|
||||
fontSize: 32.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.w600,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).headlineLargeFamily),
|
||||
),
|
||||
pickerBackgroundColor:
|
||||
FlutterFlowTheme.of(context).secondaryBackground,
|
||||
headerTextStyle: FlutterFlowTheme.of(context).headlineLarge.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).headlineLargeFamily,
|
||||
fontSize: 32.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.w600,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).headlineLargeFamily),
|
||||
),
|
||||
pickerBackgroundColor: FlutterFlowTheme.of(context).secondaryBackground,
|
||||
pickerForegroundColor: FlutterFlowTheme.of(context).primaryText,
|
||||
selectedDateTimeBackgroundColor:
|
||||
FlutterFlowTheme.of(context).primary,
|
||||
selectedDateTimeForegroundColor:
|
||||
FlutterFlowTheme.of(context).info,
|
||||
actionButtonForegroundColor:
|
||||
FlutterFlowTheme.of(context).primaryText,
|
||||
selectedDateTimeBackgroundColor: FlutterFlowTheme.of(context).primary,
|
||||
selectedDateTimeForegroundColor: FlutterFlowTheme.of(context).info,
|
||||
actionButtonForegroundColor: FlutterFlowTheme.of(context).primaryText,
|
||||
iconSize: 24.0,
|
||||
);
|
||||
},
|
||||
|
@ -427,27 +410,19 @@ class _ScheduleProvisionalVisitPageWidgetState extends State<ScheduleProvisional
|
|||
child!,
|
||||
headerBackgroundColor: FlutterFlowTheme.of(context).primary,
|
||||
headerForegroundColor: FlutterFlowTheme.of(context).info,
|
||||
headerTextStyle:
|
||||
FlutterFlowTheme.of(context).headlineLarge.override(
|
||||
fontFamily:
|
||||
FlutterFlowTheme.of(context).headlineLargeFamily,
|
||||
fontSize: 32.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.w600,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).headlineLargeFamily),
|
||||
),
|
||||
pickerBackgroundColor:
|
||||
FlutterFlowTheme.of(context).secondaryBackground,
|
||||
headerTextStyle: FlutterFlowTheme.of(context).headlineLarge.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).headlineLargeFamily,
|
||||
fontSize: 32.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.w600,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).headlineLargeFamily),
|
||||
),
|
||||
pickerBackgroundColor: FlutterFlowTheme.of(context).secondaryBackground,
|
||||
pickerForegroundColor: FlutterFlowTheme.of(context).info,
|
||||
selectedDateTimeBackgroundColor:
|
||||
FlutterFlowTheme.of(context).primary,
|
||||
pickerDialForegroundColor:
|
||||
FlutterFlowTheme.of(context).primaryText,
|
||||
selectedDateTimeForegroundColor:
|
||||
FlutterFlowTheme.of(context).info,
|
||||
actionButtonForegroundColor:
|
||||
FlutterFlowTheme.of(context).primaryText,
|
||||
selectedDateTimeBackgroundColor: FlutterFlowTheme.of(context).primary,
|
||||
pickerDialForegroundColor: FlutterFlowTheme.of(context).primaryText,
|
||||
selectedDateTimeForegroundColor: FlutterFlowTheme.of(context).info,
|
||||
actionButtonForegroundColor: FlutterFlowTheme.of(context).primaryText,
|
||||
iconSize: 24.0,
|
||||
);
|
||||
},
|
||||
|
@ -473,8 +448,7 @@ class _ScheduleProvisionalVisitPageWidgetState extends State<ScheduleProvisional
|
|||
locale: FFLocalizations.of(context).languageCode,
|
||||
);
|
||||
|
||||
model.dateTimeTextController?.selection = TextSelection.collapsed(
|
||||
offset: model.dateTimeTextController!.text.length);
|
||||
model.dateTimeTextController?.selection = TextSelection.collapsed(offset: model.dateTimeTextController!.text.length);
|
||||
});
|
||||
},
|
||||
child: Container(
|
||||
|
@ -530,16 +504,14 @@ class _ScheduleProvisionalVisitPageWidgetState extends State<ScheduleProvisional
|
|||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
fontSize: limitedInputFontSize,
|
||||
),
|
||||
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||
FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
fontSize: limitedInputFontSize,
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
|
@ -579,8 +551,7 @@ class _ScheduleProvisionalVisitPageWidgetState extends State<ScheduleProvisional
|
|||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
fontSize: limitedInputFontSize,
|
||||
),
|
||||
textAlign: TextAlign.start,
|
||||
|
@ -607,29 +578,24 @@ class _ScheduleProvisionalVisitPageWidgetState extends State<ScheduleProvisional
|
|||
: () async {
|
||||
try {
|
||||
model.provVisitSchedule = await PhpGroup.postProvVisitSchedulingCall.call(
|
||||
data: DateFormat('dd/MM/yyyy HH:mm:ss').format(DateFormat('dd/MM/yyyy HH:mm:ss')
|
||||
.parse(model.dateTimeTextController.text)
|
||||
.add(const Duration(hours: 3))),
|
||||
data: DateFormat('dd/MM/yyyy HH:mm:ss')
|
||||
.format(DateFormat('dd/MM/yyyy HH:mm:ss').parse(model.dateTimeTextController.text).add(const Duration(hours: 3))),
|
||||
motivo: model.notesTextController.text,
|
||||
nome: model.personNameTextController.text,
|
||||
proID: model.ownerUUID,
|
||||
);
|
||||
if (PhpGroup.postProvVisitSchedulingCall
|
||||
.error((model.provVisitSchedule?.jsonBody ?? '')) ==
|
||||
false) {
|
||||
if (PhpGroup.postProvVisitSchedulingCall.error((model.provVisitSchedule?.jsonBody ?? '')) == false) {
|
||||
await DialogUtil.success(
|
||||
context,
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
ptText: "Agendamento Provisório Realizado com Sucesso!",
|
||||
enText: "Provisional Scheduling Successfully Completed"));
|
||||
FFLocalizations.of(context)
|
||||
.getVariableText(ptText: "Agendamento Provisório Realizado com Sucesso!", enText: "Provisional Scheduling Successfully Completed"));
|
||||
safeSetState(() {
|
||||
model.dateTimeTextController?.clear();
|
||||
model.personNameTextController?.clear();
|
||||
model.notesTextController?.clear();
|
||||
});
|
||||
} else {
|
||||
var message = PhpGroup.postProvVisitSchedulingCall
|
||||
.msg((model.provVisitSchedule?.jsonBody ?? ''));
|
||||
var message = PhpGroup.postProvVisitSchedulingCall.msg((model.provVisitSchedule?.jsonBody ?? ''));
|
||||
if (message != null) {
|
||||
await DialogUtil.error(context, message);
|
||||
} else {
|
||||
|
@ -639,8 +605,7 @@ class _ScheduleProvisionalVisitPageWidgetState extends State<ScheduleProvisional
|
|||
setState(() {});
|
||||
} catch (e, s) {
|
||||
await DialogUtil.errorDefault(context);
|
||||
LogUtil.requestAPIFailed(
|
||||
"processRequest.php", "", "Cadastrar Visita Provisória", e, s);
|
||||
LogUtil.requestAPIFailed("processRequest.php", "", "Cadastrar Visita Provisória", e, s);
|
||||
}
|
||||
},
|
||||
showLoadingIndicator: true,
|
||||
|
@ -654,8 +619,7 @@ class _ScheduleProvisionalVisitPageWidgetState extends State<ScheduleProvisional
|
|||
fontFamily: FlutterFlowTheme.of(context).titleSmallFamily,
|
||||
color: Colors.white,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).titleSmallFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).titleSmallFamily),
|
||||
fontSize: limitedInputFontSize,
|
||||
),
|
||||
elevation: 3.0,
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
||||
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
||||
import 'package:hub/features/backend/index.dart';
|
||||
import 'package:hub/features/storage/index.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/form_field_controller.dart';
|
||||
import 'regisiter_vistor_template_component_widget.dart';
|
||||
|
@ -129,9 +129,9 @@ class RegisiterVistorTemplateComponentModel extends FlutterFlowModel<RegisiterVi
|
|||
}
|
||||
|
||||
Future<void> initializeDatabase() async {
|
||||
devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||
userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||
cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||
devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||
userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||
cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||
;
|
||||
}
|
||||
|
||||
|
|
|
@ -3,13 +3,13 @@ import 'package:flutter/material.dart';
|
|||
import 'package:flutter/services.dart';
|
||||
import 'package:google_fonts/google_fonts.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/image_util.dart';
|
||||
import 'package:hub/shared/utils/limited_text_size.dart';
|
||||
import 'package:hub/shared/utils/validator_util.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_theme.dart';
|
||||
import '/flutter_flow/flutter_flow_util.dart';
|
||||
|
@ -103,9 +103,7 @@ class _RegisiterVistorTemplateComponentWidgetState extends State<RegisiterVistor
|
|||
return false;
|
||||
}
|
||||
|
||||
if (_model.textController4.text.isNotEmpty &&
|
||||
_model.textController4.text != '' &&
|
||||
ValidatorUtil.isValidEmail(_model.textController4.text) == false) {
|
||||
if (_model.textController4.text.isNotEmpty && _model.textController4.text != '' && ValidatorUtil.isValidEmail(_model.textController4.text) == false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -153,8 +151,7 @@ class _RegisiterVistorTemplateComponentWidgetState extends State<RegisiterVistor
|
|||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
fontSize: limitedHeaderFontSize,
|
||||
),
|
||||
),
|
||||
|
@ -184,15 +181,13 @@ class _RegisiterVistorTemplateComponentWidgetState extends State<RegisiterVistor
|
|||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
fontSize: limitedInputFontSize,
|
||||
),
|
||||
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
fontSize: limitedInputFontSize,
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
|
@ -236,8 +231,7 @@ class _RegisiterVistorTemplateComponentWidgetState extends State<RegisiterVistor
|
|||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
fontSize: limitedInputFontSize,
|
||||
),
|
||||
onChanged: (value) {
|
||||
|
@ -249,10 +243,7 @@ class _RegisiterVistorTemplateComponentWidgetState extends State<RegisiterVistor
|
|||
}, const Duration(milliseconds: 500));
|
||||
},
|
||||
validator: _model.textController2Validator.asValidator(context),
|
||||
inputFormatters: [
|
||||
FilteringTextInputFormatter.allow(RegExp('[0-9]')),
|
||||
LengthLimitingTextInputFormatter(20)
|
||||
],
|
||||
inputFormatters: [FilteringTextInputFormatter.allow(RegExp('[0-9]')), LengthLimitingTextInputFormatter(20)],
|
||||
),
|
||||
_model.textController2.text.isEmpty
|
||||
? const SizedBox()
|
||||
|
@ -306,16 +297,14 @@ class _RegisiterVistorTemplateComponentWidgetState extends State<RegisiterVistor
|
|||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
fontSize: limitedInputFontSize,
|
||||
),
|
||||
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
fontSize: limitedInputFontSize,
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
|
@ -359,8 +348,7 @@ class _RegisiterVistorTemplateComponentWidgetState extends State<RegisiterVistor
|
|||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
fontSize: limitedInputFontSize,
|
||||
),
|
||||
maxLines: null,
|
||||
|
@ -391,8 +379,7 @@ class _RegisiterVistorTemplateComponentWidgetState extends State<RegisiterVistor
|
|||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
fontSize: limitedInputFontSize,
|
||||
),
|
||||
hintText: FFLocalizations.of(context).getVariableText(
|
||||
|
@ -430,8 +417,7 @@ class _RegisiterVistorTemplateComponentWidgetState extends State<RegisiterVistor
|
|||
fontFamily: FlutterFlowTheme.of(context).bodySmallFamily,
|
||||
color: FlutterFlowTheme.of(context).customColor6,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(FlutterFlowTheme.of(context).bodySmallFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodySmallFamily),
|
||||
fontSize: limitedInputFontSize,
|
||||
)),
|
||||
),
|
||||
|
@ -497,8 +483,7 @@ class _RegisiterVistorTemplateComponentWidgetState extends State<RegisiterVistor
|
|||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
fontSize: limitedSubHeaderFontSize,
|
||||
),
|
||||
),
|
||||
|
@ -516,10 +501,7 @@ class _RegisiterVistorTemplateComponentWidgetState extends State<RegisiterVistor
|
|||
|
||||
maxLength: 25,
|
||||
keyboardType: TextInputType.phone,
|
||||
inputFormatters: [
|
||||
FilteringTextInputFormatter.allow(RegExp('[0-9, +, -, (, )]')),
|
||||
LengthLimitingTextInputFormatter(25)
|
||||
],
|
||||
inputFormatters: [FilteringTextInputFormatter.allow(RegExp('[0-9, +, -, (, )]')), LengthLimitingTextInputFormatter(25)],
|
||||
obscureText: false,
|
||||
|
||||
decoration: InputDecoration(
|
||||
|
@ -531,16 +513,14 @@ class _RegisiterVistorTemplateComponentWidgetState extends State<RegisiterVistor
|
|||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
fontSize: limitedInputFontSize,
|
||||
),
|
||||
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
fontSize: limitedInputFontSize,
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
|
@ -580,8 +560,7 @@ class _RegisiterVistorTemplateComponentWidgetState extends State<RegisiterVistor
|
|||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
fontSize: limitedInputFontSize,
|
||||
),
|
||||
// validator:
|
||||
|
@ -613,16 +592,14 @@ class _RegisiterVistorTemplateComponentWidgetState extends State<RegisiterVistor
|
|||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
fontSize: limitedInputFontSize,
|
||||
),
|
||||
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
fontSize: limitedInputFontSize,
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
|
@ -662,8 +639,7 @@ class _RegisiterVistorTemplateComponentWidgetState extends State<RegisiterVistor
|
|||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
fontSize: limitedInputFontSize,
|
||||
),
|
||||
keyboardType: TextInputType.emailAddress,
|
||||
|
@ -707,14 +683,12 @@ class _RegisiterVistorTemplateComponentWidgetState extends State<RegisiterVistor
|
|||
_model.uploadedLocalFile = FFUploadedFile(bytes: Uint8List.fromList([]));
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
ptText: 'Visitante cadastrado com sucesso.',
|
||||
enText: 'Visitor successfully registered.'),
|
||||
style: TextStyle(
|
||||
color: FlutterFlowTheme.of(context).info,
|
||||
fontSize: limitedInputFontSize,
|
||||
)),
|
||||
content:
|
||||
Text(FFLocalizations.of(context).getVariableText(ptText: 'Visitante cadastrado com sucesso.', enText: 'Visitor successfully registered.'),
|
||||
style: TextStyle(
|
||||
color: FlutterFlowTheme.of(context).info,
|
||||
fontSize: limitedInputFontSize,
|
||||
)),
|
||||
backgroundColor: FlutterFlowTheme.of(context).primary,
|
||||
duration: const Duration(seconds: 3),
|
||||
width: MediaQuery.of(context).size.width,
|
||||
|
@ -740,9 +714,7 @@ class _RegisiterVistorTemplateComponentWidgetState extends State<RegisiterVistor
|
|||
ptText: 'Erro ao se conectar com o servidor',
|
||||
enText: 'Error connecting to server',
|
||||
)
|
||||
: PhpGroup.postScheduleVisitorCall
|
||||
.errorMsg(_model.scheduleVisitor?.jsonBody)
|
||||
.toString());
|
||||
: PhpGroup.postScheduleVisitorCall.errorMsg(_model.scheduleVisitor?.jsonBody).toString());
|
||||
}
|
||||
}
|
||||
: null,
|
||||
|
@ -759,8 +731,7 @@ class _RegisiterVistorTemplateComponentWidgetState extends State<RegisiterVistor
|
|||
fontFamily: FlutterFlowTheme.of(context).titleSmallFamily,
|
||||
color: FlutterFlowTheme.of(context).info,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).titleSmallFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).titleSmallFamily),
|
||||
fontSize: limitedInputFontSize,
|
||||
),
|
||||
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:google_fonts/google_fonts.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/limited_text_size.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_util.dart';
|
||||
import '/flutter_flow/flutter_flow_widgets.dart';
|
||||
import '../../../shared/services/authentication/authentication_service.dart';
|
||||
import '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:google_fonts/google_fonts.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/shared/helpers/storage/base_storage.dart';
|
||||
import 'package:hub/shared/helpers/storage/storage_helper.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/features/storage/index.dart';
|
||||
|
||||
import 'package:hub/shared/utils/limited_text_size.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_util.dart';
|
||||
import '/flutter_flow/flutter_flow_widgets.dart';
|
||||
import '../../../shared/services/authentication/authentication_service.dart';
|
||||
import 'sign_up_template_component_model.dart';
|
||||
|
||||
export 'sign_up_template_component_model.dart';
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
||||
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
||||
import 'package:hub/features/backend/index.dart';
|
||||
import 'package:hub/features/storage/index.dart';
|
||||
|
||||
import '/backend/api_requests/api_calls.dart';
|
||||
import '/flutter_flow/flutter_flow_util.dart';
|
||||
import 'view_visit_detail_widget.dart' show ViewVisitDetailWidget;
|
||||
|
||||
|
@ -37,9 +36,9 @@ class ViewVisitDetailModel extends FlutterFlowModel<ViewVisitDetailWidget> {
|
|||
}
|
||||
|
||||
Future<void> initializeDatabase() async {
|
||||
devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||
userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||
cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||
devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||
userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||
cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||
;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:flutter/material.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/shared/utils/dialog_util.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_theme.dart';
|
||||
import '/flutter_flow/flutter_flow_util.dart';
|
||||
|
@ -85,8 +85,7 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
|||
// }
|
||||
// });
|
||||
|
||||
_model.textController1 =
|
||||
TextEditingController(text: widget.visitTempStr == 'null' ? '' : widget.visitTempStr ?? '');
|
||||
_model.textController1 = TextEditingController(text: widget.visitTempStr == 'null' ? '' : widget.visitTempStr ?? '');
|
||||
_model.textFieldFocusNode1 ??= FocusNode();
|
||||
|
||||
_model.textController2 ??= TextEditingController(text: widget.visitStartDate);
|
||||
|
@ -257,15 +256,13 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
|||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
|
@ -299,8 +296,7 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
|||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
),
|
||||
validator: _model.textController1Validator.asValidator(context),
|
||||
),
|
||||
|
@ -332,8 +328,7 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
|||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
hintText: FFLocalizations.of(context).getText(
|
||||
'ub084nhy' /* dd/mm/yyyy */,
|
||||
|
@ -342,8 +337,7 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
|||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
|
@ -377,8 +371,7 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
|||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
validator: _model.textController2Validator.asValidator(context),
|
||||
|
@ -405,8 +398,7 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
|||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
hintText: FFLocalizations.of(context).getText(
|
||||
'ixs67mrz' /* dd/mm/yyyy */,
|
||||
|
@ -415,8 +407,7 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
|||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
|
@ -450,8 +441,7 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
|||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
validator: _model.textController3Validator.asValidator(context),
|
||||
|
@ -487,8 +477,7 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
|||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
hintText: FFLocalizations.of(context).getText(
|
||||
'ypeydbem' /* Motivo */,
|
||||
|
@ -497,8 +486,7 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
|||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
|
@ -532,8 +520,7 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
|||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
validator: _model.textController4Validator.asValidator(context),
|
||||
|
@ -560,8 +547,7 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
|||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
hintText: FFLocalizations.of(context).getText(
|
||||
'rs3d4gb8' /* Nível de Acesso */,
|
||||
|
@ -570,8 +556,7 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
|||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
|
@ -605,8 +590,7 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
|||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
validator: _model.textController5Validator.asValidator(context),
|
||||
|
@ -637,15 +621,13 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
|||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
|
@ -679,8 +661,7 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
|||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
),
|
||||
validator: _model.textController6Validator.asValidator(context),
|
||||
),
|
||||
|
@ -754,10 +735,7 @@ class _ViewVisitDetailWidgetState extends State<ViewVisitDetailWidget> {
|
|||
),
|
||||
],
|
||||
);
|
||||
} else if ((widget.visitStatusStr == 'C') ||
|
||||
(widget.visitStatusStr == 'F') ||
|
||||
(widget.visitStatusStr == 'B') ||
|
||||
(widget.visitStatusStr == 'I')) {
|
||||
} else if ((widget.visitStatusStr == 'C') || (widget.visitStatusStr == 'F') || (widget.visitStatusStr == 'B') || (widget.visitStatusStr == 'I')) {
|
||||
return InkWell(
|
||||
splashColor: Colors.transparent,
|
||||
focusColor: Colors.transparent,
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
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/features/backend/index.dart';
|
||||
import 'package:hub/features/storage/index.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> {
|
||||
late final String devUUID;
|
||||
|
@ -35,9 +34,9 @@ class VisitorSearchModalTemplateComponentModel extends FlutterFlowModel<VisitorS
|
|||
}
|
||||
|
||||
Future<void> initDatabase() async {
|
||||
devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||
userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||
cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||
devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||
userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||
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:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:fluttertoast/fluttertoast.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/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/features/backend/index.dart';
|
||||
import 'package:hub/flutter_flow/flutter_flow_icon_button.dart';
|
||||
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
||||
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
||||
|
@ -30,8 +28,7 @@ class VisitorSearchModalTemplateComponentWidget extends StatefulWidget {
|
|||
State<VisitorSearchModalTemplateComponentWidget> createState() => _VisitorSearchModalTemplateComponentWidgetState();
|
||||
}
|
||||
|
||||
class _VisitorSearchModalTemplateComponentWidgetState extends State<VisitorSearchModalTemplateComponentWidget>
|
||||
with TickerProviderStateMixin {
|
||||
class _VisitorSearchModalTemplateComponentWidgetState extends State<VisitorSearchModalTemplateComponentWidget> with TickerProviderStateMixin {
|
||||
late VisitorSearchModalTemplateComponentModel _model;
|
||||
|
||||
safeSetState(VoidCallback callback) {
|
||||
|
@ -106,34 +103,22 @@ class _VisitorSearchModalTemplateComponentWidgetState extends State<VisitorSearc
|
|||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(color: FlutterFlowTheme.of(context).accent1, width: 0.5),
|
||||
borderRadius: const BorderRadius.only(
|
||||
bottomLeft: Radius.circular(15.0),
|
||||
bottomRight: Radius.circular(15.0),
|
||||
topLeft: Radius.circular(15.0),
|
||||
topRight: Radius.circular(15.0)),
|
||||
bottomLeft: Radius.circular(15.0), bottomRight: Radius.circular(15.0), topLeft: Radius.circular(15.0), topRight: Radius.circular(15.0)),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(color: FlutterFlowTheme.of(context).primary, width: 0.5),
|
||||
borderRadius: const BorderRadius.only(
|
||||
bottomLeft: Radius.circular(15.0),
|
||||
bottomRight: Radius.circular(15.0),
|
||||
topLeft: Radius.circular(15.0),
|
||||
topRight: Radius.circular(15.0)),
|
||||
bottomLeft: Radius.circular(15.0), bottomRight: Radius.circular(15.0), topLeft: Radius.circular(15.0), topRight: Radius.circular(15.0)),
|
||||
),
|
||||
errorBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(color: FlutterFlowTheme.of(context).error, width: 0.5),
|
||||
borderRadius: const BorderRadius.only(
|
||||
bottomLeft: Radius.circular(15.0),
|
||||
bottomRight: Radius.circular(15.0),
|
||||
topLeft: Radius.circular(15.0),
|
||||
topRight: Radius.circular(15.0)),
|
||||
bottomLeft: Radius.circular(15.0), bottomRight: Radius.circular(15.0), topLeft: Radius.circular(15.0), topRight: Radius.circular(15.0)),
|
||||
),
|
||||
focusedErrorBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(color: FlutterFlowTheme.of(context).error, width: 0.5),
|
||||
borderRadius: const BorderRadius.only(
|
||||
bottomLeft: Radius.circular(15.0),
|
||||
bottomRight: Radius.circular(15.0),
|
||||
topLeft: Radius.circular(15.0),
|
||||
topRight: Radius.circular(15.0)),
|
||||
bottomLeft: Radius.circular(15.0), bottomRight: Radius.circular(15.0), topLeft: Radius.circular(15.0), topRight: Radius.circular(15.0)),
|
||||
),
|
||||
filled: true,
|
||||
fillColor: FlutterFlowTheme.of(context).primaryBackground,
|
||||
|
@ -163,8 +148,7 @@ class _VisitorSearchModalTemplateComponentWidgetState extends State<VisitorSearc
|
|||
fontFamily: FlutterFlowTheme.of(context).labelMediumFamily,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily),
|
||||
fontSize: limitedHeaderFontSize,
|
||||
),
|
||||
),
|
||||
|
@ -176,8 +160,7 @@ class _VisitorSearchModalTemplateComponentWidgetState extends State<VisitorSearc
|
|||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts:
|
||||
GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
||||
fontSize: limitedHeaderFontSize,
|
||||
),
|
||||
),
|
||||
|
@ -250,8 +233,7 @@ class _VisitorSearchModalTemplateComponentWidgetState extends State<VisitorSearc
|
|||
style: FlutterFlowTheme.of(context).bodyLarge.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyLargeFamily,
|
||||
letterSpacing: 0.0,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey(FlutterFlowTheme.of(context).bodyLargeFamily),
|
||||
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyLargeFamily),
|
||||
fontSize: limitedBodyFontSize,
|
||||
),
|
||||
),
|
||||
|
@ -263,8 +245,7 @@ class _VisitorSearchModalTemplateComponentWidgetState extends State<VisitorSearc
|
|||
borderRadius: 20.0,
|
||||
borderWidth: 1.0,
|
||||
buttonSize: 40.0,
|
||||
icon: Icon(Icons.close,
|
||||
color: FlutterFlowTheme.of(context).customColor6, size: 20.0),
|
||||
icon: Icon(Icons.close, color: FlutterFlowTheme.of(context).customColor6, size: 20.0),
|
||||
onPressed: () async {
|
||||
_model.removeFromVisitors(visitorItem);
|
||||
_model.removeFromDocs(docItem);
|
||||
|
@ -324,11 +305,8 @@ class _VisitorSearchModalTemplateComponentWidgetState extends State<VisitorSearc
|
|||
),
|
||||
elevation: 3.0,
|
||||
borderSide: const BorderSide(color: Colors.transparent, width: 1.0),
|
||||
borderRadius: const BorderRadius.only(
|
||||
bottomLeft: Radius.circular(15),
|
||||
bottomRight: Radius.circular(15),
|
||||
topLeft: Radius.circular(15),
|
||||
topRight: Radius.circular(15)),
|
||||
borderRadius:
|
||||
const BorderRadius.only(bottomLeft: 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?.selection = TextSelection.collapsed(offset: _model.textController!.text.length);
|
||||
});
|
||||
_model.getVisitorByDoc =
|
||||
await PhpGroup.getVisitorByDocCall.call(documento: _model.textController.text.replaceFirst(RegExp(r'^0+'), ''));
|
||||
_model.getVisitorByDoc = await PhpGroup.getVisitorByDocCall.call(documento: _model.textController.text.replaceFirst(RegExp(r'^0+'), ''));
|
||||
|
||||
if (PhpGroup.getVisitorByDocCall.vistanteId((_model.getVisitorByDoc?.jsonBody ?? '')) != '0' &&
|
||||
PhpGroup.getVisitorByDocCall.error((_model.getVisitorByDoc?.jsonBody ?? '')) == false &&
|
||||
|
@ -365,8 +342,7 @@ class _VisitorSearchModalTemplateComponentWidgetState extends State<VisitorSearc
|
|||
safeSetState(() {});
|
||||
} else if (existDoc == true) {
|
||||
ToastUtil.showToast(
|
||||
message: FFLocalizations.of(context)
|
||||
.getVariableText(ptText: 'Visitante já adicionado!', enText: 'Visitor already added!'),
|
||||
message: FFLocalizations.of(context).getVariableText(ptText: 'Visitante já adicionado!', enText: 'Visitor already added!'),
|
||||
gravity: ToastGravity.TOP,
|
||||
backgroundColor: Colors.red,
|
||||
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 'domain/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_bloc/flutter_bloc.dart';
|
||||
import 'package:hub/features/home/presentation/pages/home_page.dart';
|
||||
import 'package:hub/features/backend/index.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/shared/components/molecules/modules/data/repositories/license_repository_impl.dart';
|
||||
import 'package:hub/shared/helpers/database/database_helper.dart';
|
||||
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
||||
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
||||
import 'package:hub/shared/utils/device_util.dart';
|
||||
import 'package:hub/shared/utils/dialog_util.dart';
|
||||
import 'package:hub/shared/utils/log_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/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 {
|
||||
static Future<void> login(BuildContext context) async {
|
||||
|
@ -74,7 +67,7 @@ class AuthenticationService {
|
|||
if ((email != '') && (passwd != '')) {
|
||||
await StorageHelper().set(SecureStorageKey.email.value, email);
|
||||
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();
|
||||
|
||||
if (response.jsonBody['error'] == false) {
|
||||
|
@ -83,10 +76,10 @@ class AuthenticationService {
|
|||
userDevUUID = response.jsonBody['user']['dev_id'];
|
||||
userName = response.jsonBody['user']['name'];
|
||||
|
||||
await StorageHelper().set(KeychainStorageKey.userUUID.value, userUUID);
|
||||
await StorageHelper().set(KeychainStorageKey.userDevUUID.value, userDevUUID);
|
||||
await StorageHelper().set(KeychainStorageKey.status.value, status);
|
||||
await StorageHelper().set(KeychainStorageKey.userName.value, userName);
|
||||
await StorageHelper().set(ProfileStorageKey.userUUID.key, userUUID);
|
||||
await StorageHelper().set(ProfileStorageKey.userDevUUID.key, userDevUUID);
|
||||
await StorageHelper().set(ProfileStorageKey.status.key, status);
|
||||
await StorageHelper().set(ProfileStorageKey.userName.key, userName);
|
||||
|
||||
await login(context);
|
||||
} else {
|
||||
|
@ -113,9 +106,7 @@ class AuthenticationService {
|
|||
}) async {
|
||||
try {
|
||||
ApiCallResponse? response;
|
||||
if ((email != null && email != '') &&
|
||||
(passwd != null && passwd != '' && passwd.length > 7) &&
|
||||
(name != null && name != '')) {
|
||||
if ((email != null && email != '') && (passwd != null && passwd != '' && passwd.length > 7) && (name != null && name != '')) {
|
||||
response = await PhpGroup.registerCall.call(
|
||||
name: name,
|
||||
password: passwd,
|
||||
|
@ -153,7 +144,7 @@ class AuthenticationService {
|
|||
await StorageHelper().clean(Storage.databaseStorage);
|
||||
await StorageHelper().clean(Storage.secureStorage);
|
||||
await LicenseRepositoryImpl().cleanLicense();
|
||||
DatabaseStorage.isInitialized = false;
|
||||
DatabaseService.isInitialized = false;
|
||||
await StorageHelper().init();
|
||||
|
||||
context.go('/welcomePage', extra: extra);
|
||||
|
@ -163,8 +154,7 @@ class AuthenticationService {
|
|||
try {
|
||||
final ApiCallResponse? response;
|
||||
final ForgotPasswordCall callback = PhpGroup.forgotPasswordCall;
|
||||
final String message = FFLocalizations.of(context)
|
||||
.getVariableText(enText: "Send E-mail Successful!", ptText: "E-mail Enviado com Sucesso!");
|
||||
final String message = FFLocalizations.of(context).getVariableText(enText: "Send E-mail Successful!", ptText: "E-mail Enviado com Sucesso!");
|
||||
|
||||
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 {
|
||||
try {
|
||||
final ApiCallResponse response =
|
||||
await PhpGroup.changePasswordCall.call(email: email, psswd: password, token: token);
|
||||
final ApiCallResponse response = await PhpGroup.changePasswordCall.call(email: email, psswd: password, token: token);
|
||||
|
||||
if (response.jsonBody['error'] == false) {
|
||||
final String message = FFLocalizations.of(context).getVariableText(
|
||||
|
@ -216,7 +205,6 @@ class AuthenticationService {
|
|||
ptText: 'Conta deletada com sucesso',
|
||||
);
|
||||
return await signOut(context);
|
||||
|
||||
}
|
||||
}).catchError((err) {
|
||||
context.pop();
|
||||
|
@ -224,8 +212,8 @@ class AuthenticationService {
|
|||
enText: 'Error deleting account',
|
||||
ptText: 'Erro ao deletar conta',
|
||||
);
|
||||
SnackBarUtil.showSnackBar(context, content);
|
||||
return;
|
||||
SnackBarUtil.showSnackBar(context, content);
|
||||
return;
|
||||
});
|
||||
} catch (err) {
|
||||
context.pop();
|
|
@ -0,0 +1 @@
|
|||
export 'authentication_service.dart';
|
|
@ -3,9 +3,9 @@ import 'dart:convert';
|
|||
import 'dart:developer';
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:hub/backend/notifications/firebase_messaging_service.dart';
|
||||
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
||||
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
||||
import 'package:hub/features/notifications/index.dart';
|
||||
import 'package:hub/features/storage/index.dart';
|
||||
|
||||
import 'package:hub/shared/utils/log_util.dart';
|
||||
import 'package:hub/shared/utils/validator_util.dart';
|
||||
|
||||
|
@ -65,9 +65,9 @@ class PhpGroup {
|
|||
class GetProvSchedules {
|
||||
Future<ApiCallResponse> call(final String page, final String status) async {
|
||||
final String baseUrl = PhpGroup.getBaseUrl();
|
||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||
final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||
const String atividade = 'getAgendamentoProv';
|
||||
const String pageSize = '10';
|
||||
final bool isFiltered = status != '' && status != '.*';
|
||||
|
@ -100,9 +100,9 @@ class GetProvSchedules {
|
|||
class GetOpenedVisits {
|
||||
Future<ApiCallResponse> call(final String page) async {
|
||||
final String baseUrl = PhpGroup.getBaseUrl();
|
||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||
final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||
const String atividade = 'getOpenedVisits';
|
||||
const String pageSize = '10';
|
||||
return await ApiManager.instance.makeApiCall(
|
||||
|
@ -132,9 +132,9 @@ class GetOpenedVisits {
|
|||
class GetResidentsByProperty {
|
||||
Future<ApiCallResponse> call(final String page) async {
|
||||
final String baseUrl = PhpGroup.getBaseUrl();
|
||||
final String devUUID = await StorageHelper().get(KeychainStorageKey.devUUID.value) ?? '';
|
||||
final String userUUID = await StorageHelper().get(KeychainStorageKey.userUUID.value) ?? '';
|
||||
final String cliID = await StorageHelper().get(KeychainStorageKey.clientUUID.value) ?? '';
|
||||
final String devUUID = await StorageHelper().get(ProfileStorageKey.devUUID.key) ?? '';
|
||||
final String userUUID = await StorageHelper().get(ProfileStorageKey.userUUID.key) ?? '';
|
||||
final String cliID = await StorageHelper().get(ProfileStorageKey.clientUUID.key) ?? '';
|
||||
const String atividade = 'getResidentsByProperty';
|
||||
const String pageSize = '10';
|
||||
return await ApiManager.instance.makeApiCall(
|
||||
|
@ -163,9 +163,9 @@ class GetResidentsByProperty {
|
|||
class GetVehiclesByProperty {
|
||||
Future<ApiCallResponse> call(final String page) async {
|
||||
final String baseUrl = PhpGroup.getBaseUrl();
|
||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||
final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||
const String atividade = 'getVehiclesByProperty';
|
||||
const String pageSize = '10';
|
||||
return await ApiManager.instance.makeApiCall(
|
||||
|
@ -196,9 +196,9 @@ class GetVehiclesByProperty {
|
|||
class GetLicense {
|
||||
Future<ApiCallResponse> call() async {
|
||||
final String baseUrl = PhpGroup.getBaseUrl();
|
||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||
final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||
|
||||
return await ApiManager.instance.makeApiCall(
|
||||
callName: 'getLicense',
|
||||
|
@ -227,8 +227,8 @@ class GetLicense {
|
|||
class UnregisterDevice {
|
||||
Future<ApiCallResponse> call() async {
|
||||
final String baseUrl = PhpGroup.getBaseUrl();
|
||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||
|
||||
return await ApiManager.instance.makeApiCall(
|
||||
callName: 'unregisterDevice',
|
||||
|
@ -255,9 +255,9 @@ class UnregisterDevice {
|
|||
class DeletePet {
|
||||
Future<ApiCallResponse> call({final int? petID = 0}) async {
|
||||
final String baseUrl = PhpGroup.getBaseUrl();
|
||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||
final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||
const String atividade = 'excluirPet';
|
||||
|
||||
return await ApiManager.instance.makeApiCall(
|
||||
|
@ -300,9 +300,9 @@ class UpdatePet {
|
|||
}) async {
|
||||
final String baseUrl = PhpGroup.getBaseUrl();
|
||||
|
||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||
final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||
const String atividade = 'atualizarPet';
|
||||
|
||||
return await ApiManager.instance.makeApiCall(
|
||||
|
@ -346,9 +346,9 @@ class GetPets {
|
|||
}) async {
|
||||
final String baseUrl = PhpGroup.getBaseUrl();
|
||||
|
||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||
final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||
const String atividade = 'consultaPets';
|
||||
|
||||
return await ApiManager.instance.makeApiCall(
|
||||
|
@ -380,9 +380,9 @@ class GetPetPhoto {
|
|||
Future<ApiCallResponse> call({final int? petId}) async {
|
||||
final String baseUrl = PhpGroup.getBaseUrl();
|
||||
|
||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||
final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||
const String atividade = 'consultaFotoPet';
|
||||
|
||||
return await ApiManager.instance.makeApiCall(
|
||||
|
@ -423,9 +423,9 @@ class RegisterPet {
|
|||
}) async {
|
||||
final String baseUrl = PhpGroup.getBaseUrl();
|
||||
|
||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||
final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||
const String atividade = 'cadastrarPet';
|
||||
|
||||
return await ApiManager.instance.makeApiCall(
|
||||
|
@ -468,9 +468,9 @@ class BuscaEnconcomendas {
|
|||
final String? adresseeType,
|
||||
final String? status,
|
||||
}) async {
|
||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||
final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||
const String atividade = 'getEncomendas';
|
||||
|
||||
final String baseUrl = PhpGroup.getBaseUrl();
|
||||
|
@ -512,9 +512,9 @@ class CancelaVisita {
|
|||
}) async {
|
||||
final String baseUrl = PhpGroup.getBaseUrl();
|
||||
|
||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||
final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||
const String atividade = 'cancelaVisita';
|
||||
|
||||
return await ApiManager.instance.makeApiCall(
|
||||
|
@ -546,8 +546,8 @@ class CancelaVisita {
|
|||
|
||||
class DeleteAccount {
|
||||
Future<ApiCallResponse> call() async {
|
||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||
|
||||
final String baseUrl = PhpGroup.getBaseUrl();
|
||||
return await ApiManager.instance.makeApiCall(
|
||||
|
@ -578,9 +578,9 @@ class ChangePanic {
|
|||
}) async {
|
||||
final String baseUrl = PhpGroup.getBaseUrl();
|
||||
|
||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||
final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||
const String atividade = 'updVisitado';
|
||||
|
||||
return await ApiManager.instance.makeApiCall(
|
||||
|
@ -614,9 +614,9 @@ class ChangePass {
|
|||
}) async {
|
||||
final String baseUrl = PhpGroup.getBaseUrl();
|
||||
|
||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||
final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||
const String atividade = 'updVisitado';
|
||||
|
||||
return await ApiManager.instance.makeApiCall(
|
||||
|
@ -650,9 +650,9 @@ class RespondeVinculo {
|
|||
}) async {
|
||||
final String baseUrl = PhpGroup.getBaseUrl();
|
||||
|
||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||
final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||
|
||||
return await ApiManager.instance.makeApiCall(
|
||||
callName: 'respondeVinculo',
|
||||
|
@ -684,9 +684,9 @@ class ChangeNotifica {
|
|||
}) async {
|
||||
final String baseUrl = PhpGroup.getBaseUrl();
|
||||
|
||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||
final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||
const String atividade = 'updVisitado';
|
||||
|
||||
return await ApiManager.instance.makeApiCall(
|
||||
|
@ -718,10 +718,10 @@ class UpdateIDE {
|
|||
Future<ApiCallResponse> call() async {
|
||||
final String baseUrl = PhpGroup.getBaseUrl();
|
||||
|
||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||
final String cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||
final String newIde = (await StorageHelper().get(KeychainStorageKey.userDevUUID.value)) ?? '';
|
||||
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||
final String cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||
final String newIde = (await StorageHelper().get(ProfileStorageKey.userDevUUID.key)) ?? '';
|
||||
const String atividade = 'updVisitado';
|
||||
|
||||
return await ApiManager.instance.makeApiCall(
|
||||
|
@ -753,8 +753,8 @@ class UpdToken {
|
|||
Future<ApiCallResponse> call() async {
|
||||
final String baseUrl = PhpGroup.getBaseUrl();
|
||||
|
||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||
final String token = (await StorageHelper().get(SecureStorageKey.token.value)) ?? '';
|
||||
|
||||
return await ApiManager.instance.makeApiCall(
|
||||
|
@ -782,7 +782,7 @@ class UpdToken {
|
|||
class LoginCall {
|
||||
Future<ApiCallResponse> call() async {
|
||||
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 password = (await StorageHelper().get(SecureStorageKey.password.value)) ?? '';
|
||||
final String type = (await StorageHelper().get(SecureStorageKey.deviceType.value)) ?? '';
|
||||
|
@ -869,9 +869,9 @@ class ChangePasswordCall {
|
|||
required final String psswd,
|
||||
}) async {
|
||||
final String baseUrl = PhpGroup.getBaseUrl();
|
||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||
final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||
|
||||
return await ApiManager.instance.makeApiCall(
|
||||
callName: 'changePassword',
|
||||
|
@ -930,8 +930,8 @@ class GetLocalsCall {
|
|||
Future<ApiCallResponse> call() async {
|
||||
final String baseUrl = PhpGroup.getBaseUrl();
|
||||
|
||||
final String devUUID = await StorageHelper().get(KeychainStorageKey.devUUID.value) ?? '';
|
||||
final String userUUID = await StorageHelper().get(KeychainStorageKey.userUUID.value) ?? '';
|
||||
final String devUUID = await StorageHelper().get(ProfileStorageKey.devUUID.key) ?? '';
|
||||
final String userUUID = await StorageHelper().get(ProfileStorageKey.userUUID.key) ?? '';
|
||||
|
||||
return await ApiManager.instance
|
||||
.makeApiCall(
|
||||
|
@ -972,9 +972,9 @@ class PostScheduleVisitorCall {
|
|||
}) async {
|
||||
final String baseUrl = PhpGroup.getBaseUrl();
|
||||
|
||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||
final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||
const String atividade = 'putVisitante';
|
||||
|
||||
return await ApiManager.instance.makeApiCall(
|
||||
|
@ -1027,9 +1027,9 @@ class PostScheduleVisitCall {
|
|||
}) async {
|
||||
final String baseUrl = PhpGroup.getBaseUrl();
|
||||
|
||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||
final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||
const String atividade = 'putVisita';
|
||||
|
||||
return await ApiManager.instance.makeApiCall(
|
||||
|
@ -1081,9 +1081,9 @@ class GetScheduleVisitCall {
|
|||
}) async {
|
||||
final String baseUrl = PhpGroup.getBaseUrl();
|
||||
|
||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||
final String cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||
final String cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||
const String atividade = 'getVisitas';
|
||||
|
||||
return await ApiManager.instance.makeApiCall(
|
||||
|
@ -1355,32 +1355,34 @@ class GetDadosCall {
|
|||
Future<ApiCallResponse> call() async {
|
||||
final String baseUrl = PhpGroup.getBaseUrl();
|
||||
|
||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||
final String cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||
final String cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||
const String atividade = 'getDados';
|
||||
|
||||
return await ApiManager.instance.makeApiCall(
|
||||
callName: 'getDados',
|
||||
apiUrl: '$baseUrl/processRequest.php',
|
||||
callType: ApiCallType.POST,
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
},
|
||||
params: {
|
||||
'devUUID': devUUID,
|
||||
'userUUID': userUUID,
|
||||
'cliID': cliUUID,
|
||||
'atividade': atividade,
|
||||
},
|
||||
bodyType: BodyType.X_WWW_FORM_URL_ENCODED,
|
||||
returnBody: true,
|
||||
encodeBodyUtf8: false,
|
||||
decodeUtf8: false,
|
||||
cache: false,
|
||||
isStreamingApi: false,
|
||||
alwaysAllowBody: false,
|
||||
).timeout(const Duration(seconds: 30));
|
||||
return await ApiManager.instance
|
||||
.makeApiCall(
|
||||
callName: 'getDados',
|
||||
apiUrl: '$baseUrl/processRequest.php',
|
||||
callType: ApiCallType.POST,
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
},
|
||||
params: {
|
||||
'devUUID': devUUID,
|
||||
'userUUID': userUUID,
|
||||
'cliID': cliUUID,
|
||||
'atividade': atividade,
|
||||
},
|
||||
bodyType: BodyType.X_WWW_FORM_URL_ENCODED,
|
||||
returnBody: true,
|
||||
encodeBodyUtf8: false,
|
||||
decodeUtf8: false,
|
||||
cache: false,
|
||||
isStreamingApi: false,
|
||||
alwaysAllowBody: false,
|
||||
)
|
||||
.timeout(const Duration(seconds: 30));
|
||||
}
|
||||
|
||||
bool? errorBolean(dynamic response) => castToType<bool>(getJsonField(
|
||||
|
@ -1588,9 +1590,9 @@ class GetVisitorByDocCall {
|
|||
}) async {
|
||||
final String baseUrl = PhpGroup.getBaseUrl();
|
||||
|
||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||
final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||
const String atividade = 'getVisitante';
|
||||
|
||||
return await ApiManager.instance.makeApiCall(
|
||||
|
@ -1642,9 +1644,9 @@ class GetFotoVisitanteCall {
|
|||
}) async {
|
||||
final String baseUrl = PhpGroup.getBaseUrl();
|
||||
|
||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||
final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||
const String atividade = 'getFotoVisitante';
|
||||
|
||||
return await ApiManager.instance.makeApiCall(
|
||||
|
@ -1681,9 +1683,9 @@ class PostProvVisitSchedulingCall {
|
|||
}) async {
|
||||
final String baseUrl = PhpGroup.getBaseUrl();
|
||||
|
||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||
final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||
const String atividade = 'putAgendamentoProv';
|
||||
|
||||
return await ApiManager.instance.makeApiCall(
|
||||
|
@ -1730,9 +1732,9 @@ class GetVisitsCall {
|
|||
}) async {
|
||||
final String baseUrl = PhpGroup.getBaseUrl();
|
||||
|
||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||
final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||
const String atividade = 'getVisitas';
|
||||
|
||||
return await ApiManager.instance.makeApiCall(
|
||||
|
@ -1993,9 +1995,9 @@ class DeleteVisitCall {
|
|||
}) async {
|
||||
final String baseUrl = PhpGroup.getBaseUrl();
|
||||
|
||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||
final String cliID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||
final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||
const String atividade = 'cancelaVisita';
|
||||
|
||||
return await ApiManager.instance.makeApiCall(
|
||||
|
@ -2036,10 +2038,10 @@ class GetPessoasLocalCall {
|
|||
Future<ApiCallResponse> call() async {
|
||||
final String baseUrl = PhpGroup.getBaseUrl();
|
||||
|
||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||
final String ownerUUID = (await StorageHelper().get(KeychainStorageKey.ownerUUID.value)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||
final String cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||
final String ownerUUID = (await StorageHelper().get(ProfileStorageKey.ownerUUID.key)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||
final String cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||
|
||||
return await ApiManager.instance.makeApiCall(
|
||||
callName: 'getPessoasLocal',
|
||||
|
@ -2102,9 +2104,9 @@ class RespondeSolicitacaoCall {
|
|||
}) async {
|
||||
final String baseUrl = PhpGroup.getBaseUrl();
|
||||
|
||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||
final String cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||
final String cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||
const String atividade = 'respondeSolicitacao';
|
||||
|
||||
return await ApiManager.instance.makeApiCall(
|
||||
|
@ -2152,9 +2154,9 @@ class GetAccessCall {
|
|||
}) async {
|
||||
final String baseUrl = PhpGroup.getBaseUrl();
|
||||
|
||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||
final String cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||
final String cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||
const String atividade = 'getAcessos';
|
||||
|
||||
return await ApiManager.instance.makeApiCall(
|
||||
|
@ -2401,9 +2403,9 @@ class GetLiberationsCall {
|
|||
final StreamController<ApiCallResponse> controller = StreamController();
|
||||
|
||||
Future.microtask(() async {
|
||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||
final String cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||
final String cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||
const String atividade = 'getSolicitacoes';
|
||||
|
||||
try {
|
||||
|
@ -2593,9 +2595,9 @@ class GetMessagesCall {
|
|||
}) async {
|
||||
final String baseUrl = PhpGroup.getBaseUrl();
|
||||
|
||||
final String devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||
final String cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||
final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||
final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||
final String cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||
const String atividade = 'getMensagens';
|
||||
|
||||
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
|
||||
|
||||
import 'package:hub/features/backend/index.dart';
|
||||
import 'package:hub/flutter_flow/nav/nav.dart';
|
||||
|
||||
import 'index.dart';
|
||||
|
@ -40,8 +41,7 @@ class DeviceStruct extends BaseStruct {
|
|||
description: data['description'] as String?,
|
||||
);
|
||||
|
||||
static DeviceStruct? maybeFromMap(dynamic data) =>
|
||||
data is Map ? DeviceStruct.fromMap(data.cast<String, dynamic>()) : null;
|
||||
static DeviceStruct? maybeFromMap(dynamic data) => data is Map ? DeviceStruct.fromMap(data.cast<String, dynamic>()) : null;
|
||||
|
||||
Map<String, dynamic> toMap() => {
|
||||
'devUUID': _devUUID,
|
||||
|
@ -88,10 +88,7 @@ class DeviceStruct extends BaseStruct {
|
|||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return other is DeviceStruct &&
|
||||
devUUID == other.devUUID &&
|
||||
version == other.version &&
|
||||
description == other.description;
|
||||
return other is DeviceStruct && devUUID == other.devUUID && version == other.version && description == other.description;
|
||||
}
|
||||
|
||||
@override
|
|
@ -0,0 +1 @@
|
|||
export 'device_struct.dart';
|
|
@ -0,0 +1 @@
|
|||
export 'schema_util.dart';
|
|
@ -1,8 +1,6 @@
|
|||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:from_css_color/from_css_color.dart';
|
||||
import 'package:hub/backend/schema/enums/enums.dart';
|
||||
import 'package:hub/features/backend/index.dart';
|
||||
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
||||
import 'package:hub/flutter_flow/nav/serialization_util.dart';
|
||||
|
||||
|
@ -35,9 +33,7 @@ dynamic deserializeStructParam<T>(
|
|||
if (paramValues is! Iterable) {
|
||||
return null;
|
||||
}
|
||||
return paramValues
|
||||
.map<T>((e) => deserializeStructParam<T>(e, paramType, false, structBuilder: structBuilder))
|
||||
.toList();
|
||||
return paramValues.map<T>((e) => deserializeStructParam<T>(e, paramType, false, structBuilder: structBuilder)).toList();
|
||||
} else if (param is Map<String, dynamic>) {
|
||||
return structBuilder(param);
|
||||
} else {
|
|
@ -1,10 +1,9 @@
|
|||
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/storage/index.dart';
|
||||
import 'package:hub/flutter_flow/flutter_flow_model.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> {
|
||||
late final String devUUID;
|
||||
|
@ -32,9 +31,9 @@ class AcessHistoryPageModel extends FlutterFlowModel<AccessHistoryScreen> {
|
|||
}
|
||||
|
||||
Future<void> initDatabase() async {
|
||||
devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||
userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||
cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||
devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||
userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||
cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
||||
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
||||
import 'package:hub/features/storage/index.dart';
|
||||
|
||||
class ProvisionalHistoryEvent {}
|
||||
|
||||
|
@ -44,9 +43,9 @@ class ProvisionalHistoryBloc extends Bloc<ProvisionalHistoryEvent, ProvisionalHi
|
|||
Emitter<ProvisionalHistoryStateBloc> emit,
|
||||
) async {
|
||||
emit(state.copyWith(isLoading: true));
|
||||
final devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||
final userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||
final cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||
final devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||
final userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||
final cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||
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_spinkit/flutter_spinkit.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/features/backend/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_theme.dart';
|
||||
|
|
|
@ -4,8 +4,8 @@ import 'dart:developer';
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_spinkit/flutter_spinkit.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/features/backend/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_theme.dart';
|
||||
|
|
|
@ -1,28 +1,26 @@
|
|||
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
||||
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
||||
import 'package:hub/features/locals/index.dart';
|
||||
import 'package:hub/features/storage/index.dart';
|
||||
|
||||
import '../../../../shared/components/molecules/locals/index.dart';
|
||||
import 'index.dart';
|
||||
|
||||
class HomeBloc extends Bloc<HomeEvent, HomeState> {
|
||||
late StreamSubscription<bool> _completer;
|
||||
|
||||
|
||||
HomeBloc() : super(HomeState()) {
|
||||
on<HomeEvent>(_onHomeEvent);
|
||||
_completer = LocalsRepositoryImpl.license.stream.listen((v) {
|
||||
add(HomeEvent());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _onHomeEvent(HomeEvent event, Emitter<HomeState> emit) async {
|
||||
final devUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value)) ?? '';
|
||||
final userUUID = (await StorageHelper().get(KeychainStorageKey.userUUID.value)) ?? '';
|
||||
final cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||
final userName = (await StorageHelper().get(KeychainStorageKey.userName.value)) ?? '';
|
||||
Future<void> _onHomeEvent(HomeEvent event, Emitter<HomeState> emit) async {
|
||||
final devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? '';
|
||||
final userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? '';
|
||||
final cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||
final userName = (await StorageHelper().get(ProfileStorageKey.userName.key)) ?? '';
|
||||
final userEmail = (await StorageHelper().get(SecureStorageKey.email.value)) ?? '';
|
||||
|
||||
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:google_fonts/google_fonts.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_theme.dart';
|
||||
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
||||
import 'package:hub/shared/components/molecules/locals/index.dart';
|
||||
import 'package:hub/shared/components/molecules/menu/index.dart';
|
||||
import 'package:hub/features/locals/index.dart';
|
||||
|
||||
class HomePageWidget extends StatefulWidget {
|
||||
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_bloc/flutter_bloc.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_util.dart';
|
||||
import 'package:hub/shared/components/molecules/locals/index.dart';
|
||||
import 'package:hub/shared/components/molecules/menu/index.dart';
|
||||
import 'package:hub/shared/components/molecules/modules/index.dart';
|
||||
import 'package:hub/features/locals/index.dart';
|
||||
|
||||
class DrawerWidget extends StatelessWidget {
|
||||
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 '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/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/internationalization.dart';
|
||||
import 'package:hub/flutter_flow/nav/nav.dart';
|
||||
import 'package:hub/shared/components/molecules/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/features/locals/index.dart';
|
||||
import 'package:hub/shared/utils/snackbar_util.dart';
|
||||
|
||||
abstract class LocalsRemoteDataSource {
|
||||
Future<void> linkLocal(BuildContext context);
|
||||
Future<bool> checkLocals(BuildContext context);
|
||||
Future<bool> processLocals(BuildContext context) ;
|
||||
Future<bool> processLocals(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);
|
||||
}
|
||||
|
||||
|
@ -60,8 +57,8 @@ class LocalsRemoteDataSourceImpl implements LocalsRemoteDataSource {
|
|||
await StorageHelper().set(SecureStorageKey.haveLocal.value, true);
|
||||
await StorageHelper().set(SecureStorageKey.isLogged.value, true);
|
||||
await WidgetsBinding.instance.endOfFrame;
|
||||
await StorageHelper().set(KeychainStorageKey.clientUUID.value, '');
|
||||
await StorageHelper().set(KeychainStorageKey.ownerUUID.value, '');
|
||||
await StorageHelper().set(ProfileStorageKey.clientUUID.key, '');
|
||||
await StorageHelper().set(ProfileStorageKey.ownerUUID.key, '');
|
||||
StorageHelper().context?.go('/homePage');
|
||||
}
|
||||
} catch (e, s) {
|
||||
|
@ -71,7 +68,7 @@ class LocalsRemoteDataSourceImpl implements LocalsRemoteDataSource {
|
|||
|
||||
@override
|
||||
Future<bool> processLocals(BuildContext context) async {
|
||||
log('() => processLocals');
|
||||
log('() => processLocals');
|
||||
try {
|
||||
final GetLocalsCall callback = PhpGroup.getLocalsCall;
|
||||
final ApiCallResponse response = await callback.call();
|
||||
|
@ -145,8 +142,8 @@ class LocalsRemoteDataSourceImpl implements LocalsRemoteDataSource {
|
|||
|
||||
@override
|
||||
Future<bool> checkLocals(BuildContext context) async {
|
||||
String cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||
String cliName = (await StorageHelper().get(KeychainStorageKey.clientName.value)) ?? '';
|
||||
String cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||
String cliName = (await StorageHelper().get(ProfileStorageKey.clientName.key)) ?? '';
|
||||
return cliUUID.isEmpty && cliName.isEmpty;
|
||||
}
|
||||
|
||||
|
@ -219,9 +216,9 @@ class LocalsRemoteDataSourceImpl implements LocalsRemoteDataSource {
|
|||
|
||||
await PhpGroup.resopndeVinculo.call(tarefa: 'I').then((value) async {
|
||||
if (value.jsonBody['error'] == false) {
|
||||
await StorageHelper().set(KeychainStorageKey.clientName.value, '');
|
||||
await StorageHelper().set(KeychainStorageKey.ownerName.value, '');
|
||||
await StorageHelper().set(KeychainStorageKey.clientUUID.value, '');
|
||||
await StorageHelper().set(ProfileStorageKey.clientName.key, '');
|
||||
await StorageHelper().set(ProfileStorageKey.ownerName.key, '');
|
||||
await StorageHelper().set(ProfileStorageKey.clientUUID.key, '');
|
||||
context.pop();
|
||||
context.go('/homePage', extra: {'update': LocalsRepositoryImpl().update});
|
||||
SnackBarUtil.showSnackBar(context, content);
|
||||
|
@ -244,6 +241,4 @@ class LocalsRemoteDataSourceImpl implements LocalsRemoteDataSource {
|
|||
SnackBarUtil.showSnackBar(context, content, isError: true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -2,12 +2,12 @@ import 'dart:developer';
|
|||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:hub/backend/notifications/firebase_messaging_service.dart';
|
||||
import 'package:hub/shared/components/molecules/locals/index.dart';
|
||||
import 'package:hub/shared/components/molecules/menu/presentation/blocs/menu_bloc.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/features/locals/index.dart';
|
||||
import 'package:hub/features/menu/index.dart';
|
||||
import 'package:hub/features/modules/data/index.dart';
|
||||
import 'package:hub/features/notifications/index.dart';
|
||||
import 'package:hub/features/storage/index.dart';
|
||||
|
||||
import 'package:hub/shared/utils/dialog_util.dart';
|
||||
import 'package:rxdart/rxdart.dart';
|
||||
|
||||
|
@ -32,21 +32,21 @@ class LocalsRepositoryImpl implements LocalsRepository {
|
|||
}
|
||||
|
||||
Future<void> select(BuildContext context) async {
|
||||
await localDataSource.unlinkLocal();
|
||||
await update(context);
|
||||
await localDataSource.unlinkLocal();
|
||||
await update(context);
|
||||
}
|
||||
|
||||
Future<void> check(BuildContext context) async {
|
||||
final String? cliUUID = await StorageHelper().get(KeychainStorageKey.clientUUID.value);
|
||||
final String? ownerUUID = await StorageHelper().get(KeychainStorageKey.ownerUUID.value);
|
||||
final String? cliUUID = await StorageHelper().get(ProfileStorageKey.clientUUID.key);
|
||||
final String? ownerUUID = await StorageHelper().get(ProfileStorageKey.ownerUUID.key);
|
||||
final bool haveCli = cliUUID != null && cliUUID.isNotEmpty;
|
||||
final bool haveOwner = ownerUUID != null && ownerUUID.isNotEmpty;
|
||||
if (!haveCli && !haveOwner) {
|
||||
await update(context);
|
||||
await FirebaseMessagingService().updateDeviceToken();
|
||||
await update(context);
|
||||
await FirebaseMessagingService().updateDeviceToken();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Future<bool> _handleReponse(BuildContext context) async {
|
||||
bool response = false;
|
||||
final bool isUnselected = await remoteDataSource.checkLocals(context);
|
||||
|
@ -69,16 +69,14 @@ class LocalsRepositoryImpl implements LocalsRepository {
|
|||
}
|
||||
|
||||
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';
|
||||
await DialogUtil.error(context, errorMsg);
|
||||
}
|
||||
|
||||
Future<void> _notifyBlocs(BuildContext context) async {
|
||||
|
||||
context.read<LocalProfileBloc>().add(LocalProfileEvent());
|
||||
context.read<MenuBloc>().add(MenuEvent());
|
||||
|
||||
}
|
||||
|
||||
@override
|
|
@ -3,16 +3,12 @@ import 'dart:developer';
|
|||
|
||||
import 'package:flutter_bloc/flutter_bloc.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/nav/nav.dart';
|
||||
import 'package:hub/shared/components/molecules/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';
|
||||
import 'package:hub/features/locals/index.dart';
|
||||
|
||||
class LocalProfileEvent {
|
||||
|
||||
}
|
||||
class LocalProfileEvent {}
|
||||
|
||||
class LocalProfileState {
|
||||
final String cliName;
|
||||
|
@ -22,7 +18,6 @@ class LocalProfileState {
|
|||
LocalProfileState({this.cliName = '', this.cliUUID = '', this.ownerName = ''});
|
||||
|
||||
LocalProfileState copyWith({String? cliName, String? ownerName, String? cliUUID}) {
|
||||
|
||||
return LocalProfileState(
|
||||
cliName: cliName ?? this.cliName,
|
||||
ownerName: ownerName ?? this.ownerName,
|
||||
|
@ -42,9 +37,9 @@ class LocalProfileBloc extends Bloc<LocalProfileEvent, LocalProfileState> {
|
|||
}
|
||||
|
||||
Future<void> _onLocalProfileEvent(LocalProfileEvent event, Emitter<LocalProfileState> emit) async {
|
||||
final cliName = (await StorageHelper().get(KeychainStorageKey.clientName.value)) ?? '';
|
||||
final ownerName = (await StorageHelper().get(KeychainStorageKey.ownerName.value)) ?? '';
|
||||
final cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||
final cliName = (await StorageHelper().get(ProfileStorageKey.clientName.key)) ?? '';
|
||||
final ownerName = (await StorageHelper().get(ProfileStorageKey.ownerName.key)) ?? '';
|
||||
final cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||
emit(state.copyWith(cliName: cliName, cliUUID: cliUUID, ownerName: ownerName));
|
||||
}
|
||||
|
||||
|
@ -68,9 +63,9 @@ class LocalProfileComponentModel extends FlutterFlowModel<LocalProfileComponentW
|
|||
}
|
||||
|
||||
Future<void> getData() async {
|
||||
cliName = (await StorageHelper().get(KeychainStorageKey.clientName.value)) ?? '';
|
||||
ownerName = (await StorageHelper().get(KeychainStorageKey.ownerName.value)) ?? '';
|
||||
cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||
cliName = (await StorageHelper().get(ProfileStorageKey.clientName.key)) ?? '';
|
||||
ownerName = (await StorageHelper().get(ProfileStorageKey.ownerName.key)) ?? '';
|
||||
cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||
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 '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/shared/components/molecules/locals/index.dart';
|
||||
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
||||
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
||||
import 'package:hub/features/locals/index.dart';
|
||||
|
||||
import 'package:hub/shared/utils/dialog_util.dart';
|
||||
import 'package:hub/shared/utils/log_util.dart';
|
||||
|
||||
class LocalUtil {
|
||||
|
||||
static void handleError(BuildContext context, String errorMsg) async {
|
||||
final String devUUID = await StorageHelper().get(KeychainStorageKey.devUUID.value) ?? '';
|
||||
final String userUUID = await StorageHelper().get(KeychainStorageKey.userUUID.value) ?? '';
|
||||
final String devUUID = await StorageHelper().get(ProfileStorageKey.devUUID.key) ?? '';
|
||||
final String userUUID = await StorageHelper().get(ProfileStorageKey.userUUID.key) ?? '';
|
||||
final bool isAuthenticated = userUUID.isNotEmpty && devUUID.isNotEmpty;
|
||||
final bool isDevLinked = !errorMsg.contains('Esse dispositivo nao pertence a esse usuario');
|
||||
log('() => isLinked: $errorMsg');
|
||||
|
@ -42,17 +39,17 @@ class LocalUtil {
|
|||
static Future<bool> handleUnavailable(BuildContext context, List<dynamic> locals) async {
|
||||
log('() => isUnavailable');
|
||||
try {
|
||||
await StorageHelper().set(KeychainStorageKey.clientUUID.value, locals[0]['CLI_ID']);
|
||||
await StorageHelper().set(KeychainStorageKey.ownerUUID.value, locals[0]['CLU_OWNER_ID']);
|
||||
await StorageHelper().set(KeychainStorageKey.clientName.value, locals[0]['CLI_NOME']);
|
||||
await StorageHelper().set(KeychainStorageKey.ownerName.value, locals[0]['CLU_OWNER_DSC']);
|
||||
await StorageHelper().set(ProfileStorageKey.clientUUID.key, locals[0]['CLI_ID']);
|
||||
await StorageHelper().set(ProfileStorageKey.ownerUUID.key, locals[0]['CLU_OWNER_ID']);
|
||||
await StorageHelper().set(ProfileStorageKey.clientName.key, locals[0]['CLI_NOME']);
|
||||
await StorageHelper().set(ProfileStorageKey.ownerName.key, locals[0]['CLU_OWNER_DSC']);
|
||||
|
||||
var response = await PhpGroup.resopndeVinculo.call(tarefa: 'A');
|
||||
if (response.jsonBody['error'] == true) {
|
||||
await StorageHelper().set(KeychainStorageKey.clientUUID.value, '');
|
||||
await StorageHelper().set(KeychainStorageKey.ownerUUID.value, '');
|
||||
await StorageHelper().set(KeychainStorageKey.clientName.value, '');
|
||||
await StorageHelper().set(KeychainStorageKey.ownerName.value, '');
|
||||
await StorageHelper().set(ProfileStorageKey.clientUUID.key, '');
|
||||
await StorageHelper().set(ProfileStorageKey.ownerUUID.key, '');
|
||||
await StorageHelper().set(ProfileStorageKey.clientName.key, '');
|
||||
await StorageHelper().set(ProfileStorageKey.ownerName.key, '');
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -67,11 +64,11 @@ class LocalUtil {
|
|||
|
||||
static Future<bool> handleEnabled(BuildContext context, dynamic local) async {
|
||||
log('() => isEnabled');
|
||||
await StorageHelper().set(KeychainStorageKey.clientUUID.value, local['CLI_ID']);
|
||||
await StorageHelper().set(KeychainStorageKey.ownerUUID.value, local['CLU_OWNER_ID']);
|
||||
await StorageHelper().set(KeychainStorageKey.clientName.value, local['CLI_NOME']);
|
||||
await StorageHelper().set(KeychainStorageKey.ownerName.value, local['CLU_OWNER_DSC']);
|
||||
await StorageHelper().set(KeychainStorageKey.userName.value, local['USU_NOME']);
|
||||
await StorageHelper().set(ProfileStorageKey.clientUUID.key, local['CLI_ID']);
|
||||
await StorageHelper().set(ProfileStorageKey.ownerUUID.key, local['CLU_OWNER_ID']);
|
||||
await StorageHelper().set(ProfileStorageKey.clientName.key, local['CLI_NOME']);
|
||||
await StorageHelper().set(ProfileStorageKey.ownerName.key, local['CLU_OWNER_DSC']);
|
||||
await StorageHelper().set(ProfileStorageKey.userName.key, local['USU_NOME']);
|
||||
return await LocalsRemoteDataSourceImpl().processData(context);
|
||||
}
|
||||
|
||||
|
@ -84,16 +81,15 @@ class LocalUtil {
|
|||
|
||||
static Future<bool> updateStorageUtil(Map<String, dynamic> jsonBody) async {
|
||||
try {
|
||||
await StorageHelper().set(KeychainStorageKey.whatsapp.value, jsonBody['whatsapp'] ?? false);
|
||||
await StorageHelper().set(KeychainStorageKey.provisional.value, jsonBody['provisional'] ?? false);
|
||||
await StorageHelper().set(KeychainStorageKey.pets.value, jsonBody['pet'] ?? false);
|
||||
await StorageHelper().set(KeychainStorageKey.petAmount.value,
|
||||
jsonBody['petAmountRegister']?.toString().isEmpty ?? true ? '0' : jsonBody['petAmountRegister'].toString());
|
||||
await StorageHelper().set(KeychainStorageKey.userName.value, jsonBody['visitado']['VDO_NOME'] ?? '');
|
||||
await StorageHelper().set(KeychainStorageKey.userEmail.value, jsonBody['visitado']['VDO_EMAIL'] ?? '');
|
||||
await StorageHelper().set(LocalsStorageKey.whatsapp.key, jsonBody['whatsapp'] ?? false);
|
||||
await StorageHelper().set(LocalsStorageKey.provisional.key, jsonBody['provisional'] ?? false);
|
||||
await StorageHelper().set(LocalsStorageKey.pets.key, jsonBody['pet'] ?? false);
|
||||
await StorageHelper().set(LocalsStorageKey.petAmount.key, jsonBody['petAmountRegister']?.toString().isEmpty ?? true ? '0' : jsonBody['petAmountRegister'].toString());
|
||||
await StorageHelper().set(ProfileStorageKey.userName.key, jsonBody['visitado']['VDO_NOME'] ?? '');
|
||||
await StorageHelper().set(ProfileStorageKey.userEmail.key, jsonBody['visitado']['VDO_EMAIL'] ?? '');
|
||||
|
||||
final bool isNewVersion = jsonBody['newVersion'] ?? false;
|
||||
await StorageHelper().set(KeychainStorageKey.isNewVersion.value, isNewVersion);
|
||||
await StorageHelper().set(LocalsStorageKey.isNewVersion.key, isNewVersion);
|
||||
return isNewVersion;
|
||||
} catch (e, s) {
|
||||
log('Error in _updateStorageUtil: $e', stackTrace: s);
|
||||
|
@ -106,7 +102,7 @@ class LocalUtil {
|
|||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -115,22 +111,21 @@ class LocalUtil {
|
|||
}
|
||||
|
||||
static Future<bool> isUnselected() async {
|
||||
String cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||
String cliName = (await StorageHelper().get(KeychainStorageKey.clientName.value)) ?? '';
|
||||
String ownerUUID = (await StorageHelper().get(KeychainStorageKey.ownerUUID.value)) ?? '';
|
||||
String cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||
String cliName = (await StorageHelper().get(ProfileStorageKey.clientName.key)) ?? '';
|
||||
String ownerUUID = (await StorageHelper().get(ProfileStorageKey.ownerUUID.key)) ?? '';
|
||||
return cliUUID.isEmpty && cliName.isEmpty && ownerUUID.isEmpty;
|
||||
}
|
||||
|
||||
static Future<bool> isSelected(bool isInactived) async {
|
||||
String cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||
String cliName = (await StorageHelper().get(KeychainStorageKey.clientName.value)) ?? '';
|
||||
String cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||
String cliName = (await StorageHelper().get(ProfileStorageKey.clientName.key)) ?? '';
|
||||
return cliUUID.isNotEmpty && cliName.isNotEmpty && isInactived;
|
||||
}
|
||||
|
||||
static Future<bool> isAvailable() async {
|
||||
String cliUUID = (await StorageHelper().get(KeychainStorageKey.clientUUID.value)) ?? '';
|
||||
String cliName = (await StorageHelper().get(KeychainStorageKey.clientName.value)) ?? '';
|
||||
String cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? '';
|
||||
String cliName = (await StorageHelper().get(ProfileStorageKey.clientName.key)) ?? '';
|
||||
return cliUUID.isNotEmpty && cliName.isNotEmpty;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -1,18 +1,16 @@
|
|||
|
||||
|
||||
import 'dart:developer';
|
||||
|
||||
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/shared/components/molecules/menu/index.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 '../../../modules/domain/entities/index.dart';
|
||||
|
||||
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<void> handleMenu(EnumMenuItem item, EnumDisplay display, MenuEntry opt, List<MenuItem?> entries);
|
||||
Future<bool> processStartDate(String startDate, MenuEntry entry);
|
||||
|
@ -36,7 +34,7 @@ class MenuLocalDataSourceImpl implements MenuLocalDataSource {
|
|||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
Future<bool> processDisplayDefault(EnumMenuItem item, MenuEntry opt, List<MenuItem?> entries) async {
|
||||
if (opt.key == 'FRE-HUB-LOGOUT') {
|
||||
|
@ -44,9 +42,8 @@ class MenuLocalDataSourceImpl implements MenuLocalDataSource {
|
|||
await AuthenticationService.signOut(navigatorKey.currentContext!);
|
||||
});
|
||||
return true;
|
||||
|
||||
}
|
||||
else return false;
|
||||
} else
|
||||
return false;
|
||||
}
|
||||
|
||||
@override
|
||||
|
@ -75,14 +72,14 @@ class MenuLocalDataSourceImpl implements MenuLocalDataSource {
|
|||
Future<bool> processStartDate(String startDate, MenuEntry opt) async {
|
||||
try {
|
||||
if (startDate.isEmpty) return true;
|
||||
final start = DateTime.tryParse(startDate);
|
||||
final start = DateTime.tryParse(startDate);
|
||||
if (start == null) return false;
|
||||
return DateTime.now().isAfter(start);
|
||||
} catch (e) {
|
||||
log('Error processing start date for module ${opt.key}: $e');
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Future<bool> processExpirationDate(String expirationDate, MenuEntry opt) async {
|
||||
|
@ -95,7 +92,4 @@ class MenuLocalDataSourceImpl implements MenuLocalDataSource {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
|
@ -1,23 +1,12 @@
|
|||
|
||||
|
||||
import 'dart:convert';
|
||||
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/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 {
|
||||
final MenuLocalDataSource menuDataSource = MenuLocalDataSourceImpl();
|
||||
|
||||
|
||||
@override
|
||||
Future<List<MenuItem?>> generateMenuEntries(List<MenuEntry> menuEntries, EnumMenuItem item) async {
|
||||
List<MenuItem?> entries = [];
|
||||
|
@ -55,8 +44,6 @@ class MenuRepositoryImpl implements MenuRepository {
|
|||
}
|
||||
|
||||
Future<EnumDisplay> processDisplay(Map<String, dynamic> module, bool isNewVersion) async {
|
||||
|
||||
|
||||
if (await _shouldUpdateDisplay(module, isNewVersion)) {
|
||||
final displayValue = module['display'] == EnumDisplay.active ? 'VISIVEL' : 'INVISIVEL';
|
||||
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 {
|
||||
const keysToCheck = [
|
||||
LicenseKeys.residents,
|
||||
LicenseKeys.vehicles,
|
||||
LicenseKeys.openedVisits
|
||||
];
|
||||
const keysToCheck = [LicenseKeys.residents, LicenseKeys.vehicles, LicenseKeys.openedVisits];
|
||||
return isNewVersion && keysToCheck.any((key) => module['key'] == key.value);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:hub/shared/components/molecules/menu/index.dart';
|
||||
import 'package:hub/features/menu/index.dart';
|
||||
|
||||
enum EnumMenuItem {
|
||||
button,
|
||||
|
@ -29,7 +29,6 @@ abstract class MenuItem extends StatefulWidget {
|
|||
final Function() action;
|
||||
final String title;
|
||||
final IconData icon;
|
||||
|
||||
|
||||
factory MenuItem.create(
|
||||
EnumMenuItem type, {
|
|
@ -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:developer';
|
||||
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:hub/flutter_flow/nav/nav.dart';
|
||||
import 'package:hub/shared/components/molecules/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';
|
||||
|
||||
import 'package:hub/features/menu/index.dart';
|
||||
import 'package:hub/features/modules/index.dart';
|
||||
import 'package:hub/features/locals/index.dart';
|
||||
|
||||
class MenuEvent {}
|
||||
|
||||
|
@ -44,7 +36,7 @@ class MenuBloc extends Bloc<MenuEvent, MenuState> {
|
|||
|
||||
Future<void> _onMenuEvent(MenuEvent event, Emitter<MenuState> emit) async {
|
||||
await LicenseRemoteDataSourceImpl().waitForSaveCompletion();
|
||||
|
||||
|
||||
final List<MenuItem?> newEntries = await MenuRepositoryImpl().generateMenuEntries(entries, item);
|
||||
emit(state.copyWith(menuEntries: newEntries));
|
||||
}
|
||||
|
@ -54,6 +46,4 @@ class MenuBloc extends Bloc<MenuEvent, MenuState> {
|
|||
_completer.cancel();
|
||||
return super.close();
|
||||
}
|
||||
|
||||
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue