import 'package:flutter/material.dart';

class Settings {
  final ThemeMode themeMode;

  const Settings({
    this.themeMode = ThemeMode.system,
  });

  factory Settings.fromJson(Map<String, dynamic> json) {
    return Settings(
      themeMode: ThemeMode.values.byName(json['themeMode']),
    );
  }

  Map<String, String> toJson() => {
    'themeMode': themeMode.name,
  };
}