Move classes like MediaItem and PlaybackState into a regular Dart package
Is your feature request related to a problem? Please describe.
I'm writing my app's business logic in a Dart package, that can be used for CLI and Flutter UIs. It'd be great to use types like MediaItem and PlaybackState in the business logic and CLI code. At the moment, this isn't possible, because they're declared in the main package which depends on Flutter.
Describe the solution you'd like Types like these can be moved into a Dart package.
Describe alternatives you've considered The only solution in the meantime would be to define copies of these types and convert them when necessary. This is painful and resource-intensive.
Additional context
Would you be open to a PR on the one-isolate branch?
In theory it sounds like a great idea but a reusable package like this absolutely needs to be very stable. Recently I changed the artUri type from String to Uri for example and that only affected the republishing of one package. But I could see such a package as the one you're proposing being used by many packages on pub.dev. Any breaking change to that library will end up in a situation where some of these packages will be slow to migrate, and then app developers will be faced with a situation where they can't use a certain combination of packages because their transitive dependencies are incompatible.
This was in the forefront of my mind when I created audio_session which is intended to be extremely reusable. But now every change to that package has to be considered very carefully so as not to break the ecosystem.
Would a warning that the package may change often be enough? I intend it to be used by libraries that are compatible with audio_service handlers, rather than things that just using objects like MediaItem for their own purposes, so library authors should be expecting frequent changes as this package is updated.
i see MediaItem as a part of the core of this plugin so i don't think it should be separated to anywhere else
The only solution in the meantime would be to define copies of these types and convert them when necessary. This is painful and resource-intensive.
why?