forked from Henry-Hiles/nexus
wip
This commit is contained in:
parent
0df327d125
commit
bfd0b1ec47
15 changed files with 186 additions and 89 deletions
17
lib/controllers/profile_controller.dart
Normal file
17
lib/controllers/profile_controller.dart
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import "package:flutter_riverpod/flutter_riverpod.dart";
|
||||
import "package:nexus/controllers/client_controller.dart";
|
||||
import "package:nexus/models/profile.dart";
|
||||
|
||||
class ProfileController extends AsyncNotifier<Profile> {
|
||||
final String userId;
|
||||
ProfileController(this.userId);
|
||||
|
||||
@override
|
||||
Future<Profile> build() =>
|
||||
ref.watch(ClientController.provider.notifier).getProfile(userId);
|
||||
|
||||
static final provider =
|
||||
AsyncNotifierProvider.family<ProfileController, Profile, String>(
|
||||
ProfileController.new,
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue