Search code snippets, questions, articles...

Call back function from one class to another

class Class1Name{
    Class2Name(functionName: functionName);

    void functionName(){
        //desired actions
    }
}

class Class2Name {
    final VoidCallback functionName;
    Class2Name({@required this.functionName});

    //call function
    functionName();
}

https://www.digitalocean.com/community/tutorials/flutter-widget-communication

Search Index Data (The code snippet can also be found with below search text)

VoidCallback
Call back function
from one class to another
Was this helpful?
0 Comments
Programming Feeds
Learn something new everyday on Devsheet