add JumpToEventController to allow jumping to events from the NotificationsPage when it has been pushed from the NotificationController
This commit is contained in:
parent
c90a1c41b0
commit
1c1f585362
5 changed files with 70 additions and 65 deletions
15
lib/controllers/jump_to_event.dart
Normal file
15
lib/controllers/jump_to_event.dart
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import "package:flutter_riverpod/flutter_riverpod.dart";
|
||||
|
||||
class JumpToEventController extends Notifier<String?> {
|
||||
@override
|
||||
String? build() => null;
|
||||
|
||||
void set(String? eventId) => state = eventId;
|
||||
|
||||
@override
|
||||
bool updateShouldNotify(_, _) => true;
|
||||
|
||||
static final provider = NotifierProvider<JumpToEventController, String?>(
|
||||
JumpToEventController.new,
|
||||
);
|
||||
}
|
||||
|
|
@ -37,7 +37,6 @@ class NotificationController
|
|||
MaterialPageRoute(
|
||||
builder: (_) => NotificationsPage(
|
||||
highlightedEventId: eventId,
|
||||
jumpToEvent: (eventId) {},
|
||||
defaultToAllNotifications: true,
|
||||
),
|
||||
),
|
||||
|
|
@ -63,7 +62,6 @@ class NotificationController
|
|||
MaterialPageRoute(
|
||||
builder: (_) => NotificationsPage(
|
||||
highlightedEventId: eventId,
|
||||
jumpToEvent: (eventId) {},
|
||||
defaultToAllNotifications: true,
|
||||
),
|
||||
),
|
||||
|
|
|
|||
Loading…
Reference in a new issue