This commit is contained in:
jantunesmessias 2025-02-17 12:08:27 -03:00
parent b9f355cdbf
commit 3a9772558f
1 changed files with 9 additions and 3 deletions

View File

@ -11,7 +11,7 @@ class VehicleHistoryScreen extends StatefulWidget {
class _VehicleHistoryScreenState extends State<VehicleHistoryScreen> class _VehicleHistoryScreenState extends State<VehicleHistoryScreen>
with Pageable { with Pageable {
final apiCall = PhpGroup.getVehiclesByProperty; final apiCall = PhpGroup.getVehiclesByProperty;
int count = 0; int totalOwnerVehicles = 0;
final PagingController<int, dynamic> _pagingController = final PagingController<int, dynamic> _pagingController =
PagingController<int, dynamic>(firstPageKey: 1); PagingController<int, dynamic>(firstPageKey: 1);
bool _isSnackble = true; bool _isSnackble = true;
@ -28,7 +28,7 @@ class _VehicleHistoryScreenState extends State<VehicleHistoryScreen>
(newItems.jsonBody['vehicles'] as List<dynamic>?) ?? []; (newItems.jsonBody['vehicles'] as List<dynamic>?) ?? [];
safeSetState(() { safeSetState(() {
count = newItems.jsonBody['total_rows'] ?? 0; totalOwnerVehicles = newItems.jsonBody['total_owner_vehicles'] ?? 0;
}); });
return (vehicles.isNotEmpty, vehicles); return (vehicles.isNotEmpty, vehicles);
@ -96,6 +96,12 @@ class _VehicleHistoryScreenState extends State<VehicleHistoryScreen>
Widget _buildHeader(BuildContext context) { Widget _buildHeader(BuildContext context) {
final bodyFontSize = LimitedFontSizeUtil.getBodyFontSize(context); final bodyFontSize = LimitedFontSizeUtil.getBodyFontSize(context);
final headerTitle = FFLocalizations.of(context).getVariableText(
ptText: "Meus Veículos: ",
enText: "My Vehicles: ",
);
final totalRegisteredVehicles = widget.model.amountRegister;
return SizedBox( return SizedBox(
height: 30, height: 30,
child: Center( child: Center(
@ -103,7 +109,7 @@ class _VehicleHistoryScreenState extends State<VehicleHistoryScreen>
(widget.model.amountRegister == '0' || (widget.model.amountRegister == '0' ||
widget.model.amountRegister == null) widget.model.amountRegister == null)
? '' ? ''
: "${FFLocalizations.of(context).getVariableText(ptText: "Quantidade de Veículos: ", enText: "Amount of Vehicles: ")}${widget.model.amountRegister}/$count", : "$headerTitle $totalOwnerVehicles/$totalRegisteredVehicles",
textAlign: TextAlign.right, textAlign: TextAlign.right,
style: TextStyle( style: TextStyle(
fontFamily: 'Nunito', fontFamily: 'Nunito',