Commit be6458cc authored by Chris Bracken's avatar Chris Bracken Committed by GitHub

Apply a dark theme to Tooltip contents (#6572)

Use the typography specified in the theme rather than Typography.white.
parent 018ab3f6
...@@ -8,8 +8,8 @@ import 'dart:math' as math; ...@@ -8,8 +8,8 @@ import 'dart:math' as math;
import 'package:flutter/gestures.dart'; import 'package:flutter/gestures.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'colors.dart'; import 'theme.dart';
import 'typography.dart'; import 'theme_data.dart';
const double _kScreenEdgeMargin = 10.0; const double _kScreenEdgeMargin = 10.0;
const Duration _kFadeDuration = const Duration(milliseconds: 200); const Duration _kFadeDuration = const Duration(milliseconds: 200);
...@@ -265,6 +265,12 @@ class _TooltipOverlay extends StatelessWidget { ...@@ -265,6 +265,12 @@ class _TooltipOverlay extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ThemeData theme = Theme.of(context);
ThemeData darkTheme = new ThemeData(
brightness: Brightness.dark,
accentColor: theme.accentColor,
accentColorBrightness: theme.accentColorBrightness,
);
return new Positioned.fill( return new Positioned.fill(
child: new IgnorePointer( child: new IgnorePointer(
child: new CustomSingleChildLayout( child: new CustomSingleChildLayout(
...@@ -279,14 +285,14 @@ class _TooltipOverlay extends StatelessWidget { ...@@ -279,14 +285,14 @@ class _TooltipOverlay extends StatelessWidget {
opacity: 0.9, opacity: 0.9,
child: new Container( child: new Container(
decoration: new BoxDecoration( decoration: new BoxDecoration(
backgroundColor: Colors.grey[700], backgroundColor: darkTheme.backgroundColor,
borderRadius: new BorderRadius.circular(2.0) borderRadius: new BorderRadius.circular(2.0)
), ),
height: height, height: height,
padding: padding, padding: padding,
child: new Center( child: new Center(
widthFactor: 1.0, widthFactor: 1.0,
child: new Text(message, style: Typography.white.body1) child: new Text(message, style: darkTheme.textTheme.body1)
) )
) )
) )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment