32 lines
734 B
Dart
32 lines
734 B
Dart
import 'package:equatable/equatable.dart';
|
|
import 'package:flutter/material.dart';
|
|
|
|
enum SettingsStatus { loaded, error }
|
|
|
|
class SettingsState extends Equatable {
|
|
final SettingsStatus status;
|
|
final ThemeMode themeMode;
|
|
final Locale locale;
|
|
|
|
const SettingsState({
|
|
this.status = SettingsStatus.loaded,
|
|
this.themeMode = ThemeMode.system,
|
|
this.locale = const Locale('ar'),
|
|
});
|
|
|
|
SettingsState copyWith({
|
|
SettingsStatus? status,
|
|
ThemeMode? themeMode,
|
|
Locale? locale,
|
|
}) {
|
|
return SettingsState(
|
|
status: status ?? this.status,
|
|
themeMode: themeMode ?? this.themeMode,
|
|
locale: locale ?? this.locale,
|
|
);
|
|
}
|
|
|
|
@override
|
|
List<Object?> get props => [status, themeMode, locale];
|
|
}
|