Skip to content

[FEATURE REQUEST] mixin on StatefulWidget #28

@lohnn

Description

@lohnn

It would be nice to be able to piggy back on the lifecycle of a StatefulWidget's state for handling the StatefulIsolate, like SingleTickerProviderStateMixin.

Describe the solution you'd like
Attaching a mixin on your StatefulWidget's state that creates and holds an Isolate and exposes it for running work on the isolate.
This mixin would handle lifecycle piggybacking on the State's initState and dispose functions.

Additional context
Naming is hard, the names I have come up with so far are probably not good for different reasons.

  • Reusing the name StatefulIsolate will probably end up in confusion, if even possible to implement.
  • Just use Isolate would look nice (class _MyWidgetState extends StatefulWidget<MyWidget> with Isolate) but would clash with the Isolate class from Dart.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions