Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

全消しの削除 #41

Merged
merged 1 commit into from
Feb 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions geoguessur_test/lib/service/database/develop_creat.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ class DevelopCreat {
final FirebaseStorage _storage = FirebaseStorage.instance;

Future<void> savePlacesToFirestore() async {
// 既存のデータを全消去
// await _firestoreService.deleteAllPlaces();

final places = [
Place(
id: 1,
Expand Down
12 changes: 6 additions & 6 deletions geoguessur_test/lib/service/database/firestore_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ class FirestoreService {
}

// Delete all places
Future<void> deleteAllPlaces() async {
QuerySnapshot querySnapshot = await _firestore.collection('places').get();
for (DocumentSnapshot doc in querySnapshot.docs) {
await doc.reference.delete();
}
}
// Future<void> deleteAllPlaces() async {
// QuerySnapshot querySnapshot = await _firestore.collection('places').get();
// for (DocumentSnapshot doc in querySnapshot.docs) {
// await doc.reference.delete();
// }
// }

// Get all places
Future<List<Place>> getAllPlaces() async {
Expand Down