I make a call where I checked it happens correctly, but then when I try to retrieve a data received by the call me from null. I can not understand why but .. quancuno of you can give me a hand?

    Future<UserDataByCode> sendCode() async {
  var url = "$_baseUrl/api/users/ABC124";

  try {
    var response = await _dio.get(
      url,
      options: Options(headers: {"x-access-token": _loginData.token}),
    );

    if (response.statusCode == 200) {
      var userData = UserDataByCode.fromJson(response.data);
      return userDataByCode;
    } else {
      _printLog("Upload sendCode 2", response, level: Level.WARNING);
      return null;
    }
  } on DioError catch (e) {
    _printLog("Upload sendCode 3", e, level: Level.SHOUT);
    return null;
  }
}

This is the UserDataByCode model which should return the data to insert as name in the text after making the call, but it returns null:import 'dart:convert';

class UserDataByCode {
  String firstName;
  String surname;
  int balance;
  double ticketValue;
  int remainingTickets;

  UserDataByCode(
      {this.firstName,
      this.surname,
      this.balance,
      this.ticketValue,
      this.remainingTickets,
      });

  UserDataByCode.fromJson(Map<String, dynamic> json) {
    firstName = json['user_name_first'];
    surname = json['user_name_surname'];
    balance = json['tckt_balance'];
    ticketValue = json['ticket_value'];
    remainingTickets = json['remaining_tickets'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['firstName'] = this.firstName;
    data['surname'] = this.surname;
    data['balance'] = this.balance;
    data['ticketValue'] = this.ticketValue;
    data['remainingTickets'] = this.remainingTickets;
    return data;
  }

  @override
  String toString() {
    return jsonEncode(toJson());
  }
}

In my ContentManager I put this, since for the other calls whoever worked before me did well I hurt the same thing ..

      Future<UserDataByCode> getUserDataByCode() async {
    return _userDataByCode = await connection.sendCode();
  }

  UserDataByCode getUserDataByCodeSync() {
    if (_userDataByCode == null) {
      print("Still no _userDataByCode");
      return null;
    }
    return _userDataByCode;
  }

UPDATE:

Receive this

UPDATE 2:

    return FutureBuilder<UserData>(
    future: contentManager.getUserData(),
    builder: (context, AsyncSnapshot<UserData> snapUserData) {

All widget code:

      Widget build(BuildContext context) {
    Size size = MediaQuery.of(context).size;
    _buttonHeight = size.height * .05;
    //double splitPoint = size.height / 7;

    return FutureBuilder<UserData>(
        future: contentManager.getUserData(),
        builder: (context, AsyncSnapshot<UserData> snapUserData) {
          if (snapUserData.hasError)
            return Container(
              child: Center(
                child: Text("There was some error"),
              ),
            );
          if (snapUserData.connectionState != ConnectionState.done)
            return Container(
              child: Center(
                child: CircularProgressIndicator(valueColor: new AlwaysStoppedAnimation<Color>(appColors.yellow)),
              ),
            );
            return Container(
              color: appColors.primaryColor,
              child: ListView(
                primary: false,
                      children: [
                        // TITOLO
                        Align(
                          alignment: Alignment.center,
                            child: Container(
                            child: Text(
                                    localization.showQR,
                                    style: Theme.of(context).primaryTextTheme.headline5.copyWith(
                                      color: appColors.green,
                                      fontWeight: FontWeight.bold,
                                    ),
                                  ),
                                ),
                            ),
                        Align(
                          alignment: Alignment.center,
                            child: Container(
                                    child: qrCodeHolder
                                ),
                            ),
                        Align(
                          alignment: Alignment.center,
                            child: Container(
                                  child: AutoSizeText(
                                    localization.home_subLabel,
                                    textAlign: TextAlign.center,
                                    maxLines: 1,
                                    style: Theme.of(context).primaryTextTheme.headline5.copyWith(
                                      color: appColors.green,
                                      fontWeight: FontWeight.bold,
                                    ),
                                  ),
                                ),
                            ),
                        Padding(
                          padding: EdgeInsets.all(15.0),
                          //top: size.height * .02,
                          //right: size.width * .02,
                          child: Row(
                            children: [
                              Expanded(
                                  child: TextField(
                                    inputFormatters: [
                                      new LengthLimitingTextInputFormatter(11),
                                    ],
                                    decoration: InputDecoration(
                                      filled: true,
                                      fillColor: Colors.white,
                                      focusedBorder: OutlineInputBorder(
                                        borderSide: BorderSide(color: Colors.white),
                                      ),
                                      enabledBorder: UnderlineInputBorder(
                                        borderSide: BorderSide(color: Colors.white),
                                      ),
                                    ),
                                    textAlign: TextAlign.center,
                                    style: TextStyle(
                                      fontSize: 18.0,
                                      color: Colors.black,
                                    ),
                                  ),
                                ),
                              IconButton(
                                icon: Image.asset("assets/images/send.png"),
                                onPressed: () async {
                                  connection.sendCode().then((value) {
                                      if (value != null) {
                                        showDialog(context: context, builder: (_) => PaymentDialog());
                                      } else {
                                        showDialog(context: context, builder: (_) => PaymentDialog());
                                      }
                                    });
                                  }
                                //onPressed: () => showDialog(context: context, builder: (_) => PaymentDialog()),
                              ),
                            ]
                          ),
                        ),
                      ],
                  padding: EdgeInsets.all(20.0),
                ),
              );
        });
  }
}