Skip to content

Commit 47e4875

Browse files
committed
fix(no-ref): remove bodytext2
1 parent fcd0c52 commit 47e4875

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

charts_flutter/lib/src/behaviors/legend/legend_entry_layout.dart

+6-3
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@
1515

1616
import 'package:charts_common/common.dart' as common;
1717
import 'package:charts_flutter/src/util/color.dart';
18+
import 'package:flutter/material.dart';
1819
import 'package:flutter/widgets.dart';
1920
import 'package:flutter/material.dart'
20-
show GestureDetector, GestureTapUpCallback, TapUpDetails, Theme;
21+
show Colors, GestureDetector, GestureTapUpCallback, TapUpDetails, Theme;
2122

2223
import '../../symbol_renderer.dart';
2324
import 'legend.dart' show TappableLegend;
@@ -131,8 +132,10 @@ class SimpleLegendEntryLayout implements LegendEntryLayout {
131132
: null;
132133
if (isHidden) {
133134
// Use a default color for hidden legend entries if none is provided.
134-
color ??= Theme.of(context).textTheme.bodyText2!.color;
135-
color = color!.withOpacity(0.26);
135+
color ??= MediaQuery.of(context).platformBrightness == Brightness.dark
136+
? Colors.white
137+
: Colors.black;
138+
color = color.withOpacity(0.26);
136139
}
137140

138141
return new TextStyle(

0 commit comments

Comments
 (0)