title: Waiting time to charge shared preferences is too long
body: <p>I have a user profile class on my app:</p>
  <pre><code>class Perfil extends StatefulWidget {
    const Perfil({Key? key}) : super(key: key);
  
    @override
    _PerfilState createState() =&gt; _PerfilState();
  }
  
  class _PerfilState extends State&lt;Perfil&gt; {
    final _util_preferences = UtilidadPreferences();
    var _estado_autenticacion = false;
  
    String _id = &quot;&quot;;
    String _email = &quot;&quot;;
    String _imagen = &quot;&quot;;
    String _token_firebase = &quot;&quot;;
    String _nombre = &quot;&quot;;
    String _apellidos = &quot;&quot;;
    bool _verificada = false;
    bool _activa = false;
  
    @override
    void initState() {
      // TODO: implement initState
      super.initState();
      getEstadoAutenticacion();
    }
  
    void getEstadoAutenticacion() {
      var estado =
          _util_preferences.recibirEstadoAutenticacion().then((value) async {
        value == null
            ? _estado_autenticacion = false
            : _estado_autenticacion = value as bool;
        print(
            &quot;valor autenticacion en perfil:&quot; + _estado_autenticacion.toString());
  
        if (_estado_autenticacion == false) {}
  
        _estado_autenticacion = _estado_autenticacion;
        _id = await _util_preferences.recibirUsuarioId();
        _email = await _util_preferences.recibirUsuarioEmail();
        _nombre = await _util_preferences.recibirUsuarioNombre();
        _apellidos = await _util_preferences.recibirUsuarioApellidos();
        _imagen = await _util_preferences.recibirUsuarioImagen();
        _token_firebase = await _util_preferences.recibirUsuarioTokenFB();
        _verificada = await _util_preferences.recibirUsuarioVerificado();
        _activa = await _util_preferences.recibirUsuarioActivo();
  
        setState(() {});
      });
    }
  
    @override
    Widget build(BuildContext context) {
      localizationsDelegates:
      context.localizationDelegates;
      supportedLocales:
      context.supportedLocales;
      locale:
      context.locale;
  
      var _esp = false;
      var _en = false;
      var _ca = false;
  
      int count;
      //idioma actual
      var actual = EasyLocalization.of(context)?.locale;
      if (actual?.languageCode == &quot;es&quot;) {
        _en = false;
        _esp = true;
        _ca = false;
      }
      if (actual?.languageCode == &quot;en&quot;) {
        _en = true;
        _esp = false;
        _ca = false;
      }
      if (actual?.languageCode == &quot;ca&quot;) {
        _en = false;
        _esp = false;
        _ca = true;
      }
      ;
      print(&quot;Idioma actual bool esp:&quot; + _esp.toString());
      print(&quot;Idioma actual bool en:&quot; + _en.toString());
  
      return SafeArea(
        child: Scaffold(
          backgroundColor: Colors.white,
          body: Center(
  
              //perfil si no esta logeado
  
              child: _estado_autenticacion == false
                  ? Column(
                      mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                      children: [
                        ElevatedButton(
                          child: Text('IniciarSesion'.tr()),
                          onPressed: () {
                            Navigator.of(context)
                                .push(MaterialPageRoute(
                                    builder: (context) =&gt; LoginPage()))
                                .then((value) {
                              setState(() {
                                print(&quot;estoy de vuelta en perfil&quot;);
                                getEstadoAutenticacion();
                              });
                            });
                          },
                          style: ElevatedButton.styleFrom(
                              shape: new RoundedRectangleBorder(
                                borderRadius: new BorderRadius.circular(30.0),
                              ),
                              primary: Colors.red,
                              padding: const EdgeInsets.symmetric(
                                  horizontal: 20, vertical: 20),
                              textStyle: const TextStyle(
                                  fontSize: 20, fontWeight: FontWeight.bold)),
                        ),
                        ElevatedButton(
                          child: Text('CrearCuenta'.tr()),
                          onPressed: () {
                            Navigator.of(context).push(MaterialPageRoute(
                                builder: (context) =&gt; SignupPage()));
                          },
                          style: ElevatedButton.styleFrom(
                              shape: new RoundedRectangleBorder(
                                borderRadius: new BorderRadius.circular(30.0),
                              ),
                              primary: Colors.red,
                              padding: const EdgeInsets.symmetric(
                                  horizontal: 20, vertical: 20),
                              textStyle: const TextStyle(
                                  fontSize: 20, fontWeight: FontWeight.bold)),
                        ),
                        SizedBox(
                          height: 8.0,
                        ),
                        Row(
                          mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                          children: [
                            ChoiceChip(
                              selected: _en,
                              shadowColor: Colors.teal,
                              elevation: 10,
                              pressElevation: 5,
                              backgroundColor: Colors.black54,
                              selectedColor: Colors.red,
                              label: Text('English',
                                  style: TextStyle(color: Colors.white)),
                              onSelected: (bool selected) {
                                setState(() {
                                  context.setLocale(Locale('en', 'EN'));
                                });
                              },
                            ),
                            ChoiceChip(
                              selected: _esp,
                              shadowColor: Colors.teal,
                              elevation: 10,
                              pressElevation: 5,
                              label: Text('Español',
                                  style: TextStyle(color: Colors.white)),
                              backgroundColor: Colors.black54,
                              selectedColor: Colors.red,
                              onSelected: (bool selected) {
                                setState(() {
                                  context.setLocale(Locale('es', 'ES'));
                                });
                              },
                            ),
                            ChoiceChip(
                              selected: _ca,
                              shadowColor: Colors.teal,
                              elevation: 10,
                              pressElevation: 5,
                              label: Text('Català',
                                  style: TextStyle(color: Colors.white)),
                              backgroundColor: Colors.black54,
                              selectedColor: Colors.red,
                              onSelected: (bool selected) {
                                setState(() {
                                  context.setLocale(Locale('ca', 'CA'));
                                });
                              },
                            ),
                          ],
                        )
                      ],
                    )
                  :
  
                  //  perfil si esta logeado,
                  Column(
                      children: [
                        Text(_id),
                        Text(_imagen),
                        Text(_nombre),
                        Text(_apellidos),
                        Text(_token_firebase),
                        Text(_verificada.toString()),
                        Text(_activa.toString()),
                      ],
                    )),
        ),
      );
    }
  }
  </code></pre>
  <p>At this moment it is working fine, but I am experiencing a small issue.</p>
  <p>When the class is shown, it should detect if the user is logged in or not.</p>
  <p>Depending on this state, the class should show a column or another.</p>
  <p>The small issue I am talking about is that during the time that all shared preferences values are been received, the class is showing the first column, it takes only a fraction of a second, but it is not very nice to see.</p>
  <p>What should I do to avoid showing the first column while shared preferences are loading?</p>