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 bb46b0c1..299e47d4 100644 --- a/lib/components/organism_components/menu_component/menu_component_model.dart +++ b/lib/components/organism_components/menu_component/menu_component_model.dart @@ -133,7 +133,7 @@ class MenuComponentModel extends FlutterFlowModel { safeSetState; }); if (options.contains(MenuOption.PackagesOnTheProperty)) - addMenuEntry(Icons.inventory_2_outlined, 'My Orders', 'Minhas Encomendas', () async { + addMenuEntry(Icons.inventory_2_outlined, 'Orders', 'Encomendas', () async { if (await StorageHelper().get(SQLiteStorageKey.whatsapp.value, Storage.SQLiteStorage) == 'true') await open(context, '/packageOrder'); else 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 c73c5e20..4814763e 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 @@ -4,6 +4,7 @@ import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:hub/shared/utils/limited_text_size.dart'; +import 'package:material_symbols_icons/symbols.dart'; import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_util.dart'; @@ -182,7 +183,7 @@ class _CardItemTemplateComponentWidgetState extends State?> statusHashMap; final String? imagePath; final Future Function()? onTapCardItemAction; - final List buttons; + final List? buttons; @override State createState() => _DetailsComponentWidgetState(); @@ -75,7 +75,7 @@ class _DetailsComponentWidgetState extends State { mainAxisAlignment: MainAxisAlignment.start, children: [ SizedBox(height: MediaQuery.of(context).size.height * 0.02), - if (widget.imagePath != null) + if (widget.imagePath != null && widget.imagePath != '') Container( width: MediaQuery.of(context).size.width * 0.3, height: MediaQuery.of(context).size.width * 0.3, @@ -86,7 +86,7 @@ class _DetailsComponentWidgetState extends State { child: CachedNetworkImage( fadeInDuration: const Duration(milliseconds: 100), fadeOutDuration: const Duration(milliseconds: 100), - imageUrl: widget.imagePath ?? '', + imageUrl: widget.imagePath!, fit: BoxFit.cover, useOldImageOnUrlChange: true, ), @@ -238,14 +238,14 @@ class _DetailsComponentWidgetState extends State { }, ), SizedBox(height: MediaQuery.of(context).size.height * 0.02), - if (widget.buttons.isNotEmpty) // Adicione este SizedBox com a altura desejada + if (widget.buttons!.isNotEmpty || widget.buttons != null) OverflowBar( overflowAlignment: OverflowBarAlignment.center, alignment: MainAxisAlignment.center, overflowSpacing: 2, spacing: 2, // mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: widget.buttons, + children: widget.buttons!, ), SizedBox(height: MediaQuery.of(context).size.height * 0.02), ], diff --git a/lib/main.dart b/lib/main.dart index 06cb585d..38828b06 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -280,7 +280,7 @@ class _AppState extends State with WidgetsBindingObserver { if (state == AppLifecycleState.detached) { await LocalizationService.processLocals(context); FirebaseMessagingService().updateDeviceToken(); - } + } } @override diff --git a/lib/pages/about_property_page/about_property_screen.dart b/lib/pages/about_property_page/about_property_screen.dart index 335863a1..9a80615a 100644 --- a/lib/pages/about_property_page/about_property_screen.dart +++ b/lib/pages/about_property_page/about_property_screen.dart @@ -59,14 +59,16 @@ class _AboutPropertyPageState extends State with SingleTicker } Widget _buildBody(BuildContext context) { - return Container( - color: FlutterFlowTheme.of(context).primaryBackground, - child: wrapWithModel( - model: _model.menuComponentModel, - updateCallback: () => setState(() {}), - child: Padding( - padding: EdgeInsets.only(bottom: 40), - child: MenuComponentWidget(model: _model.menuComponentModel), + return SingleChildScrollView( + child: Container( + color: FlutterFlowTheme.of(context).primaryBackground, + child: wrapWithModel( + model: _model.menuComponentModel, + updateCallback: () => setState(() {}), + child: Padding( + padding: EdgeInsets.only(bottom: 40), + child: MenuComponentWidget(model: _model.menuComponentModel), + ), ), ), ); diff --git a/lib/pages/package_order_page/package_order_page.dart b/lib/pages/package_order_page/package_order_page.dart index 03d95592..26ba4504 100644 --- a/lib/pages/package_order_page/package_order_page.dart +++ b/lib/pages/package_order_page/package_order_page.dart @@ -36,11 +36,11 @@ class _PackageOrderPage extends State { List _orderList = []; final Map filter = { - 'adresseeType': '.*', + 'adresseeType': 'PRO', 'status': 'notPickedUp', }; - String _adresseeType = '.*'; + String _adresseeType = 'PRO'; String _status = 'notPickedUp'; late BehaviorSubject> _selectedTypeSubject; @@ -224,7 +224,7 @@ class _PackageOrderPage extends State { return AppBar( backgroundColor: FlutterFlowTheme.of(context).primaryBackground, automaticallyImplyLeading: false, - title: Text(FFLocalizations.of(context).getVariableText(enText: 'My Orders', ptText: 'Minhas Encomendas'), + title: Text(FFLocalizations.of(context).getVariableText(enText: 'Orders', ptText: 'Encomendas'), style: FlutterFlowTheme.of(context).headlineMedium.override( fontFamily: 'Nunito', color: FlutterFlowTheme.of(context).primaryText, 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 44771b8d..d2771a97 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 @@ -38,7 +38,7 @@ class _PetsHistoryScreenState extends State with TickerProvid @override void initState() { super.initState(); - model = widget.model ?? createModel(context, () => PetsPageModel()); + model = widget.model ?? createModel(context, () => PetsPageModel(isInteractive: false)); _petsFuture = _fetchVisits(); _scrollController = ScrollController() ..addListener(() { diff --git a/lib/pages/pets_page/pets_page_model.dart b/lib/pages/pets_page/pets_page_model.dart index d0e5b3f5..3bef02ac 100644 --- a/lib/pages/pets_page/pets_page_model.dart +++ b/lib/pages/pets_page/pets_page_model.dart @@ -20,6 +20,11 @@ import 'package:hub/shared/utils/limited_text_size.dart'; import 'package:hub/shared/utils/validator_util.dart'; class PetsPageModel extends FlutterFlowModel { + PetsPageModel({ + required this.isInteractive, + }); + late final bool isInteractive; + late String devUUID = ''; late String userUUID = ''; late String cliUUID = ''; @@ -393,118 +398,116 @@ class PetsPageModel extends FlutterFlowModel { required PetsPageModel model, }) { return DetailsComponentWidget( - buttons: [ - // EDIT ACTION - FFButtonWidget( - text: FFLocalizations.of(context).getVariableText( - ptText: 'Editar', - enText: 'Edit', - ), - icon: const Icon(Icons.edit), - onPressed: () async { - context.pop(); - - model.isEditing = true; - model.item = item; - model.switchTab(0); - model.setEditForm(); - // model.safeSetState!(); - }, - options: FFButtonOptions( - 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( - color: FlutterFlowTheme.of(context).primaryBackground, - width: 1, - ), - // borderRadius: 12, - ), - ), - - // DELETE ACTION - FFButtonWidget( - text: FFLocalizations.of(context).getVariableText( - ptText: 'Excluir', - enText: 'Delete', - ), - icon: const Icon(Icons.close), - onPressed: () async { - showAlertDialog( - context, - FFLocalizations.of(context).getVariableText( - ptText: 'Excluir Pet', - enText: 'Delete Pet', + buttons: isInteractive + ? [ + FFButtonWidget( + text: FFLocalizations.of(context).getVariableText( + ptText: 'Editar', + enText: 'Edit', ), - FFLocalizations.of(context).getVariableText( - ptText: 'Você tem certeza que deseja excluir esse pet?', - enText: 'Are you sure you want to delete this pet?', - ), () async { - int id = item['id']; - await PhpGroup.deletePet - .call( - petID: id, - ) - .then((value) { - // Navigator.pop(context, value); - context.pop(value); - context.pop(value); + icon: const Icon(Icons.edit), + onPressed: () async { + context.pop(); - 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( - enText: 'Error deleting pet', - ptText: 'Erro ao excluir pet', + model.isEditing = true; + model.item = item; + model.switchTab(0); + model.setEditForm(); + // model.safeSetState!(); + }, + options: FFButtonOptions( + height: 40, + color: FlutterFlowTheme.of(context).primaryBackground, + elevation: 0, + textStyle: TextStyle( + color: FlutterFlowTheme.of(context).primaryText, + fontSize: LimitedFontSizeUtil.getNoResizeFont(context, 15), ), - true, - ); - }); - }); - }, - options: FFButtonOptions( - 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( - color: FlutterFlowTheme.of(context).primaryBackground, - width: 1, - ), - // borderRadius: 12, - ), - ), - ], - // 'MIN', 'PEQ', 'MED', 'GRA', 'GIG' + splashColor: const Color.fromARGB(95, 0, 146, 5), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primaryBackground, + width: 1, + ), + // borderRadius: 12, + ), + ), + FFButtonWidget( + text: FFLocalizations.of(context).getVariableText( + ptText: 'Excluir', + enText: 'Delete', + ), + icon: const Icon(Icons.close), + onPressed: () async { + showAlertDialog( + context, + FFLocalizations.of(context).getVariableText( + ptText: 'Excluir Pet', + enText: 'Delete Pet', + ), + FFLocalizations.of(context).getVariableText( + ptText: 'Você tem certeza que deseja excluir esse pet?', + enText: 'Are you sure you want to delete this pet?', + ), () async { + int id = item['id']; + await PhpGroup.deletePet + .call( + petID: id, + ) + .then((value) { + // Navigator.pop(context, value); + context.pop(value); + context.pop(value); + + 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( + enText: 'Error deleting pet', + ptText: 'Erro ao excluir pet', + ), + true, + ); + }); + }); + }, + options: FFButtonOptions( + 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( + color: FlutterFlowTheme.of(context).primaryBackground, + width: 1, + ), + // borderRadius: 12, + ), + ), + ] + : [], labelsHashMap: Map.from({ if (item['species'] != null && item['species'] != '') '${FFLocalizations.of(context).getVariableText(ptText: "Espécie", enText: "Species")}:': diff --git a/lib/pages/pets_page/pets_page_widget.dart b/lib/pages/pets_page/pets_page_widget.dart index a0953d77..4beac680 100644 --- a/lib/pages/pets_page/pets_page_widget.dart +++ b/lib/pages/pets_page/pets_page_widget.dart @@ -34,7 +34,7 @@ class _PetsPageWidgetState extends State with SingleTickerProvid @override void initState() { super.initState(); - _model = createModel(context, () => PetsPageModel()); + _model = createModel(context, () => PetsPageModel(isInteractive: true)); _model.updateOnChange = true; 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 7fe9ca0d..b4a283eb 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 @@ -127,7 +127,7 @@ class _VisitsOnThePropertyState extends State with TickerPr return AppBar( backgroundColor: FlutterFlowTheme.of(context).primaryBackground, automaticallyImplyLeading: false, - title: Text(FFLocalizations.of(context).getVariableText(enText: 'Visitas em aberto', ptText: 'Opened visits'), + title: Text(FFLocalizations.of(context).getVariableText(ptText: 'Visitas em aberto', enText: 'Opened visits'), style: FlutterFlowTheme.of(context).headlineMedium.override( fontFamily: 'Nunito', color: FlutterFlowTheme.of(context).primaryText,