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;
|
safeSetState;
|
||||||
});
|
});
|
||||||
if (options.contains(MenuOption.PackagesOnTheProperty))
|
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')
|
if (await StorageHelper().get(SQLiteStorageKey.whatsapp.value, Storage.SQLiteStorage) == 'true')
|
||||||
await open(context, '/packageOrder');
|
await open(context, '/packageOrder');
|
||||||
else
|
else
|
||||||
|
|
|
@ -4,6 +4,7 @@ import 'package:cached_network_image/cached_network_image.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
import 'package:hub/shared/utils/limited_text_size.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_theme.dart';
|
||||||
import '/flutter_flow/flutter_flow_util.dart';
|
import '/flutter_flow/flutter_flow_util.dart';
|
||||||
|
@ -182,7 +183,7 @@ class _CardItemTemplateComponentWidgetState extends State<CardItemTemplateCompon
|
||||||
return Column(
|
return Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
_generateImage(),
|
if (widget.imagePath != null) _generateImage(),
|
||||||
Container(
|
Container(
|
||||||
padding: const EdgeInsets.all(8),
|
padding: const EdgeInsets.all(8),
|
||||||
child: Column(
|
child: Column(
|
||||||
|
|
|
@ -22,7 +22,7 @@ class DetailsComponentWidget extends StatefulWidget {
|
||||||
final List<Map<String, Color>?> statusHashMap;
|
final List<Map<String, Color>?> statusHashMap;
|
||||||
final String? imagePath;
|
final String? imagePath;
|
||||||
final Future Function()? onTapCardItemAction;
|
final Future Function()? onTapCardItemAction;
|
||||||
final List<Widget> buttons;
|
final List<Widget>? buttons;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<DetailsComponentWidget> createState() => _DetailsComponentWidgetState();
|
State<DetailsComponentWidget> createState() => _DetailsComponentWidgetState();
|
||||||
|
@ -75,7 +75,7 @@ class _DetailsComponentWidgetState extends State<DetailsComponentWidget> {
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
SizedBox(height: MediaQuery.of(context).size.height * 0.02),
|
SizedBox(height: MediaQuery.of(context).size.height * 0.02),
|
||||||
if (widget.imagePath != null)
|
if (widget.imagePath != null && widget.imagePath != '')
|
||||||
Container(
|
Container(
|
||||||
width: MediaQuery.of(context).size.width * 0.3,
|
width: MediaQuery.of(context).size.width * 0.3,
|
||||||
height: 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(
|
child: CachedNetworkImage(
|
||||||
fadeInDuration: const Duration(milliseconds: 100),
|
fadeInDuration: const Duration(milliseconds: 100),
|
||||||
fadeOutDuration: const Duration(milliseconds: 100),
|
fadeOutDuration: const Duration(milliseconds: 100),
|
||||||
imageUrl: widget.imagePath ?? '',
|
imageUrl: widget.imagePath!,
|
||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
useOldImageOnUrlChange: true,
|
useOldImageOnUrlChange: true,
|
||||||
),
|
),
|
||||||
|
@ -238,14 +238,14 @@ class _DetailsComponentWidgetState extends State<DetailsComponentWidget> {
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
SizedBox(height: MediaQuery.of(context).size.height * 0.02),
|
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(
|
OverflowBar(
|
||||||
overflowAlignment: OverflowBarAlignment.center,
|
overflowAlignment: OverflowBarAlignment.center,
|
||||||
alignment: MainAxisAlignment.center,
|
alignment: MainAxisAlignment.center,
|
||||||
overflowSpacing: 2,
|
overflowSpacing: 2,
|
||||||
spacing: 2,
|
spacing: 2,
|
||||||
// mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
// mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
children: widget.buttons,
|
children: widget.buttons!,
|
||||||
),
|
),
|
||||||
SizedBox(height: MediaQuery.of(context).size.height * 0.02),
|
SizedBox(height: MediaQuery.of(context).size.height * 0.02),
|
||||||
],
|
],
|
||||||
|
|
|
@ -280,7 +280,7 @@ class _AppState extends State<App> with WidgetsBindingObserver {
|
||||||
if (state == AppLifecycleState.detached) {
|
if (state == AppLifecycleState.detached) {
|
||||||
await LocalizationService.processLocals(context);
|
await LocalizationService.processLocals(context);
|
||||||
FirebaseMessagingService().updateDeviceToken();
|
FirebaseMessagingService().updateDeviceToken();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -59,14 +59,16 @@ class _AboutPropertyPageState extends State<AboutPropertyPage> with SingleTicker
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildBody(BuildContext context) {
|
Widget _buildBody(BuildContext context) {
|
||||||
return Container(
|
return SingleChildScrollView(
|
||||||
color: FlutterFlowTheme.of(context).primaryBackground,
|
child: Container(
|
||||||
child: wrapWithModel(
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
model: _model.menuComponentModel,
|
child: wrapWithModel(
|
||||||
updateCallback: () => setState(() {}),
|
model: _model.menuComponentModel,
|
||||||
child: Padding(
|
updateCallback: () => setState(() {}),
|
||||||
padding: EdgeInsets.only(bottom: 40),
|
child: Padding(
|
||||||
child: MenuComponentWidget(model: _model.menuComponentModel),
|
padding: EdgeInsets.only(bottom: 40),
|
||||||
|
child: MenuComponentWidget(model: _model.menuComponentModel),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
|
@ -36,11 +36,11 @@ class _PackageOrderPage extends State<PackageOrderPage> {
|
||||||
List<dynamic> _orderList = [];
|
List<dynamic> _orderList = [];
|
||||||
|
|
||||||
final Map<String, String> filter = {
|
final Map<String, String> filter = {
|
||||||
'adresseeType': '.*',
|
'adresseeType': 'PRO',
|
||||||
'status': 'notPickedUp',
|
'status': 'notPickedUp',
|
||||||
};
|
};
|
||||||
|
|
||||||
String _adresseeType = '.*';
|
String _adresseeType = 'PRO';
|
||||||
String _status = 'notPickedUp';
|
String _status = 'notPickedUp';
|
||||||
|
|
||||||
late BehaviorSubject<Map<String, String>> _selectedTypeSubject;
|
late BehaviorSubject<Map<String, String>> _selectedTypeSubject;
|
||||||
|
@ -224,7 +224,7 @@ class _PackageOrderPage extends State<PackageOrderPage> {
|
||||||
return AppBar(
|
return AppBar(
|
||||||
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
automaticallyImplyLeading: false,
|
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(
|
style: FlutterFlowTheme.of(context).headlineMedium.override(
|
||||||
fontFamily: 'Nunito',
|
fontFamily: 'Nunito',
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
|
|
|
@ -38,7 +38,7 @@ class _PetsHistoryScreenState extends State<PetsHistoryScreen> with TickerProvid
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
model = widget.model ?? createModel(context, () => PetsPageModel());
|
model = widget.model ?? createModel(context, () => PetsPageModel(isInteractive: false));
|
||||||
_petsFuture = _fetchVisits();
|
_petsFuture = _fetchVisits();
|
||||||
_scrollController = ScrollController()
|
_scrollController = ScrollController()
|
||||||
..addListener(() {
|
..addListener(() {
|
||||||
|
|
|
@ -20,6 +20,11 @@ import 'package:hub/shared/utils/limited_text_size.dart';
|
||||||
import 'package:hub/shared/utils/validator_util.dart';
|
import 'package:hub/shared/utils/validator_util.dart';
|
||||||
|
|
||||||
class PetsPageModel extends FlutterFlowModel<PetsPageWidget> {
|
class PetsPageModel extends FlutterFlowModel<PetsPageWidget> {
|
||||||
|
PetsPageModel({
|
||||||
|
required this.isInteractive,
|
||||||
|
});
|
||||||
|
late final bool isInteractive;
|
||||||
|
|
||||||
late String devUUID = '';
|
late String devUUID = '';
|
||||||
late String userUUID = '';
|
late String userUUID = '';
|
||||||
late String cliUUID = '';
|
late String cliUUID = '';
|
||||||
|
@ -393,118 +398,116 @@ class PetsPageModel extends FlutterFlowModel<PetsPageWidget> {
|
||||||
required PetsPageModel model,
|
required PetsPageModel model,
|
||||||
}) {
|
}) {
|
||||||
return DetailsComponentWidget(
|
return DetailsComponentWidget(
|
||||||
buttons: [
|
buttons: isInteractive
|
||||||
// EDIT ACTION
|
? [
|
||||||
FFButtonWidget(
|
FFButtonWidget(
|
||||||
text: FFLocalizations.of(context).getVariableText(
|
text: FFLocalizations.of(context).getVariableText(
|
||||||
ptText: 'Editar',
|
ptText: 'Editar',
|
||||||
enText: 'Edit',
|
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',
|
|
||||||
),
|
),
|
||||||
FFLocalizations.of(context).getVariableText(
|
icon: const Icon(Icons.edit),
|
||||||
ptText: 'Você tem certeza que deseja excluir esse pet?',
|
onPressed: () async {
|
||||||
enText: 'Are you sure you want to delete this pet?',
|
context.pop();
|
||||||
), () 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) {
|
model.isEditing = true;
|
||||||
showSnackbar(
|
model.item = item;
|
||||||
context,
|
model.switchTab(0);
|
||||||
FFLocalizations.of(context).getVariableText(
|
model.setEditForm();
|
||||||
ptText: 'Erro ao excluir pet',
|
// model.safeSetState!();
|
||||||
enText: 'Error deleting pet',
|
},
|
||||||
),
|
options: FFButtonOptions(
|
||||||
true,
|
height: 40,
|
||||||
);
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
} else if (value == true) {
|
elevation: 0,
|
||||||
showSnackbar(
|
textStyle: TextStyle(
|
||||||
context,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
FFLocalizations.of(context).getVariableText(
|
fontSize: LimitedFontSizeUtil.getNoResizeFont(context, 15),
|
||||||
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,
|
splashColor: const Color.fromARGB(95, 0, 146, 5),
|
||||||
);
|
borderSide: BorderSide(
|
||||||
});
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
});
|
width: 1,
|
||||||
},
|
),
|
||||||
options: FFButtonOptions(
|
// borderRadius: 12,
|
||||||
height: 40,
|
),
|
||||||
color: FlutterFlowTheme.of(context).primaryBackground,
|
),
|
||||||
elevation: 0,
|
FFButtonWidget(
|
||||||
textStyle: TextStyle(
|
text: FFLocalizations.of(context).getVariableText(
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
ptText: 'Excluir',
|
||||||
fontSize: LimitedFontSizeUtil.getNoResizeFont(context, 15),
|
enText: 'Delete',
|
||||||
),
|
),
|
||||||
splashColor: const Color.fromARGB(131, 255, 17, 0),
|
icon: const Icon(Icons.close),
|
||||||
borderSide: BorderSide(
|
onPressed: () async {
|
||||||
color: FlutterFlowTheme.of(context).primaryBackground,
|
showAlertDialog(
|
||||||
width: 1,
|
context,
|
||||||
),
|
FFLocalizations.of(context).getVariableText(
|
||||||
// borderRadius: 12,
|
ptText: 'Excluir Pet',
|
||||||
),
|
enText: 'Delete Pet',
|
||||||
),
|
),
|
||||||
],
|
FFLocalizations.of(context).getVariableText(
|
||||||
// 'MIN', 'PEQ', 'MED', 'GRA', 'GIG'
|
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({
|
labelsHashMap: Map<String, String>.from({
|
||||||
if (item['species'] != null && item['species'] != '')
|
if (item['species'] != null && item['species'] != '')
|
||||||
'${FFLocalizations.of(context).getVariableText(ptText: "Espécie", enText: "Species")}:':
|
'${FFLocalizations.of(context).getVariableText(ptText: "Espécie", enText: "Species")}:':
|
||||||
|
|
|
@ -34,7 +34,7 @@ class _PetsPageWidgetState extends State<PetsPageWidget> with SingleTickerProvid
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
_model = createModel(context, () => PetsPageModel());
|
_model = createModel(context, () => PetsPageModel(isInteractive: true));
|
||||||
|
|
||||||
_model.updateOnChange = true;
|
_model.updateOnChange = true;
|
||||||
|
|
||||||
|
|
|
@ -127,7 +127,7 @@ class _VisitsOnThePropertyState extends State<VisitsOnTheProperty> with TickerPr
|
||||||
return AppBar(
|
return AppBar(
|
||||||
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
automaticallyImplyLeading: false,
|
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(
|
style: FlutterFlowTheme.of(context).headlineMedium.override(
|
||||||
fontFamily: 'Nunito',
|
fontFamily: 'Nunito',
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
|
|
Loading…
Reference in New Issue