Skip to content

Tooltip text color is incorrect when the primarySwatch color is a light color #33654

@sgon00

Description

@sgon00

Flutter version

[✓] Flutter (Channel master, v1.6.1-pre.47, on Mac OS X 10.13.6 17G4015, locale en-CN)

Code

import 'package:flutter/material.dart';

void main() => runApp(App());

class App extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: "test",
      theme: ThemeData(
        primarySwatch: Colors.yellow
      ),
      home: MyWidget()
    );
  }
}

class MyWidget extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        actions: <Widget>[
          IconButton(
            icon: Icon(Icons.add),
            onPressed: () {},
            tooltip: 'test',
          )
        ],
      ),
    );
  }
}

Screenshot

tooltip

Issue Description

Regardless what the primarySwatch color is, the tooltip background is always black. This is fine to me. But when primarySwatch is a light color, the tooltip text color changed from white to black. This really doesn't make sense. primarySwatch color has nothing to do with tooltip text color because the tooltip background color is never changed. Tooltip with black background and black text color is hard to read.

Expected: the tooltip text color should never be changed and should remain white. (the same color when primarySwatch color is a dark color).

Metadata

Metadata

Assignees

Labels

f: material designflutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions