Skip to content

Commit 6f3d8ec

Browse files
committed
Fix saved places unload on state change
1 parent 56cbd68 commit 6f3d8ec

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/pages/saved_places.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,10 @@ class SavedPlacesPageState extends State<SavedPlacesPage> {
7171
final savedLocationsBloc = SavedLocationsBloc.of(context);
7272

7373
return StreamBuilder(
74+
initialData: savedLocationsBloc.locations.reversed.toList(),
7475
stream: savedLocationsBloc.outLocations,
7576
builder: (BuildContext context, AsyncSnapshot<List<TrufiLocation>> snapshot) {
76-
final data = savedLocationsBloc.locations.reversed.toList();
77+
final data = snapshot.data.reversed.toList();
7778
return ListView.builder(
7879
padding: const EdgeInsets.all(16.0),
7980
itemCount: data.length,

0 commit comments

Comments
 (0)