title: can't receive data from flutter to nodejs
body: <p>I try to make login with Flutter, Nodejs(Express), and oracle
  the backend is working when I test it with POSTMAN I can get the token
  here postman test
  <a href="https://i.stack.imgur.com/9pEtj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9pEtj.png" alt="enter image description here" /></a>
  data show in cmd when I try with Postman
  <a href="https://i.stack.imgur.com/g94JQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/g94JQ.png" alt="enter image description here" /></a></p>
  <p>this image contains the data show in the flutter debugger</p>
  <p><a href="https://i.stack.imgur.com/GpN6H.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GpN6H.png" alt="enter image description here" /></a>
  but the problem is
  when I try to link the flutter and the node the data sent from flutter is not received in node js
  the <code>IDNUMBER</code> and <code>PASS</code> have the value of undefined
  means <code>req.body.IDNUMBER=undefined</code> and <code>req.body.PASS=undefined</code>
  data show in cmd when I try with flutter in nodejs</p>
  <p><a href="https://i.stack.imgur.com/cwRJe.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cwRJe.png" alt="enter image description here" /></a></p>
  <p>I know that I'm missing something</p>
  <p>here the flutter code</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>import 'dart:convert';
  
  import 'package:app_project/homepage.dart';
  import 'package:flutter/material.dart';
  import 'package:http/http.dart' as http;
  import 'package:shared_preferences/shared_preferences.dart';
  
  class Login extends StatefulWidget {
    Login({Key? key}) : super(key: key);
  
    @override
    _LoginState createState() =&gt; _LoginState();
  }
  
  class _LoginState extends State&lt;Login&gt; {
    TextEditingController _idNumberController = new TextEditingController();
    TextEditingController _passController = new TextEditingController();
    bool _isloading = false;
    bool showpass = true;
    String url = "http://192.168.1.19:3000/auth2";
    signIn(String idNumber, String pass) async {
      SharedPreferences sharedPreferences = await SharedPreferences.getInstance();
      Map body = {"IDNUMBER": idNumber, "PASS": pass};
      var jsonResponse;
      var res = await http
          .post(Uri.parse(url), body: {"IDNUMBER": idNumber, "PASS": pass});
      // check the api status (connection)
      if (res.statusCode == 200) {
        jsonResponse = await json.decode(json.encode(res.body));
        print("the body is ${body}");
        print("Response  status 1 :${res.statusCode}");
        print("Response  status 2 :${res.body}");
  
        if (jsonResponse != null) {
          setState(() {
            _isloading = false;
            print("Response  status 2 2 :${res.body}");
          });
          //print(jsonResponse.runtimeType);
          sharedPreferences.setString("token", jsonResponse.toString());
          Navigator.of(context).pushReplacementNamed("homepage");
        }
      } else {
        setState(() {
          _isloading = false;
        });
        print("Response  status 3 :${res.body}");
      }
    }
  
    @override
    Widget build(BuildContext context) {
      return Scaffold(
        body: ListView(
          children: [
            Column(
              mainAxisAlignment: MainAxisAlignment.center,
              children: [
                Image.asset("images/1.png"),
                Container(
                  margin: EdgeInsets.all(20),
                  child: Form(
                      child: Column(
                    children: [
                      TextFormField(
                        controller: _idNumberController,
                        cursorColor: Colors.red,
                        style: TextStyle(fontSize: 20),
                        decoration: InputDecoration(
                            hintText: "اكتم رقمك التسلسلي",
                            prefixIcon: Icon(Icons.person),
                            filled: true,
                            fillColor: Colors.orange[100],
                            focusedBorder: OutlineInputBorder(
                                borderRadius: BorderRadius.circular(100),
                                borderSide:
                                    BorderSide(color: Colors.orange, width: 3)),
                            border: OutlineInputBorder(
                                borderRadius: BorderRadius.circular(100),
                                borderSide:
                                    BorderSide(width: 1, color: Colors.orange)),
                            focusColor: Colors.red),
                      ),
                      SizedBox(
                        height: 30,
                      ),
                      TextFormField(
                        controller: _passController,
                        cursorColor: Colors.red,
                        obscureText: showpass,
                        style: TextStyle(fontSize: 20),
                        decoration: InputDecoration(
                            suffixIcon: IconButton(
                                onPressed: () {
                                  setState(() {
                                    showpass = !showpass;
                                  });
                                },
                                icon: showpass
                                    ? Icon(Icons.remove_red_eye_sharp)
                                    : Icon(Icons.remove_red_eye_outlined)),
                            hintText: "اكتم كلمة المرور",
                            prefixIcon: Icon(Icons.lock),
                            filled: true,
                            fillColor: Colors.orange[100],
                            focusedBorder: OutlineInputBorder(
                                borderRadius: BorderRadius.circular(100),
                                borderSide:
                                    BorderSide(color: Colors.orange, width: 3)),
                            border: OutlineInputBorder(
                                borderRadius: BorderRadius.circular(100),
                                borderSide:
                                    BorderSide(width: 1, color: Colors.orange)),
                            focusColor: Colors.red),
                      ),
                      SizedBox(
                        height: 30,
                      ),
                      ElevatedButton.icon(
                          style: ElevatedButton.styleFrom(
                              padding: EdgeInsets.symmetric(
                                  horizontal: 35, vertical: 15),
                              shape: RoundedRectangleBorder(
                                  borderRadius: BorderRadius.circular(100))),
                          onPressed: () {
                            setState(() {
                              _isloading = true;
                            });
                            signIn(
                                _idNumberController.text, _passController.text);
                            print("id = ${_idNumberController.text}");
                            print("pass = ${_passController.text}");
                          },
                          icon: Icon(Icons.login),
                          label: Text("سجل الدخول"))
                    ],
                  )),
                )
              ],
            )
          ],
        ),
      );
    }
  }</code></pre>
  </div>
  </div>
  </p>
  <p>here the node code post function</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>app.post("/auth2", async (req, res) =&gt; {
    try {
      connection = await oracledb.getConnection({
        user: "system",
        password: password,
        connectString: "localhost:1521/XE"
      });
  
      console.log('connected to database');
      // run query to get all employees
       console.log(`the req id ${req.body.IDNUMBER}`)
       console.log(`the req PASS ${req.body.PASS}`)
  result = await connection.execute(`SELECT IDNUMBER,PASS FROM USERS WHERE IDNUMBER=:IDNUMBER AND PASS=:PASS`,
      [req.body.IDNUMBER,req.body.PASS]
       );
      let ress = {
        "IDNUMBER": result.rows[0][0],
          "PASS":result.rows[0][1]  
      }
      
      console.log({
      //those variables show as undefined
        "IDNUMBER": result.rows[0][0], 
         "PASS":result.rows[0][1]  
      })
      if (result.rows.length != 0) {
        const token = jwt.sign({ _id: ress }, 'privateKey');
        console.log(token);
        res.json({ token: token });
      } else {
        res.json({"message":"there is no one in the database has this idnumber"})
      }
      
    } catch (err) {
      console.log("the information is not passing ")
      return res.send(err.message)
    } 
  })</code></pre>
  </div>
  </div>
  </p>