refactor: migrate Phase 1 providers (2-7/10) to @riverpod
Migrated providers: - selectedModelProvider → SelectedModel - isManualModelSelectionProvider → IsManualModelSelection - reviewerModeProvider → ReviewerMode - isLoadingConversationProvider → IsLoadingConversation - prefilledInputTextProvider → PrefilledInputText - inputFocusTriggerProvider → InputFocusTrigger - composerHasFocusProvider → ComposerHasFocus - batchModeProvider → BatchMode - reducedMotionProvider → ReducedMotion All provider names unchanged, no breaking changes. Build runner successful, analyzer passing. Only 1 WARNING (keepAlive usage) and 2 INFO items remaining.
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||
|
||||
import '../../shared/theme/theme_extensions.dart';
|
||||
|
||||
part 'animation_service.g.dart';
|
||||
|
||||
/// Service for managing animations with performance optimization and accessibility
|
||||
class AnimationService {
|
||||
/// Get optimized animation duration based on context and settings
|
||||
@@ -208,9 +212,13 @@ class AnimationService {
|
||||
enum PageTransitionType { fade, slide, scale }
|
||||
|
||||
/// Provider for reduced motion preference
|
||||
final reducedMotionProvider = NotifierProvider<ReducedMotionNotifier, bool>(
|
||||
ReducedMotionNotifier.new,
|
||||
);
|
||||
@riverpod
|
||||
class ReducedMotion extends _$ReducedMotion {
|
||||
@override
|
||||
bool build() => false;
|
||||
|
||||
void set(bool value) => state = value;
|
||||
}
|
||||
|
||||
/// Provider for animation performance settings
|
||||
final animationPerformanceProvider =
|
||||
@@ -218,13 +226,6 @@ final animationPerformanceProvider =
|
||||
AnimationPerformanceNotifier.new,
|
||||
);
|
||||
|
||||
class ReducedMotionNotifier extends Notifier<bool> {
|
||||
@override
|
||||
bool build() => false;
|
||||
|
||||
void set(bool value) => state = value;
|
||||
}
|
||||
|
||||
class AnimationPerformanceNotifier extends Notifier<AnimationPerformance> {
|
||||
@override
|
||||
AnimationPerformance build() => AnimationPerformance.adaptive;
|
||||
|
||||
Reference in New Issue
Block a user