aws-samples / aws-samples/amplify-trips-planner

add activity issue

Open
#1 3 comments 1 reaction 1 assignee Claimed by @mo-malaka View on GitHub
Dominant language
Dart
Stars
11
Forks
5
PR merge metrics
No merged PRs in 30d

Description

Hi, I am doing the tutorial. I am new to flutter and aws. The tutorial is great and helps me to get into it better.

However I am stuck in tutorial two module 3.

Everything works good so far. But when opening **add_activity_page.dart** it is loading the activity for a few ms and then switching to CircularProgressIndicator().

It seems that the asyncvalue loses its object when the widget is build again:
```
tripValue.when(
data: (trip) => SingleChildScrollView(...)
loading: () => const Center(
child: CircularProgressIndicator(),
),
```
![grafik](https://user-images.githubusercontent.com/26210030/217280024-bb2ce3f2-92c6-46b4-afe6-1721bb2fb673.png)
![grafik](https://user-images.githubusercontent.com/26210030/217280342-424aa08d-9424-4e56-9e69-b74f2c3a8575.png)

Since the tripValue comes from **tripProvider** `final tripValue = ref.read(tripProvider(tripId));` in trips_repository.dart as a ProviderStream and the get stream 'return tripsRepository.get(id);' comes from **trips_datastore_service.dart** and `Stream getTripStream(String id)` and then from the **Amplify.DataStore** and everything is connected via **riverpod** I am completly lost how to debug everything. I do not understand why the tripValue appears for a few hundret ms and then disapears.

What is the best way to debug changes of an Stream that comes from **Amplify.DataStore**?
Why is this getTripStream() a stream at all? Wouldn't it be easier to just have a Future here?

Thanks

Markus

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.