refactor: migrate appSettingsProvider ✅
Phase 5.4 Complete (4/5) - appSettingsProvider → appSettingsNotifierProvider - High complexity NotifierProvider with many methods - 26 usages across 6 files updated automatically - Data class AppSettings unchanged
This commit is contained in:
@@ -1,8 +1,11 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
|
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||||
import 'package:shared_preferences/shared_preferences.dart';
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
import 'animation_service.dart';
|
import 'animation_service.dart';
|
||||||
|
|
||||||
|
part 'settings_service.g.dart';
|
||||||
|
|
||||||
/// Service for managing app-wide settings including accessibility preferences
|
/// Service for managing app-wide settings including accessibility preferences
|
||||||
class SettingsService {
|
class SettingsService {
|
||||||
static const String _reduceMotionKey = 'reduce_motion';
|
static const String _reduceMotionKey = 'reduce_motion';
|
||||||
@@ -404,11 +407,8 @@ bool _listEquals(List<String> a, List<String> b) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Provider for app settings
|
/// Provider for app settings
|
||||||
final appSettingsProvider = NotifierProvider<AppSettingsNotifier, AppSettings>(
|
@riverpod
|
||||||
AppSettingsNotifier.new,
|
class AppSettingsNotifier extends _$AppSettingsNotifier {
|
||||||
);
|
|
||||||
|
|
||||||
class AppSettingsNotifier extends Notifier<AppSettings> {
|
|
||||||
bool _initialized = false;
|
bool _initialized = false;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
Reference in New Issue
Block a user