@widget
Widget foo(BuildContext context, int value) {
return Text('$value');
}
However when I add Foo(42) in my code and try to run it, it doesn't work
Compiler message:
org-dartlang-app:/main.dart:23:16: Error: Method not found: 'Foo'.
child: Foo(42),
^^^
org-dartlang-app:/main.dart:23:16: Error: The method 'Foo' isn't defined for the class 'MyHomePage'.
- 'MyHomePage' is from 'package:test_functional_widget/main.dart' ('org-dartlang-app:/main.dart').
Try correcting the name to the name of an existing method, or defining a method named 'Foo'.
child: Foo(42),
^^^
According to Install (builder) in readme, I added dependencies in pubspec.yaml
and made a simple widget
However when I add
Foo(42)
in my code and try to run it, it doesn't workflutter build apk
logflutter run
logflutter doctor
Repository with my example app