-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: Latest launch #14
base: main
Are you sure you want to change the base?
Conversation
I implemented the suggestions. |
@@ -93,4 +107,24 @@ class SpaceXApiClient { | |||
throw JsonDecodeException(); | |||
} | |||
} | |||
|
|||
Future<Map<String, dynamic>> _getOne(Uri uri) async { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Future<Map<String, dynamic>> _getOne(Uri uri) async { | |
Future<Map<String, dynamic>> _get(Uri uri) async { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_get is already defined for a "List" return. _getOne only returns an item.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An alternative might be _getMany
for multiple results and _get
for single ones, but I'm fine either way :)
@felangel Wdyt?
Unresolving for the time being for visibility 👀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments and lmk what you think -- overall looks great!
@felangel It's done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First off, thanks for these changes!
I just have a couple styling comments. Once those are implemented (or otherwise resolved), I'll have another look at the app in runtime.
I'll let the CI run in the meantime so you can work on potential failures. 👍🏻
Great job!
launches: | ||
(json['launches'] as List<dynamic>).map((e) => e as String).toList(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will most likely fail the flutter format step 👀
@@ -93,4 +107,24 @@ class SpaceXApiClient { | |||
throw JsonDecodeException(); | |||
} | |||
} | |||
|
|||
Future<Map<String, dynamic>> _getOne(Uri uri) async { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An alternative might be _getMany
for multiple results and _get
for single ones, but I'm fine either way :)
@felangel Wdyt?
Unresolving for the time being for visibility 👀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if that's right. The stringify getter in the Equatable package is set to null.
@alefl10 @jeroen-meijer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added some new tests, because code coverage is still too low. I looked the lcov results on my machine, and sometimes I don't understand why it did not cover certain code places. Furthermore, I also commented out failed tests in launches_page_test.dart so may have a look what I tried.
@jeroen-meijer @felangel Can someone please start the workflow? 😃 |
linter: | ||
rules: | ||
public_member_api_docs: false | ||
avoid_print: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rather than disabling this for the whole package can we just ignore it from the example?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean exactly? I added this file like in the rocket_repository 😅
/// Throws a [LaunchException] if an error occurs. | ||
Future<Launch> fetchLatestLaunch() { | ||
try { | ||
return _spaceXApiClient.fetchLatestLaunch(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return _spaceXApiClient.fetchLatestLaunch(); | |
return await _spaceXApiClient.fetchLatestLaunch(); |
I believe we'd need to await the future in order to catch any exceptions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It only awaits the future in the presentation layer, like in the "launches_cubit". If this is true for catching any exceptions, we also have to change it, e.g. in the rocket_repository too.
Description
Just added the latest launch.
Type of Change