treewide: ref.watch(ClientController.provider.notifier) -> ref.read

This commit is contained in:
Henry Hiles 2026-09-24 20:35:20 -04:00
commit 943cd85e22
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs
8 changed files with 11 additions and 11 deletions

View file

@ -11,7 +11,7 @@ class NotificationsController([final NotificationsRequest? request])
@override @override
Future<IList<Event>> build() async { Future<IList<Event>> build() async {
final client = ref.watch(ClientController.provider.notifier); final client = ref.read(ClientController.provider.notifier);
final (unreadType, roomId) = request ?? (null, null); final (unreadType, roomId) = request ?? (null, null);
@ -32,7 +32,7 @@ class NotificationsController([final NotificationsRequest? request])
final lastTs = currentNotifications.lastOrNull?.timestamp; final lastTs = currentNotifications.lastOrNull?.timestamp;
if (lastTs == null) return const .empty(); if (lastTs == null) return const .empty();
final client = ref.watch(ClientController.provider.notifier); final client = ref.read(ClientController.provider.notifier);
final (unreadType, roomId) = request ?? (null, null); final (unreadType, roomId) = request ?? (null, null);
final newNotifications = await client.getMentions( final newNotifications = await client.getMentions(

View file

@ -6,7 +6,7 @@ class ProfileController(final String userId)
extends AsyncNotifier<ProfileResponse> { extends AsyncNotifier<ProfileResponse> {
@override @override
Future<ProfileResponse> build() { Future<ProfileResponse> build() {
final client = ref.watch(ClientController.provider.notifier); final client = ref.read(ClientController.provider.notifier);
return client.getProfile(userId); return client.getProfile(userId);
} }

View file

@ -20,7 +20,7 @@ class RoomChatController(final String roomId)
extends AsyncNotifier<IList<Event>?> { extends AsyncNotifier<IList<Event>?> {
@override @override
Future<IList<Event>?> build() async { Future<IList<Event>?> build() async {
final client = ref.watch(ClientController.provider.notifier); final client = ref.read(ClientController.provider.notifier);
final room = ref.watch( final room = ref.watch(
RoomsController.provider.select((rooms) => rooms[roomId]), RoomsController.provider.select((rooms) => rooms[roomId]),
); );
@ -178,7 +178,7 @@ class RoomChatController(final String roomId)
Event event, Event event,
String userId, String userId,
) async { ) async {
final client = ref.watch(ClientController.provider.notifier); final client = ref.read(ClientController.provider.notifier);
final allReactionEvents = await client.getRelatedEvents( final allReactionEvents = await client.getRelatedEvents(
.new( .new(
roomId: roomId, roomId: roomId,
@ -207,7 +207,7 @@ class RoomChatController(final String roomId)
} }
Future<void> sendReaction(String reaction, Event event) async { Future<void> sendReaction(String reaction, Event event) async {
final client = ref.watch(ClientController.provider.notifier); final client = ref.read(ClientController.provider.notifier);
await client.sendEvent( await client.sendEvent(
.new( .new(

View file

@ -7,7 +7,7 @@ class RoomSummaryController(final JoinRoomRequest request)
extends AsyncNotifier<RoomSummary> { extends AsyncNotifier<RoomSummary> {
@override @override
Future<RoomSummary> build() => Future<RoomSummary> build() =>
ref.watch(ClientController.provider.notifier).getRoomSummary(request); ref.read(ClientController.provider.notifier).getRoomSummary(request);
static final provider = AsyncNotifierProvider.family static final provider = AsyncNotifierProvider.family
.autoDispose<RoomSummaryController, RoomSummary, JoinRoomRequest>( .autoDispose<RoomSummaryController, RoomSummary, JoinRoomRequest>(

View file

@ -5,7 +5,7 @@ import "package:nexus/models/spec_versions_response.dart";
class SpecVersionsController extends AsyncNotifier<SpecVersionsResponse> { class SpecVersionsController extends AsyncNotifier<SpecVersionsResponse> {
@override @override
Future<SpecVersionsResponse> build() => Future<SpecVersionsResponse> build() =>
ref.watch(ClientController.provider.notifier).getSpecVersions(); ref.read(ClientController.provider.notifier).getSpecVersions();
static final provider = static final provider =
AsyncNotifierProvider.autoDispose< AsyncNotifierProvider.autoDispose<

View file

@ -62,7 +62,7 @@ final class const RoomChat({
final controllerProvider = RoomChatController.provider(roomId); final controllerProvider = RoomChatController.provider(roomId);
final notifier = ref.watch(controllerProvider.notifier); final notifier = ref.watch(controllerProvider.notifier);
final client = ref.watch(ClientController.provider.notifier); final client = ref.read(ClientController.provider.notifier);
final controllerData = ref.watch(controllerProvider); final controllerData = ref.watch(controllerProvider);

View file

@ -14,7 +14,7 @@ final class const RoomMenu(
@override @override
Widget build(BuildContext context, WidgetRef ref) { Widget build(BuildContext context, WidgetRef ref) {
final danger = Theme.of(context).colorScheme.error; final danger = Theme.of(context).colorScheme.error;
final client = ref.watch(ClientController.provider.notifier); final client = ref.read(ClientController.provider.notifier);
return PopupMenuButton( return PopupMenuButton(
itemBuilder: (_) => [ itemBuilder: (_) => [

View file

@ -26,7 +26,7 @@ final class const UserBottomSheet(
Widget build(BuildContext context, WidgetRef ref) { Widget build(BuildContext context, WidgetRef ref) {
final theme = Theme.of(context); final theme = Theme.of(context);
final textTheme = theme.textTheme; final textTheme = theme.textTheme;
final client = ref.watch(ClientController.provider.notifier); final client = ref.read(ClientController.provider.notifier);
void showMembershipDialog(MembershipAction action) => showDialog( void showMembershipDialog(MembershipAction action) => showDialog(
context: context, context: context,