FilledStacks / FilledStacks/flutter-tutorials

Stream controller providing stale values for onModelReady()

Open
#129 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Dart
Stars
4.8k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.