change how cross-room jumping works
This commit is contained in:
parent
b92aaed610
commit
da7f2dcf4e
5 changed files with 45 additions and 48 deletions
|
|
@ -1,16 +0,0 @@
|
|||
import "package:flutter_riverpod/flutter_riverpod.dart";
|
||||
|
||||
class ContextualEventController(String? _) extends Notifier<int?> {
|
||||
@override
|
||||
int? build() => null;
|
||||
|
||||
void set(int? event) => state = event;
|
||||
|
||||
@override
|
||||
bool updateShouldNotify(_, _) => true;
|
||||
|
||||
static final provider =
|
||||
NotifierProvider.family<ContextualEventController, int?, String?>(
|
||||
ContextualEventController.new,
|
||||
);
|
||||
}
|
||||
17
lib/controllers/jump_request.dart
Normal file
17
lib/controllers/jump_request.dart
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import "package:flutter_riverpod/flutter_riverpod.dart";
|
||||
|
||||
typedef JumpRequest = ({String roomId, int rowId});
|
||||
|
||||
class JumpRequestController extends Notifier<JumpRequest?> {
|
||||
@override
|
||||
JumpRequest? build() => null;
|
||||
|
||||
void request(String roomId, int rowId) =>
|
||||
state = (roomId: roomId, rowId: rowId);
|
||||
|
||||
void consume() => state = null;
|
||||
|
||||
static final provider = NotifierProvider<JumpRequestController, JumpRequest?>(
|
||||
JumpRequestController.new,
|
||||
);
|
||||
}
|
||||
Loading…
Reference in a new issue