Answers for "flutter pass parameters to onpressed"

0

flutter pass onchanged callback in arguments

class DropdownItem extends StatelessWidget {
	final Function(bool) onchangedCallback;
    
    // ....
    Checkbox(
            onChanged: onchangedCallback,
            ),
Posted by: Guest on February-01-2021
0

flutter pass onPress function as parameter

int  result = 0;

    void calculate(num1, num2) {
     setState(() {
         result = num1 + num2;
     });
    }


    new RaisedButton(
          onPressed: () => calculate(1, 100),
          ...
    ),
    new Text("$result")
Posted by: Guest on July-19-2021

Code answers related to "flutter pass parameters to onpressed"

Code answers related to "Dart"

Browse Popular Code Answers by Language