FilledStacks / FilledStacks/flutter-tutorials

Stream controller providing stale values for onModelReady()

Ouverte
#129 2 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Dart
Étoiles
4.8k
Forks
1.7k
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

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

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
dart, flutter
Domaine
authentication, mobile
Type d'issue
Bug
Difficulté
3/5
Temps estimé
1-2 jours
Activité
À l'abandon
Clarté
À clarifier
Accessibilité débutants
25/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.