FLUTTER How to get variable based on passed string name?

前端 未结 3 1161
北荒
北荒 2021-01-13 05:32

I have stored variables in a class with their code names.

Suppose I want to get XVG from that class, I want to do

String getIconsURL(String symbol)          


        
3条回答
  •  清酒与你
    2021-01-13 05:38

    Assuming that the class is being created from a JSON Object, you can always use objectName.toJSON() and then use the variable names are array indices to do your computations.

提交回复
热议问题