Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In dark mode FloatingActionButton and RaisedButton render text with different color even if the foreground color is the same #16488

Closed
AxelMarquez opened this issue Apr 12, 2018 · 3 comments
Labels
a: quality A truly polished experience f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.

Comments

@AxelMarquez
Copy link

AxelMarquez commented Apr 12, 2018

In dark mode, when I set the same color for FloatingActionButton and RaisedButton, RaisedButton’s text has different color.

dark
light

Is this the expected behavior?

The code for the dark screenshot is the following (for the light one just change dark to light):

class MyApp extends StatelessWidget {
  
  @override
  Widget build(BuildContext context) {

    return new MaterialApp(
      title: 'Flutter Demo',

      theme: new ThemeData(
        primarySwatch: Colors.orange,
        accentColor: Colors.orange,
        buttonColor: Colors.orange,
        brightness: Brightness.dark
      ),

      home: new Scaffold(
        appBar: new AppBar(title: new Text("Title")),
        body: new ListView(children: [
          new RaisedButton(child: new Text("Hi"), onPressed: () {}),
          new FloatingActionButton(child: new Text("Hi"), onPressed: () {})
        ]) 
      ),
    );
  }
}
@gspencergoog
Copy link
Contributor

No, I don't think this is the expected behavior. I think the problem is that the FAB doesn't use the ButtonTheme, whereas the RaisedButton does. This should be corrected.

@gspencergoog gspencergoog added the f: material design flutter/packages/flutter/material repository. label May 29, 2018
@zoechi zoechi added the framework flutter/packages/flutter repository. See also f: labels. label Jul 22, 2018
@zoechi zoechi added this to the Goals milestone Jan 28, 2019
@zoechi zoechi added the a: quality A truly polished experience label Jan 28, 2019
@HansMuller
Copy link
Contributor

@AxelMarquez - it's been a long time since you opened this issue and I apologize for the lack of activity. If you're still interested in the topic, there's a wide-ranging proposal for updating the button widgets and their themes in #54776. The new issue includes a proposal for API that would give one control over the text color of RaisedButtons. If you have time, I hope you'll take a look.

I'm going to close this issue in favor of #54776.

@flutter flutter deleted a comment from flutterq Jan 15, 2021
@github-actions
Copy link

github-actions bot commented Aug 7, 2021

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a: quality A truly polished experience f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

No branches or pull requests

4 participants