minor fixes

This commit is contained in:
Thibault Deckers 2022-05-13 11:57:13 +09:00
parent 4eb6f948e8
commit da99f6d138
4 changed files with 12 additions and 3 deletions

View file

@ -29,6 +29,8 @@ class Constants {
// Pop Directional Isolate
static const pdi = '\u2069';
static const zwsp = '\u200B';
static const overlayUnknown = ''; // em dash
static final pointNemo = LatLng(-48.876667, -123.393333);

View file

@ -56,7 +56,7 @@ class SectionHeader<T> extends StatelessWidget {
),
),
// TODO TLAD [flutter 3] remove this zero-width span when this is fixed: https://github.com/flutter/flutter/issues/103615
TextSpan(text: '\u200B' * 3, style: Constants.titleTextStyle),
TextSpan(text: Constants.zwsp * 3, style: Constants.titleTextStyle),
TextSpan(
text: title,
style: Constants.titleTextStyle,

View file

@ -78,7 +78,7 @@ class _RenderSliverKnownExtentBoxAdaptor extends RenderSliverMultiBoxAdaptor {
SectionLayout? sectionAtOffset(double scrollOffset) => sectionLayouts.firstWhereOrNull((section) => section.hasChildAtOffset(scrollOffset)) ?? sectionLayouts.lastOrNull;
double indexToLayoutOffset(int index) {
return (sectionAtIndex(index) ?? sectionLayouts.last).indexToLayoutOffset(index);
return (sectionAtIndex(index) ?? sectionLayouts.lastOrNull)?.indexToLayoutOffset(index) ?? 0;
}
int getMinChildIndexForScrollOffset(double scrollOffset) {

View file

@ -130,7 +130,14 @@ class _InfoRowGroupState extends State<InfoRowGroup> {
// and each span respects the directionality of its inner text only
return [
TextSpan(text: '${Constants.fsi}$key${Constants.pdi}', style: _keyStyle),
WidgetSpan(child: SizedBox(width: thisSpaceSize)),
WidgetSpan(
child: SizedBox(
width: thisSpaceSize,
// as of Flutter v3.0.0, the underline decoration from the following `TextSpan`
// is applied to the `WidgetSpan` too, so we add a dummy `Text` as a workaround
child: const Text(''),
),
),
TextSpan(text: '${Constants.fsi}$value${Constants.pdi}', style: style, recognizer: recognizer),
];
},