updateDoctorDetails method

Future<void> updateDoctorDetails()

Updates the doctor details in the Firestore database.

Implementation

Future<void> updateDoctorDetails() async {
  final data = {
    "name": _name,
    "mobileNo": _mobile,
    "email": _email,
  };

  try {
    await databases.updateDocument(
      databaseId: AppConstants.appwriteDatabaseId,
      collectionId: AppConstants.userCollectionId,
      documentId: widget.doctor!.documentId!,
      data: data,
    );

    widget.doctor!.name = _name;
    setDeviceAssociations(widget.doctor!.organizationId);
  } catch (e) {
    debugPrint("Update doctor error: $e");
  }
}