initial commit
This commit is contained in:
commit
217621daac
21 changed files with 1401 additions and 0 deletions
17
lib/controllers/auth_code_controller.dart
Normal file
17
lib/controllers/auth_code_controller.dart
Normal file
|
@ -0,0 +1,17 @@
|
|||
import "package:fast_immutable_collections/fast_immutable_collections.dart";
|
||||
import "package:matrixgate/models/matrix_user.dart";
|
||||
import "package:riverpod/riverpod.dart";
|
||||
|
||||
class AuthCodeController extends Notifier<IMap<String, MatrixUser>> {
|
||||
@override
|
||||
IMap<String, MatrixUser> build() => const IMap.empty();
|
||||
|
||||
void set(String name, MatrixUser user) =>
|
||||
state = state.update(name, (_) => user, ifAbsent: () => user);
|
||||
void remove(String name) => state = state.remove(name);
|
||||
|
||||
static final provider =
|
||||
NotifierProvider<AuthCodeController, IMap<String, MatrixUser>>(
|
||||
AuthCodeController.new,
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue