import 'package:flutter/material.dart';
import 'package:hub/components/templates_components/details_component/details_component_widget.dart';
import 'package:hub/flutter_flow/flutter_flow_model.dart';
import 'package:hub/flutter_flow/internationalization.dart';
import 'package:hub/pages/vehicles_on_the_property/vehicles_on_the_property.dart';

class VehicleModel extends FlutterFlowModel<VehicleOnTheProperty> {
  static VehicleModel? _instance = VehicleModel._internal();
  VehicleModel._internal();
  factory VehicleModel() => _instance ?? VehicleModel._internal();
  static void resetInstance() => _instance = null;

  dynamic item;

  @override
  void initState(BuildContext context) {
    resetInstance();

    initAsync();
  }

  @override
  void dispose() {}

  Future<void> initAsync() async {}

  Widget buildVehicleDetails({
    required dynamic item,
    required BuildContext context,
    required VehicleModel model,
  }) {
    return DetailsComponentWidget(
      buttons: [],
      labelsHashMap: Map<String, String>.from({
        if (item['model'] != null && item['model'] != '')
          '${FFLocalizations.of(context).getVariableText(ptText: "Modelo", enText: "Model")}:':
              item['model'].toString().toUpperCase(),
        if (item['licensePlate'] != null && item['licensePlate'] != '')
          '${FFLocalizations.of(context).getVariableText(ptText: "Placa", enText: "License Plate")}:':
              item['licensePlate'].toString().toUpperCase(),
        if (item['color'] != null && item['color'] != '')
          '${FFLocalizations.of(context).getVariableText(ptText: "Cor", enText: "Color")}:':
              item['color'].toString().toUpperCase(),
        if (item['personName'] != null && item['personName'] != '')
          '${FFLocalizations.of(context).getVariableText(ptText: "Proprietário", enText: "Owner")}:':
              item['personName'].toString().toUpperCase(),
        if (item['tag'] != null && item['tag'] != '')
          '${FFLocalizations.of(context).getVariableText(ptText: "Tag", enText: "Tag")}:':
              item['tag'].toString().toUpperCase(),
      }),
      statusHashMap: [],
    );
  }
}
