record_common_item.dart 944 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import 'package:flutter/material.dart';
  2. class RecordCommonItem extends StatelessWidget {
  3. final String itemName;
  4. final String itemValue;
  5. final double fontSize;
  6. const RecordCommonItem({
  7. super.key,
  8. required this.itemName,
  9. required this.itemValue,
  10. required this.fontSize,
  11. });
  12. @override
  13. Widget build(BuildContext context) {
  14. return _buildItem(itemName, itemValue, fontSize);
  15. }
  16. Widget _buildItem(String itemName, String itemValue, double fontSize) {
  17. return SizedBox(
  18. child: Text.rich(
  19. TextSpan(
  20. text: '$itemName ',
  21. style: TextStyle(
  22. color: Colors.black38,
  23. fontSize: fontSize,
  24. ),
  25. children: [
  26. TextSpan(
  27. text: itemValue,
  28. style: TextStyle(
  29. color: Colors.black,
  30. fontSize: fontSize,
  31. ),
  32. ),
  33. ],
  34. ),
  35. ),
  36. );
  37. }
  38. }