import 'dart:ui';

import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/material.dart';

///
class DrawerItem extends StatefulWidget {
  final String title;
  final String subTitle;
  final IconData icon;
  final Color textColor;
  final Color iconColor;

  DrawerItem(this.title, this.icon,
      {this.textColor = Colors.black,
      this.iconColor = Colors.black87,
      this.subTitle = ''});

  @override
  _DrawerItemState createState() => _DrawerItemState();
}

class _DrawerItemState extends State<DrawerItem> {
  @override
  Widget build(BuildContext context) {
    return Container(
      decoration: BoxDecoration(
          border: Border(
        bottom: BorderSide(
          //                   <--- left side
          color: Colors.grey[200],
          width: 1.0,
        ),
      )),
      margin: EdgeInsets.only(left: 10, right: 10, top: 5),
      child: Row(
        crossAxisAlignment: CrossAxisAlignment.center,
        children: <Widget>[
          Padding(
              padding: EdgeInsets.only(bottom: 30),
              child: Icon(
                widget.icon,
                color: widget.iconColor,
                size: SizeConfig.imageSizeMultiplier * 5,
              )),
          Padding(
            padding: EdgeInsets.only(left: 5, right: 5),
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: <Widget>[
                Texts(
                  widget.title,
                  color: widget.textColor,
                  fontSize: SizeConfig.textMultiplier * 2.3,
                ),
                Texts(
                  widget.subTitle,
                  color: widget.textColor,
                  fontSize: SizeConfig.textMultiplier * 2.5,
                ),
              ],
            ),
          )
        ],
      ),
    );
  }
}
