import 'package:get/get.dart';
import 'package:get/get_core/src/get_main.dart';
import 'package:injectable/injectable.dart';
import 'package:location/base/base_controller.dart';
import 'package:location/data/repositories/friends_repository.dart';

import '../../../data/bean/user_info.dart';

@injectable
class CommonPointSettingController extends BaseController {
  final RxBool _isZoneAlert = false.obs;

  bool get isZoneAlert => _isZoneAlert.value;

  final RxBool _isNotificationAllFriends = true.obs;

  bool get isNotificationAllFriends => _isNotificationAllFriends.value;

  final FriendsRepository friendsRepository;

  RxList<UserInfo> get friendsList => friendsRepository.friendsList;

  CommonPointSettingController(this.friendsRepository);

  void onBack() {
    Get.back();
  }

  Future<bool> zoneSettingFuture(bool checked) async {
    await Future.delayed(const Duration(milliseconds: 500));
    _isZoneAlert.value = checked;
    return isZoneAlert;
  }

  void onSettingAllFriendsClick() {
    _isNotificationAllFriends.value = true;
  }

  void onSettingSomeGoodFriendsClick() {
    _isNotificationAllFriends.value = false;
  }
}
