File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -46,20 +46,22 @@ mixin ComputedFlutterMixin on StatelessWidget {
46
46
StatelessElement createElement () => ComputedFlutterElement (this );
47
47
}
48
48
49
+ /// Allows Computed to track reactive dependencies of the build method.
50
+ mixin ComputedFlutterStatefulMixin on StatefulWidget {
51
+ @override
52
+ StatefulElement createElement () => ComputedFlutterStatefulElement (this );
53
+ }
54
+
49
55
/// A [StatelessWidget] the build method of which is tracked by Computed.
50
- abstract class ComputedWidget extends StatelessWidget {
56
+ abstract class ComputedWidget extends StatelessWidget
57
+ with ComputedFlutterMixin {
51
58
const ComputedWidget ({super .key});
52
-
53
- @override
54
- StatelessElement createElement () => ComputedFlutterElement (this );
55
59
}
56
60
57
61
/// A [StatefulWidget] the build method of which is tracked by Computed.
58
- abstract class ComputedStatefulWidget extends StatefulWidget {
62
+ abstract class ComputedStatefulWidget extends StatefulWidget
63
+ with ComputedFlutterStatefulMixin {
59
64
const ComputedStatefulWidget ({super .key});
60
-
61
- @override
62
- StatefulElement createElement () => ComputedFlutterStatefulElement (this );
63
65
}
64
66
65
67
/// As [Builder] , but the builder is tracked by Computed.
You can’t perform that action at this time.
0 commit comments