You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.4KB

  1. import 'package:farm_tpf/utils/const_color.dart';
  2. import 'package:flutter/material.dart';
  3. class ButtonWidget extends StatelessWidget {
  4. final Function onPressed;
  5. final String title;
  6. ButtonWidget({required this.title, required this.onPressed});
  7. @override
  8. Widget build(BuildContext context) {
  9. return SizedBox(
  10. width: double.infinity,
  11. height: 55,
  12. child:
  13. // FlatButton(
  14. // onPressed: onPressed,
  15. // color: AppColors.DEFAULT,
  16. // shape: RoundedRectangleBorder(
  17. // borderRadius: new BorderRadius.circular(7.0),
  18. // ),
  19. // child: Text(title.toUpperCase(), style: TextStyle(fontWeight: FontWeight.bold, color: AppColors.WHITE, fontSize: 18)),
  20. // ),
  21. TextButton(
  22. onPressed: () {
  23. onPressed();
  24. },
  25. style: ButtonStyle(
  26. backgroundColor: MaterialStateProperty.all<Color>(AppColors.DEFAULT),
  27. shape: MaterialStateProperty.all<OutlinedBorder>(
  28. RoundedRectangleBorder(
  29. borderRadius: BorderRadius.circular(7.0),
  30. ),
  31. ),
  32. ),
  33. child: Text(
  34. title.toUpperCase(),
  35. style: TextStyle(
  36. fontWeight: FontWeight.bold,
  37. color: AppColors.WHITE,
  38. fontSize: 18,
  39. ),
  40. ),
  41. ));
  42. }
  43. }