Skip to content

Commit 610b36e

Browse files
authored
fix statenotifier analysis warnings (#15)
1 parent 0700258 commit 610b36e

21 files changed

+46
-20
lines changed

packages/stream_feeds/lib/src/state/activity.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import 'activity_comment_list.dart';
2222
import 'activity_state.dart';
2323
import 'event/activity_event_handler.dart';
2424
import 'query/activity_comments_query.dart';
25+
import 'state_notifier_extentions.dart';
2526

2627
/// Represents a single activity with its data and state.
2728
///
@@ -407,7 +408,7 @@ class Activity with Disposable {
407408
// region Internal helper methods
408409

409410
Future<Result<ActivityData>> _ensureActivityLoaded() async {
410-
final activity = _stateNotifier.state.activity;
411+
final activity = _stateNotifier.value.activity;
411412
if (activity != null) return Result.success(activity);
412413
return get();
413414
}

packages/stream_feeds/lib/src/state/activity_comment_list.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import '../repository/comments_repository.dart';
99
import 'activity_comment_list_state.dart';
1010
import 'event/activity_comment_list_event_handler.dart';
1111
import 'query/activity_comments_query.dart';
12+
import 'state_notifier_extentions.dart';
1213

1314
/// Represents a list of activity comments with a query and state.
1415
///
@@ -70,7 +71,7 @@ class ActivityCommentList extends Disposable {
7071
int? limit,
7172
}) async {
7273
// Build the query with the current pagination state (with next page token)
73-
final next = _stateNotifier.state.pagination?.next;
74+
final next = _stateNotifier.value.pagination?.next;
7475

7576
// Early return if no more comments available
7677
if (next == null) return const Result.success([]);

packages/stream_feeds/lib/src/state/activity_list.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import '../repository/activities_repository.dart';
1010
import 'activity_list_state.dart';
1111
import 'event/activity_list_event_handler.dart';
1212
import 'query/activities_query.dart';
13+
import 'state_notifier_extentions.dart';
1314

1415
/// Represents a list of activities with a query and state.
1516
///
@@ -69,7 +70,7 @@ class ActivityList with Disposable {
6970
/// activities to return.
7071
Future<Result<List<ActivityData>>> queryMoreActivities({int? limit}) async {
7172
// Build the query with the current pagination state (with next page token)
72-
final next = _stateNotifier.state.pagination?.next;
73+
final next = _stateNotifier.value.pagination?.next;
7374

7475
// Early return if no more activities available
7576
if (next == null) return const Result.success([]);

packages/stream_feeds/lib/src/state/activity_reaction_list.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import '../repository/activities_repository.dart';
1010
import 'activity_reaction_list_state.dart';
1111
import 'event/activity_reaction_list_event_handler.dart';
1212
import 'query/activity_reactions_query.dart';
13+
import 'state_notifier_extentions.dart';
1314

1415
/// Represents a list of activity reactions with a query and state.
1516
///
@@ -68,7 +69,7 @@ class ActivityReactionList extends Disposable {
6869
int? limit,
6970
}) async {
7071
// Build the query with the current pagination state (with next page token)
71-
final next = _stateNotifier.state.pagination?.next;
72+
final next = _stateNotifier.value.pagination?.next;
7273

7374
// Early return if no more reactions available
7475
if (next == null) return const Result.success([]);

packages/stream_feeds/lib/src/state/bookmark_folder_list.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import '../repository/bookmarks_repository.dart';
1010
import 'bookmark_folder_list_state.dart';
1111
import 'event/bookmark_folder_list_event_handler.dart';
1212
import 'query/bookmark_folders_query.dart';
13+
import 'state_notifier_extentions.dart';
1314

1415
/// Represents a list of bookmark folders with a query and state.
1516
///
@@ -65,7 +66,7 @@ class BookmarkFolderList extends Disposable {
6566
int? limit,
6667
}) async {
6768
// Build the query with the current pagination state (with next page token)
68-
final next = _stateNotifier.state.pagination?.next;
69+
final next = _stateNotifier.value.pagination?.next;
6970

7071
// Early return if no more folders available
7172
if (next == null) return const Result.success([]);

packages/stream_feeds/lib/src/state/bookmark_list.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import '../repository/bookmarks_repository.dart';
1010
import 'bookmark_list_state.dart';
1111
import 'event/bookmark_list_event_handler.dart';
1212
import 'query/bookmarks_query.dart';
13+
import 'state_notifier_extentions.dart';
1314

1415
/// Represents a list of bookmarks with a query and state.
1516
///
@@ -66,7 +67,7 @@ class BookmarkList with Disposable {
6667
/// bookmarks to return.
6768
Future<Result<List<BookmarkData>>> queryMoreBookmarks({int? limit}) async {
6869
// Build the query with the current pagination state (with next page token)
69-
final next = _stateNotifier.state.pagination?.next;
70+
final next = _stateNotifier.value.pagination?.next;
7071

7172
// Early return if no more bookmarks available
7273
if (next == null) return const Result.success([]);

packages/stream_feeds/lib/src/state/comment_list.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import '../repository/comments_repository.dart';
99
import 'comment_list_state.dart';
1010
import 'event/comment_list_event_handler.dart';
1111
import 'query/comments_query.dart';
12+
import 'state_notifier_extentions.dart';
1213

1314
/// A list of comments with a query and state.
1415
///
@@ -57,7 +58,7 @@ class CommentList extends Disposable {
5758
/// Returns a [Result] containing additional [CommentData] or an error.
5859
Future<Result<List<CommentData>>> queryMoreComments({int? limit}) async {
5960
// Build the query with the current pagination state (with next page token)
60-
final next = _stateNotifier.state.pagination?.next;
61+
final next = _stateNotifier.value.pagination?.next;
6162

6263
// Early return if no more comments available
6364
if (next == null) return const Result.success([]);

packages/stream_feeds/lib/src/state/comment_reaction_list.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import '../repository/comments_repository.dart';
1010
import 'comment_reaction_list_state.dart';
1111
import 'event/comment_reaction_list_event_handler.dart';
1212
import 'query/comment_reactions_query.dart';
13+
import 'state_notifier_extentions.dart';
1314

1415
/// Represents a list of comment reactions with a query and state.
1516
///
@@ -69,7 +70,7 @@ class CommentReactionList with Disposable {
6970
int? limit,
7071
}) async {
7172
// Build the query with the current pagination state (with next page token)
72-
final next = _stateNotifier.state.pagination?.next;
73+
final next = _stateNotifier.value.pagination?.next;
7374

7475
// Early return if no more reactions available
7576
if (next == null) return const Result.success([]);

packages/stream_feeds/lib/src/state/comment_reply_list.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import '../repository/comments_repository.dart';
99
import 'comment_reply_list_state.dart';
1010
import 'event/comment_reply_list_event_handler.dart';
1111
import 'query/comment_replies_query.dart';
12+
import 'state_notifier_extentions.dart';
1213

1314
/// Represents a list of comment replies with a query and state.
1415
///
@@ -68,7 +69,7 @@ class CommentReplyList with Disposable {
6869
int? limit,
6970
}) async {
7071
// Build the query with the current pagination state (with next page token)
71-
final next = _stateNotifier.state.pagination?.next;
72+
final next = _stateNotifier.value.pagination?.next;
7273

7374
// Early return if no more replies available
7475
if (next == null) return const Result.success([]);

packages/stream_feeds/lib/src/state/feed.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import 'feed_state.dart';
2525
import 'member_list.dart';
2626
import 'query/feed_query.dart';
2727
import 'query/members_query.dart';
28+
import 'state_notifier_extentions.dart';
2829

2930
/// A feed represents a collection of activities and provides methods to interact with them.
3031
///
@@ -408,7 +409,7 @@ class Feed with Disposable {
408409
/// if the operation fails.
409410
Future<Result<List<ActivityData>>> queryMoreActivities({int? limit}) async {
410411
// Build the query with the current pagination state (with next page token)
411-
final next = _stateNotifier.state.activitiesPagination?.next;
412+
final next = _stateNotifier.value.activitiesPagination?.next;
412413

413414
// Early return if no more activities available
414415
if (next == null) return const Result.success([]);

0 commit comments

Comments
 (0)