addAccount method

Future<void> addAccount(
  1. Map acc
)

Implementation

Future<void> addAccount(Map acc) async {
  final pairs = _storage.keyPairs.val.toList();
  // remove duplicated account and add a new one
  pairs.retainWhere((e) => e['address'] != acc['address']);
  pairs.add(acc);
  _storage.keyPairs.val = pairs;

  setCurrentAddress(acc['address']);
}