mirrored_repositories/form-validation-app/lib/src
import 'package:flutter/material.dart';
import 'package:form_validation_app/src/bloc/login_bloc.dart';
export 'package:form_validation_app/src/bloc/login_bloc.dart';

class Provider extends InheritedWidget {
  static Provider _instancia;

  factory Provider({Key key, Widget child}) {
    if (_instancia == null) {
      _instancia = new Provider._internal(
        key: key,
        child: child,
      );
    }
    return _instancia;
  }

  final loginBloc = LoginBloc();

  Provider._internal({Key key, Widget child}) : super(key: key, child: child);

  @override
  bool updateShouldNotify(InheritedWidget oldWidget) => true;

  // static LoginBloc of(BuildContext context) {
  //   return context.dependOnInheritedWidgetOfExactType<Provider>().loginBloc;
  // }
  static LoginBloc of(BuildContext context) {
    return context.dependOnInheritedWidgetOfExactType<Provider>().loginBloc;
  }

  // static ProductosBloc productosBloc ( BuildContext context ) {
  //   return context.dependOnInheritedWidgetOfExactType<Provider>()._productosBloc;
  // }
}
