# codeForWeb method Null safety

Future<String> codeForWeb(

1. {required String stateToken,
2. required String kaHeader}

)

## Implementation

    Future<String> codeForWeb({
      required String stateToken,
      required String kaHeader,
    }) async {
      var queryParams = {
        'client_id': KakaoSdk.appKey,
        'auth_tran_id': stateToken,
        'ka': kaHeader,
      };

      return await ApiFactory.handleApiError(() async {
        var response = await _dio.get(Constants.apiWebCodeJson,
            queryParameters: queryParams);

        if (response.data.toString().contains('error')) {
          return 'error';
        }
        return response.data['code'];
      });
    }