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.
 
 
 
 
 
 

75 lines
2.1 KiB

  1. // ignore_for_file: public_member_api_docs, sort_constructors_first
  2. import 'package:flutter/material.dart';
  3. import 'package:qadirneyriz/config/config.dart';
  4. class PickerCustom extends StatelessWidget {
  5. final String showDate;
  6. final void Function()? onTap;
  7. final String? title;
  8. final bool isForm;
  9. final IconData icon;
  10. const PickerCustom(
  11. {Key? key,
  12. required this.showDate,
  13. required this.onTap,
  14. this.title,
  15. this.icon = Icons.calendar_month,
  16. this.isForm = false})
  17. : super(key: key);
  18. @override
  19. Widget build(BuildContext context) {
  20. return GestureDetector(
  21. onTap: onTap,
  22. child: Container(
  23. decoration: BoxDecoration(
  24. border: Border(
  25. bottom: BorderSide(color: config.ui.mainGreen, width: 2),
  26. ),
  27. ),
  28. child: Padding(
  29. padding: const EdgeInsets.symmetric(vertical: 5, horizontal: 8),
  30. child: Column(
  31. crossAxisAlignment: CrossAxisAlignment.start,
  32. children: [
  33. if (this.isForm)
  34. Text(
  35. this.title ?? '',
  36. style: TextStyle(
  37. fontWeight: FontWeight.normal,
  38. fontSize: 13,
  39. color: Colors.black.withOpacity(.8)),
  40. ),
  41. if (this.isForm)
  42. SizedBox(
  43. height: 5,
  44. ),
  45. Padding(
  46. padding: const EdgeInsets.symmetric(vertical: 8),
  47. child: Row(
  48. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  49. children: [
  50. Text(
  51. showDate,
  52. style: TextStyle(
  53. fontSize: 13, color: Colors.black.withOpacity(.5)),
  54. ), // This will show the updated date
  55. const SizedBox(width: 10),
  56. Icon(
  57. icon,
  58. size: 17,
  59. color: config.ui.secendGreen,
  60. ),
  61. ],
  62. ),
  63. ),
  64. ],
  65. ),
  66. ),
  67. ),
  68. );
  69. }
  70. }