import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:SEFER/constant/box_name.dart';
import 'package:SEFER/constant/colors.dart';
import 'package:SEFER/main.dart';
import 'package:SEFER/views/auth/captin/logout_captain.dart';
import 'package:SEFER/views/home/Captin/history/history_captain.dart';
import 'package:SEFER/views/home/Captin/home_captain/help_captain.dart';
import 'package:SEFER/views/home/Captin/settings_captain.dart';
import 'package:SEFER/views/home/my_wallet/walet_captain.dart';
import 'package:SEFER/views/home/profile/profile_captain.dart';
import 'package:SEFER/views/notification/notification_captain.dart';

class DrawerCaptain extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Drawer(
      child: Column(
        children: [
          // Other drawer items
          UserAccountsDrawerHeader(
            decoration: const BoxDecoration(
              color: AppColor.greenColor,
              gradient: LinearGradient(
                colors: [
                  AppColor.greenColor,
                  AppColor.yellowColor
                ], // Define your gradient colors
                begin: Alignment.topLeft,
                end: Alignment.bottomRight,
              ),
            ),
            accountName: Text(box.read(BoxName.nameDriver)),
            accountEmail: Text(box.read(BoxName.emailDriver)),
            currentAccountPicture: const CircleAvatar(
              backgroundImage: AssetImage('path_to_profile_image'),
            ), //todo image from server
          ),
          ListTile(
            leading: const Icon(Icons.account_balance_wallet),
            title: Text('Wallet'.tr),
            onTap: () {
              // Handle wallet item tap
              Get.to(() => WaletCaptain(), transition: Transition.native);
            },
          ),
          ListTile(
            leading: const Icon(Icons.person),
            title: Text('Profile'.tr),
            onTap: () {
              // Handle profile item tap
              Get.to(() => const ProfileCaptain(),
                  transition: Transition.rightToLeftWithFade);
            },
          ),
          ListTile(
            leading: const Icon(Icons.history),
            title: Text('History of Trip'.tr),
            onTap: () {
              Get.to(() => const HistoryCaptain(),
                  transition: Transition.downToUp);
              // Handle history of trip item tap
            },
          ),
          ListTile(
            leading: const Icon(Icons.notifications),
            title: Text('Notifications'.tr),
            onTap: () {
              // Handle notifications item tap
              Get.to(() => const NotificationCaptain(),
                  transition: Transition.upToDown);
            },
          ),
          ListTile(
            leading: const Icon(Icons.help),
            title: Text('Helping Center'.tr),
            onTap: () {
              // Handle helping center item tap
              Get.to(() => HelpCaptain(), transition: Transition.size);
            },
          ),
          ListTile(
            leading: const Icon(Icons.settings),
            title: Text('Settings'.tr),
            onTap: () {
              // Handle settings item tap
              Get.to(() => const SettingsCaptain(),
                  transition: Transition.cupertino);
            },
          ),
          ListTile(
            leading: const Icon(Icons.exit_to_app),
            title: Text('Sign Out'.tr),
            onTap: () {
              // Handle sign out item tap
              Get.to(() => const LogoutCaptain(),
                  transition: Transition.cupertinoDialog);
            },
          ),
        ],
      ),
    );
  }
}
