Skip to content

Instantly share code, notes, and snippets.

@corelmax
Last active January 10, 2021 18:28
Show Gist options
  • Save corelmax/d57601a2999488a8975a56c371255168 to your computer and use it in GitHub Desktop.
Save corelmax/d57601a2999488a8975a56c371255168 to your computer and use it in GitHub Desktop.
@@ -2,6 +2,11 @@
import 'package:uuid/uuid.dart';
class TodoList extends StatefulWidget {
+
+ static TodoListState of(BuildContext context) {
+ return context.findAncestorStateOfType<TodoListState>();
+ }
+
@override
State<StatefulWidget> createState() {
return TodoListState();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment