import 'package:flutter/material.dart'; /// 标签 + 值 的水平信息行,常用于详情页和调试面板。 class InfoRow extends StatelessWidget { const InfoRow({ super.key, required this.label, required this.value, this.valueStyle, this.crossAxisAlignment = CrossAxisAlignment.center, }); final String label; final String value; final TextStyle? valueStyle; final CrossAxisAlignment crossAxisAlignment; @override Widget build(BuildContext context) { final theme = Theme.of(context); return Padding( padding: const EdgeInsets.symmetric(vertical: 4), child: Row( crossAxisAlignment: crossAxisAlignment, children: [ SizedBox( width: 88, child: Text( label, style: theme.textTheme.bodySmall?.copyWith( color: theme.colorScheme.outline, ), ), ), const SizedBox(width: 8), Expanded( child: Text( value, style: valueStyle ?? theme.textTheme.bodySmall, ), ), ], ), ); } }