diff --git a/packages/pigeon/lib/src/generator_tools.dart b/packages/pigeon/lib/src/generator_tools.dart index e00fdf2063dd..1a8d81f3951b 100644 --- a/packages/pigeon/lib/src/generator_tools.dart +++ b/packages/pigeon/lib/src/generator_tools.dart @@ -112,7 +112,7 @@ class Indent { void addScoped( String? begin, String? end, - Function func, { + void Function() func, { bool addTrailingNewline = true, int nestCount = 1, }) { @@ -132,7 +132,7 @@ class Indent { void writeScoped( String? begin, String? end, - Function func, { + void Function() func, { int nestCount = 1, bool addTrailingNewline = true, }) { @@ -148,9 +148,9 @@ class Indent { /// Scoped increase of the indent level. /// /// For the execution of [func] the indentation will be incremented by the given amount. - void nest(int count, Function func) { + void nest(int count, void Function() func) { inc(count); - func(); // ignore: avoid_dynamic_calls + func(); dec(count); }