Skip to content

Upgrade deps, fix a name conflict, add a note about running on web. #51

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

Merged
merged 6 commits into from
Mar 7, 2024
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
7 changes: 7 additions & 0 deletions firestore/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ service cloud.firestore {
**Add Some** from the overflow menu to add some
new entries.

### Run the App Web

Don't forget to run `flutterfire configure` to set up your app's FirebaseOptions

In order to display images without a CORS exception, use the --web-renderer html flag:
`flutter run -d chrome --web-renderer html`

### Result

<img src="./assets/home.png" height="534" width="300"/>
Expand Down
4 changes: 2 additions & 2 deletions firestore/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:4.1.0'
classpath 'com.android.tools.build:gradle:7.4.1'
// START: FlutterFire Configuration
classpath 'com.google.gms:google-services:4.3.10'
// END: FlutterFire Configuration
Expand All @@ -29,6 +29,6 @@ subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
2 changes: 1 addition & 1 deletion firestore/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
3 changes: 2 additions & 1 deletion firestore/lib/firebase_options.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'package:firebase_core/firebase_core.dart' show FirebaseOptions;
/// Run 'flutterfire configure' to generate platform-specific FirebaseOptions.
class DefaultFirebaseOptions {
static FirebaseOptions get currentPlatform {
throw StateError("firebase_options.dart not generated. Did you run 'flutterfire configure'?");
throw StateError(
"firebase_options.dart not generated. Did you run 'flutterfire configure'?");
}
}
6 changes: 3 additions & 3 deletions firestore/lib/src/data/restaurant_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import 'dart:async';

import 'package:cloud_firestore/cloud_firestore.dart' hide Filter;

import '../model/filter.dart';
import '../model/filter.dart' as model_filter;
import '../model/restaurant.dart';
import '../model/review.dart';

Expand All @@ -29,7 +29,7 @@ abstract class RestaurantProvider {
{required String restaurantId, required Review review});
void addRestaurantsBatch(List<Restaurant> restaurants);
void loadAllRestaurants();
void loadFilteredRestaurants(Filter filter);
void loadFilteredRestaurants(model_filter.Filter filter);
Future<Restaurant> getRestaurantById(String restaurantId);
void dispose();
}
Expand Down Expand Up @@ -115,7 +115,7 @@ class FirestoreRestaurantProvider implements RestaurantProvider {
}

@override
void loadFilteredRestaurants(Filter filter) {
void loadFilteredRestaurants(model_filter.Filter filter) {
Query collection = FirebaseFirestore.instance.collection('restaurants');
if (filter.category != null) {
collection = collection.where('category', isEqualTo: filter.category);
Expand Down
16 changes: 8 additions & 8 deletions firestore/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ packages:
dependency: transitive
description:
name: collection
sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687
url: "https://pub.dev"
source: hosted
version: "1.18.0"
version: "1.17.2"
cupertino_icons:
dependency: "direct main"
description:
Expand Down Expand Up @@ -265,18 +265,18 @@ packages:
dependency: transitive
description:
name: stack_trace
sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b"
sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5
url: "https://pub.dev"
source: hosted
version: "1.11.1"
version: "1.11.0"
stream_channel:
dependency: transitive
description:
name: stream_channel
sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7
sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8"
url: "https://pub.dev"
source: hosted
version: "2.1.2"
version: "2.1.1"
string_scanner:
dependency: transitive
description:
Expand All @@ -297,10 +297,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b"
sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8"
url: "https://pub.dev"
source: hosted
version: "0.6.1"
version: "0.6.0"
typed_data:
dependency: transitive
description:
Expand Down