Open hayribakici opened 1 year ago
Sounds like a great idea!
Here are my suggestions so far. Please feel free to add/change/remove/... them:
Bar get foo => ...;
or if it is an async
operation:
Future<Bar> get foo async => ...;
with_underscore
, use @Jsonkey(name: 'with_underscore')
to map the json entry e.g.@Jsonkey(name: 'with_underscore')
Bar? withUnderscore;
/// Gets [Foo] given [bar]
Future<Foo> getFoo(Bar bar) async {
final query = _buildQuery({'bar': bar});
return await _api._get('$_path?$query');
}
GET
request methods should have unit tests. The path for the API (e.g. v1/me/tracks
) reflects the json
response files in the test/data/
folder.=>
arrow syntax.enum
instead of String
for types returned by the API. See the Album
class for examples.String key
for the API. See dart's documentation for that and the Me.TimeRange
enum as an example.
While browsing through the
endpoint
files, I stumbled upon methods with no parameters (e.g.playlist.me
) that are written withget
properties and actual methods with no parameters (e.g.me.savedShows()
). It would be nice to iron out the inconsistancy with a set code convention rules (contributing.md
) or at least a guide (e.g. an issue or wiki-page) for new developers who want to add more features.