So let's say I have a mixin class defined as follows:
abstract class TestMix
{
@observable bool loggedIn = false;
updateLogin(){
if (isLoggedIn()){
loggedIn = true;
}else{
loggedIn = false;
}
}
}
I would like to mix this behavior with several kinds of polymer, so I:
@CustomTag('my-app')
class App extends PolymerElement with TestMix {
App.created() : super.created() {
this.updateLogin(); // @observable field 'loggedIn' is changed in the mixin
}
}
I do not feel affection. If I move the mixin fields / methods directly to the App class, then everything works fine and the binding happens.
I just want to confirm whether this is possible or not? Can Dart reflect mixin fields like native fields? Or, if there is a way to manually trigger the binding (prefers not).
source
share