lots of stuff
This commit is contained in:
parent
8bc010cfc7
commit
ba9e99a951
19 changed files with 608 additions and 360 deletions
17
lib/controllers/avatar_controller.dart
Normal file
17
lib/controllers/avatar_controller.dart
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import "package:flutter_riverpod/flutter_riverpod.dart";
|
||||
import "package:matrix/matrix.dart";
|
||||
import "package:nexus/controllers/client_controller.dart";
|
||||
|
||||
class AvatarController extends AsyncNotifier<Uri> {
|
||||
final String mxc;
|
||||
AvatarController(this.mxc);
|
||||
@override
|
||||
Future<Uri> build() async => Uri.parse(mxc).getThumbnailUri(
|
||||
await ref.watch(ClientController.provider.future),
|
||||
width: 24,
|
||||
height: 24,
|
||||
);
|
||||
|
||||
static final provider = AsyncNotifierProvider.family
|
||||
.autoDispose<AvatarController, Uri, String>(AvatarController.new);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue