import 'package:flutter/material.dart';

import '../screens/bluetooth_screen.dart';
import '../screens/main_screen.dart';
import '../screens/registered_devices_screen.dart';
import '../screens/settings.dart';

class Sidebar extends StatelessWidget {
  const Sidebar({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Drawer(
      //backgroundColor: Colors.black ,
      child: ListView(
        padding: EdgeInsets.zero,
        children: <Widget>[
          const DrawerHeader(
            decoration: BoxDecoration(color: Colors.white),
            child: Center(
              child: Image(image: AssetImage('assets/logo/m&m_logo.png')),
            ),
          ),
          ListTile(
            leading: const Icon(Icons.home),
            title: const Text("Home"),
            onTap: () {
              Navigator.push(context, MaterialPageRoute(builder: (context) => const MainScreen()));
            },
          ),
          ListTile(
            leading: const Icon(Icons.bluetooth_searching),
            title: const Text("Connect Device"),
            onTap: () {
              Navigator.push(context, MaterialPageRoute(builder: (context) => const BluetoothScreen()));
            },
          ),
          ListTile(
            leading: const Icon(Icons.devices),
            title: const Text("Registered Devices"),
            onTap: () {
              Navigator.push(context, MaterialPageRoute(builder: (context) => const RegisteredDevicesScreen()));
            },
          ),
          ListTile(
            leading: const Icon(Icons.settings),
            title: const Text("Settings"),
            onTap: () {
              Navigator.push(context, MaterialPageRoute(builder: (context) => const Settings()));
            },
          ),
        ],
      ),
    );
  }
}
