
Короткий ответ:
Column(
mainAxisSize: MainAxisSize.min,
children: [
Icon(Icons.call),
SizedBox(height: 4), // spacing between two
Text('Call Icon'),
],
)
Длинный ответ:
Скопируйте этот класс:
class TextWithIcon extends StatelessWidget {
final IconData icon;
final String text;
final double spacing;
const TextWithIcon({Key key, this.icon, this.text, this.spacing = 2}) : super(key: key);
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.all(8),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Icon(icon),
SizedBox(height: spacing),
Text(text),
],
),
);
}
}
Использование:
TextWithIcon(
icon: Icons.call,
spacing: 6, // Space between icon and text
text: 'Call Icon',
)