what i am trying to get is when i type Id and password in the form i should be able to get into another page. But when i press submit , nothing is happening.The error i am getting is Equality operator ==
invocation with references of unrelated types. Is there any way to solve that?
Form(
key: _formKey,
child: Column(children: <Widget>[
TextFormField(
controller: nameController,
decoration: InputDecoration(labelText: 'Id'),
keyboardType: TextInputType.emailAddress,
validator: (value) {
if (value.isEmpty) {
return 'Enter id';
}
return null;
},
),
TextFormField(
controller: passwordController,
decoration: InputDecoration(labelText: 'Password'),
obscureText: true,
validator: (value) {
if (value.isEmpty) {
return 'invalid password';
}
return null;
},
),
SizedBox(height: 30),
RaisedButton(
child: Text('Submit'),
onPressed: () {
if (nameController == //i am getting a blue underline over here
FirebaseFirestore.instance
.collection("proddecAdmin")
.doc("1")
.set({'Id': ''}) &&
passwordController == //i am getting a blue underline over here
FirebaseFirestore.instance
.collection("proddecAdmin")
.doc("1")
.set({
'password': '',
})) {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => ProfilePage()),
);
}
},
Aucun commentaire:
Enregistrer un commentaire