import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:terepi_seged/pages/home/presentation/controllers/home_controller.dart';
import 'package:terepi_seged/pages/home/presentation/widgets/big_button_widget.dart';
import 'package:terepi_seged/widgets/app_drawer.dart';

class HomeView extends GetView<HomeViewController> {
  const HomeView({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
        color: Colors.white,
        child: Column(children: [
          Column(
            children: const [
              Padding(
                padding: EdgeInsets.only(top: 10.0),
                child: Center(
                  child: Text("Kezdőlap"),
                ),
              ),
              // TextButton(
              //     onPressed: () async {
              //       Get.toNamed('/map');
              //     },
              //     child: const Text('Map')),
              // TextButton(
              //     onPressed: () async {
              //       Get.toNamed('/bluetooth_test');
              //     },
              //     child: const Text('Bluetooth test')),
              // TextButton(
              //     onPressed: () async {
              //       Get.toNamed('/socket_test');
              //     },
              //     child: const Text('Socket teszt')),
              // TextButton(
              //     onPressed: () async {
              //       Get.toNamed('/rtcm_test');
              //     },
              //     child: const Text('RTCM teszt'))
            ],
          ),
          Padding(
              padding: const EdgeInsets.symmetric(vertical: 10.0),
              child: Row(
                  mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                  children: [
                    TextButton(
                        onPressed: () async {
                          Get.toNamed("/field_trip");
                        },
                        child: Text('Field trip')),
                    // TextButton(
                    //     onPressed: () async {
                    //       Get.toNamed("/tracking");
                    //     },
                    //     child: Text('Tracking')),
                    TextButton(
                        onPressed: () async {
                          Get.toNamed("/map");
                        },
                        child: Text('Kitűzés'))
                  ])),
          Padding(
            padding: const EdgeInsets.only(top: 10.0),
            child: Row(
              mainAxisAlignment: MainAxisAlignment.spaceEvenly,
              children: [
                // BigButtonWidget(
                //   iconData: Icons.flag,
                //   label: "Kitűzés",
                //   onPressed: () async {
                //     Get.toNamed('/map');
                //   },
                // ),
                BigButtonWidget(
                  iconData: Icons.flag,
                  label: "Bemérés",
                  onPressed: () async {
                    Get.toNamed('/map_survey');
                  },
                ),
                BigButtonWidget(
                  iconData: Icons.monitor_heart,
                  label: "Mérés",
                  onPressed: () async {
                    Get.toNamed("/measured_data");
                    // ScaffoldMessenger.of(context)
                    //     .showSnackBar(const SnackBar(
                    //   content: Text(
                    //     "Fejlesztlés alatt",
                    //     style: TextStyle(fontWeight: FontWeight.bold),
                    //   ),
                    //   backgroundColor: Colors.black54,
                    // ));
                  },
                ),
              ],
            ),
          ),
          Padding(
            padding: const EdgeInsets.symmetric(vertical: 10.0),
            child: Row(
              mainAxisAlignment: MainAxisAlignment.spaceEvenly,
              children: [
                BigButtonWidget(
                  iconData: Icons.navigation,
                  label: "Navigáció",
                  onPressed: () async {
                    Get.toNamed('/navigation');
                    // ScaffoldMessenger.of(context)
                    //     .showSnackBar(const SnackBar(
                    //   content: Text(
                    //     "Fejlesztlés alatt",
                    //     style: TextStyle(fontWeight: FontWeight.bold),
                    //   ),
                    //   backgroundColor: Colors.black54,
                    // ));
                  },
                ),
                BigButtonWidget(
                  iconData: Icons.message,
                  label: "Üzenetek",
                  onPressed: () async {
                    // Get.toNamed("/navigation");
                    ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
                      content: Text(
                        "Fejlesztlés alatt",
                        style: TextStyle(fontWeight: FontWeight.bold),
                      ),
                      backgroundColor: Colors.black54,
                    ));
                  },
                ),
              ],
            ),
          ),
          Padding(
            padding: const EdgeInsets.symmetric(vertical: 10.0),
            child: Row(
              mainAxisAlignment: MainAxisAlignment.spaceEvenly,
              children: [
                BigButtonWidget(
                  iconData: Icons.house,
                  label: "Ingatlanok",
                  onPressed: () async {
                    // Get.toNamed('/map_test');
                    ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
                      content: Text(
                        "Fejlesztlés alatt",
                        style: TextStyle(fontWeight: FontWeight.bold),
                      ),
                      backgroundColor: Colors.black54,
                    ));
                  },
                ),
                BigButtonWidget(
                  iconData: Icons.edit_road,
                  label: "Track",
                  onPressed: () async {
                    Get.toNamed("/tracking");
                    // ScaffoldMessenger.of(context)
                    //     .showSnackBar(const SnackBar(
                    //   content: Text(
                    //     "Fejlesztlés alatt",
                    //     style: TextStyle(fontWeight: FontWeight.bold),
                    //   ),
                    //   backgroundColor: Colors.black54,
                    // ));
                  },
                ),
              ],
            ),
          ),
          Row(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              Obx(
                () => Text(
                    "Verzió: ${controller.packageInfo.value.version}+${controller.packageInfo.value.buildNumber}",
                    style: const TextStyle(fontSize: 12)),
              )
            ],
          )
        ]));
  }
}
