This should solve https://github.com/ably/ably-flutter/issues/84. The issue was raised a while ago, and the implicit dynamic option was already deprecated, but it was replaced with strict type checks. The changes here are mostly cosmetic, but overall they remove ~200 lint warnings in the codebase and remove implicit dynamic typing, which is discouraged in Dart for a while. The changes include:
Enabled strict-casts and strict-inference lint rules, as a replacement for implicit-dynamic. Also, removed avoid_annotating_with_dynamic and avoid_types_on_closure_parameters since they conflict with strict-inference
Added declared types to all methods that used implicit dynamic values
Widened the scope of dynamic variables where it was possible. There were some cases where the variable/method did not need dynamic at all, as it's type was declared during asignement
Removed unnecessary cast methods like transformState or transformStateChange. With declared variable types, there's no need to use methods that cast variables to their type in cases like this, a simple as cast is enough, and reduces a lot of boilerplate code
Added void return types for Future methods that do not return any value. Previously these methods returned dynamic which was always a void type
This should solve https://github.com/ably/ably-flutter/issues/84. The issue was raised a while ago, and the
implicit dynamic
option was already deprecated, but it was replaced withstrict type checks
. The changes here are mostly cosmetic, but overall they remove ~200 lint warnings in the codebase and remove implicit dynamic typing, which is discouraged in Dart for a while. The changes include:strict-casts
andstrict-inference
lint rules, as a replacement forimplicit-dynamic
. Also, removedavoid_annotating_with_dynamic
andavoid_types_on_closure_parameters
since they conflict withstrict-inference
dynamic
variables where it was possible. There were some cases where the variable/method did not needdynamic
at all, as it's type was declared during asignementtransformState
ortransformStateChange
. With declared variable types, there's no need to use methods that cast variables to their type in cases like this, a simpleas
cast is enough, and reduces a lot of boilerplate codevoid
return types forFuture
methods that do not return any value. Previously these methods returneddynamic
which was always avoid
type