queryReferendums method

Future<List> queryReferendums(
  1. String address
)

Implementation

Future<List> queryReferendums(String address) async {
  final dynamic data = await serviceRoot.webView!
      .evalJavascript('gov.fetchReferendums(api, "$address")');
  if (data != null) {
    final List list = data['referendums'];
    list.asMap().forEach((k, v) {
      v['detail'] = data['details'][k];
    });
    return list;
  }
  return [];
}