AbiFunctionFragment.fromJson constructor

AbiFunctionFragment.fromJson(
  1. Map<String, dynamic> json,
  2. bool tronTypes
)

Creates an instance of AbiFunctionFragment from JSON representation.

Implementation

factory AbiFunctionFragment.fromJson(
    Map<String, dynamic> json, bool tronTypes) {
  final List<dynamic> inputs = json["inputs"] ?? [];
  final List<dynamic> outputs = json["outputs"] ?? [];
  return AbiFunctionFragment(
      name: json["name"],
      inputs: inputs.map((e) => AbiParameter.fromJson(e, tronTypes)).toList(),
      outputs:
          outputs.map((e) => AbiParameter.fromJson(e, tronTypes)).toList(),
      stateMutability: StateMutability.fromName(json["stateMutability"]),
      constant: json["constant"],
      payable: json["payable"]);
}