Flutter implements callback
Less than 1 minute
Flutter implements callback
sample code
new interface class:
// sample class
class S {
void Function(String)? onABC;
void Function(int)? onDEF;
STTCallback({this.onABC, this.onDEF});
}
how to use:
mian() {
final st = S(onABC: (string) {
print("S onABC: $string");
// add here
}, onDEF: (i) {
print("S onDEF: $i");
// add here
}
}