alfred
alfred copied to clipboard
chore: Keeping project up-to-date
The project was using the package enum_to_string for converting Enum objects to String and vice versa. Since dart 2.15 this functionality ships with dart core library. So there is no need for a third-party package.
The next thing was the project was using pedantic linter. Pedantic was discontinued by google and no one is maintaining the package now.
So, in this PR, I have removed the dependency enum_to_string and replaced pedantic by lints which is also the lint recommendation from the Dart team.
PS After adding lints there was some more linter message showing up. For now, I have suppressed them. Just to get maintainers to opinion on following the additional linter rules.
Apart from one remark, I think this is good to go.
@d-markey What is the remark?
I left it in the code review, namely:
If for some reason parsing fails (eg. the verb used in the request does not match any of the Method values), this will throw an exception when the original version defauts to a GET method. Parsing here should be done before calling the method in a try block with a catch block defaulting to GET
Hey, Thanks for your remark.
I did some changes to address your remark. Please have a look.
Thanks @aadarshadhakalg. I'm pondering though, the min SDK number in the pubspec file hasn't been updated. I guess if a user runs on Dart < 2.15 this would not work. So this change should also enforce use of Dart >= 2.15. I suppose it's not a bad thing that users upgrade their versions of Dart, but it may cause some trouble. I have no idea what the users base look like. @rknell what do you think?
Thanks! I have implemented your code manually because the changes were relatively small but there were come conflicts - but still copy and pasted it so credit goes to you! Thanks @aadarshadhakalg