fix: responsividade dos botões do pet
This commit is contained in:
parent
58911fcfbf
commit
768dd3a7ae
|
@ -242,6 +242,7 @@ class _DetailsComponentWidgetState extends State<DetailsComponentWidget> {
|
||||||
if (widget.buttons.isNotEmpty) // Adicione este SizedBox com a altura desejada
|
if (widget.buttons.isNotEmpty) // Adicione este SizedBox com a altura desejada
|
||||||
OverflowBar(
|
OverflowBar(
|
||||||
overflowAlignment: OverflowBarAlignment.center,
|
overflowAlignment: OverflowBarAlignment.center,
|
||||||
|
alignment: MainAxisAlignment.center,
|
||||||
overflowSpacing: 2,
|
overflowSpacing: 2,
|
||||||
spacing: 2,
|
spacing: 2,
|
||||||
// mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
// mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
|
|
|
@ -12,6 +12,7 @@ import 'package:hub/pages/liberation_history/liberation_history_model.dart';
|
||||||
import 'package:hub/shared/utils/dialog_util.dart';
|
import 'package:hub/shared/utils/dialog_util.dart';
|
||||||
import 'package:hub/shared/utils/limited_text_size.dart';
|
import 'package:hub/shared/utils/limited_text_size.dart';
|
||||||
import 'package:hub/shared/utils/log_util.dart';
|
import 'package:hub/shared/utils/log_util.dart';
|
||||||
|
import 'package:hub/shared/utils/snackbar_util.dart';
|
||||||
import 'package:hub/shared/utils/validator_util.dart';
|
import 'package:hub/shared/utils/validator_util.dart';
|
||||||
|
|
||||||
class LiberationHistoryWidget extends StatefulWidget {
|
class LiberationHistoryWidget extends StatefulWidget {
|
||||||
|
@ -219,7 +220,7 @@ class _LiberationHistoryWidgetState extends State<LiberationHistoryWidget> {
|
||||||
),
|
),
|
||||||
icon: const Icon(Icons.done),
|
icon: const Icon(Icons.done),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
_model.answersRequest
|
await _model.answersRequest
|
||||||
.call(
|
.call(
|
||||||
context: context,
|
context: context,
|
||||||
ref: liberationHistoryItem['NOT_ID'].toString(),
|
ref: liberationHistoryItem['NOT_ID'].toString(),
|
||||||
|
@ -229,26 +230,31 @@ class _LiberationHistoryWidgetState extends State<LiberationHistoryWidget> {
|
||||||
)
|
)
|
||||||
.then((value) {
|
.then((value) {
|
||||||
if (value) {
|
if (value) {
|
||||||
showSnackbar(
|
safeSetState(() {
|
||||||
context,
|
_requestWrap = [];
|
||||||
FFLocalizations.of(context).getVariableText(
|
_requestFuture = _fetchRequests();
|
||||||
enText: 'Successfully resolved visit', ptText: 'Visita resolvida com sucesso'),
|
});
|
||||||
false);
|
|
||||||
} else {
|
|
||||||
showSnackbar(
|
|
||||||
context,
|
|
||||||
FFLocalizations.of(context).getVariableText(
|
|
||||||
enText: 'Error resolving visit', ptText: 'Erro ao resolver visita'),
|
|
||||||
true);
|
|
||||||
}
|
|
||||||
}).whenComplete(() {
|
|
||||||
safeSetState(() {
|
|
||||||
_requestWrap = [];
|
|
||||||
_requestFuture = _fetchRequests();
|
|
||||||
});
|
|
||||||
|
|
||||||
context.pop();
|
context.pop();
|
||||||
});
|
SnackBarUtil.showSnackBar(
|
||||||
|
context,
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'Successfully resolved visit',
|
||||||
|
ptText: 'Visita resolvida com sucesso',
|
||||||
|
),
|
||||||
|
isError: false,
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
SnackBarUtil.showSnackBar(
|
||||||
|
context,
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'Error resolving visit',
|
||||||
|
ptText: 'Erro ao resolver visita',
|
||||||
|
),
|
||||||
|
isError: true,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}).whenComplete(() {});
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
if (liberationHistoryItem['NOT_STATUS'] == 'S')
|
if (liberationHistoryItem['NOT_STATUS'] == 'S')
|
||||||
|
@ -268,7 +274,7 @@ class _LiberationHistoryWidgetState extends State<LiberationHistoryWidget> {
|
||||||
),
|
),
|
||||||
icon: const Icon(Icons.close),
|
icon: const Icon(Icons.close),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
return _model.answersRequest
|
await _model.answersRequest
|
||||||
.call(
|
.call(
|
||||||
context: context,
|
context: context,
|
||||||
ref: liberationHistoryItem['NOT_ID'].toString(),
|
ref: liberationHistoryItem['NOT_ID'].toString(),
|
||||||
|
@ -277,23 +283,24 @@ class _LiberationHistoryWidgetState extends State<LiberationHistoryWidget> {
|
||||||
id: liberationHistoryItem['VTE_ID'].toString(),
|
id: liberationHistoryItem['VTE_ID'].toString(),
|
||||||
)
|
)
|
||||||
.then((message) {
|
.then((message) {
|
||||||
if (message.isEmpty) {
|
|
||||||
showSnackbar(
|
|
||||||
context,
|
|
||||||
FFLocalizations.of(context).getVariableText(
|
|
||||||
enText: 'Successfully resolved visit', ptText: 'Visita resolvida com sucesso'),
|
|
||||||
false);
|
|
||||||
} else {
|
|
||||||
showSnackbar(context, message, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
safeSetState(() {
|
safeSetState(() {
|
||||||
_requestWrap = [];
|
_requestWrap = [];
|
||||||
_requestFuture = _fetchRequests();
|
_requestFuture = _fetchRequests();
|
||||||
});
|
});
|
||||||
|
|
||||||
context.pop();
|
context.pop();
|
||||||
});
|
if (message == null || message == '') {
|
||||||
|
showSnackbar(
|
||||||
|
context,
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'Successfully resolved visit',
|
||||||
|
ptText: 'Visita resolvida com sucesso',
|
||||||
|
),
|
||||||
|
false,
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
showSnackbar(context, message, true);
|
||||||
|
}
|
||||||
|
}).whenComplete(() {});
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
|
|
|
@ -411,7 +411,6 @@ class PetsPageModel extends FlutterFlowModel<PetsPageWidget> {
|
||||||
// model.safeSetState!();
|
// model.safeSetState!();
|
||||||
},
|
},
|
||||||
options: FFButtonOptions(
|
options: FFButtonOptions(
|
||||||
width: 100,
|
|
||||||
height: 40,
|
height: 40,
|
||||||
color: FlutterFlowTheme.of(context).primaryBackground,
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
|
@ -489,7 +488,6 @@ class PetsPageModel extends FlutterFlowModel<PetsPageWidget> {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
options: FFButtonOptions(
|
options: FFButtonOptions(
|
||||||
width: 100,
|
|
||||||
height: 40,
|
height: 40,
|
||||||
color: FlutterFlowTheme.of(context).primaryBackground,
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
|
|
Loading…
Reference in New Issue