diff --git a/lib/blocs/widgets/kira/kira_list/abstract_list/a_list_bloc.dart b/lib/blocs/widgets/kira/kira_list/abstract_list/a_list_bloc.dart index 6e8ee9d2..0b7860ad 100644 --- a/lib/blocs/widgets/kira/kira_list/abstract_list/a_list_bloc.dart +++ b/lib/blocs/widgets/kira/kira_list/abstract_list/a_list_bloc.dart @@ -1,4 +1,4 @@ -import 'dart:async'; + import 'dart:async'; import 'package:flutter/cupertino.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; @@ -149,7 +149,7 @@ abstract class AListBloc extends Bloc.initial(); lastPageIndex = 0; - await favouritesBloc?.initFavourites(); + await favouritesBloc?.initFavourites(forceRequestBool: true); bool filtersEnabledBool = filtersBloc?.state is FiltersActiveState; bool sortEnabledBool = sortBloc != null; diff --git a/lib/blocs/widgets/kira/kira_list/infinity_list/infinity_list_bloc.dart b/lib/blocs/widgets/kira/kira_list/infinity_list/infinity_list_bloc.dart index 04887348..0935d084 100644 --- a/lib/blocs/widgets/kira/kira_list/infinity_list/infinity_list_bloc.dart +++ b/lib/blocs/widgets/kira/kira_list/infinity_list/infinity_list_bloc.dart @@ -7,6 +7,7 @@ import 'package:miro/blocs/widgets/kira/kira_list/abstract_list/events/list_upda import 'package:miro/blocs/widgets/kira/kira_list/abstract_list/models/a_list_item.dart'; import 'package:miro/blocs/widgets/kira/kira_list/abstract_list/models/page_data.dart'; import 'package:miro/blocs/widgets/kira/kira_list/abstract_list/states/list_loaded_state.dart'; +import 'package:miro/blocs/widgets/kira/kira_list/abstract_list/states/list_loading_state.dart'; import 'package:miro/blocs/widgets/kira/kira_list/favourites/favourites_bloc.dart'; import 'package:miro/blocs/widgets/kira/kira_list/filters/filters_bloc.dart'; import 'package:miro/blocs/widgets/kira/kira_list/infinity_list/events/infinity_list_reached_bottom_event.dart'; @@ -58,6 +59,9 @@ class InfinityListBloc extends AListBloc { end: (lastPageIndex + 1) * singlePageSize, ); + // Loading state was added only to ensure loading state is always emitted. + // In BLoC, if next state is recognized as the same as previous state, it will not be emitted. + emit(ListLoadingState()); emit(ListLoadedState( listItems: visibleListItems, lastPage: currentPageData.lastPageBool, diff --git a/pubspec.yaml b/pubspec.yaml index f548023f..df8dc652 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -12,7 +12,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 1.28.0 +version: 1.28.1 environment: sdk: ">=3.1.3"