form_bloc 0.3.0 copy "form_bloc: ^0.3.0" to clipboard
form_bloc: ^0.3.0 copied to clipboard

outdated

An easy way to create forms with BLoC pattern without writing a lot of boilerplate code.

example/main.dart

import 'package:form_bloc/form_bloc.dart';

class LoginFormBloc extends FormBloc<String, String> {
  final emailField = TextFieldBloc<String>(
    validators: [Validators.validEmail],
  );
  final passwordField = TextFieldBloc<String>(
    validators: [Validators.notEmpty],
  );

  // @override
  // List<FieldBloc> get fieldBlocs => [emailField, passwordField];

  @override
  Stream<FormBlocState<String, String>> onSubmitting() async* {
    // Login logic...
    await Future<void>.delayed(Duration(seconds: 2));
    yield currentState.toSuccess();
  }

  @override
  List<FieldBloc> get fieldBlocs => null;
}
156
likes
0
pub points
84%
popularity

Publisher

unverified uploader

An easy way to create forms with BLoC pattern without writing a lot of boilerplate code.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

bloc, equatable, meta, rxdart

More

Packages that depend on form_bloc