0

I'm using a Speed Dial type floating menu from a floatingActionButton. I'm populating the different icons from a list, but I'm having trouble populating the necessary onPressed: method. My widget is coded like so...

child: new FloatingActionButton(
                heroTag: "Y${icons[index]}",
                backgroundColor: Colors.blue,
                mini: true,
                child: new Icon(icons[index], color: Colors.white),
                onPressed: () {print("hello");},
              ),

All my icons successfully print "hello". How can I make them use different methods or specifically Navigations?

1 Answer 1

2
List<VoidCallback> functions = [(){
    print("hello 1");
}, () {
    print("hello 2");
}];

You can use it as functions[index]

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.