dart - Icon is not changing -
i trying change icon when specific radio-button selected.
however, switch statement in .dart code never changes icon though switch triggered.
thanks help.
.dart
class gender extends object observable { @observable string sex = ''; } @observable string ikon = 'alarm'; void onchangeradiogrouphandler(dom.customevent e) { gender.sex = (e.target paperradiobutton).label; switch(gender.sex) { case 'male': ikon = 'done'; break; case 'female': ikon = 'cached'; break; }
.html
<div layout vertical center> <div layout horizontal self-center> <paper-icon-button icon='{{ikon}}' on-click='{{toggle}}'></paper-icon-button> </div> </div> <core-collapse id='core--collapse'> <div layout vertical'> <label id='genderlbl'></label> <paper-radio-group id='gender-group' on-change='{{onchangeradiogrouphandler}}'> <paper-radio-button name='male' label='male'></paper-radio-button><br> <paper-radio-button name='female' label='female'></paper-radio-button> </paper-radio-group> </div> </core-collapse> </div>
Comments
Post a Comment