13 lines
378 B
Dart
13 lines
378 B
Dart
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
|
|
import '../domain/auth_repository.dart';
|
|
import 'auth_repository_impl.dart';
|
|
|
|
/// 认证仓库 Provider。
|
|
///
|
|
/// 会话级依赖,通过 ref.keepAlive() 避免页面切换时被销毁重建。
|
|
final authRepositoryProvider = Provider<AuthRepository>((ref) {
|
|
ref.keepAlive();
|
|
return const AuthRepositoryImpl();
|
|
});
|