FilledStacks / FilledStacks/flutter-tutorials
Stream controller providing stale values for onModelReady()
- Lenguaje dominante
- Dart
- Estrellas
- 4.8k
- Forks
- 1.7k
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
I followed the pattern you suggested in provider-aechitecture-pt2
The flow is common as follows, login view gets user credentials , passes to login view model which then passes to auth service. After api call is successful auth service adds user to user stream controller and then on login success navigator.pushNamed()
Which pushes to homeview
ref - https://github.com/FilledStacks/flutter-tutorials/blob/master/012-provider-architecture-pt2/2-final/lib/ui/views/home_view.dart
onModelReady: (model) => model.loadData(Provider.of(context))
The issue I am facing is that the stream controller doesn't pass the user before model.loadData() is called for homeview. After reading a few articles I got to know that there is no way to ensure if streams deliver data. Am I missing something? how can I solve this issue?
Not sure if this is the right place to ask this question
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Línea de trabajo
Start with the home_view.dart example linked in the issue, especially the onModelReady call and its model.loadData(Provider.of(context)) argument. Trace the login success path through the auth service and user stream controller, then verify the ordering between publishing the user and navigating to HomeView. Done means the home view receives the intended user before loadData runs.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- dart, flutter
- Área
- authentication, mobile
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Necesita aclaración
- Aptitud para principiantes
- 25/100