# listen method Null safety

1. @override

StreamSubscription<List<DecoratedContentModel?>> listen(

1. DecoratedContentModelTrigger trigger,
2. {String? orderBy,
3. bool? descending,
4. Object? startAfter,
5. int? limit,
6. int? privilegeLevel,
7. EliudQuery? eliudQuery}

)
override

## Implementation

    @override
    StreamSubscription<List<DecoratedContentModel?>> listen(
        DecoratedContentModelTrigger trigger,
        {String? orderBy,
        bool? descending,
        Object? startAfter,
        int? limit,
        int? privilegeLevel,
        EliudQuery? eliudQuery}) {
      Stream<List<DecoratedContentModel?>> stream;
      stream = getQuery(getCollection(),
              orderBy: orderBy,
              descending: descending,
              startAfter: startAfter as DocumentSnapshot?,
              limit: limit,
              privilegeLevel: privilegeLevel,
              eliudQuery: eliudQuery,
              appId: appId)!
          .snapshots()
    //  see comment listen(...) above
    //  stream = getQuery(decoratedContentCollection, orderBy: orderBy,  descending: descending,  startAfter: startAfter as DocumentSnapshot?,  limit: limit, privilegeLevel: privilegeLevel, eliudQuery: eliudQuery, appId: appId)!.snapshots()
          .asyncMap((data) async {
        return await Future.wait(
            data.docs.map((doc) => _populateDoc(doc)).toList());
      });

      return stream.listen((listOfDecoratedContentModels) {
        trigger(listOfDecoratedContentModels);
      });
    }