#[SOLVED] type 'Null' is not a subtype of type 'List<dynamic>' in getDocument Method

10 messages · Page 1 of 1 (latest)

grave herald
#

why the map value has total and documents object

#

This my code on fetching the specific document

  @override
  Future<BridgeRequest> getRequest(String id) async {
    try {
      _logger.info('Getting bridge request');

      final response = await databases.getDocument(
        databaseId: bridgeRequestCredential.databaseId,
        collectionId: bridgeRequestCredential.collectionId,
        documentId: id,
      );
      return BridgeRequest.fromJson(response.data);
    } on AppwriteException catch (e, stackTrace) {
      _logger.severe(
          e.message ?? 'Error while getting bridge request', e, stackTrace);
      throw BridgeException(
        message: e.message ?? 'Error while getting bridge request',
        stackTrace: stackTrace,
      );
    } catch (e, stackTrace) {
      _logger.severe('Error while getting bridge request', e, stackTrace);
      throw BridgeException(
        message: 'Error while getting bridge request',
        stackTrace: stackTrace,
      );
    }
  }
#

I really need help for this one

raven marten
# grave herald

Would you please try to inspect the map to see what's in it? nvm

#

And please double check you're passing a non empty string for the id

grave herald
#

I just pass a wrong id

raven marten
grave herald
#

yup I tought that I closed this post hehehhe