{"action":"created","issue":{"url":"https://api.github.com/repos/brianegan/scoped_model/issues/27","repository_url":"https://api.github.com/repos/brianegan/scoped_model","labels_url":"https://api.github.com/repos/brianegan/scoped_model/issues/27/labels{/name}","comments_url":"https://api.github.com/repos/brianegan/scoped_model/issues/27/comments","events_url":"https://api.github.com/repos/brianegan/scoped_model/issues/27/events","html_url":"https://github.com/brianegan/scoped_model/issues/27","id":351822731,"node_id":"MDU6SXNzdWUzNTE4MjI3MzE=","number":27,"title":"Cross-platform Support","user":{"login":"brianegan","id":126604,"node_id":"MDQ6VXNlcjEyNjYwNA==","avatar_url":"https://avatars2.githubusercontent.com/u/126604?v=4","gravatar_id":"","url":"https://api.github.com/users/brianegan","html_url":"https://github.com/brianegan","followers_url":"https://api.github.com/users/brianegan/followers","following_url":"https://api.github.com/users/brianegan/following{/other_user}","gists_url":"https://api.github.com/users/brianegan/gists{/gist_id}","starred_url":"https://api.github.com/users/brianegan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brianegan/subscriptions","organizations_url":"https://api.github.com/users/brianegan/orgs","repos_url":"https://api.github.com/users/brianegan/repos","events_url":"https://api.github.com/users/brianegan/events{/privacy}","received_events_url":"https://api.github.com/users/brianegan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-08-18T14:00:32Z","updated_at":"2018-08-20T09:51:40Z","closed_at":null,"author_association":"OWNER","body":"Hey all,\r\n\r\nOne downside to scoped_model: It cannot be used for AngularDart / Dart Web apps because `Model` implements the `Listenable` interface from Flutter.\r\n\r\n### Proposal \r\n\r\nSplit scoped_model into 3 packages:\r\n\r\n  1. `scoped_model` would contain *only* the `Model` class, which implements no interfaces.\r\n  2. `scoped_model_flutter` would Import the `Model` class and use it for the  `ScopedModel` / `ScopedModelDescendant` Widgets\r\n  3. `scoped_model_angular` would provide a `Pipe` that can be used to listen for changes to a `Model` class, rebuilding the appropriate component on change. e.g. `{{(myModel | listen).message}}`\r\n\r\n### Pros\r\n\r\nMakes the Model class Completely independent of Flutter, and can be re-used cross-platform.\r\n\r\n### Cons\r\n\r\n  * Can't create a `MyModel.of(BuildContext context)` method directly on the Model if you want to use the library cross-platform. I don't know how common this is...\r\n  * Not sure if folks are currently using `scoped_model` as a Listenable (such as with an `AnimatedBuilder` widget), or merging it with other Listenables via the `Listenable.merge` constructor.\r\n\r\nWould love to hear your thoughts @passsy, @apwilson, @chimon2000 and others! Is anyone using the `Model` class as a `Listenable`?"},"comment":{"url":"https://api.github.com/repos/brianegan/scoped_model/issues/comments/414261261","html_url":"https://github.com/brianegan/scoped_model/issues/27#issuecomment-414261261","issue_url":"https://api.github.com/repos/brianegan/scoped_model/issues/27","id":414261261,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNDI2MTI2MQ==","user":{"login":"brianegan","id":126604,"node_id":"MDQ6VXNlcjEyNjYwNA==","avatar_url":"https://avatars2.githubusercontent.com/u/126604?v=4","gravatar_id":"","url":"https://api.github.com/users/brianegan","html_url":"https://github.com/brianegan","followers_url":"https://api.github.com/users/brianegan/followers","following_url":"https://api.github.com/users/brianegan/following{/other_user}","gists_url":"https://api.github.com/users/brianegan/gists{/gist_id}","starred_url":"https://api.github.com/users/brianegan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brianegan/subscriptions","organizations_url":"https://api.github.com/users/brianegan/orgs","repos_url":"https://api.github.com/users/brianegan/repos","events_url":"https://api.github.com/users/brianegan/events{/privacy}","received_events_url":"https://api.github.com/users/brianegan/received_events","type":"User","site_admin":false},"created_at":"2018-08-20T09:51:40Z","updated_at":"2018-08-20T09:51:40Z","author_association":"OWNER","body":"Thanks for the feedback :) \r\n\r\n  >  I wonder, in a non flutter environment, what is the use case for a Model?\r\n\r\nI thought it might be cool to support cross-platform dev with the Model class, since you could reuse a `TodoListModel` or `UserModel` for example between AngularDart and Flutter apps without needing to rewrite anything, similar to the BLoC pattern which is based on Streams.\r\n\r\nI think of the Listenable or Model classes as \"simple streams,\" and some folks seem to prefer them over stream-based architectures because they're easy to work with.\r\n\r\nAngularDart apps could pass a Model around via Dependency Injection rather than an InheritedWidget, and listen to updates using the proposed `listen` pipe, so I think it'd be a pretty good story on that side of the fence as well.\r\n\r\nThat said, I've gotten some mixed feedback on this proposal, and not sure folks are even really interested in this feature or if folks would even use it for cross-platform coding. \r\n\r\nI'll keep it open for now but won't make any changes, and if we get more interest I'll consider taking some more time to flesh it out!"}}
{"actor":{"display_login":"brianegan"}}