I have TextFormFields in my Flutter app. When I click on them when the app is running on web everything is ok.

But when I run on any Android emulator, and when I click on the TextFormField to enter data, the smartphone keyboard pops up for less than 1 second and automatically disapear after.

Also the TextFormField is contained in an ExpandableNotifier which is contained in a Container. When clicking on the TextFormField, not only the smartphone keyboard disappear after 1 second, the ExpansionNotifier which contains the TextFormField shutdown as if the whole widget was reloaded.

Before clicking (the TextFormField is on the right) :

enter image description here

After clicking :

enter image description here

Here the code of the TextFormField which is contained in a FutureBuilder calling a getTimes function to return data from the selected date (from the dateTimePicker on the left):

FutureBuilder getTimesFutureBuilder(){
    return FutureBuilder<double?>(
      future: _getTimes,
      builder: (BuildContext context, AsyncSnapshot snapshot) {
        if (snapshot.hasData){
          _timeController.clear();
          return TextFormField(
            controller: _timeController,
            textAlign: TextAlign.center,
            enabled: false,
            decoration: InputDecoration(
              hintText: snapshot.data.toString() + " h",
              contentPadding: EdgeInsets.zero,
              filled: true,
              fillColor: Colors.white70
            ),
          );
        } 
        else {
          return TextFormField(
            controller: _timeController,
            textAlign: TextAlign.center,
            enabled: true,
            decoration: InputDecoration(
              hintText: "0 h",
              contentPadding: EdgeInsets.zero,
              filled: true,
              fillColor: Colors.white
            ),
          );
        }
      }
    );
  }

Here the code of the getTimes function :

Future<double?> getTimes(DateTime date) async{
    var actualLaborEffort;
    if (ContextManager.selectedTask != null) {
    if (ContextManager.times.isEmpty && ((widget.task != ContextManager.selectedTask) || (currentWeek != date.weekOfYear ))) {
      actualLaborEffort = await widget.p3provider.getSelectedTime(widget.task.id, date);
      appelsWebService++;
      currentWeek = date.weekOfYear;
      ContextManager.selectedTask = widget.task;
    } else if (ContextManager.times.isEmpty) {
      actualLaborEffort = null;
      currentWeek = date.weekOfYear;
      ContextManager.isTimeNull = true;
      ContextManager.selectedTask = widget.task;
    } else {
      for (int i = 0; i < ContextManager.times.length; i++) {
        if ((date.weekOfYear == ContextManager.times[i].date.weekOfYear) && (widget.task.id == ContextManager.times[i].taskId)) {
          actualLaborEffort = widget.p3provider.getCachedActualLaborEffort(date);
          currentWeek = date.weekOfYear;
          hasBeenCalled = true;
          ContextManager.selectedTask = widget.task;
        } else {
          actualLaborEffort = await widget.p3provider.getSelectedTime(widget.task.id, date);
          autreAppelWebServ++;
          currentWeek = date.weekOfYear;
          hasBeenCalled = true;
          ContextManager.selectedTask = widget.task;
        }
      }
    }

    hasBeenCalled = hasBeenCalled;
    //if (mounted) setState(() {
      _isButtonEnabled = ContextManager.isTimeNull;
    //});
    ContextManager.selectedTask = widget.task;
    return actualLaborEffort;
  }

I tried to wrap the setState called in getTimes in a if (mounted) condition but it didn't really changed anything.

Any help will be welcomed.