how to receive and update value after widget has created
prayuk545160 opened this issue · comments
how to receive and update value after widget has created
I want to read text of button and change after click button
i modify class RaisedButtonParser extends WidgetParser
by add line
key: map.containsKey('id') ? Key(map['id']) :null, for set Widget id
var raisedButtonJson = '''
{
"type": "Container",
"alignment": "center",
"child": {
"type": "RaisedButton",
"color": "##FF00FF",
"padding": "8,8,8,8",
"textColor": "#00FF00",
"elevation" : 8.0,
"splashColor" : "#00FF00",
"click_event" : "route://productDetail?goods_id=123",
"id" : "btn_post1",
"child" : {
"type": "Text",
"data": "I am a button xxxxxxxxx"
}
}
}
and read by
var textFind = find.byType(RaisedButton);//find.byKey(Key('btn_post1'));
var btn1 = (textFind.at(0).evaluate().single.widget) as RaisedButton;
msgbox(ctx,id+":"+id+":"+ (btn1.child as Text).data);
success
but i can't update text data
i wont to get and set all Widget by find and update
no support for that
I understand that this is not currently support. Is it possible with architecture or is it to hard. I am hapy to look at doing a pull request if you think it is possible