import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:ride/constant/box_name.dart';
import 'package:ride/constant/colors.dart';
import 'package:ride/main.dart';
import 'package:ride/views/auth/captin/logout_captain.dart';
import 'package:ride/views/home/Captin/history/history_captain.dart';
import 'package:ride/views/home/Captin/home_captain/help_captain.dart';
import 'package:ride/views/home/Captin/settings_captain.dart';
import 'package:ride/views/home/my_wallet/walet_captain.dart';
import 'package:ride/views/home/profile/profile_captain.dart';
import 'package:ride/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: const Text('Wallet'),
            onTap: () {
              // Handle wallet item tap
              Get.to(() => WaletCaptain(), transition: Transition.native);
            },
          ),
          ListTile(
            leading: const Icon(Icons.person),
            title: const Text('Profile'),
            onTap: () {
              // Handle profile item tap
              Get.to(() => const ProfileCaptain(),
                  transition: Transition.rightToLeftWithFade);
            },
          ),
          ListTile(
            leading: const Icon(Icons.history),
            title: const Text('History of Trip'),
            onTap: () {
              Get.to(() => const HistoryCaptain(),
                  transition: Transition.downToUp);
              // Handle history of trip item tap
            },
          ),
          ListTile(
            leading: const Icon(Icons.notifications),
            title: const Text('Notifications'),
            onTap: () {
              // Handle notifications item tap
              Get.to(() => const NotificationCaptain(),
                  transition: Transition.upToDown);
            },
          ),
          ListTile(
            leading: const Icon(Icons.help),
            title: const Text('Helping Center'),
            onTap: () {
              // Handle helping center item tap
              Get.to(() => HelpCaptain(), transition: Transition.size);
            },
          ),
          ListTile(
            leading: const Icon(Icons.settings),
            title: const Text('Settings'),
            onTap: () {
              // Handle settings item tap
              Get.to(() => const SettingsCaptain(),
                  transition: Transition.cupertino);
            },
          ),
          ListTile(
            leading: const Icon(Icons.exit_to_app),
            title: const Text('Sign Out'),
            onTap: () {
              // Handle sign out item tap
              Get.to(() => const LogoutCaptain(),
                  transition: Transition.cupertinoDialog);
            },
          ),
        ],
      ),
    );
  }
}
