hoc081098 / flutter_validation_login_form_BLoC_pattern_RxDart

[Functional reactive programming (FRP)]💧 💧 💧 [Pure RxDart] Validation login form by using the BLoC pattern with RxDart - A new Flutter project featuring a faked authentication interface to demonstrate validation. Implemented with BloC pattern.
https://pub.dartlang.org/packages/distinct_value_connectable_observable
MIT License
49 stars 11 forks source link

How to use BLOC pattern to validate 'Confirm Password' text field? #1

Closed jonahfang closed 6 years ago

jonahfang commented 6 years ago

I am using a Stream/Observable to validate 'Password' text field like final _emailController = BehaviorSubject(); Stream get email => _emailController.stream.transform(validateEmail); where valdiateEmail is a StreamTransformer<String,String> to validate whether the password length is at least 6. I am trying to use the similar idea for 'Confirm Password' but the validate function would take two inputs: password, confirmPassword; not sure how to handle this using StreamTransformer.

hoc081098 commented 6 years ago

sorry for late reply, you can use combineLatest operator, and compare password and confirm password

jonahfang commented 6 years ago

@hoc081098 Thank you very much, I will try.