From 35e7379e2f4cb2a051dd6485308be98caa9dafc0 Mon Sep 17 00:00:00 2001 From: dan63047 Date: Wed, 11 Oct 2023 18:32:47 +0300 Subject: [PATCH] Fix of tl_thingy text line under TR --- lib/views/main_view.dart | 1 + lib/widgets/tl_thingy.dart | 20 +++++++++++++++----- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/lib/views/main_view.dart b/lib/views/main_view.dart index 0c4ed76..f2343d0 100644 --- a/lib/views/main_view.dart +++ b/lib/views/main_view.dart @@ -1077,6 +1077,7 @@ class _OtherThingy extends StatelessWidget { children: [ Text(t.distinguishment, style: TextStyle(fontFamily: "Eurostile Round Extended", fontSize: bigScreen ? 42 : 28), textAlign: TextAlign.center), RichText( + textAlign: TextAlign.center, text: TextSpan( style: DefaultTextStyle.of(context).style, children: getDistinguishmentSetOfWidgets(distinguishment!.header!), diff --git a/lib/widgets/tl_thingy.dart b/lib/widgets/tl_thingy.dart index 9a203e8..9c5dd4b 100644 --- a/lib/widgets/tl_thingy.dart +++ b/lib/widgets/tl_thingy.dart @@ -55,14 +55,24 @@ class TLThingy extends StatelessWidget { Colors.green ), ), - Row( - mainAxisAlignment: MainAxisAlignment.center, + Column( children: [ - Text( - "${t.top} ${f2.format(tl.percentile * 100)}% (${tl.percentileRank.toUpperCase()})${tl.bestRank != "z" ? " • ${t.topRank}: ${tl.bestRank.toUpperCase()}" : ""}${topTR != null ? " (${f2.format(topTR)} TR)" : ""} • Glicko: ${f2.format(tl.glicko!)}±${f2.format(tl.rd!)}", + RichText( textAlign: TextAlign.center, + softWrap: true, + text: TextSpan( + style: DefaultTextStyle.of(context).style, + children: [ + TextSpan(text: "${t.top} ${f2.format(tl.percentile * 100)}% (${tl.percentileRank.toUpperCase()})"), + if (tl.bestRank != "z") const TextSpan(text: " • "), + if (tl.bestRank != "z") TextSpan(text: "${t.topRank}: ${tl.bestRank.toUpperCase()}"), + if (topTR != null) TextSpan(text: " (${f2.format(topTR)} TR)"), + TextSpan(text: " • Glicko: ${f2.format(tl.glicko!)}±"), + TextSpan(text: f2.format(tl.rd!), style: tl.decaying ? TextStyle(color: tl.rd! > 98 ? Colors.red : Colors.yellow) : null), + if (tl.decaying) WidgetSpan(child: Icon(Icons.trending_up, color: tl.rd! > 98 ? Colors.red : Colors.yellow,), alignment: PlaceholderAlignment.middle, baseline: TextBaseline.alphabetic) + ], + ), ), - if (tl.decaying) Icon(Icons.trending_up, color: tl.rd! > 98 ? Colors.red : Colors.yellow,) ], ), ],