import 'dart:async';

import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import '/app/route.dart';
import '/models/patient_model.dart';
import '/widget/patient_card.dart';

import '../../app/constant.dart';
import '../../models/response_search_pengantaran_hasil_model.dart';
import '../../provider/current_scan_provider.dart';
import '../../provider/current_user_provider.dart';
import '../../provider/dio_provider.dart';
import '../../repository/pengantaran_hasil_dokter_repository.dart';
import '../../widget/custom_textfield.dart';
import '../../widget/sas_textfield.dart';
import '../../widget/snackbar_widget.dart';
import 'pengantaran_hasil_dokter_loadnolab_provider.dart';
import 'pengantaran_hasil_dokter_save_provider.dart';

class InputPengantaranHasilDokterScreen extends HookConsumerWidget {
  const InputPengantaranHasilDokterScreen({super.key, required this.data});
  final Map<String, dynamic> data;

  @override
  Widget build(BuildContext context, WidgetRef ref) {
    print(data);

    final tipePekerjaanIDSave = data['tipePekerjaan'];
    final deliveryIDSave = useState<String>("");
    final mCourirID =
        ref.watch(currentUserProvider)?.model.user?.mCourierID ?? "0";

    final isForm = useState(true);
    final isScan = useState(false);

    final hasilSearchData = useState<List<ResponseSearchPengantaranHasilModel>>(
        List.empty(growable: true));
    final focusNodeNoDokter = useFocusNode();
    final nodokterhasFocus = useState(false);
    final isLoadingSearchNoDokter = useState(false);
    final ctrlNoDokter = useTextEditingController(text: "");

    final ctrlNama = useTextEditingController(text: "");
    final focusNodeNama = useFocusNode();
    final namahasFocus = useState(false);

    final ctrlAlamat = useTextEditingController(text: "");
    final focusNodeAlamat = useFocusNode();
    final alamathasFocus = useState(false);
    final errorMessage = useState("");

    final isFromScanScreenProvider = ref.read(isFromScanScreen);

    final listPatient =
        useState<List<PatientModel>>(List.empty(growable: true));

    final listViewBuilderShow = useState(false);
    final singleListSearchShow = useState(true);

    focusNodeNoDokter.addListener(() {
      if (focusNodeNoDokter.hasFocus) {
        nodokterhasFocus.value = true;
      } else {
        nodokterhasFocus.value = false;
      }
    });

    focusNodeNama.addListener(() {
      if (focusNodeNama.hasFocus) {
        namahasFocus.value = true;
      } else {
        namahasFocus.value = false;
      }
    });

    focusNodeAlamat.addListener(() {
      if (focusNodeAlamat.hasFocus) {
        alamathasFocus.value = true;
      } else {
        alamathasFocus.value = false;
      }
    });

    // useEffect(() {
    //   isForm.value = true;
    //   isScan.value = false;
    // }, []);

    // search
    ref.listen(pengantaranHasilDokterSearch, (prev, next) {
      if (next is PengantaranhasilDokterStateLoading) {
        isLoadingSearchNoDokter.value = true;
      } else if (next is PengantaranhasilDokterStateError) {
        isLoadingSearchNoDokter.value = false;
        errorMessage.value = next.message ?? "";
        Timer(const Duration(seconds: 3), () {
          errorMessage.value = "";
        });
      } else if (next is PengantaranhasilDokterStateDone) {
        isLoadingSearchNoDokter.value = false;
        if (next.model.isNotEmpty) {
          hasilSearchData.value = next.model;

          // klu lebih dari 1 length nya dibikin list view builder
          // klu cm 1 seperti ini

          if (hasilSearchData.value.length > 1) {
            listViewBuilderShow.value = true;
            singleListSearchShow.value = false;
          } else {
            // deliveryid merupakan json dari id
            print('Delivery ID : ${hasilSearchData.value[0].deliveryid}');
            print('Tipe ID : ${hasilSearchData.value[0].tipeid}');
            print('Selected No Lab : ${hasilSearchData.value[0].nomor}');
            print('Selected Nama : ${hasilSearchData.value[0].nama}');
            print('Selected Alamat : ${hasilSearchData.value[0].alamat}');

            // ctrlNoDokter.text = hasilSearchData.value[0].nomor.toString();
            ctrlNoDokter.text = hasilSearchData.value[0].detail.toString();
            ctrlNama.text = hasilSearchData.value[0].nama.toString();
            ctrlAlamat.text = hasilSearchData.value[0].alamat.toString();
            deliveryIDSave.value =
                hasilSearchData.value[0].deliveryid.toString();

            if (hasilSearchData.value[0].patients!.isNotEmpty) {
              // hasilSearchData.value[0].patients?.forEach((element) {
              // listPatient.value.add(element);
              // });
              listPatient.value = hasilSearchData.value[0].patients!;
            }
          }
        } else {
          listPatient.value = [];
          hasilSearchData.value = [];
          ctrlNoDokter.text = "";
          ctrlNama.text = "";
          ctrlAlamat.text = "";
          SanckbarWidget(context, "Data Tidak Ditemukan", snackbarType.warning);
        }
      }
    });

    // save pengantaran hasil
    ref.listen(pengantaranHasilDokterSave, (prev, next) {
      if (next is PengantaranhasilDokterSaveStateLoading) {
        isLoadingSearchNoDokter.value = true;
      } else if (next is PengantaranhasilDokterSaveStateError) {
        isLoadingSearchNoDokter.value = false;
        errorMessage.value = next.message ?? "";
        SanckbarWidget(context, "${next.message}", snackbarType.error);
        Timer(const Duration(seconds: 3), () {
          errorMessage.value = "";
        });
      } else if (next is PengantaranhasilDokterSaveStateDone) {
        isLoadingSearchNoDokter.value = false;
        if (next.model.status != "OK") {
          SanckbarWidget(context, "${next.model.message}", snackbarType.error);
        } else {
          Navigator.of(context).pushNamedAndRemoveUntil(
            konfirmasiRoute,
            (route) => false,
          );
        }
      }
    });

    // check kalau pake scan
    useEffect(() {
      WidgetsBinding.instance.addPostFrameCallback((timeStamp) async {
        final barcodeScanResultValue = ref.read(barcodeScanResult);
        print("barcode Scan Result: $barcodeScanResultValue");
        print("Is from scan : ${isFromScanScreen}");

        if (isFromScanScreenProvider == true) {
          if (barcodeScanResultValue != "") {
            isForm.value = true;
            isScan.value = false;
            ref
                .read(pengantaranHasilDokterSearch.notifier)
                .loadListNoDokterPengantaranHasilDokter(
                  search: barcodeScanResultValue,
                );
          }
        } else {
          ref.read(barcodeScanResult.notifier).update((state) => "");
          ref.read(isFromScanScreen.notifier).update((state) => false);
        }
      });
    }, []);

    return Container(
      width: Constant.getActualX(context: context, x: 320),
      height: Constant.getActualY(context: context, y: 544),
      padding: EdgeInsets.only(
        bottom: Constant.getActualY(context: context, y: 20),
      ),
      // color: Colors.pink,
      child: ListView(
        children: [
          // tab nolab & scanner
          Container(
            width: Constant.getActualX(context: context, x: 320),
            height: Constant.getActualY(context: context, y: 36),
            child: Row(
              children: [
                // button form kiri
                SizedBox(
                  width: Constant.getActualX(context: context, x: 156),
                  height: Constant.getActualY(context: context, y: 36),
                  child: ElevatedButton(
                    // onPressed: () {
                    //   isForm.value = !isForm.value;
                    //   isScan.value = !isScan.value;
                    // },
                    onPressed: () {
                      if (isForm.value == true) {
                        return;
                      } else {
                        isForm.value = true;
                        isScan.value = false;
                      }
                    },
                    style: ButtonStyle(
                      backgroundColor: (isForm.value == true)
                          ? MaterialStateColor.resolveWith(
                              (st) => Constant.primaryMain)
                          : MaterialStateColor.resolveWith(
                              (st) => Constant.buttonIsNotActive),
                      shape: MaterialStateProperty.all<RoundedRectangleBorder>(
                        RoundedRectangleBorder(
                          borderRadius: BorderRadius.only(
                              bottomLeft: Radius.circular(12),
                              topLeft: Radius.circular(12)),
                          // side: BorderSide(color: Colors.red),
                        ),
                      ),
                      shadowColor:
                          MaterialStateProperty.all(Color(0xffff48423d)),
                      elevation: MaterialStateProperty.all(4.0),
                    ),
                    child: Align(
                      alignment: Alignment.center,
                      child: Text(
                        'Form',
                        style: Constant.buttonLarge(context: context).copyWith(
                          color: (isForm.value == true)
                              ? Constant.backgroundWhite
                              : Constant.textBlack,
                          fontWeight: FontWeight.w700,
                        ),
                      ),
                    ),
                  ),
                ),

                SizedBox(
                  width: Constant.getActualX(context: context, x: 8),
                ),
                // button scan kanan

                SizedBox(
                  width: Constant.getActualX(context: context, x: 156),
                  height: Constant.getActualY(context: context, y: 36),
                  child: ElevatedButton(
                    // onPressed: () {
                    //   isScan.value = !isScan.value;
                    //   isForm.value = !isForm.value;
                    // },
                    onPressed: () {
                      // isScan.value = !isScan.value;
                      // isForm.value = !isForm.value;

                      if (isScan.value == true) {
                        return;
                      } else {
                        isForm.value = false;
                        isScan.value = true;
                      }
                    },
                    style: ButtonStyle(
                      backgroundColor: (isScan.value == true)
                          ? MaterialStateColor.resolveWith(
                              (st) => Constant.primaryMain)
                          : MaterialStateColor.resolveWith(
                              (st) => Constant.buttonIsNotActive),
                      shape: MaterialStateProperty.all<RoundedRectangleBorder>(
                        RoundedRectangleBorder(
                          borderRadius: BorderRadius.only(
                            bottomRight: Radius.circular(12),
                            topRight: Radius.circular(12),
                          ),
                          // side: BorderSide(color: Colors.red),
                        ),
                      ),
                      shadowColor:
                          MaterialStateProperty.all(Color(0xffff48423d)),
                      elevation: MaterialStateProperty.all(4.0),
                    ),
                    child: Align(
                      alignment: Alignment.center,
                      child: Text(
                        'Scan',
                        style: Constant.buttonLarge(context: context).copyWith(
                          color: (isScan.value == true)
                              ? Constant.backgroundWhite
                              : Constant.textBlack,
                          fontWeight: FontWeight.w700,
                        ),
                      ),
                    ),
                  ),
                ),
              ],
            ),
          ),

          if (isForm.value == true) ...[
            // button batal & simpan jika isForm true
            SizedBox(
              height: Constant.getActualY(context: context, y: 20),
            ),

            // loading
            if (isLoadingSearchNoDokter.value) ...[
              // Center(
              //   child: SizedBox(
              //     width: Constant.getActualX(context: context, x: 20),
              //     height: Constant.getActualY(context: context, y: 20),
              //     child: CircularProgressIndicator(),
              //   ),
              // ),
              const Center(
                child: CircularProgressIndicator(),
              ),
            ],

            SizedBox(
              height: Constant.getActualY(context: context, y: 20),
            ),

            // muncul jika hasil search data > 1
            if (listViewBuilderShow.value) ...[
              Container(
                width: Constant.getActualX(context: context, x: 320),
                // height: Constant.getActualY(context: context, y: 56),
                child: SasTextFieldSearch(
                  controller: ctrlNoDokter,
                  hintText: "Nama[Kode]",
                  labelText: "Nama[Kode]",
                  focusNode: focusNodeNoDokter,
                  hasFocus: nodokterhasFocus.value,
                  isReadOnly: false,
                  onPressed: () {
                    if (ctrlNoDokter.text != "" ||
                        ctrlNoDokter.text.isNotEmpty) {
                      if (ctrlNoDokter.text.length >= 3) {
                        ref
                            .read(pengantaranHasilDokterSearch.notifier)
                            .loadListNoDokterPengantaranHasilDokter(
                              search: ctrlNoDokter.text.toString(),
                            );
                      }
                    } else {
                      SanckbarWidget(
                          context,
                          "Silahkan Masukkan Keyword Pencarian",
                          snackbarType.warning);
                    }
                  },
                ),
              ),
              SizedBox(
                height: Constant.getActualY(context: context, y: 10),
              ),
              Container(
                padding: EdgeInsets.symmetric(horizontal: 0.9, vertical: 0.5),
                height: Constant.getActualY(context: context, y: 290),
                child: ListView.builder(
                    itemCount: hasilSearchData.value.length,
                    itemBuilder: (context, index) {
                      return InkWell(
                        onTap: () {
                          // ctrlNoDokter.text =
                          //     hasilSearchData.value[index].nomor.toString();
                          ctrlNoDokter.text =
                              hasilSearchData.value[index].detail.toString();
                          ctrlNama.text =
                              hasilSearchData.value[index].nama.toString();
                          ctrlAlamat.text =
                              hasilSearchData.value[index].alamat.toString();
                          deliveryIDSave.value = hasilSearchData
                              .value[index].deliveryid
                              .toString();

                          if (hasilSearchData
                              .value[index].patients!.isNotEmpty) {
                            // hasilSearchData.value[index].patients?.forEach((element) {
                            // listPatient.value.add(element);
                            // });
                            listPatient.value =
                                hasilSearchData.value[index].patients!;
                          }
                          listViewBuilderShow.value = false;
                          singleListSearchShow.value = true;
                        },
                        child: Padding(
                          padding: const EdgeInsets.only(bottom: 10),
                          child: Container(
                            padding: EdgeInsets.symmetric(
                                horizontal: Constant.getActualX(
                                    context: context, x: 24),
                                vertical: Constant.getActualY(
                                    context: context, y: 20)),
                            margin: EdgeInsets.symmetric(
                                vertical:
                                    Constant.getActualY(context: context, y: 4),
                                horizontal: Constant.getActualX(
                                    context: context, x: 1)),
                            // height: Constant.getActualY(context: context, y: 76),
                            decoration: BoxDecoration(
                                color: Colors.white,
                                border:
                                    Border.all(color: Colors.grey, width: 0.1),
                                boxShadow: [
                                  BoxShadow(
                                    color: Colors.grey.shade300,
                                    offset: const Offset(0.0, 1), //(x,y)
                                    blurRadius: 2,
                                  ),
                                ],
                                borderRadius: BorderRadius.circular(12)),
                            child: Column(
                              children: [
                                Row(
                                  mainAxisAlignment: MainAxisAlignment.start,
                                  crossAxisAlignment: CrossAxisAlignment.start,
                                  children: [
                                    Expanded(
                                      child: Text(
                                        "Nomor",
                                        style: Constant.caption1(
                                                context: context)
                                            .copyWith(
                                                fontWeight: FontWeight.w400,
                                                color: Constant.textPrimary),
                                      ),
                                    ),
                                    Expanded(
                                      child: Text(
                                        hasilSearchData.value[index].nomor
                                            .toString(),
                                        // 's',
                                        maxLines: 2,
                                        overflow: TextOverflow.ellipsis,
                                        style: Constant.caption1(
                                                context: context)
                                            .copyWith(
                                                fontWeight: FontWeight.w400,
                                                color: Constant.textPrimary),
                                      ),
                                    )
                                  ],
                                ),
                                SizedBox(
                                  height: Constant.getActualY(
                                      context: context, y: 4),
                                ),
                                Row(
                                  mainAxisAlignment: MainAxisAlignment.start,
                                  crossAxisAlignment: CrossAxisAlignment.start,
                                  children: [
                                    Expanded(
                                      child: Text(
                                        "Nama",
                                        style: Constant.caption1(
                                                context: context)
                                            .copyWith(
                                                fontWeight: FontWeight.w400,
                                                color: Constant.textPrimary),
                                      ),
                                    ),
                                    Expanded(
                                      child: Text(
                                        hasilSearchData.value[index].nama
                                            .toString(),
                                        // 's',
                                        maxLines: 2,
                                        overflow: TextOverflow.ellipsis,
                                        style: Constant.caption1(
                                                context: context)
                                            .copyWith(
                                                fontWeight: FontWeight.w400,
                                                color: Constant.textPrimary),
                                      ),
                                    )
                                  ],
                                ),
                                Row(
                                  mainAxisAlignment: MainAxisAlignment.start,
                                  crossAxisAlignment: CrossAxisAlignment.start,
                                  children: [
                                    Expanded(
                                      child: Text(
                                        "Alamat Pengantaran",
                                        style: Constant.caption1(
                                                context: context)
                                            .copyWith(
                                                fontWeight: FontWeight.w400,
                                                color: Constant.textPrimary),
                                      ),
                                    ),
                                    Expanded(
                                      child: Text(
                                        hasilSearchData.value[index].alamat
                                            .toString(),
                                        // 's',
                                        maxLines: 2,
                                        overflow: TextOverflow.ellipsis,
                                        style: Constant.caption1(
                                                context: context)
                                            .copyWith(
                                                fontWeight: FontWeight.w400,
                                                color: Constant.textPrimary),
                                      ),
                                    )
                                  ],
                                ),
                              ],
                            ),
                          ),
                        ),
                      );
                    }),
              ),
            ],

            // single list show
            if (singleListSearchShow.value) ...[
              // no lab autocomplete
              Container(
                width: Constant.getActualX(context: context, x: 320),
                // height: Constant.getActualY(context: context, y: 56),
                child: SasTextFieldSearch(
                  controller: ctrlNoDokter,
                  hintText: "Nama[Kode]",
                  labelText: "Nama[Kode]",
                  focusNode: focusNodeNoDokter,
                  hasFocus: nodokterhasFocus.value,
                  isReadOnly: false,
                  onPressed: () {
                    if (ctrlNoDokter.text != "" ||
                        ctrlNoDokter.text.isNotEmpty) {
                      if (ctrlNoDokter.text.length >= 3) {
                        ref
                            .read(pengantaranHasilDokterSearch.notifier)
                            .loadListNoDokterPengantaranHasilDokter(
                              search: ctrlNoDokter.text.toString(),
                            );
                      }
                    } else {
                      SanckbarWidget(
                          context,
                          "Silahkan Masukkan Keyword Pencarian",
                          snackbarType.warning);
                    }
                  },
                ),
              ),

              SizedBox(
                height: Constant.getActualY(context: context, y: 20),
              ),

              // // nama
              // Container(
              //   width: Constant.getActualX(context: context, x: 320),
              //   height: Constant.getActualY(context: context, y: 56),
              //   child: SasTextField(
              //     hintText: "Nama",
              //     labelText: "Nama",
              //     focusNode: focusNodeNama,
              //     hasFocus: namahasFocus.value,
              //     controller: ctrlNama,
              //     isReadOnly: true,
              //   ),
              // ),
              // SizedBox(
              //   height: Constant.getActualY(context: context, y: 20),
              // ),
              // alamat
              Container(
                width: Constant.getActualX(context: context, x: 320),
                height: Constant.getActualY(context: context, y: 120),
                // color: Colors.green,
                child: SasTextFieldArea(
                  hintText: "Alamat Pengantaran",
                  labelText: "Alamat Pengantaran",
                  focusNode: focusNodeAlamat,
                  hasFocus: alamathasFocus.value,
                  controller: ctrlAlamat,
                  isReadOnly: true,
                ),
              ),

              SizedBox(
                height: Constant.getActualY(context: context, y: 10),
              ),

              if (listPatient.value.isNotEmpty) ...[
                for (var i = 0; i < listPatient.value.length; i++) ...[
                  Padding(
                    padding: EdgeInsets.only(
                        bottom: Constant.getActualY(context: context, y: 10)),
                    child: PatientCard(
                      name: listPatient.value[i].pasien.toString(),
                      noLab:
                          listPatient.value[i].tOrderHeaderLabNumber.toString(),
                    ),
                  ),
                ],
              ] else ...[
                SizedBox.shrink(),
                SizedBox(
                  height: Constant.getActualY(context: context, y: 40),
                )
              ],
            ],

            // SizedBox(
            //   height: Constant.getActualY(context: context, y: 100),
            // ),

            Padding(
              padding: EdgeInsets.only(
                top: Constant.getActualY(context: context, y: 20),
                bottom: Constant.getActualY(context: context, y: 20),
              ),
              child: Align(
                alignment: Alignment.bottomCenter,
                child: Container(
                  // width: Constant.getActualX(context: context, x: 317),
                  // height: Constant.getActualY(context: context, y: 36),
                  // padding: EdgeInsets.symmetric(
                  //     horizontal: Constant.getActualX(context: context, x: 10)),
                  height: Constant.getActualY(context: context, y: 36),
                  // color: Colors.pink,
                  child: Row(
                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
                    children: [
                      // batal
                      ElevatedButton(
                        onPressed: () {
                          Navigator.pop(context);
                        },
                        style: ButtonStyle(
                          backgroundColor: MaterialStateColor.resolveWith(
                              (st) => Constant.backgroundWhite),
                          shape:
                              MaterialStateProperty.all<RoundedRectangleBorder>(
                            RoundedRectangleBorder(
                              borderRadius: BorderRadius.circular(8),
                              side: BorderSide(color: Constant.blueButton),
                            ),
                          ),
                          shadowColor:
                              MaterialStateProperty.all(Color(0xffff48423d)),
                          elevation: MaterialStateProperty.all(4.0),
                        ),
                        child: Align(
                          alignment: Alignment.center,
                          child: Text(
                            'Batal',
                            style: Constant.body3(context: context).copyWith(
                              color: Constant.blueButton,
                              fontWeight: FontWeight.w700,
                            ),
                          ),
                        ),
                      ),

                      // simpan
                      ElevatedButton(
                        onPressed: (isLoadingSearchNoDokter.value)
                            ? null
                            : () {
                                print("kurir id : $mCourirID");
                                print("tipe id : $tipePekerjaanIDSave");
                                print("delivery id : ${deliveryIDSave.value}");

                                if (deliveryIDSave.value == "") {
                                  SanckbarWidget(
                                      context,
                                      "Silahkan Cari No Dokter",
                                      snackbarType.warning);
                                } else {
                                  ref
                                      .read(pengantaranHasilDokterSave.notifier)
                                      .pengantaranHasilDokterSave(
                                        courierID: mCourirID,
                                        tipeID: tipePekerjaanIDSave,
                                        deliveryID: deliveryIDSave.value,
                                      );
                                }
                              },
                        style: ButtonStyle(
                          backgroundColor: MaterialStateColor.resolveWith(
                            (st) => Constant.blueButton,
                          ),
                          shape:
                              MaterialStateProperty.all<RoundedRectangleBorder>(
                            RoundedRectangleBorder(
                              borderRadius: BorderRadius.circular(8),
                              // side: BorderSide(color: Constant.blueButton),
                            ),
                          ),
                          shadowColor:
                              MaterialStateProperty.all(Color(0xffff48423d)),
                          elevation: MaterialStateProperty.all(4.0),
                        ),
                        child: Align(
                          alignment: Alignment.center,
                          child: Text(
                            'Simpan',
                            style: Constant.body3(context: context).copyWith(
                              color: Constant.backgroundWhite,
                              fontWeight: FontWeight.w700,
                            ),
                          ),
                        ),
                      ),
                    ],
                  ),
                ),
              ),
            ),
          ] else ...[
            // button scan barcode
            SizedBox(
              height: Constant.getActualY(context: context, y: 445),
            ),
            Container(
              width: Constant.getActualX(context: context, x: 317),
              height: Constant.getActualY(context: context, y: 36),
              // color: Colors.pink,
              child: SizedBox(
                width: Constant.getActualX(context: context, x: 83),
                height: Constant.getActualY(context: context, y: 36),
                child: ElevatedButton(
                  onPressed: () {
                    FocusManager.instance.primaryFocus?.unfocus();
                    ref.read(isFromScanScreen.notifier).update((state) => true);
                    Navigator.of(context).pushNamedAndRemoveUntil(
                        inputScanRoute, (route) => false,
                        arguments: InputScanPekerjaanProp(0, 2));
                  },
                  style: ButtonStyle(
                    backgroundColor: MaterialStateColor.resolveWith(
                        (st) => Constant.blueButton),
                    shape: MaterialStateProperty.all<RoundedRectangleBorder>(
                      RoundedRectangleBorder(
                        borderRadius: BorderRadius.circular(8),
                        // side: BorderSide(color: Constant.blueButton),
                      ),
                    ),
                    shadowColor: MaterialStateProperty.all(Color(0xffff48423d)),
                    elevation: MaterialStateProperty.all(4.0),
                  ),
                  child: Row(
                    mainAxisAlignment: MainAxisAlignment.center,
                    children: [
                      Icon(Icons.document_scanner),
                      SizedBox(
                        width: Constant.getActualX(context: context, x: 10),
                      ),
                      Text(
                        'Scan Barcode',
                        style: Constant.body3(context: context).copyWith(
                          color: Constant.backgroundWhite,
                          fontWeight: FontWeight.w700,
                        ),
                      ),
                    ],
                  ),
                ),
              ),
            ),
          ],
        ],
      ),
    );
  }
}
