diff --git a/lib/backend/api_requests/api_calls.dart b/lib/backend/api_requests/api_calls.dart index dce2dffa..e92107cf 100644 --- a/lib/backend/api_requests/api_calls.dart +++ b/lib/backend/api_requests/api_calls.dart @@ -6,7 +6,6 @@ import 'package:flutter/foundation.dart'; import 'package:hub/backend/notifications/firebase_messaging_service.dart'; import 'package:hub/shared/helpers/base_storage.dart'; import 'package:hub/shared/helpers/storage_helper.dart'; -import 'package:hub/shared/utils/dialog_util.dart'; import 'package:hub/shared/utils/log_util.dart'; import 'package:hub/shared/utils/validator_util.dart'; @@ -731,7 +730,7 @@ class LoginCall { late final String token; try { token = await FirebaseMessagingService.getToken(); - if (token == null || token.isEmpty) throw Exception('Token is empty'); + if (token == 'null' || token.isEmpty) throw Exception('Token is empty'); } catch (e, s) { token = ''; log('Error getting token', error: e, stackTrace: s); 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 f780b292..758a3f5b 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,8 +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'; -import '../../../shared/extensions/dialog_extensions.dart'; -import '../../../shared/services/localization/localization_service.dart'; class MenuButtonWidget extends MenuEntry { const MenuButtonWidget({ 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 552db839..906dee28 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,8 +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'; -import '../../../shared/extensions/dialog_extensions.dart'; -import '../../../shared/services/localization/localization_service.dart'; class MenuCardItem extends MenuEntry { const MenuCardItem({ diff --git a/lib/components/atomic_components/shared_components_atoms/media_upload_button.dart b/lib/components/atomic_components/shared_components_atoms/media_upload_button.dart index 7b712455..2977f7cb 100644 --- a/lib/components/atomic_components/shared_components_atoms/media_upload_button.dart +++ b/lib/components/atomic_components/shared_components_atoms/media_upload_button.dart @@ -2,7 +2,6 @@ import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:hub/flutter_flow/flutter_flow_theme.dart'; import 'package:hub/flutter_flow/flutter_flow_util.dart'; -import 'package:hub/flutter_flow/flutter_flow_widgets.dart'; import 'package:hub/flutter_flow/upload_data.dart'; import 'package:hub/shared/utils/limited_text_size.dart'; diff --git a/lib/main.dart b/lib/main.dart index 24ebdf9b..38828b06 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -21,7 +21,6 @@ import 'package:hub/pages/forgot_password_page/forgot_password_screen.dart'; import 'package:hub/shared/helpers/base_storage.dart'; import 'package:hub/shared/helpers/storage_helper.dart'; import 'package:hub/shared/services/localization/localization_service.dart'; -import 'package:hub/shared/utils/device_util.dart'; import 'package:responsive_framework/responsive_framework.dart'; import 'backend/notifications/firebase_messaging_service.dart'; 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 a8ce35df..7764c3ed 100644 --- a/lib/pages/fast_pass_page/fast_pass_page_widget.dart +++ b/lib/pages/fast_pass_page/fast_pass_page_widget.dart @@ -1,3 +1,5 @@ +// ignore_for_file: unused_field + import 'dart:io' show Platform; import 'package:flutter/material.dart'; diff --git a/lib/pages/home_page/home_page_widget.dart b/lib/pages/home_page/home_page_widget.dart index 7976be2f..dd271180 100644 --- a/lib/pages/home_page/home_page_widget.dart +++ b/lib/pages/home_page/home_page_widget.dart @@ -1,8 +1,6 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; -import 'package:hub/backend/notifications/firebase_messaging_service.dart'; -import 'package:hub/backend/schema/enums/enums.dart'; import 'package:hub/components/organism_components/local_profile_component/local_profile_component_widget.dart'; import 'package:hub/components/organism_components/menu_component/menu_component_widget.dart'; import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; diff --git a/lib/pages/package_order_page/package_order_page.dart b/lib/pages/package_order_page/package_order_page.dart index 4e2f1246..c82cfff6 100644 --- a/lib/pages/package_order_page/package_order_page.dart +++ b/lib/pages/package_order_page/package_order_page.dart @@ -412,6 +412,7 @@ class _PackageOrderPage extends State { @override Widget build(BuildContext context) { return Scaffold( + backgroundColor: FlutterFlowTheme.of(context).primaryBackground, appBar: _appBar(context), body: _appBody(context), ); diff --git a/lib/pages/people_on_the_property_page/people_on_the_property_page_widget.dart b/lib/pages/people_on_the_property_page/people_on_the_property_page_widget.dart index 96de721d..be16c18d 100644 --- a/lib/pages/people_on_the_property_page/people_on_the_property_page_widget.dart +++ b/lib/pages/people_on_the_property_page/people_on_the_property_page_widget.dart @@ -7,6 +7,7 @@ import 'package:hub/flutter_flow/flutter_flow_theme.dart'; import 'package:hub/flutter_flow/flutter_flow_util.dart'; import 'package:hub/pages/people_on_the_property_page/people_on_the_property_page_model.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'; class PeopleOnThePropertyPage extends StatefulWidget { @@ -23,8 +24,6 @@ class _PeopleOnThePropertyPageState extends State with bool _hasData = false; bool _loading = false; int count = 0; - - late final PeopleOnThePropertyPageModel model; @@ -35,7 +34,6 @@ class _PeopleOnThePropertyPageState extends State with void initState() { super.initState(); model = createModel(context, () => PeopleOnThePropertyPageModel(onRefresh: () => safeSetState(() {}))); - _future = _fetchVisits(); _scrollController = ScrollController() @@ -53,67 +51,79 @@ class _PeopleOnThePropertyPageState extends State with } @override - Widget build(BuildContext context) => Scaffold( - appBar: _appBar(context), - backgroundColor: FlutterFlowTheme.of(context).primaryBackground, - body: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - if (_hasData == false && _pageNumber <= 1 && _loading == false) - Expanded( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - mainAxisSize: MainAxisSize.max, - children: [ - Center( - child: Text(FFLocalizations.of(context) - .getVariableText(ptText: "Nenhum morador encontrado!", enText: "No residents found!")), - ) - ], - ), - ) - else if (_hasData == true || _pageNumber >= 1) - Expanded( - child: FutureBuilder( - future: _future, - builder: (context, snapshot) { - return ListView.builder( - shrinkWrap: true, - physics: const BouncingScrollPhysics(), - controller: _scrollController, - itemCount: _wrap.length + 1, - itemBuilder: (context, index) { - if (index == 0) { - // Add your item here - return Padding( - padding: const EdgeInsets.only(right: 30, top: 10), - child: Text( - '', - textAlign: TextAlign.right, - ), - ); - } else { - final item = _wrap[index - 1]; - return _item(context, item); - } - }); - }, - )), - if (_hasData == true && _loading == true) - Container( - padding: const EdgeInsets.only(top: 15, bottom: 15), - child: Center( - child: CircularProgressIndicator( - valueColor: AlwaysStoppedAnimation( - FlutterFlowTheme.of(context).primary, + Widget build(BuildContext context) { + late final limitedHeaderTextSize = LimitedFontSizeUtil.getHeaderFontSize(context); + + return Scaffold( + appBar: _appBar(context), + backgroundColor: FlutterFlowTheme.of(context).primaryBackground, + body: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + if (_hasData == false && _pageNumber <= 1 && _loading == false) + Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + mainAxisSize: MainAxisSize.max, + children: [ + Center( + child: Text( + FFLocalizations.of(context).getVariableText( + ptText: "Nenhum morador encontrado!", + enText: "No residents found!", + ), + style: TextStyle( + fontFamily: 'Nunito', + fontSize: limitedHeaderTextSize, + ), ), + ) + ], + ), + ) + else if (_hasData == true || _pageNumber >= 1) + Expanded( + child: FutureBuilder( + future: _future, + builder: (context, snapshot) { + return ListView.builder( + shrinkWrap: true, + physics: const BouncingScrollPhysics(), + controller: _scrollController, + itemCount: _wrap.length + 1, + itemBuilder: (context, index) { + if (index == 0) { + // Add your item here + return Padding( + padding: const EdgeInsets.only(right: 30, top: 10), + child: Text( + '', + textAlign: TextAlign.right, + ), + ); + } else { + final item = _wrap[index - 1]; + return _item(context, item); + } + }); + }, + )), + if (_hasData == true && _loading == true) + Container( + padding: const EdgeInsets.only(top: 15, bottom: 15), + child: Center( + child: CircularProgressIndicator( + valueColor: AlwaysStoppedAnimation( + FlutterFlowTheme.of(context).primary, ), ), - ) - ].addToStart(const SizedBox(height: 0)), - ), - ); + ), + ) + ].addToStart(const SizedBox(height: 0)), + ), + ); + } PreferredSizeWidget _appBar(BuildContext context) { return AppBar( @@ -199,15 +209,23 @@ class _PeopleOnThePropertyPageState extends State with void _showNoMoreDataSnackBar(BuildContext context) { ScaffoldMessenger.of(context).showSnackBar( SnackBar( - content: - Text(FFLocalizations.of(context).getVariableText(ptText: "Não há mais dados.", enText: "No more data.")), + content: Text( + FFLocalizations.of(context).getVariableText( + ptText: "Não há mais dados.", + enText: "No more data.", + ), + style: TextStyle( + color: Colors.white, + fontSize: LimitedFontSizeUtil.getBodyFontSize(context), + ), + ), duration: const Duration(seconds: 3), backgroundColor: FlutterFlowTheme.of(context).primary, ), ); } - Widget _item(BuildContext context, dynamic uItem) { + Widget _item(BuildContext context, dynamic uItem) { return CardItemTemplateComponentWidget( imagePath: 'https://freaccess.com.br/freaccess/getImage.php?devUUID=${model.devUUID}&cliID=${model.cliUUID}&atividade=getFoto&Documento=${uItem['documento']}&tipo=Z', diff --git a/lib/pages/pets_on_the_property_page/pets_history_screen.dart b/lib/pages/pets_on_the_property_page/pets_history_screen.dart index d80593bc..9458923c 100644 --- a/lib/pages/pets_on_the_property_page/pets_history_screen.dart +++ b/lib/pages/pets_on_the_property_page/pets_history_screen.dart @@ -19,7 +19,8 @@ class PetsHistoryScreen extends StatefulWidget { final bool isApp; final PetsPageModel? model; - @override _PetsHistoryScreenState createState() => _PetsHistoryScreenState(); + @override + _PetsHistoryScreenState createState() => _PetsHistoryScreenState(); } class _PetsHistoryScreenState extends State with TickerProviderStateMixin { @@ -31,7 +32,6 @@ class _PetsHistoryScreenState extends State with TickerProvid bool _loading = false; int count = 0; late final PetsPageModel model; - late Future _petsFuture; List _petsWrap = []; @@ -39,10 +39,7 @@ class _PetsHistoryScreenState extends State with TickerProvid void initState() { super.initState(); model = widget.model ?? createModel(context, () => PetsPageModel()); - model.petAmountRegister = '0'; _petsFuture = _fetchVisits(); - - _scrollController = ScrollController() ..addListener(() { if (_scrollController.position.atEdge && _scrollController.position.pixels != 0) { @@ -57,81 +54,6 @@ class _PetsHistoryScreenState extends State with TickerProvid super.dispose(); } - @override - Widget build(BuildContext context) { - double limitedBodyTextSize = LimitedFontSizeUtil.getBodyFontSize(context); - double limitedHeaderTextSize = LimitedFontSizeUtil.getHeaderFontSize(context); - - return Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - if (_hasData == false && _pageNumber <= 1 && _loading == false) - Expanded( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - mainAxisSize: MainAxisSize.max, - children: [ - Center( - child: Text(FFLocalizations.of(context).getVariableText( - ptText: "Nenhum Pet encontrado!", - enText: "No pets found"), - style: TextStyle( - fontFamily: 'Nunito', - fontSize: limitedHeaderTextSize,) - ), - ) - ], - ), - ) - else if (_hasData == true || _pageNumber >= 1) - Expanded( - child: FutureBuilder( - future: _petsFuture, - builder: (context, snapshot) { - return ListView.builder( - shrinkWrap: true, - physics: const BouncingScrollPhysics(), - controller: _scrollController, - itemCount: _petsWrap.length + 1, - itemBuilder: (context, index) { - if (index == 0) { - // Add your item here - return Padding( - padding: const EdgeInsets.only(right: 30, top: 10), - child: Text( - widget.model?.petAmountRegister == '0' - ? FFLocalizations.of(context).getVariableText(ptText: "Ilimitado", enText: "Unlimited") - : "${FFLocalizations.of(context).getVariableText(ptText: "Quantidade de Pets: ", enText: "Amount of Pets: ")}$count/${widget.model?.petAmountRegister}", - textAlign: TextAlign.right, - style: TextStyle( - fontFamily: 'Nunito', - fontSize: limitedBodyTextSize, - ), - ), - ); - } else { - final item = _petsWrap[index - 1]; - return _item(context, item); - } - }); - }, - )), - if (_hasData == true && _loading == true) - Container( - padding: const EdgeInsets.only(top: 15, bottom: 15), - child: Center( - child: CircularProgressIndicator( - valueColor: AlwaysStoppedAnimation( - FlutterFlowTheme.of(context).primary, - ), - ), - ), - ) - ].addToStart(const SizedBox(height: 0)), - ); - } - PreferredSizeWidget _appBar(BuildContext context) { return AppBar( backgroundColor: FlutterFlowTheme.of(context).primaryBackground, @@ -234,76 +156,80 @@ class _PetsHistoryScreenState extends State with TickerProvid @override Widget build(BuildContext context) { - double limitedBodyTextSize = LimitedFontSizeUtil.getBodyFontSize(context); - double limitedHeaderTextSize = LimitedFontSizeUtil.getHeaderFontSize(context); + late final double limitedBodyTextSize = LimitedFontSizeUtil.getBodyFontSize(context); + late final double limitedHeaderTextSize = LimitedFontSizeUtil.getHeaderFontSize(context); - return Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - if (_hasData == false && _pageNumber <= 1 && _loading == false) - Expanded( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - mainAxisSize: MainAxisSize.max, - children: [ - Center( - child: Text( - FFLocalizations.of(context) - .getVariableText(ptText: "Nenhum Pet encontrado!", enText: "No pets found"), - style: TextStyle( - fontFamily: 'Nunito', - fontSize: limitedHeaderTextSize, - )), - ) - ], - ), - ) - else if (_hasData == true || _pageNumber >= 1) - Expanded( - child: FutureBuilder( - future: _petsFuture, - builder: (context, snapshot) { - return ListView.builder( - shrinkWrap: true, - physics: const BouncingScrollPhysics(), - controller: _scrollController, - itemCount: _petsWrap.length + 1, - itemBuilder: (context, index) { - if (index == 0) { - // Add your item here - return Padding( - padding: const EdgeInsets.only(right: 30, top: 10), - child: Text( - widget.model.petAmountRegister == '0' - ? FFLocalizations.of(context).getVariableText(ptText: "Ilimitado", enText: "Unlimited") - : "${FFLocalizations.of(context).getVariableText(ptText: "Quantidade de Pets: ", enText: "Amount of Pets: ")}$count/${widget.model.petAmountRegister}", - textAlign: TextAlign.right, - style: TextStyle( - fontFamily: 'Nunito', - fontSize: limitedBodyTextSize, + return Scaffold( + appBar: widget.isApp ? _appBar(context) : null, + backgroundColor: FlutterFlowTheme.of(context).primaryBackground, + body: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + if (_hasData == false && _pageNumber <= 1 && _loading == false) + Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + mainAxisSize: MainAxisSize.max, + children: [ + Center( + child: Text( + FFLocalizations.of(context) + .getVariableText(ptText: "Nenhum Pet encontrado!", enText: "No pets found"), + style: TextStyle( + fontFamily: 'Nunito', + fontSize: limitedHeaderTextSize, + )), + ) + ], + ), + ) + else if (_hasData == true || _pageNumber >= 1) + Expanded( + child: FutureBuilder( + future: _petsFuture, + builder: (context, snapshot) { + return ListView.builder( + shrinkWrap: true, + physics: const BouncingScrollPhysics(), + controller: _scrollController, + itemCount: _petsWrap.length + 1, + itemBuilder: (context, index) { + if (index == 0) { + // Add your item here + return Padding( + padding: const EdgeInsets.only(right: 30, top: 10), + child: Text( + model.petAmountRegister == '0' + ? FFLocalizations.of(context).getVariableText(ptText: "Ilimitado", enText: "Unlimited") + : "${FFLocalizations.of(context).getVariableText(ptText: "Quantidade de Pets: ", enText: "Amount of Pets: ")}$count/${model.petAmountRegister}", + textAlign: TextAlign.right, + style: TextStyle( + fontFamily: 'Nunito', + fontSize: limitedBodyTextSize, + ), ), - ), - ); - } else { - final item = _petsWrap[index - 1]; - return _item(context, item); - } - }); - }, - )), - if (_hasData == true && _loading == true) - Container( - padding: const EdgeInsets.only(top: 15, bottom: 15), - child: Center( - child: CircularProgressIndicator( - valueColor: AlwaysStoppedAnimation( - FlutterFlowTheme.of(context).primary, + ); + } else { + final item = _petsWrap[index - 1]; + return _item(context, item); + } + }); + }, + )), + if (_hasData == true && _loading == true) + Container( + padding: const EdgeInsets.only(top: 15, bottom: 15), + child: Center( + child: CircularProgressIndicator( + valueColor: AlwaysStoppedAnimation( + FlutterFlowTheme.of(context).primary, + ), ), ), - ), - ) - ].addToStart(const SizedBox(height: 0)), + ) + ].addToStart(const SizedBox(height: 0)), + ), ); } diff --git a/lib/pages/pets_page/pets_page_model.dart b/lib/pages/pets_page/pets_page_model.dart index 7746b489..fd099522 100644 --- a/lib/pages/pets_page/pets_page_model.dart +++ b/lib/pages/pets_page/pets_page_model.dart @@ -28,7 +28,7 @@ class PetsPageModel extends FlutterFlowModel { late final String devUUID; late final String userUUID; late final String cliUUID; - late String petAmountRegister; + late String petAmountRegister = '0'; dynamic item; late final TabController tabBarController; @@ -111,13 +111,14 @@ class PetsPageModel extends FlutterFlowModel { devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? ''; userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? ''; cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? ''; - petAmountRegister = (await StorageHelper().get(SQLiteStorageKey.petAmount.value, Storage.SQLiteStorage)) ?? ''; + petAmountRegister = await StorageHelper().get(SQLiteStorageKey.petAmount.value, Storage.SQLiteStorage) ?? '0'; safeSetState?.call(); } @override void initState(BuildContext context) { + initAsync(); resetInstance(); tabBarController = TabController( vsync: Navigator.of(context), @@ -145,8 +146,6 @@ class PetsPageModel extends FlutterFlowModel { dropDownValueController1 = FormFieldController(dropDownValue1 ??= 'Selecione uma opção'); dropDownValueController2 = FormFieldController(dropDownValue2 ??= 'Selecione uma opção'); - - initAsync(); } @override @@ -175,7 +174,6 @@ class PetsPageModel extends FlutterFlowModel { dropDownValueController2?.dispose(); } - void setEditForm() { log('item: $item'); @@ -395,29 +393,29 @@ class PetsPageModel extends FlutterFlowModel { onPressed: () async { context.pop(); - model.isEditing = true; - model.item = item; - model.switchTab(0); - model.setEditForm(); - // model.safeSetState!(); - }, - options: FFButtonOptions( - width: 100, - height: 40, - color: FlutterFlowTheme.of(context).primaryBackground, - elevation: 0, - textStyle: TextStyle( - color: FlutterFlowTheme.of(context).primaryText, - fontSize: LimitedFontSizeUtil.getNoResizeFont(context, 15), - ), - splashColor: const Color.fromARGB(95, 0, 146, 5), - borderSide: BorderSide( + model.isEditing = true; + model.item = item; + model.switchTab(0); + model.setEditForm(); + // model.safeSetState!(); + }, + options: FFButtonOptions( + width: 100, + height: 40, color: FlutterFlowTheme.of(context).primaryBackground, - width: 1, + elevation: 0, + textStyle: TextStyle( + color: FlutterFlowTheme.of(context).primaryText, + fontSize: LimitedFontSizeUtil.getNoResizeFont(context, 15), + ), + splashColor: const Color.fromARGB(95, 0, 146, 5), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primaryBackground, + width: 1, + ), + // borderRadius: 12, ), - // borderRadius: 12, ), - ), // DELETE ACTION if (isInteractive) @@ -448,55 +446,55 @@ class PetsPageModel extends FlutterFlowModel { context.pop(value); context.pop(value); - if (value == false) { + if (value == false) { + showSnackbar( + context, + FFLocalizations.of(context).getVariableText( + ptText: 'Erro ao excluir pet', + enText: 'Error deleting pet', + ), + true, + ); + } else if (value == true) { + showSnackbar( + context, + FFLocalizations.of(context).getVariableText( + enText: 'Success deleting pet', + ptText: 'Succeso ao excluir pet', + ), + false, + ); + } + }).catchError((err, stack) { + context.pop(); showSnackbar( context, FFLocalizations.of(context).getVariableText( - ptText: 'Erro ao excluir pet', enText: 'Error deleting pet', + ptText: 'Erro ao excluir pet', ), true, ); - } else if (value == true) { - showSnackbar( - context, - FFLocalizations.of(context).getVariableText( - enText: 'Success deleting pet', - ptText: 'Succeso ao excluir pet', - ), - false, - ); - } - }).catchError((err, stack) { - context.pop(); - showSnackbar( - context, - FFLocalizations.of(context).getVariableText( - enText: 'Error deleting pet', - ptText: 'Erro ao excluir pet', - ), - true, - ); + }); }); - }); - }, - options: FFButtonOptions( - width: 100, - height: 40, - color: FlutterFlowTheme.of(context).primaryBackground, - elevation: 0, - textStyle: TextStyle( - color: FlutterFlowTheme.of(context).primaryText, - fontSize: LimitedFontSizeUtil.getNoResizeFont(context, 15), - ), - splashColor: const Color.fromARGB(131, 255, 17, 0), - borderSide: BorderSide( + }, + options: FFButtonOptions( + width: 100, + height: 40, color: FlutterFlowTheme.of(context).primaryBackground, - width: 1, + elevation: 0, + textStyle: TextStyle( + color: FlutterFlowTheme.of(context).primaryText, + fontSize: LimitedFontSizeUtil.getNoResizeFont(context, 15), + ), + splashColor: const Color.fromARGB(131, 255, 17, 0), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primaryBackground, + width: 1, + ), + // borderRadius: 12, ), - // borderRadius: 12, ), - ), ], // 'MIN', 'PEQ', 'MED', 'GRA', 'GIG' labelsHashMap: Map.from({ diff --git a/lib/pages/reception_page/reception_page_widget.dart b/lib/pages/reception_page/reception_page_widget.dart index 1bdc0f2a..77d4c65f 100644 --- a/lib/pages/reception_page/reception_page_widget.dart +++ b/lib/pages/reception_page/reception_page_widget.dart @@ -9,9 +9,7 @@ import 'package:hub/components/atomic_components/shared_components_atoms/atom_im import 'package:hub/flutter_flow/flutter_flow_theme.dart'; import 'package:hub/flutter_flow/flutter_flow_util.dart'; import 'package:hub/flutter_flow/flutter_flow_widgets.dart'; -import 'package:hub/flutter_flow/nav/nav.dart'; import 'package:hub/pages/reception_page/reception_page_model.dart'; -import 'package:hub/shared/helpers/base_storage.dart'; import 'package:hub/shared/helpers/storage_helper.dart'; import 'package:hub/shared/services/authentication/authentication_service.dart'; import 'package:hub/shared/services/localization/localization_service.dart'; 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 e8635cd9..7b8dc738 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 @@ -1,4 +1,3 @@ -import 'package:auto_size_text/auto_size_text.dart'; import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; @@ -751,12 +750,10 @@ class _ScheduleCompleteVisitPageWidgetState extends State(); model.visitorJsonList = visitorsParam!.toList().cast(); safeSetState(() {}); }, getDocs: (docsParam) async { - model.visitorStrList = strListToStr(docsParam!.toList()); model.visitorStrList = strListToStr(docsParam!.toList()); safeSetState(() {}); }, diff --git a/lib/pages/vehicles_on_the_property/vehicles_on_the_property.dart b/lib/pages/vehicles_on_the_property/vehicles_on_the_property.dart index 6b4b8afc..263eb263 100644 --- a/lib/pages/vehicles_on_the_property/vehicles_on_the_property.dart +++ b/lib/pages/vehicles_on_the_property/vehicles_on_the_property.dart @@ -7,6 +7,7 @@ import 'package:hub/flutter_flow/flutter_flow_theme.dart'; import 'package:hub/flutter_flow/flutter_flow_util.dart'; import 'package:hub/pages/vehicles_on_the_property/vehicle_model.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'; class VehicleOnTheProperty extends StatefulWidget { @@ -33,7 +34,6 @@ class _VehicleOnThePropertyState extends State with Ticker super.initState(); model = createModel(context, () => VehicleModel()); _future = _fetchVisits(); - _scrollController = ScrollController() ..addListener(() { if (_scrollController.position.atEdge && _scrollController.position.pixels != 0) { @@ -49,67 +49,79 @@ class _VehicleOnThePropertyState extends State with Ticker } @override - Widget build(BuildContext context) => Scaffold( - backgroundColor: FlutterFlowTheme.of(context).primaryBackground, - appBar: _appBar(context), - body: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - if (_hasData == false && _pageNumber <= 1 && _loading == false) - Expanded( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - mainAxisSize: MainAxisSize.max, - children: [ - Center( - child: Text(FFLocalizations.of(context) - .getVariableText(ptText: "Nenhum veículo encontrado!", enText: "No vehicle found")), - ) - ], - ), - ) - else if (_hasData == true || _pageNumber >= 1) - Expanded( - child: FutureBuilder( - future: _future, - builder: (context, snapshot) { - return ListView.builder( - shrinkWrap: true, - physics: const BouncingScrollPhysics(), - controller: _scrollController, - itemCount: _wrap.length + 1, - itemBuilder: (context, index) { - if (index == 0) { - // Add your item here - return Padding( - padding: const EdgeInsets.only(right: 30, top: 10), - child: Text( - '', - textAlign: TextAlign.right, - ), - ); - } else { - final item = _wrap[index - 1]; - return _item(context, item); - } - }); - }, - )), - if (_hasData == true && _loading == true) - Container( - padding: const EdgeInsets.only(top: 15, bottom: 15), - child: Center( - child: CircularProgressIndicator( - valueColor: AlwaysStoppedAnimation( - FlutterFlowTheme.of(context).primary, + Widget build(BuildContext context) { + late final limitedHeaderTextSize = LimitedFontSizeUtil.getHeaderFontSize(context); + + return Scaffold( + backgroundColor: FlutterFlowTheme.of(context).primaryBackground, + appBar: _appBar(context), + body: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + if (_hasData == false && _pageNumber <= 1 && _loading == false) + Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + mainAxisSize: MainAxisSize.max, + children: [ + Center( + child: Text( + FFLocalizations.of(context).getVariableText( + ptText: "Nenhum veículo encontrado!", + enText: "No vehicle found", + ), + style: TextStyle( + fontFamily: 'Nunito', + fontSize: limitedHeaderTextSize, + ), ), + ) + ], + ), + ) + else if (_hasData == true || _pageNumber >= 1) + Expanded( + child: FutureBuilder( + future: _future, + builder: (context, snapshot) { + return ListView.builder( + shrinkWrap: true, + physics: const BouncingScrollPhysics(), + controller: _scrollController, + itemCount: _wrap.length + 1, + itemBuilder: (context, index) { + if (index == 0) { + // Add your item here + return Padding( + padding: const EdgeInsets.only(right: 30, top: 10), + child: Text( + '', + textAlign: TextAlign.right, + ), + ); + } else { + final item = _wrap[index - 1]; + return _item(context, item); + } + }); + }, + )), + if (_hasData == true && _loading == true) + Container( + padding: const EdgeInsets.only(top: 15, bottom: 15), + child: Center( + child: CircularProgressIndicator( + valueColor: AlwaysStoppedAnimation( + FlutterFlowTheme.of(context).primary, ), ), - ) - ].addToStart(const SizedBox(height: 0)), - ), - ); + ), + ) + ].addToStart(const SizedBox(height: 0)), + ), + ); + } PreferredSizeWidget _appBar(BuildContext context) { return AppBar( @@ -195,8 +207,16 @@ class _VehicleOnThePropertyState extends State with Ticker void _showNoMoreDataSnackBar(BuildContext context) { ScaffoldMessenger.of(context).showSnackBar( SnackBar( - content: - Text(FFLocalizations.of(context).getVariableText(ptText: "Não há mais dados.", enText: "No more data.")), + content: Text( + FFLocalizations.of(context).getVariableText( + ptText: "Não há mais dados.", + enText: "No more data.", + ), + style: TextStyle( + color: Colors.white, + fontSize: LimitedFontSizeUtil.getBodyFontSize(context), + ), + ), duration: const Duration(seconds: 3), backgroundColor: FlutterFlowTheme.of(context).primary, ), diff --git a/lib/pages/visits_on_the_property/model.dart b/lib/pages/visits_on_the_property/model.dart index 455b44cd..5b4db026 100644 --- a/lib/pages/visits_on_the_property/model.dart +++ b/lib/pages/visits_on_the_property/model.dart @@ -1,5 +1,4 @@ import 'package:flutter/material.dart'; -import 'package:hub/backend/api_requests/api_manager.dart'; import 'package:hub/components/templates_components/details_component/details_component_widget.dart'; import 'package:hub/flutter_flow/flutter_flow_model.dart'; import 'package:hub/flutter_flow/flutter_flow_theme.dart'; diff --git a/lib/pages/visits_on_the_property/visits_on_the_property_screen.dart b/lib/pages/visits_on_the_property/visits_on_the_property_screen.dart index 477a5958..7fe9ca0d 100644 --- a/lib/pages/visits_on_the_property/visits_on_the_property_screen.dart +++ b/lib/pages/visits_on_the_property/visits_on_the_property_screen.dart @@ -8,6 +8,7 @@ import 'package:hub/flutter_flow/flutter_flow_util.dart'; import 'package:hub/pages/visits_on_the_property/model.dart'; import 'package:hub/shared/utils/dialog_util.dart'; import 'package:hub/shared/utils/log_util.dart'; +import 'package:hub/shared/utils/limited_text_size.dart'; class VisitsOnTheProperty extends StatefulWidget { const VisitsOnTheProperty({super.key}); @@ -31,7 +32,7 @@ class _VisitsOnThePropertyState extends State with TickerPr @override void initState() { super.initState(); - model = createModel(context, () => VisitsModel(onRefresh: () => safeSetState((){}))); + model = createModel(context, () => VisitsModel(onRefresh: () => safeSetState(() {}))); _future = _fetchVisits(); _scrollController = ScrollController() @@ -49,67 +50,78 @@ class _VisitsOnThePropertyState extends State with TickerPr } @override - Widget build(BuildContext context) => Scaffold( - appBar: _appBar(context), - backgroundColor: FlutterFlowTheme.of(context).primaryBackground, - body: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - if (_hasData == false && _pageNumber <= 1 && _loading == false) - Expanded( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - mainAxisSize: MainAxisSize.max, - children: [ - Center( - child: Text(FFLocalizations.of(context).getVariableText( - ptText: "Nenhuma visita em aberto encontrada!", enText: "No opened visits found")), - ) - ], - ), - ) - else if (_hasData == true || _pageNumber >= 1) - Expanded( - child: FutureBuilder( - future: _future, - builder: (context, snapshot) { - return ListView.builder( - shrinkWrap: true, - physics: const BouncingScrollPhysics(), - controller: _scrollController, - itemCount: _list.length + 1, - itemBuilder: (context, index) { - if (index == 0) { - // Add your item here - return Padding( - padding: const EdgeInsets.only(right: 30, top: 10), - child: Text( - '', - textAlign: TextAlign.right, - ), - ); - } else { - final item = _list[index - 1]; - return _item(context, item); - } - }); - }, - )), - if (_hasData == true && _loading == true) - Container( - padding: const EdgeInsets.only(top: 15, bottom: 15), - child: Center( - child: CircularProgressIndicator( - valueColor: AlwaysStoppedAnimation( - FlutterFlowTheme.of(context).primary, + Widget build(BuildContext context) { + late final limitedBodyTextSize = LimitedFontSizeUtil.getBodyFontSize(context); + late final limitedHeaderTextSize = LimitedFontSizeUtil.getHeaderFontSize(context); + + return Scaffold( + appBar: _appBar(context), + backgroundColor: FlutterFlowTheme.of(context).primaryBackground, + body: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + if (_hasData == false && _pageNumber <= 1 && _loading == false) + Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + mainAxisSize: MainAxisSize.max, + children: [ + Center( + child: Text( + FFLocalizations.of(context).getVariableText( + ptText: "Nenhuma visita em aberto encontrada!", enText: "No opened visits found"), + style: TextStyle( + fontFamily: 'Nunito', + fontSize: limitedHeaderTextSize, + ), ), + ) + ], + ), + ) + else if (_hasData == true || _pageNumber >= 1) + Expanded( + child: FutureBuilder( + future: _future, + builder: (context, snapshot) { + return ListView.builder( + shrinkWrap: true, + physics: const BouncingScrollPhysics(), + controller: _scrollController, + itemCount: _list.length + 1, + itemBuilder: (context, index) { + if (index == 0) { + // Add your item here + return Padding( + padding: const EdgeInsets.only(right: 30, top: 10), + child: Text( + '', + textAlign: TextAlign.right, + ), + ); + } else { + final item = _list[index - 1]; + return _item(context, item); + } + }); + }, + )), + if (_hasData == true && _loading == true) + Container( + padding: const EdgeInsets.only(top: 15, bottom: 15), + child: Center( + child: CircularProgressIndicator( + valueColor: AlwaysStoppedAnimation( + FlutterFlowTheme.of(context).primary, ), ), - ) - ].addToStart(const SizedBox(height: 0)), - ), - ); + ), + ) + ].addToStart(const SizedBox(height: 0)), + ), + ); + } PreferredSizeWidget _appBar(BuildContext context) { return AppBar( @@ -195,8 +207,13 @@ class _VisitsOnThePropertyState extends State with TickerPr void _showNoMoreDataSnackBar(BuildContext context) { ScaffoldMessenger.of(context).showSnackBar( SnackBar( - content: - Text(FFLocalizations.of(context).getVariableText(ptText: "Não há mais dados.", enText: "No more data.")), + content: Text( + FFLocalizations.of(context).getVariableText(ptText: "Não há mais dados.", enText: "No more data."), + style: TextStyle( + color: Colors.white, + fontSize: LimitedFontSizeUtil.getBodyFontSize(context), + ), + ), duration: const Duration(seconds: 3), backgroundColor: FlutterFlowTheme.of(context).primary, ), diff --git a/lib/shared/helpers/secure_storage.dart b/lib/shared/helpers/secure_storage.dart index 0313b583..b1ac5cf0 100644 --- a/lib/shared/helpers/secure_storage.dart +++ b/lib/shared/helpers/secure_storage.dart @@ -1,4 +1,3 @@ -import 'package:flutter/material.dart'; import 'package:flutter_secure_storage/flutter_secure_storage.dart'; import 'package:hub/shared/helpers/base_storage.dart'; diff --git a/lib/shared/helpers/shared_preferences_storage.dart b/lib/shared/helpers/shared_preferences_storage.dart index c7d10cd5..e419a570 100644 --- a/lib/shared/helpers/shared_preferences_storage.dart +++ b/lib/shared/helpers/shared_preferences_storage.dart @@ -1,4 +1,3 @@ -import 'package:flutter/material.dart'; import 'package:hub/shared/helpers/base_storage.dart'; import 'package:shared_preferences/shared_preferences.dart';