Error when i try to load my code on my phone

hello goodevening, please this my code is not loading its showing NOSUCHMETHODFOUND…

import 'dart:async';

import 'package:first_app/Message.dart';

import 'package:first_app/service/validation.dart';

import 'package:rxdart/rxdart.dart';

class MessageFormManager with Validation {

  final _email = BehaviorSubject<String>();

  Stream<String> get email$ => _email.stream.transform(validateEmail);

  Sink<String> get inEmail => _email.sink;

  final _subject = BehaviorSubject<String>();

  Stream<String> get subject$ => _subject.stream.transform(validateSubject);

  Sink<String> get inSubject => _subject.sink;

  final _body = BehaviorSubject<String>();

  Stream<String> get body$ => _body.stream;

  Sink<String> get inBody => _body.sink;

  Stream<bool> get isFormValid$ =>

      Observable.combineLatest([email$, subject$, body$], (values) => true);

  // ignore: non_constant_identifier_names

  get Observable => null;

  Message submit() {

    String subject = _subject.value;

    String body = _body.value;

    return Message(subject: subject, body: body);

  }

}

BUT I THINK THE PROBLEM MIGHT BE FROM THIS LINE

Stream<bool> get isFormValid$ =>

      Observable.combineLatest([email$, subject$, body$], (values) => true);

  // ignore: non_constant_identifier_names

  get Observable => null;

THANKS

Please paste the complete error message, and the relevant code for it, if other from the part you already posted.

the error message… 'NoSuchMethodError: class ‘Future<dynamic.’ tried calling: combineLatest(Instance( length:3 of ‘_Growablelist’, Closure: (dynamic) => bool) see also: https://flutter.dev/docs/testing/errors

this is the complete code

import 'dart:async';

import 'package:first_app/Message.dart';

import 'package:first_app/service/validation.dart';

import 'package:rxdart/rxdart.dart';

class MessageFormManager with Validation {

  final _email = BehaviorSubject<String>();

  Stream<String> get email$ => _email.stream.transform(validateEmail);

  Sink<String> get inEmail => _email.sink;

  final _subject = BehaviorSubject<String>();

  Stream<String> get subject$ => _subject.stream.transform(validateSubject);

  Sink<String> get inSubject => _subject.sink;

  final _body = BehaviorSubject<String>();

  Stream<String> get body$ => _body.stream;

  Sink<String> get inBody => _body.sink;

  Stream<bool> get isFormValid$ =>

      Observable.combineLatest2([email$, subject$, body$], (values) => true);

  Message submit() {

    String subject = _subject.value;

    String body = _body.value;

    return Message(subject: subject, body: body);

  }

}
```

Thank you,
so the error is thrown at:

Stream<bool> get isFormValid$ => Observable.combineLatest2([email$, subject$, body$], (values) => true);

when the compiler cannot find the method combineLatest2.

Check rxdart 0.24.1docs for detailed infos, I guess (by name homology) that you have to use the new implementation, that seems to be Rx.combineLatest2:

https://pub.dev/documentation/rxdart/latest/rx/Rx/combineLatest2.html

hth

1 Like

thanks alot… it worked for me