12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- import 'package:flutter/material.dart';
- class RecordCommonItem extends StatelessWidget {
- final String itemName;
- final String itemValue;
- final double fontSize;
- const RecordCommonItem({
- super.key,
- required this.itemName,
- required this.itemValue,
- required this.fontSize,
- });
- @override
- Widget build(BuildContext context) {
- return _buildItem(itemName, itemValue, fontSize);
- }
- Widget _buildItem(String itemName, String itemValue, double fontSize) {
- return SizedBox(
- child: Text.rich(
- TextSpan(
- text: '$itemName ',
- style: TextStyle(
- color: Colors.black38,
- fontSize: fontSize,
- ),
- children: [
- TextSpan(
- text: itemValue,
- style: TextStyle(
- color: Colors.black,
- fontSize: fontSize,
- ),
- ),
- ],
- ),
- maxLines: 1, // Set the maximum lines
- overflow: TextOverflow.ellipsis, //
- ),
- );
- }
- }
|