full_with_icon_button.dart 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. import 'package:flutter/material.dart';
  2. import 'package:flutter/rendering.dart';
  3. import 'package:flutter_screenutil/flutter_screenutil.dart';
  4. import '../../common/style/style.dart' show ICons,AppColors;
  5. class FullWithIconButton extends StatelessWidget {
  6. const FullWithIconButton({
  7. this.title,
  8. this.iconPath,
  9. this.onPressed,
  10. this.showDivider,
  11. this.description
  12. }): assert (title != null),
  13. assert (iconPath != null),
  14. assert (onPressed != null);
  15. final bool showDivider;
  16. final String iconPath;
  17. final String title;
  18. final VoidCallback onPressed;
  19. final String description;
  20. @override
  21. Widget build(BuildContext context) {
  22. return FlatButton(
  23. padding: EdgeInsets.only(right: 0.0,left: ScreenUtil().setWidth(30.0)),
  24. onPressed: (){onPressed();},
  25. color: Colors.white,
  26. child: Row(
  27. crossAxisAlignment: CrossAxisAlignment.center,
  28. children: <Widget>[
  29. Image.asset(
  30. iconPath,
  31. width: ScreenUtil().setWidth(50.0),
  32. height: ScreenUtil().setWidth(50.0),
  33. ),
  34. SizedBox(width: ScreenUtil().setWidth(35.0),),
  35. Expanded(
  36. child: Container(
  37. height: ScreenUtil().setHeight(80.0),
  38. alignment: Alignment.centerLeft,
  39. decoration: BoxDecoration(
  40. border: Border(
  41. bottom: BorderSide(width: 0.5,color: showDivider ? Colors.black12 : Colors.white)
  42. )
  43. ),
  44. child: Row(
  45. children: <Widget>[
  46. Expanded(
  47. child:Text(title,style: TextStyle(fontSize: ScreenUtil().setSp(30.0),color: Color(AppColors.FullWithIconButton)),),
  48. ),
  49. Icon(ICons.RIGHT,color: Color(AppColors.KeyboardArrowRight),),
  50. SizedBox(width: ScreenUtil().setWidth(25.0),)
  51. ],
  52. ),
  53. ),
  54. )
  55. ],
  56. ),
  57. );
  58. }
  59. }