import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:siro_service/constant/style.dart';
import 'package:siro_service/controller/mainController/pages/edit_car.dart';
import 'package:siro_service/views/widgets/my_scafold.dart';

import '../../functions/encrypt_decrypt.dart';
import '../main_controller.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';

class EditCarPlate extends StatelessWidget {
  const EditCarPlate({super.key});

  @override
  Widget build(BuildContext context) {
    Get.put(MainController());

    return GetBuilder<MainController>(builder: (mainController) {
      return MyScaffold(
        title: 'Edit car details'.tr,
        isleading: true,
        body: [
          Expanded(
            child: ListView.builder(
                padding: const EdgeInsets.all(16.0),
                itemCount: mainController
                    .carPlateNotEdit.length, // 10 fields + 1 save button
                itemBuilder: (context, index) {
                  var carData = mainController.carPlateNotEdit[index];
                  return Padding(
                    padding: const EdgeInsets.all(8.0),
                    child: InkWell(
                      onTap: () {
                        Get.to(EditCar(carData: carData));
                      },
                      child: Container(
                          decoration: AppStyle.boxDecoration1,
                          child: Text((carData['owner']))),
                    ),
                  );
                }),
          ),
        ],
      );
    });
  }
}
