Closed RicoLiu closed 2 years ago
There should not be anything special about those classes, but you will need to request the reflection support in an indirect manner (because, presumably, you can't edit the declaration of AppBar
etc, so you can't directly add metadata like @reflector
to those classes).
Check out https://github.com/google/reflectable.dart/blob/master/test_reflectable/test/global_quantify_test.dart to see an example where GlobalQuantifyCapability
is used to connect the given reflector
to some classes, based on a String
argument that matches the class name. You have to put @GlobalQuantifyCapability(...)
as metadata on an import of reflectable.dart
(that's the only location where this metadata is enabled).
Check out https://github.com/google/reflectable.dart/blob/master/reflectable/doc/TheDesignOfReflectableCapabilities.md for some background information about capabilities.
I'll close this issue as resolved, please create a new one if further questions about this topic remain.
Can I use reflectable to reflect Flutter Widgets, such as
AppBar
,Container
etc.