setKillSwitchState method

Future<void> setKillSwitchState(
  1. bool enabled
)

Set The Kill Switch State In Firestore

Implementation

Future<void> setKillSwitchState(bool enabled) async {
  try {
    final docRef = _firestore.doc(_collectionPath);
    await docRef.set({
      _fieldName: enabled,
      'lastUpdated': FieldValue.serverTimestamp(),
    }, SetOptions(merge: true));
  } catch (e) {
    throw Exception('Failed To Set Kill Switch State: $e');
  }
}