Open OlegNovosad opened 1 week ago
@OlegNovosad handling versions is a very good idea. if we throw UnsupportedError for methods, devs would needs to wrap almost every method with try/catch (+upcoming new api). I am think about adding docs and printing 'unsupported' silent logs. What do you think? Do you have better idea?
I thought on annotations but they are not supported well on web (especially dart:mirrors
). Idea I had was something like:
@version('6.1')
Future show() {
// annotation value processing, throw / log if isVersionAtLeast is lower
return tg.show()
}
maybe we should wait for macros and until then do simple silent logging as you suggest.
Great! If you would like to do then it is cool! Otherwise I will do it
It might make sense to add versioning support for APIs, e.g. CloudStorage is available since 6.9, BiometricManager since 7.2 etc. I suggest to add general approach on throwing UnsupportedError error. This also might be controlled with annotations on classes / methods if used.
Any thoughts?