@@ -24,8 +24,6 @@ class GSYIConText extends StatelessWidget {
2424
2525 final MainAxisSize mainAxisSize;
2626
27- final CrossAxisAlignment crossAxisAlignment;
28-
2927 final double textWidth;
3028
3129 GSYIConText (
@@ -38,18 +36,19 @@ class GSYIConText extends StatelessWidget {
3836 this .onPressed,
3937 this .mainAxisAlignment = MainAxisAlignment .start,
4038 this .mainAxisSize = MainAxisSize .max,
41- this .crossAxisAlignment = CrossAxisAlignment .center,
4239 this .textWidth = - 1 ,
4340 });
4441
4542 @override
4643 Widget build (BuildContext context) {
4744 Widget showText = (textWidth == - 1 )
48- ? new Text (
49- iconText,
50- style: textStyle,
51- overflow: TextOverflow .ellipsis,
52- maxLines: 1 ,
45+ ? new Container (
46+ child: new Text (
47+ iconText,
48+ style: textStyle.merge (new TextStyle (textBaseline: TextBaseline .alphabetic)),
49+ overflow: TextOverflow .ellipsis,
50+ maxLines: 1 ,
51+ ),
5352 )
5453 : new Container (
5554 width: textWidth,
@@ -63,19 +62,22 @@ class GSYIConText extends StatelessWidget {
6362 maxLines: 1 ,
6463 ));
6564
66- return new Row (
67- mainAxisAlignment: mainAxisAlignment,
68- mainAxisSize: mainAxisSize,
69- crossAxisAlignment: crossAxisAlignment,
70- children: < Widget > [
71- new Icon (
72- iconData,
73- size: iconSize,
74- color: iconColor,
75- ),
76- new Padding (padding: new EdgeInsets .all (padding)),
77- new Expanded (child: showText)
78- ],
65+ return new Container (
66+ child: new Row (
67+ textBaseline: TextBaseline .alphabetic,
68+ mainAxisAlignment: mainAxisAlignment,
69+ mainAxisSize: mainAxisSize,
70+ crossAxisAlignment: CrossAxisAlignment .baseline,
71+ children: < Widget > [
72+ new Icon (
73+ iconData,
74+ size: iconSize,
75+ color: iconColor,
76+ ),
77+ new Padding (padding: new EdgeInsets .all (padding)),
78+ showText
79+ ],
80+ ),
7981 );
8082 }
8183}
0 commit comments