Skip to content

Instantly share code, notes, and snippets.

@Alexi-Zemcov
Last active March 3, 2023 07:35
Show Gist options
  • Save Alexi-Zemcov/d36f84154c4dd79d57aa94af68b1758d to your computer and use it in GitHub Desktop.
Save Alexi-Zemcov/d36f84154c4dd79d57aa94af68b1758d to your computer and use it in GitHub Desktop.
Text height from DS broke cross axis alignment.
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
static const withHeight = TextStyle(
fontSize: 22,
height: 28 / 22,
);
static const withoutHeight = TextStyle(
fontSize: 22,
);
@override
Widget build(BuildContext context) {
return MaterialApp(
theme:ThemeData.dark(),
home: Scaffold(
body: Center(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: const [
Icon(Icons.circle, size: 3),
Text(
' Текст ',
style: withoutHeight,
),
Icon(Icons.circle, size: 3),
Text(
' без ',
style: withoutHeight,
),
Icon(Icons.circle, size: 3),
Text(
' высоты ',
style: withoutHeight,
),
Icon(Icons.circle, size: 3),
Text(
' Текст ',
style: withHeight,
),
Icon(Icons.circle, size: 3),
Text(
' с ',
style: withHeight,
),
Icon(Icons.circle, size: 3),
Text(
' высотой ',
style: withHeight,
),
Icon(Icons.circle, size: 3),
],
),
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment