Skip to content

Instantly share code, notes, and snippets.

@evaisse
Last active June 19, 2025 14:13
Show Gist options
  • Select an option

  • Save evaisse/08f7f48f58fd196df0646439c4d7cb39 to your computer and use it in GitHub Desktop.

Select an option

Save evaisse/08f7f48f58fd196df0646439c4d7cb39 to your computer and use it in GitHub Desktop.
doc_returns_types_for_function.dart
/// Attention à TOUJOURS typer le retour des callback/builders
/// que vous allez passer aux widgets/controllers.
class Foo {
Function()? onFoo;
void Function()? onFoufou;
Foo({ this.onFoo, this.onFoufou });
}
void main() {
// AVANT
final a = Foo();
print(a.onFoo?.call() ?? 'foo');
// MAINTENANT
print(a.onFoufou?.call() ?? 'foufou');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment