Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: Favourite balance refresh #12

Merged
merged 1 commit into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'dart:async';
import 'dart:async';

import 'package:flutter/cupertino.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
Expand Down Expand Up @@ -149,7 +149,7 @@ abstract class AListBloc<T extends AListItem> extends Bloc<AListEvent, AListStat
currentPageData = PageData<T>.initial();
lastPageIndex = 0;

await favouritesBloc?.initFavourites();
await favouritesBloc?.initFavourites(forceRequestBool: true);

bool filtersEnabledBool = filtersBloc?.state is FiltersActiveState<T>;
bool sortEnabledBool = sortBloc != null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -58,6 +59,9 @@ class InfinityListBloc<T extends AListItem> extends AListBloc<T> {
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<T>(
listItems: visibleListItems,
lastPage: currentPageData.lastPageBool,
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down