Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to receive and update value after widget has created #47

Open
prayuk545160 opened this issue Oct 20, 2020 · 4 comments
Open

how to receive and update value after widget has created #47

prayuk545160 opened this issue Oct 20, 2020 · 4 comments

Comments

@prayuk545160
Copy link

how to receive and update value after widget has created

I want to read text of button and change after click button

@prayuk545160
Copy link
Author

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

@prayuk545160
Copy link
Author

i wont to get and set all Widget by find and update

@dengyin2000
Copy link
Owner

no support for that

@chrisn-au
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants