I have a login bloc file where I have created 2 streams username and password

```
class LoginBloc {
  LoginRepository _loginRepository = new LoginRepository();
  StreamController _loginController = StreamController<Response<LoginModel>>();

  //declare streams
  final _userName = BehaviorSubject<String>();
  final _password = BehaviorSubject<String>();

  //get data from streams
  StreamSink<Response<LoginModel>> get loginControllerSink =>
  _loginController.sink;
  Stream<String> get loginUserName => _userName.stream;
  Stream<String> get loginPassword => _password.stream;
  Stream<bool> get submitLoginForm =>
      Rx.combineLatest2(loginUserName, loginPassword, (a, b) => true);

  Function(String) get changeLoginUserName => _userName.sink.add;
  Function(String) get changeLoginPassword => _password.sink.add;

  //dispose
  dispose() {
    _userName.close();
    _password.close();
  }

  //functions
  login(email, password, context) async {
    try {
      LoginModel data = await _loginRepository.loginIntoSystem(email, password);
      loginControllerSink.add(Response.completed(data));    
      Navigator.pushNamed(context, '/dashboard');
    } catch (e) {
      loginControllerSink.add(Response.error(e.toString()));
      print(e);
    }
  }
}

```

Here's the login.dart

```
    class Login extends StatefulWidget {
  @override
  _LoginState createState() => _LoginState();
}

class _LoginState extends State<Login> {
  bool _passwordVisible = false;
  @override
  Widget build(BuildContext context) {
    Size size = MediaQuery.of(context).size;
    final LoginBloc bloc = LoginProvider.of(context);
    return Scaffold(
      backgroundColor: Colors.white,
      body: SingleChildScrollView(
        child: SafeArea(
          child: Center(
            child:
            Column(
              children: <Widget>[
                SizedBox(height: size.height*0.05),
                Icon(
                  Icons.track_changes,
                  size: size.width*0.06,
                ),
                SizedBox(height: size.height*0.02),
                Text('Login',
                    style: TextStyle(
                        color: Color(0xff005D6C),
                        fontSize: size.width*0.02,
                        fontWeight: FontWeight.bold,
                        fontStyle: FontStyle.italic)),
                SizedBox(height: size.height*0.04),
                Container(
                  width: size.width * 0.2,
                  padding: EdgeInsets.only(bottom: 20.0),
                  child: StreamBuilder<String>(
                      stream: bloc.loginUserName,
                      builder: (context, snapshot) {
                        return TextField(
                          onChanged: bloc.changeLoginUserName,
                          decoration: new InputDecoration(
                              contentPadding: EdgeInsets.symmetric(vertical: 0, horizontal: 15.0),
                              border: new OutlineInputBorder(
                                  borderSide: const BorderSide(
                                      width: 2.0, style: BorderStyle.solid),
                                  borderRadius: BorderRadius.circular(50.0)),
                              focusedBorder: OutlineInputBorder(
                                borderSide: const BorderSide(
                                    color: Colors.grey, width: 2.0),
                                borderRadius: BorderRadius.circular(50.0),
                              ),
                              hintText: 'User Name',
                              hintStyle: new TextStyle(
                                  color: Colors.grey,
                                  fontWeight: FontWeight.bold),
                              suffixIcon: const Icon(
                                Icons.person,
                                size: 30.0,
                                color: Colors.grey,
                              ),
                              errorText: snapshot.error),
                        );
                      }),
                ),
                Container(
                  width: size.width * 0.2,
                  padding: EdgeInsets.only(bottom: 20.0),
                  child: StreamBuilder<String>(
                      stream: bloc.loginPassword,
                      builder: (context, snapshot) {
                        return TextField(
                          onChanged: bloc.changeLoginPassword,
                          obscureText: !_passwordVisible,
                          maxLength: 20,
                          decoration: new InputDecoration(
                              contentPadding: EdgeInsets.symmetric(vertical: 0, horizontal: 15.0),
                              border: new OutlineInputBorder(
                                  borderSide: const BorderSide(
                                      width: 2.0, style: BorderStyle.solid),
                                  borderRadius: BorderRadius.circular(50.0)),
                              focusedBorder: OutlineInputBorder(
                                borderSide: const BorderSide(
                                    color: Colors.grey, width: 2.0),
                                borderRadius: BorderRadius.circular(50.0),
                              ),
                              hintText: 'Password',
                              hintStyle: new TextStyle(
                                  color: Colors.grey,
                                  fontWeight: FontWeight.bold),
                              prefixIcon: const Icon(
                                Icons.lock,
                                size: 30.0,
                                color: Colors.grey,
                              ),
                              suffixIcon: IconButton(
                                icon: Icon(
                                  // Based on passwordVisible state choose the icon
                                  _passwordVisible
                                      ? Icons.visibility
                                      : Icons.visibility_off,
                                  color: Colors.grey,
                                ),
                                onPressed: () {
                                  setState(() {
                                    _passwordVisible = !_passwordVisible;
                                  });
                                },
                              ),
                              errorText: snapshot.error),
                        );
                      }),
                ),

                Container(
                  width: size.width * 0.2,
                  child: ClipRRect(
                    borderRadius: BorderRadius.circular(29),
                    child: StreamBuilder<bool>(
                      stream: bloc.submitLoginForm,
                      builder: (context, snapshot){
                        return FlatButton(
                          color: Color(0XFFEFEFEF),
                          textColor: primaryColor,
                          disabledColor: Colors.grey,
                          disabledTextColor: Colors.black,
                          padding: EdgeInsets.symmetric(
                              vertical: 12.0, horizontal: 10.0),
                          onPressed: () => snapshot.hasError ? null : bloc.login(bloc.loginUserName, bloc.loginPassword, context) ,
                          child: Text(
                            "Login",
                            style: TextStyle(
                                fontSize: 20.0,
                                fontWeight: FontWeight.bold,
                                fontStyle: FontStyle.italic),
                          ),
                        );
                      },
                    ),
                  ),
                )
              ],
            )
          ),
        ),
      ),
    );
  }
}

```

I am calling the login function on CLick of login button and passing the username, password and context as parameters. But on click its giving **"Expected a value of type 'String', but got one of type 'BehaviorSubject'"**

added the loginIntoSystem:

```
Future<LoginModel> loginIntoSystem(String email, String password) 
async {
    dynamic body = {
      'email': email,
      'password': password
    };
    final response = await _provider.post("/login", body);
    return LoginModel.fromJson(response);
  }

```

Is there a way to convert BehaviorSubject to String ?