make profile fetching much faster
This commit is contained in:
parent
ab48472aec
commit
6b4d612535
2 changed files with 9 additions and 22 deletions
|
|
@ -1,17 +0,0 @@
|
|||
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