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

Parent icon color not changing #27

Open
dmvvilela opened this issue Apr 15, 2019 · 4 comments
Open

Parent icon color not changing #27

dmvvilela opened this issue Apr 15, 2019 · 4 comments
Labels
bug Something isn't working

Comments

@dmvvilela
Copy link

I can't change the color of the icon.. I have on the scaffold:

floatingActionButton: UnicornDialer(
backgroundColor: Color.fromRGBO(255, 255, 255, 0.6),
parentButtonBackground: Color(0xFFFFD421),
orientation: UnicornOrientation.VERTICAL,
parentButton: Icon(
Icons.add,
color: Colors.black, // not working
),
childButtons: _childButtons,
),

But it is still white.

@hiseholuwa
Copy link

If you change this in the source code:

var mainFAB = AnimatedBuilder(
        animation: this._parentController,
       ...
                          child: new Icon(
                              this._animationController.isDismissed
                                  ? widget.parentButton.icon
                                  : widget.finalButtonIcon == null
                                  ? Icons.close
                                  : widget.finalButtonIcon.icon),
                        );
                      })));
        });

to:

var mainFAB = AnimatedBuilder(
        animation: this._parentController,
       ...
                          child: this._animationController.isDismissed
                                  ? widget.parentButton
                                  : widget.finalButtonIcon
                         );
                      })));
        });

should solve your problem. Just make sure both parentIcon and finalIcon are not null. Or better yet you can do:

var mainFAB = AnimatedBuilder(
        animation: this._parentController,
       ...
                          child: this._animationController.isDismissed
                                  ? widget.parentButton
                                  : widget.finalButtonIcon == null
                                  ? Icon(Icons.close)
                                  : widget.finalButtonIcon,
                        );
                      })));
        });

@mohamed6996
Copy link

  floatingActionButton: Theme(
        data: ThemeData(
            accentIconTheme: IconThemeData(color: Colors.white)),
        child: UnicornDialer(
            //backgroundColor: Color.fromRGBO(255, 255, 255, 0.6),
            //  parentButtonBackground: Colors.redAccent,
            orientation: UnicornOrientation.VERTICAL,
            parentButton: Icon(Icons.add),
            childButtons: childButtons),
      ),

@Purvik
Copy link

Purvik commented Mar 25, 2020

@mohamed6996 This should be a perfect answer.

@tiagojencmartins tiagojencmartins added the bug Something isn't working label Apr 25, 2020
@ra-develop
Copy link

@mohamed6996 Thank you! Good idea! It is very helpful for me.
Little correcting. This construction: "accentIconTheme: IconThemeData(color: Colors.white))," was deprecated. Recommended use this method:

...
data: ThemeData(
          floatingActionButtonTheme:
              FloatingActionButtonThemeData(foregroundColor: Colors.black)),
      child: UnicornDialer(
          parentButtonBackground: Colors.white,
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants