diff --git a/lib/backend/api_requests/api_calls.dart b/lib/backend/api_requests/api_calls.dart index e92107cf..65e74d1a 100644 --- a/lib/backend/api_requests/api_calls.dart +++ b/lib/backend/api_requests/api_calls.dart @@ -63,12 +63,9 @@ class PhpGroup { class GetOpenedVisits { Future call(final String page) async { final String baseUrl = PhpGroup.getBaseUrl(); - final String devUUID = - (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; - final String userUUID = - (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; - final String cliID = - (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; + final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; + final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; + final String cliID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; const String atividade = 'getOpenedVisits'; const String pageSize = '10'; return ApiManager.instance.makeApiCall( @@ -98,12 +95,9 @@ class GetOpenedVisits { class GetResidentsByProperty { Future call(final String page) async { final String baseUrl = PhpGroup.getBaseUrl(); - final String devUUID = - (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; - final String userUUID = - (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; - final String cliID = - (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; + final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; + final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; + final String cliID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; const String atividade = 'getResidentsByProperty'; const String pageSize = '10'; return ApiManager.instance.makeApiCall( @@ -132,12 +126,9 @@ class GetResidentsByProperty { class GetVehiclesByProperty { Future call(final String page) async { final String baseUrl = PhpGroup.getBaseUrl(); - final String devUUID = - (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; - final String userUUID = - (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; - final String cliID = - (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; + final String devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; + final String userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; + final String cliID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; const String atividade = 'getVehiclesByProperty'; const String pageSize = '10'; return ApiManager.instance.makeApiCall( diff --git a/lib/components/atomic_components/menu_button_item/menu_button_item_widget.dart b/lib/components/atomic_components/menu_button_item/menu_button_item_widget.dart index 758a3f5b..ced0373e 100644 --- a/lib/components/atomic_components/menu_button_item/menu_button_item_widget.dart +++ b/lib/components/atomic_components/menu_button_item/menu_button_item_widget.dart @@ -3,7 +3,6 @@ import 'package:google_fonts/google_fonts.dart'; import 'package:hub/components/molecular_components/menu_item/menu_item.dart'; import 'package:hub/flutter_flow/flutter_flow_theme.dart'; - class MenuButtonWidget extends MenuEntry { const MenuButtonWidget({ super.key, diff --git a/lib/components/atomic_components/menu_card_item/menu_card_item.dart b/lib/components/atomic_components/menu_card_item/menu_card_item.dart index 906dee28..5696f83a 100644 --- a/lib/components/atomic_components/menu_card_item/menu_card_item.dart +++ b/lib/components/atomic_components/menu_card_item/menu_card_item.dart @@ -3,7 +3,6 @@ import 'package:google_fonts/google_fonts.dart'; import 'package:hub/components/molecular_components/menu_item/menu_item.dart'; import 'package:hub/flutter_flow/flutter_flow_theme.dart'; - class MenuCardItem extends MenuEntry { const MenuCardItem({ super.key, diff --git a/lib/components/organism_components/menu_component/menu_component_model.dart b/lib/components/organism_components/menu_component/menu_component_model.dart index 4b3bb3a7..bb46b0c1 100644 --- a/lib/components/organism_components/menu_component/menu_component_model.dart +++ b/lib/components/organism_components/menu_component/menu_component_model.dart @@ -216,7 +216,7 @@ class MenuComponentModel extends FlutterFlowModel { ); } - Future out(BuildContext context) async { + Future out(BuildContext context) async { final String title = FFLocalizations.of(context).getVariableText( ptText: 'Sair', enText: 'Logout', diff --git a/lib/components/organism_components/menu_component/menu_component_widget.dart b/lib/components/organism_components/menu_component/menu_component_widget.dart index d3686874..795982cd 100644 --- a/lib/components/organism_components/menu_component/menu_component_widget.dart +++ b/lib/components/organism_components/menu_component/menu_component_widget.dart @@ -1,7 +1,6 @@ import 'package:flutter/material.dart'; import 'package:hub/backend/schema/enums/enums.dart'; - import '/components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart'; import '/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart'; import '/flutter_flow/flutter_flow_util.dart'; diff --git a/lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart b/lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart index 0216eaff..c73c5e20 100644 --- a/lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart +++ b/lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart @@ -175,7 +175,7 @@ class _CardItemTemplateComponentWidgetState extends State { mainAxisAlignment: MainAxisAlignment.start, children: [ SizedBox(height: MediaQuery.of(context).size.height * 0.02), - if(widget.imagePath != null) Container( - width: MediaQuery.of(context).size.width * 0.3, - height: MediaQuery.of(context).size.width * 0.3, - clipBehavior: Clip.antiAlias, - decoration: const BoxDecoration( - shape: BoxShape.circle, + if (widget.imagePath != null) + Container( + width: MediaQuery.of(context).size.width * 0.3, + height: MediaQuery.of(context).size.width * 0.3, + clipBehavior: Clip.antiAlias, + decoration: const BoxDecoration( + shape: BoxShape.circle, + ), + child: CachedNetworkImage( + fadeInDuration: const Duration(milliseconds: 100), + fadeOutDuration: const Duration(milliseconds: 100), + imageUrl: widget.imagePath ?? '', + fit: BoxFit.cover, + useOldImageOnUrlChange: true, + ), ), - child: CachedNetworkImage( - fadeInDuration: const Duration(milliseconds: 100), - fadeOutDuration: const Duration(milliseconds: 100), - imageUrl: widget.imagePath ?? '', - fit: BoxFit.cover, - useOldImageOnUrlChange: true, - ), - ), - SizedBox(height: MediaQuery.of(context).size.height * 0.03), Row( children: statusLinkedHashMap.expand((linkedHashMap) { @@ -115,7 +115,7 @@ class _DetailsComponentWidgetState extends State { ), filled: true, fillColor: item.value, - labelText: item.key, + labelText: item.key, labelStyle: FlutterFlowTheme.of(context).labelMedium.override( fontFamily: FlutterFlowTheme.of(context).labelMediumFamily, fontWeight: FontWeight.bold, diff --git a/lib/flutter_flow/nav/nav.dart b/lib/flutter_flow/nav/nav.dart index 3deb7ddf..5200e876 100644 --- a/lib/flutter_flow/nav/nav.dart +++ b/lib/flutter_flow/nav/nav.dart @@ -54,7 +54,6 @@ class AppStateNotifier extends ChangeNotifier { } GoRouter createRouter(AppStateNotifier appStateNotifier) { - return GoRouter( initialLocation: '/', debugLogDiagnostics: true, diff --git a/lib/pages/fast_pass_page/fast_pass_page_widget.dart b/lib/pages/fast_pass_page/fast_pass_page_widget.dart index 7764c3ed..087752bd 100644 --- a/lib/pages/fast_pass_page/fast_pass_page_widget.dart +++ b/lib/pages/fast_pass_page/fast_pass_page_widget.dart @@ -32,7 +32,8 @@ class _FastPassPageWidgetState extends State { final cliUUID = await StorageHelper().get(hub.SQLiteStorageKey.clientUUID.value, hub.Storage.SQLiteStorage) ?? ''; const createdAt = '0000-00-00 00:00:00'; final url = 'https://hub.freaccess.com.br/hub/fast-pass/$cliUUID'; - final freUserData = "{\"name\": \"$name\", \"email\": \"$email\",\"dev_id\": \"$devUUID\",\"created_at\":\"$createdAt\",\"updated_at\": \"0000-00-00 00:00:00\",\"status\": \"A\" }"; + final freUserData = + "{\"name\": \"$name\", \"email\": \"$email\",\"dev_id\": \"$devUUID\",\"created_at\":\"$createdAt\",\"updated_at\": \"0000-00-00 00:00:00\",\"status\": \"A\" }"; return { 'url': url, 'name': name, @@ -55,7 +56,9 @@ class _FastPassPageWidgetState extends State { if (snapshot.connectionState == ConnectionState.waiting) { return const Center(child: CircularProgressIndicator()); } else if (snapshot.hasError || !snapshot.hasData || snapshot.data!.isEmpty) { - return Center(child: Text(FFLocalizations.of(context).getVariableText(enText: 'Unexpected error', ptText: 'Erro inesperado'))); + return Center( + child: Text(FFLocalizations.of(context) + .getVariableText(enText: 'Unexpected error', ptText: 'Erro inesperado'))); } else { final data = snapshot.data!; final url = data['url']!; @@ -133,4 +136,4 @@ class _FastPassPageWidgetState extends State { ..loadRequest(Uri.parse(url)), ); } -} \ No newline at end of file +} diff --git a/lib/pages/home_page/home_page_model.dart b/lib/pages/home_page/home_page_model.dart index 6dea5f8b..6fb86a4d 100644 --- a/lib/pages/home_page/home_page_model.dart +++ b/lib/pages/home_page/home_page_model.dart @@ -23,7 +23,7 @@ class HomePageModel extends FlutterFlowModel { final unfocusNode = FocusNode(); FocusNode? textFieldFocusNode; TextEditingController? textController; - String? Function(BuildContext, String?)? textControllerValidator; + String? Function(BuildContext, String?)? textControllerValidator; late LocalProfileComponentModel localComponentModel; late MenuComponentModel homeMenuComponentModel; late MenuComponentModel drawerMenuComponentModel; diff --git a/lib/pages/home_page/home_page_widget.dart b/lib/pages/home_page/home_page_widget.dart index dd271180..ca2ff3ce 100644 --- a/lib/pages/home_page/home_page_widget.dart +++ b/lib/pages/home_page/home_page_widget.dart @@ -37,7 +37,7 @@ class _HomePageWidgetState extends State { void initState() { super.initState(); - _model = createModel(context, () => HomePageModel(safeSetState: () => safeSetState((){}))); + _model = createModel(context, () => HomePageModel(safeSetState: () => safeSetState(() {}))); _model.textController ??= TextEditingController(); _model.textFieldFocusNode ??= FocusNode(); diff --git a/lib/pages/people_on_the_property_page/people_on_the_property_page_model.dart b/lib/pages/people_on_the_property_page/people_on_the_property_page_model.dart index 0fb0d19b..6e7114f8 100644 --- a/lib/pages/people_on_the_property_page/people_on_the_property_page_model.dart +++ b/lib/pages/people_on_the_property_page/people_on_the_property_page_model.dart @@ -5,18 +5,16 @@ import 'package:hub/shared/helpers/base_storage.dart'; import 'package:hub/shared/helpers/storage_helper.dart'; class PeopleOnThePropertyPageModel extends FlutterFlowModel { - PeopleOnThePropertyPageModel({this.onRefresh}); - late final VoidCallback? onRefresh; - + PeopleOnThePropertyPageModel({this.onRefresh}); + late final VoidCallback? onRefresh; final unfocusNode = FocusNode(); - late final String devUUID; - late final String cliUUID; + late final String devUUID; + late final String cliUUID; @override void initState(BuildContext context) { - initVariables(); - + initVariables(); } void initVariables() async { diff --git a/lib/pages/reservation_page/reservation_page_widget.dart b/lib/pages/reservation_page/reservation_page_widget.dart index 2cc86d47..31422dfd 100644 --- a/lib/pages/reservation_page/reservation_page_widget.dart +++ b/lib/pages/reservation_page/reservation_page_widget.dart @@ -29,7 +29,8 @@ class _ReservationPageWidgetState extends State { final clientId = await StorageHelper().get(hub.SQLiteStorageKey.clientUUID.value, hub.Storage.SQLiteStorage) ?? ''; const createdAt = '0000-00-00 00:00:00'; final url = 'https://hub.freaccess.com.br/hub/reservation/$clientId'; - final freUserData = "{\"name\": \"$name\", \"email\": \"$email\",\"dev_id\": \"$devUUID\",\"created_at\": \"$createdAt\",\"updated_at\": \"0000-00-00 00:00:00\",\"status\": \"A\" }"; + final freUserData = + "{\"name\": \"$name\", \"email\": \"$email\",\"dev_id\": \"$devUUID\",\"created_at\": \"$createdAt\",\"updated_at\": \"0000-00-00 00:00:00\",\"status\": \"A\" }"; return { 'url': url, 'name': name, @@ -52,7 +53,9 @@ class _ReservationPageWidgetState extends State { if (snapshot.connectionState == ConnectionState.waiting) { return const Center(child: CircularProgressIndicator()); } else if (snapshot.hasError || !snapshot.hasData || snapshot.data!.isEmpty) { - return Center(child: Text(FFLocalizations.of(context).getVariableText(enText: 'Unexpected error', ptText: 'Erro inesperado'))); + return Center( + child: Text(FFLocalizations.of(context) + .getVariableText(enText: 'Unexpected error', ptText: 'Erro inesperado'))); } else { final data = snapshot.data!; final url = data['url']!; @@ -129,4 +132,4 @@ class _ReservationPageWidgetState extends State { ..loadRequest(Uri.parse(url)), ); } -} \ No newline at end of file +} diff --git a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart index 65f672ff..c5c93bae 100644 --- a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart +++ b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart @@ -17,7 +17,7 @@ import 'package:share_plus/share_plus.dart'; import '../../shared/utils/validator_util.dart'; class ScheduleCompleteVisitPageModel extends FlutterFlowModel { - ScheduleCompleteVisitPageModel({ this.safeSetState}); + ScheduleCompleteVisitPageModel({this.safeSetState}); late VoidCallback? safeSetState; late Function(Function) updateState; diff --git a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart index 7b8dc738..2cf0c1cb 100644 --- a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart +++ b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart @@ -24,13 +24,15 @@ import 'package:hub/shared/utils/share_util.dart'; class ScheduleComplete extends StatefulWidget { const ScheduleComplete({super.key}); - @override State createState() => throw UnimplementedError(); + @override + State createState() => throw UnimplementedError(); } class ScheduleCompleteVisitPageWidget extends ScheduleComplete { const ScheduleCompleteVisitPageWidget({super.key}); - @override State createState() => _ScheduleCompleteVisitPageWidgetState(); + @override + State createState() => _ScheduleCompleteVisitPageWidgetState(); } class _ScheduleCompleteVisitPageWidgetState extends State @@ -44,9 +46,10 @@ class _ScheduleCompleteVisitPageWidgetState extends State(); - @override void initState() { + @override + void initState() { super.initState(); - _model = createModel(context, () => ScheduleCompleteVisitPageModel(safeSetState: () => safeSetState((){}))); + _model = createModel(context, () => ScheduleCompleteVisitPageModel(safeSetState: () => safeSetState(() {}))); _model.updateState = (Function fn) => safeSetState(fn()); _model.tabBarController = TabController( @@ -94,7 +97,8 @@ class _ScheduleCompleteVisitPageWidgetState extends State _model.unfocusNode.canRequestFocus ? FocusScope.of(context).requestFocus(_model.unfocusNode) diff --git a/lib/pages/vehicles_on_the_property/vehicle_model.dart b/lib/pages/vehicles_on_the_property/vehicle_model.dart index 52b6cea0..826095f5 100644 --- a/lib/pages/vehicles_on_the_property/vehicle_model.dart +++ b/lib/pages/vehicles_on_the_property/vehicle_model.dart @@ -48,8 +48,7 @@ class VehicleModel extends FlutterFlowModel { '${FFLocalizations.of(context).getVariableText(ptText: "Tag", enText: "Tag")}:': item['tag'].toString().toUpperCase(), }), - statusHashMap: [ - ], + statusHashMap: [], ); } } diff --git a/lib/pages/visits_on_the_property/model.dart b/lib/pages/visits_on_the_property/model.dart index 5b4db026..fe59a038 100644 --- a/lib/pages/visits_on_the_property/model.dart +++ b/lib/pages/visits_on_the_property/model.dart @@ -18,8 +18,6 @@ class VisitsModel extends FlutterFlowModel { late final String cliUUID; dynamic item; - - @override void initState(BuildContext context) { @@ -43,47 +41,47 @@ class VisitsModel extends FlutterFlowModel { required VisitsModel model, }) { return DetailsComponentWidget( - buttons: [], - labelsHashMap: Map.from({ - if (item['MOT_DESCRICAO'] != null && item['MOT_DESCRICAO'] != '') - '${FFLocalizations.of(context).getVariableText( - ptText: "Motivo", - enText: "Reason", - )}:': item['MOT_DESCRICAO'].toString().toUpperCase(), - if (item['VTA_DTINICIO'] != null && item['VTA_DTINICIO'] != '') - '${FFLocalizations.of(context).getVariableText( - ptText: "Data de Início", - enText: "Start Date", - )}:': item['VTA_DTINICIO'].toString().toUpperCase(), - if (item['VTA_VALIDADE'] != null && item['VTA_VALIDADE'] != '') - '${FFLocalizations.of(context).getVariableText( - ptText: "Validade", - enText: "Validity", - )}:': item['VTA_VALIDADE'].toString().toUpperCase(), - if (item['VTA_FIXA'] != null && item['VTA_FIXA'] != '') - '${FFLocalizations.of(context).getVariableText( - ptText: "Entrada Única", - enText: "Single Entry", - )}:': item['VTA_FIXA'] == true - ? FFLocalizations.of(context).getVariableText( - ptText: "Sim", - enText: "Yes", - ) - : FFLocalizations.of(context).getVariableText( - ptText: "Não", - enText: "No", - ), - }), - imagePath: - 'https://freaccess.com.br/freaccess/getImage.php?devUUID=${devUUID}&cliID=${cliUUID}&atividade=getFoto&Documento=${item['VDO_DOCUMENTO']}&tipo=E', - statusHashMap: [ - if (item['VTA_FIXA'] != null) - Map.from({ - item['VTA_FIXA'] - ? FFLocalizations.of(context).getVariableText(ptText: "Entrada Única", enText: "Single Entry") - : FFLocalizations.of(context).getVariableText(ptText: "Entrada Recorrente", enText: "Recurrent Entry") - : FlutterFlowTheme.of(context).warning - }), - ]); - } + buttons: [], + labelsHashMap: Map.from({ + if (item['MOT_DESCRICAO'] != null && item['MOT_DESCRICAO'] != '') + '${FFLocalizations.of(context).getVariableText( + ptText: "Motivo", + enText: "Reason", + )}:': item['MOT_DESCRICAO'].toString().toUpperCase(), + if (item['VTA_DTINICIO'] != null && item['VTA_DTINICIO'] != '') + '${FFLocalizations.of(context).getVariableText( + ptText: "Data de Início", + enText: "Start Date", + )}:': item['VTA_DTINICIO'].toString().toUpperCase(), + if (item['VTA_VALIDADE'] != null && item['VTA_VALIDADE'] != '') + '${FFLocalizations.of(context).getVariableText( + ptText: "Validade", + enText: "Validity", + )}:': item['VTA_VALIDADE'].toString().toUpperCase(), + if (item['VTA_FIXA'] != null && item['VTA_FIXA'] != '') + '${FFLocalizations.of(context).getVariableText( + ptText: "Entrada Única", + enText: "Single Entry", + )}:': item['VTA_FIXA'] == true + ? FFLocalizations.of(context).getVariableText( + ptText: "Sim", + enText: "Yes", + ) + : FFLocalizations.of(context).getVariableText( + ptText: "Não", + enText: "No", + ), + }), + imagePath: + 'https://freaccess.com.br/freaccess/getImage.php?devUUID=${devUUID}&cliID=${cliUUID}&atividade=getFoto&Documento=${item['VDO_DOCUMENTO']}&tipo=E', + statusHashMap: [ + if (item['VTA_FIXA'] != null) + Map.from({ + item['VTA_FIXA'] + ? FFLocalizations.of(context).getVariableText(ptText: "Entrada Única", enText: "Single Entry") + : FFLocalizations.of(context).getVariableText( + ptText: "Entrada Recorrente", enText: "Recurrent Entry"): FlutterFlowTheme.of(context).warning + }), + ]); + } } diff --git a/lib/shared/services/localization/localization_service.dart b/lib/shared/services/localization/localization_service.dart index 3dfbd1f1..8f9c6ae4 100644 --- a/lib/shared/services/localization/localization_service.dart +++ b/lib/shared/services/localization/localization_service.dart @@ -48,7 +48,6 @@ class LocalizationService { static Future processLocals(BuildContext context) async { try { - final GetLocalsCall callback = PhpGroup.getLocalsCall; final ApiCallResponse response = await callback.call(); final bool isError = response.jsonBody['error'];