Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR DART

dart callback function with parameter

class Obj {
	// <returnType> Function(<parameters>) fName;
	String Function(String, int, etc...) callbackName;
    
    // Call the callback function somewhere, eg constructor, textfield etc.
    Obj(this.callbackName);
}

main() {
	// Use the callback
	var myObj = Obj((String p1, int p2, etc...) {
		return "$p1$p2";
	});
}
 
PREVIOUS NEXT
Tagged: #dart #callback #function #parameter
ADD COMMENT
Topic
Name
9+3 =