import 'package:equatable/equatable.dart';
import 'package:flutter/material.dart';

/// Abstract base class for all theme-related events.
/// 
/// This class extends [Equatable] to enable value equality for event comparison.
/// All theme events in the application should inherit from this class.
abstract class ThemeEvent extends Equatable {
  /// Creates a new [ThemeEvent].
  const ThemeEvent();

  @override
  List<Object?> get props => [];
}

/// Event to request a theme change.
/// 
/// This event is dispatched when the user wants to change the application theme
/// mode (light, dark, or system). The new theme mode is persisted and applied immediately.
class ThemeChanged extends ThemeEvent {
  /// The new theme mode to apply.
  final ThemeMode themeMode;

  /// Creates a new [ThemeChanged] event with the specified [themeMode].
  const ThemeChanged({required this.themeMode});

  @override
  List<Object?> get props => [themeMode];
}

/// Event to request loading of saved theme preferences.
/// 
/// This event is typically dispatched when the app starts to restore
/// the user's previously selected theme preference.
class ThemeLoadRequested extends ThemeEvent {}