{"action":"closed","issue":{"url":"https://api.github.com/repos/dart-lang/dart_lint/issues/14","labels_url":"https://api.github.com/repos/dart-lang/dart_lint/issues/14/labels{/name}","comments_url":"https://api.github.com/repos/dart-lang/dart_lint/issues/14/comments","events_url":"https://api.github.com/repos/dart-lang/dart_lint/issues/14/events","html_url":"https://github.com/dart-lang/dart_lint/issues/14","id":57109301,"number":14,"title":"Lint for one-member abstract class when a simple function will do (Style Guide).","user":{"login":"pq","id":67586,"avatar_url":"https://avatars.githubusercontent.com/u/67586?v=3","gravatar_id":"","url":"https://api.github.com/users/pq","html_url":"https://github.com/pq","followers_url":"https://api.github.com/users/pq/followers","following_url":"https://api.github.com/users/pq/following{/other_user}","gists_url":"https://api.github.com/users/pq/gists{/gist_id}","starred_url":"https://api.github.com/users/pq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pq/subscriptions","organizations_url":"https://api.github.com/users/pq/orgs","repos_url":"https://api.github.com/users/pq/repos","events_url":"https://api.github.com/users/pq/events{/privacy}","received_events_url":"https://api.github.com/users/pq/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dart-lang/dart_lint/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"closed","locked":false,"assignee":{"login":"pq","id":67586,"avatar_url":"https://avatars.githubusercontent.com/u/67586?v=3","gravatar_id":"","url":"https://api.github.com/users/pq","html_url":"https://github.com/pq","followers_url":"https://api.github.com/users/pq/followers","following_url":"https://api.github.com/users/pq/following{/other_user}","gists_url":"https://api.github.com/users/pq/gists{/gist_id}","starred_url":"https://api.github.com/users/pq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pq/subscriptions","organizations_url":"https://api.github.com/users/pq/orgs","repos_url":"https://api.github.com/users/pq/repos","events_url":"https://api.github.com/users/pq/events{/privacy}","received_events_url":"https://api.github.com/users/pq/received_events","type":"User","site_admin":false},"milestone":null,"comments":0,"created_at":"2015-02-09T23:54:04Z","updated_at":"2015-02-10T00:20:32Z","closed_at":"2015-02-10T00:20:32Z","body":"From the [style guide] (https://www.dartlang.org/articles/style-guide/):\r\n\r\n**AVOID** defining a one-member abstract class when a simple function will do.\r\n\r\nUnlike Java, Dart has first-class functions, closures, and a nice light syntax for using them. If all you need is something like a callback, just use a function. If you're defining an class and it only has a single abstract member with a meaningless name like ``call`` or ``invoke``, there is a good chance you just want a function.\r\n\r\n**GOOD:**\r\n```\r\ntypedef bool Predicate(item);\r\n```\r\n\r\n**BAD:**\r\n```\r\nabstract class Predicate {\r\n  bool test(item);\r\n}\r\n```"}}