import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:tangheem/classes/const.dart'; class CommonDropDownButton extends StatelessWidget { final String text; final String icon; final Color iconColor; final Color color; final VoidCallback onPressed; final double widthHeight; CommonDropDownButton(this.text, {Key key, this.onPressed, this.color, this.icon, this.widthHeight, this.iconColor}) : super(key: key); @override Widget build(BuildContext context) { return InkWell( splashColor: Colors.transparent, highlightColor: Colors.transparent, onTap: onPressed, child: Container( height: 40, decoration: BoxDecoration( color: color ?? Const.primaryBlue, borderRadius: BorderRadius.circular(6), ), padding: EdgeInsets.fromLTRB(8, 8, 16, 8), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center, mainAxisSize: MainAxisSize.min, children: [ Text( text, style: TextStyle(fontSize: 13, color: Colors.white), ), SizedBox(width: 8), SvgPicture.asset( icon ?? "assets/icons/drop_menu.svg", width: widthHeight ?? 10, height: widthHeight ?? 5, color: iconColor ?? Const.secondaryOrange, ), ], ), ), ); } }