Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR DART

dart typedef

typedef ManyOperation(int firstNo, int secondNo);   // function signature to match
Subtract(int firstNo, int second){
   print("Subtract result is ${firstNo-second}"); 
}  
Calculator(int a, int b, ManyOperation oper){ 		// matches function signature
   oper(a,b); 
}  
main(){ 
   Calculator(5, 5, Subtract); 						// 'Subtract result is 0'
} 
Source by www.tutorialspoint.com #
 
PREVIOUS NEXT
Tagged: #dart #typedef
ADD COMMENT
Topic
Name
6+8 =