import 'package:SEFER/constant/box_name.dart';
import 'package:SEFER/main.dart';
import 'package:get/get.dart';

class SettingController extends GetxController {
  bool isGoogleMapsEnabled = false;

  void onChangMapApp() {
    if (!isGoogleMapsEnabled) {
      isGoogleMapsEnabled = true;
      box.write(BoxName.googlaMapApp, true);
      update();
    } else {
      isGoogleMapsEnabled = false;
      box.write(BoxName.googlaMapApp, false);
      update();
    }
  }

  @override
  void onInit() {
    if (box.read(BoxName.googlaMapApp) != null) {
      isGoogleMapsEnabled = box.read(BoxName.googlaMapApp);
    }
    update();
    super.onInit();
  }
}
