// Flutter imports:
import 'package:flutter/material.dart';

class CustomTheme extends ValueNotifier<ThemeMode> {
  /// Текущая тема
  static bool _isDarkTheme = false;

  CustomTheme(super.value);

  @override
  ThemeMode get value => _isDarkTheme ? ThemeMode.dark : ThemeMode.light;

  bool get isDark => _isDarkTheme;

  ///
  /// Смена темы
  ///
  void toggleTheme() {
    _isDarkTheme = !_isDarkTheme;

    notifyListeners();
  }

  ///
  /// Темная тема
  ///
  static ThemeData get darkTheme {
    return ThemeData.dark(useMaterial3: false);
  }

  ///
  /// Светлая тема
  ///
  static ThemeData get lightTheme {
    return ThemeData(useMaterial3: false);
  }
}
