事象
文字が長いと以下のようにエラーが出てしまいます。
A RenderFlex overflowed by 1312 pixels on the right.
Swiftなどだと、
UILabelのtruncate
パラメータ等で調整します。
解決方法
Textの`Overflow`パラメータを使用する。
修正前
Text(categoryName,
style: TextStyle(
fontFamily: 'SFProDisplay',
color: Color(0xffffffff),
fontSize: 30,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
letterSpacing: 0.0075,
),
textAlign: TextAlign.right,
),
修正後
Text(categoryName,
style: TextStyle(
fontFamily: 'SFProDisplay',
color: Color(0xffffffff),
fontSize: 30,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
letterSpacing: 0.0075,
),
textAlign: TextAlign.right,
overflow: TextOverflow.ellipsis, //ここ!!
),