import 'dart:ui'; import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:flutter/material.dart'; /// class DrawerItem extends StatefulWidget { final String title; final String subTitle; final icon; final Color textColor; final Color iconColor; final bool bottomLine; final bool sideArrow; final Widget count; final bool isImageIcon; final double fontHeight; DrawerItem(this.title, this.icon, {this.textColor, this.iconColor, this.subTitle = '', this.bottomLine = true, this.count, this.sideArrow = false, this.isImageIcon = false,this.fontHeight}); @override _DrawerItemState createState() => _DrawerItemState(); } class _DrawerItemState extends State { @override Widget build(BuildContext context) { return Container( decoration: widget.bottomLine == true ? BoxDecoration( border: Border( bottom: BorderSide( // <--- left side color: Colors.grey[200], width: 1.0, ), )) : BoxDecoration(), child: Padding( padding: EdgeInsets.all(10), child: Row( children: [ Expanded( flex: 1, child: widget.isImageIcon == true ? widget.icon : Icon( widget.icon, color: widget.iconColor == null ? Theme.of(context).textTheme.bodyText1.color : widget.iconColor, size: SizeConfig.imageSizeMultiplier * 5, )), Expanded( flex: 7, child: Column(crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.center, children: [ Row( children: [ AppText( widget.title, fontWeight: FontWeight.bold, fontSize: SizeConfig.textMultiplier * 2.3, height: widget.fontHeight, ), widget.count ?? SizedBox(), ], ), widget.subTitle != '' ? AppText( widget.subTitle, fontSize: SizeConfig.textMultiplier * 2.5, ) : SizedBox(), ])), widget.sideArrow == true ? Expanded(flex: 1, child: Icon(Icons.keyboard_arrow_right, color: Colors.black)) : Expanded(flex: 1, child: SizedBox()), ], ), )); } }