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 =
|
final inSiteNotificationRepositoryProvider =
|
||||||
Provider<InSiteNotificationRepository>((ref) {
|
Provider<InSiteNotificationRepository>((ref) {
|
||||||
final dio = ref.watch(dioClientProvider).dio;
|
final dio = ref.watch(dioClientProvider);
|
||||||
return InSiteNotificationRepository(dio);
|
return InSiteNotificationRepository(dio);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ import '../../../../core/network/dio_client.dart';
|
||||||
// ── Providers ──────────────────────────────────────────────────────────────
|
// ── Providers ──────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
final _channelPrefsProvider = FutureProvider.autoDispose<List<NotificationChannelPreference>>((ref) async {
|
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 res = await dio.get('/api/v1/notifications/channels/me/preferences');
|
||||||
final list = res.data as List;
|
final list = res.data as List;
|
||||||
return list
|
return list
|
||||||
|
|
@ -31,7 +31,7 @@ class _NotificationPreferencesPageState extends ConsumerState<NotificationPrefer
|
||||||
if (_pendingChanges.isEmpty) return;
|
if (_pendingChanges.isEmpty) return;
|
||||||
setState(() => _saving = true);
|
setState(() => _saving = true);
|
||||||
try {
|
try {
|
||||||
final dio = ref.read(dioClientProvider).dio;
|
final dio = ref.read(dioClientProvider);
|
||||||
final preferences = _pendingChanges.entries
|
final preferences = _pendingChanges.entries
|
||||||
.map((e) => {'channelKey': e.key, 'enabled': e.value})
|
.map((e) => {'channelKey': e.key, 'enabled': e.value})
|
||||||
.toList();
|
.toList();
|
||||||
|
|
|
||||||
|
|
@ -89,9 +89,8 @@ class _ProfilePageState extends ConsumerState<ProfilePage> {
|
||||||
_InSiteMessageRow(subtitleColor: subtitleColor),
|
_InSiteMessageRow(subtitleColor: subtitleColor),
|
||||||
_SettingsRow(
|
_SettingsRow(
|
||||||
icon: Icons.tune_outlined,
|
icon: Icons.tune_outlined,
|
||||||
label: '通知偏好设置',
|
iconBg: const Color(0xFF8B5CF6),
|
||||||
subtitle: '管理各类通知的订阅开关',
|
title: '通知偏好设置',
|
||||||
subtitleColor: subtitleColor,
|
|
||||||
onTap: () => context.push('/notifications/preferences'),
|
onTap: () => context.push('/notifications/preferences'),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|
|
||||||
|
|
@ -52,6 +52,6 @@ class ReferralRepository {
|
||||||
// ── Riverpod provider ────────────────────────────────────────────────────────
|
// ── Riverpod provider ────────────────────────────────────────────────────────
|
||||||
|
|
||||||
final referralRepositoryProvider = Provider<ReferralRepository>((ref) {
|
final referralRepositoryProvider = Provider<ReferralRepository>((ref) {
|
||||||
final dio = ref.watch(dioClientProvider).dio;
|
final dio = ref.watch(dioClientProvider);
|
||||||
return ReferralRepository(dio);
|
return ReferralRepository(dio);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue