Last active
March 3, 2023 07:35
-
-
Save Alexi-Zemcov/d36f84154c4dd79d57aa94af68b1758d to your computer and use it in GitHub Desktop.
Text height from DS broke cross axis alignment.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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