getAccount method

  1. @override
Future<Account> getAccount(
  1. Session session
)
override

Implementation

@override
Future<Account> getAccount(model.Session session) async {
  _session = session;
  final res = await _api.nakamaGetAccount();

  final acc = Account();
  // Some workaround here while protobuf expects the vars map to not be null
  acc.mergeFromProto3Json((res.body!.copyWith(
    devices: res.body!.devices!
        .map((e) => e.copyWith(
              vars: e.vars ?? {},
            ))
        .toList(),
  )).toJson());

  return acc;
}