fix: alteracoes solicitadas pelo Daniel dia 11/13/2024
This commit is contained in:
parent
44e9e736a3
commit
29c246fe03
|
@ -133,7 +133,7 @@ class MenuComponentModel extends FlutterFlowModel<MenuComponentWidget> {
|
|||
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
|
||||
|
|
|
@ -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<CardItemTemplateCompon
|
|||
return Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
_generateImage(),
|
||||
if (widget.imagePath != null) _generateImage(),
|
||||
Container(
|
||||
padding: const EdgeInsets.all(8),
|
||||
child: Column(
|
||||
|
|
|
@ -22,7 +22,7 @@ class DetailsComponentWidget extends StatefulWidget {
|
|||
final List<Map<String, Color>?> statusHashMap;
|
||||
final String? imagePath;
|
||||
final Future Function()? onTapCardItemAction;
|
||||
final List<Widget> buttons;
|
||||
final List<Widget>? buttons;
|
||||
|
||||
@override
|
||||
State<DetailsComponentWidget> createState() => _DetailsComponentWidgetState();
|
||||
|
@ -75,7 +75,7 @@ class _DetailsComponentWidgetState extends State<DetailsComponentWidget> {
|
|||
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<DetailsComponentWidget> {
|
|||
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<DetailsComponentWidget> {
|
|||
},
|
||||
),
|
||||
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),
|
||||
],
|
||||
|
|
|
@ -280,7 +280,7 @@ class _AppState extends State<App> with WidgetsBindingObserver {
|
|||
if (state == AppLifecycleState.detached) {
|
||||
await LocalizationService.processLocals(context);
|
||||
FirebaseMessagingService().updateDeviceToken();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
|
@ -59,14 +59,16 @@ class _AboutPropertyPageState extends State<AboutPropertyPage> 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),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
|
|
@ -36,11 +36,11 @@ class _PackageOrderPage extends State<PackageOrderPage> {
|
|||
List<dynamic> _orderList = [];
|
||||
|
||||
final Map<String, String> filter = {
|
||||
'adresseeType': '.*',
|
||||
'adresseeType': 'PRO',
|
||||
'status': 'notPickedUp',
|
||||
};
|
||||
|
||||
String _adresseeType = '.*';
|
||||
String _adresseeType = 'PRO';
|
||||
String _status = 'notPickedUp';
|
||||
|
||||
late BehaviorSubject<Map<String, String>> _selectedTypeSubject;
|
||||
|
@ -224,7 +224,7 @@ class _PackageOrderPage extends State<PackageOrderPage> {
|
|||
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,
|
||||
|
|
|
@ -38,7 +38,7 @@ class _PetsHistoryScreenState extends State<PetsHistoryScreen> 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(() {
|
||||
|
|
|
@ -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<PetsPageWidget> {
|
||||
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<PetsPageWidget> {
|
|||
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<String, String>.from({
|
||||
if (item['species'] != null && item['species'] != '')
|
||||
'${FFLocalizations.of(context).getVariableText(ptText: "Espécie", enText: "Species")}:':
|
||||
|
|
|
@ -34,7 +34,7 @@ class _PetsPageWidgetState extends State<PetsPageWidget> with SingleTickerProvid
|
|||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_model = createModel(context, () => PetsPageModel());
|
||||
_model = createModel(context, () => PetsPageModel(isInteractive: true));
|
||||
|
||||
_model.updateOnChange = true;
|
||||
|
||||
|
|
|
@ -127,7 +127,7 @@ class _VisitsOnThePropertyState extends State<VisitsOnTheProperty> 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,
|
||||
|
|
Loading…
Reference in New Issue