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

class UseSettings {
  ValueNotifier<bool> settingState; // 设置主页
  ValueNotifier<bool> preferenceSetState; // 偏好设置

  UseSettings._({required this.settingState, required this.preferenceSetState});

  factory UseSettings.use() {
    return UseSettings._(settingState: useState(false), preferenceSetState: useState(false));
  }

  switchSetmain(bool val) {
    if (val) preferenceSetState.value = false;
    settingState.value = val;
  }

  switchPreference(bool val) {
    if (val) settingState.value = false;
    preferenceSetState.value = val;
  }
}
