exam_side_bar.dart 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. import 'package:flutter/material.dart';
  2. class ExamSideBar extends StatelessWidget {
  3. final String title;
  4. final String value;
  5. final String unit;
  6. final Function? onTap;
  7. final bool? hasDevice;
  8. const ExamSideBar({
  9. super.key,
  10. required this.title,
  11. required this.value,
  12. required this.unit,
  13. this.onTap,
  14. this.hasDevice = false,
  15. });
  16. @override
  17. Widget build(BuildContext context) {
  18. var padding = const EdgeInsets.only(
  19. right: 30,
  20. );
  21. return Container(
  22. margin: const EdgeInsets.only(top: 10),
  23. child: InkWell(
  24. onTap: () => onTap?.call(),
  25. child: Container(
  26. margin: const EdgeInsets.only(top: 10),
  27. // padding: const EdgeInsets.symmetric(vertical: 20),
  28. child: Row(
  29. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  30. crossAxisAlignment: CrossAxisAlignment.start,
  31. children: [
  32. Container(
  33. height: 50,
  34. alignment: Alignment.center,
  35. child: Text(
  36. title,
  37. style: const TextStyle(
  38. fontSize: 26,
  39. ),
  40. ),
  41. ),
  42. Container(
  43. alignment: Alignment.bottomRight,
  44. padding: padding,
  45. child: FittedBox(
  46. child: Row(
  47. mainAxisAlignment: MainAxisAlignment.end,
  48. crossAxisAlignment: CrossAxisAlignment.center,
  49. children: [
  50. Text(
  51. value,
  52. style: const TextStyle(
  53. fontSize: 26,
  54. color: Colors.black,
  55. ),
  56. ),
  57. Text(
  58. " $unit",
  59. style: const TextStyle(fontSize: 26),
  60. )
  61. ],
  62. ),
  63. ),
  64. ),
  65. ],
  66. ),
  67. ),
  68. ),
  69. );
  70. }
  71. }