import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';

import 'package:im_app/app/router/app_route_name.dart';

part 'settings_view_model.g.dart';

/// 设置页 ViewModel
///
/// ## 数据流位置
///
/// ```
/// SettingsPage
///   → ref.read(settingsViewModelProvider.notifier).navigateToTheme(context)
///     → ★ SettingsViewModel.navigateToTheme() ★   ← 你在这里
///       → context.push(AppRouteName.settingsTheme.path)
/// ```
///
/// 导航意图由 ViewModel 统一管理，View 不直接调用路由。
@riverpod
class SettingsViewModel extends _$SettingsViewModel {
  @override
  void build() {}

  /// 跳转到主题设置页。
  void navigateToTheme(BuildContext context) {
    context.push(AppRouteName.settingsTheme.path);
  }
}
