import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:hive_flutter/hive_flutter.dart';
import '../../data/local/hive_boxes.dart';
import '../../data/local/models/app_settings.dart';

/// Theme mode state provider.
final themeProvider = StateProvider<ThemeMode>((ref) {
  final box = Hive.box<AppSettings>(HiveBoxes.settings);
  final settings = box.get('default');
  return settings?.themeModeIndex == 1 ? ThemeMode.light : ThemeMode.dark;
});
