fix(flutter): remove incorrect .dio accessor from dioClientProvider calls
dioClientProvider returns Dio directly (not a wrapper class). Removed spurious .dio property access from 3 files: - in_site_notification_repository.dart - notification_preferences_page.dart - referral_repository.dart Also fix _SettingsRow usage in profile_page: replaced incorrect `label`/`subtitle` params with the correct `title`/`iconBg` params. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
5ff8bda99e
commit
52c443d937
|
|
@ -45,6 +45,6 @@ class InSiteNotificationRepository {
|
|||
|
||||
final inSiteNotificationRepositoryProvider =
|
||||
Provider<InSiteNotificationRepository>((ref) {
|
||||
final dio = ref.watch(dioClientProvider).dio;
|
||||
final dio = ref.watch(dioClientProvider);
|
||||
return InSiteNotificationRepository(dio);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import '../../../../core/network/dio_client.dart';
|
|||
// ── Providers ──────────────────────────────────────────────────────────────
|
||||
|
||||
final _channelPrefsProvider = FutureProvider.autoDispose<List<NotificationChannelPreference>>((ref) async {
|
||||
final dio = ref.watch(dioClientProvider).dio;
|
||||
final dio = ref.watch(dioClientProvider);
|
||||
final res = await dio.get('/api/v1/notifications/channels/me/preferences');
|
||||
final list = res.data as List;
|
||||
return list
|
||||
|
|
@ -31,7 +31,7 @@ class _NotificationPreferencesPageState extends ConsumerState<NotificationPrefer
|
|||
if (_pendingChanges.isEmpty) return;
|
||||
setState(() => _saving = true);
|
||||
try {
|
||||
final dio = ref.read(dioClientProvider).dio;
|
||||
final dio = ref.read(dioClientProvider);
|
||||
final preferences = _pendingChanges.entries
|
||||
.map((e) => {'channelKey': e.key, 'enabled': e.value})
|
||||
.toList();
|
||||
|
|
|
|||
|
|
@ -89,9 +89,8 @@ class _ProfilePageState extends ConsumerState<ProfilePage> {
|
|||
_InSiteMessageRow(subtitleColor: subtitleColor),
|
||||
_SettingsRow(
|
||||
icon: Icons.tune_outlined,
|
||||
label: '通知偏好设置',
|
||||
subtitle: '管理各类通知的订阅开关',
|
||||
subtitleColor: subtitleColor,
|
||||
iconBg: const Color(0xFF8B5CF6),
|
||||
title: '通知偏好设置',
|
||||
onTap: () => context.push('/notifications/preferences'),
|
||||
),
|
||||
],
|
||||
|
|
|
|||
|
|
@ -52,6 +52,6 @@ class ReferralRepository {
|
|||
// ── Riverpod provider ────────────────────────────────────────────────────────
|
||||
|
||||
final referralRepositoryProvider = Provider<ReferralRepository>((ref) {
|
||||
final dio = ref.watch(dioClientProvider).dio;
|
||||
final dio = ref.watch(dioClientProvider);
|
||||
return ReferralRepository(dio);
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue