Skip to content

Commit

Permalink
fix: removed restart method from PageRemoteData interface
Browse files Browse the repository at this point in the history
  • Loading branch information
andrespd99 committed Mar 12, 2024
1 parent c4e01d7 commit afa8403
Showing 1 changed file with 16 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,19 +100,20 @@ abstract class PagedRemoteDataBloc<T>
PagedRemoteDataFetchNextPage event,
);

/// Fetches and returns the first page of data from the remote source. Use this
/// method when you want to restart the view and fetch the first page of data.
///
/// This method is called when a [PagedRemoteDataRestart] event is dispatched.
///
/// The [oldState] parameter represents the previous state of the paged remote data.
/// The [event] parameter represents the event triggering the fetch of the next page.
///
/// Returns a [Future] that completes with a tuple containing a list of [T] items and a boolean value.
/// The list represents the fetched data for the first page, while the boolean value indicates whether there are more pages to fetch.
@visibleForTesting
Future<(List<T>, bool)> restart(
PagedRemoteDataState<T> oldState,
PagedRemoteDataFetchNextPage event,
);
// NOTE: Leaving this here in case adding pre or post fetch hooks is required for restart method
// /// Fetches and returns the first page of data from the remote source. Use this
// /// method when you want to restart the view and fetch the first page of data.
// ///
// /// This method is called when a [PagedRemoteDataRestart] event is dispatched.
// ///
// /// The [oldState] parameter represents the previous state of the paged remote data.
// /// The [event] parameter represents the event triggering the fetch of the next page.
// ///
// /// Returns a [Future] that completes with a tuple containing a list of [T] items and a boolean value.
// /// The list represents the fetched data for the first page, while the boolean value indicates whether there are more pages to fetch.
// @visibleForTesting
// Future<(List<T>, bool)> restart(
// PagedRemoteDataState<T> oldState,
// PagedRemoteDataFetchNextPage event,
// );
}

0 comments on commit afa8403

Please sign in to comment.