diff --git a/packages/cloud_firestore/cloud_firestore/example/ios/Flutter/AppFrameworkInfo.plist b/packages/cloud_firestore/cloud_firestore/example/ios/Flutter/AppFrameworkInfo.plist
index 6c2de8086bcd..3a9c234f96d4 100755
--- a/packages/cloud_firestore/cloud_firestore/example/ios/Flutter/AppFrameworkInfo.plist
+++ b/packages/cloud_firestore/cloud_firestore/example/ios/Flutter/AppFrameworkInfo.plist
@@ -25,6 +25,6 @@
arm64
MinimumOSVersion
- 8.0
+ 9.0
diff --git a/packages/cloud_firestore/cloud_firestore/example/lib/firebase_config.dart b/packages/cloud_firestore/cloud_firestore/example/lib/firebase_config.dart
new file mode 100644
index 000000000000..9a7e23a5538f
--- /dev/null
+++ b/packages/cloud_firestore/cloud_firestore/example/lib/firebase_config.dart
@@ -0,0 +1,45 @@
+import 'dart:io';
+
+import 'package:firebase_core/firebase_core.dart';
+import 'package:flutter/foundation.dart';
+
+class DefaultFirebaseConfig {
+ static FirebaseOptions get platformOptions {
+ if (kIsWeb) {
+ // Web
+ return const FirebaseOptions(
+ apiKey: 'AIzaSyAgUhHU8wSJgO5MVNy95tMT07NEjzMOfz0',
+ authDomain: 'react-native-firebase-testing.firebaseapp.com',
+ databaseURL: 'https://react-native-firebase-testing.firebaseio.com',
+ projectId: 'react-native-firebase-testing',
+ storageBucket: 'react-native-firebase-testing.appspot.com',
+ messagingSenderId: '448618578101',
+ appId: '1:448618578101:web:772d484dc9eb15e9ac3efc',
+ measurementId: 'G-0N1G9FLDZE',
+ );
+ } else if (Platform.isIOS || Platform.isMacOS) {
+ // iOS and MacOS
+ return const FirebaseOptions(
+ appId: '1:448618578101:ios:2bc5c1fe2ec336f8ac3efc',
+ apiKey: 'AIzaSyAHAsf51D0A407EklG1bs-5wA7EbyfNFg0',
+ projectId: 'react-native-firebase-testing',
+ messagingSenderId: '448618578101',
+ iosBundleId: 'io.flutter.plugins.firebase.firestore.example',
+ iosClientId:
+ '448618578101-ja1be10uicsa2dvss16gh4hkqks0vq61.apps.googleusercontent.com',
+ androidClientId:
+ '448618578101-2baveavh8bvs2famsa5r8t77fe1nrcn6.apps.googleusercontent.com',
+ storageBucket: 'react-native-firebase-testing.appspot.com',
+ databaseURL: 'https://react-native-firebase-testing.firebaseio.com',
+ );
+ } else {
+ // Android
+ return const FirebaseOptions(
+ appId: '1:448618578101:android:3ad281c0067ccf97ac3efc',
+ apiKey: 'AIzaSyCuu4tbv9CwwTudNOweMNstzZHIDBhgJxA',
+ projectId: 'react-native-firebase-testing',
+ messagingSenderId: '448618578101',
+ );
+ }
+ }
+}
diff --git a/packages/cloud_firestore/cloud_firestore/example/lib/main.dart b/packages/cloud_firestore/cloud_firestore/example/lib/main.dart
index c02eb81764d5..961e076f69b9 100755
--- a/packages/cloud_firestore/cloud_firestore/example/lib/main.dart
+++ b/packages/cloud_firestore/cloud_firestore/example/lib/main.dart
@@ -2,6 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+import 'package:cloud_firestore_example/firebase_config.dart';
import 'package:cloud_firestore_example/movie.dart';
import 'package:flutter/material.dart';
import 'package:firebase_core/firebase_core.dart';
@@ -13,14 +14,7 @@ bool USE_FIRESTORE_EMULATOR = false;
Future main() async {
WidgetsFlutterBinding.ensureInitialized();
- await Firebase.initializeApp(
- options: const FirebaseOptions(
- apiKey: 'AIzaSyAHAsf51D0A407EklG1bs-5wA7EbyfNFg0',
- appId: '1:448618578101:ios:2bc5c1fe2ec336f8ac3efc',
- messagingSenderId: '448618578101',
- projectId: 'react-native-firebase-testing',
- ),
- );
+ await Firebase.initializeApp(options: DefaultFirebaseConfig.platformOptions);
if (USE_FIRESTORE_EMULATOR) {
FirebaseFirestore.instance.useFirestoreEmulator('localhost', 8080);
@@ -218,9 +212,7 @@ class _MovieItem extends StatelessWidget {
Widget get poster {
return SizedBox(
width: 100,
- child: Center(
- child: Image.network(movie.poster),
- ),
+ child: Image.network(movie.poster),
);
}
@@ -255,7 +247,8 @@ class _MovieItem extends StatelessWidget {
Widget get metadata {
return Padding(
padding: const EdgeInsets.only(top: 8),
- child: Row(
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(right: 8),
@@ -299,6 +292,7 @@ class _MovieItem extends StatelessWidget {
return Padding(
padding: const EdgeInsets.only(bottom: 4, top: 4),
child: Row(
+ crossAxisAlignment: CrossAxisAlignment.start,
children: [
poster,
Flexible(child: details),
diff --git a/packages/cloud_firestore/cloud_firestore/example/macos/Runner.xcodeproj/project.pbxproj b/packages/cloud_firestore/cloud_firestore/example/macos/Runner.xcodeproj/project.pbxproj
index f7409e7def98..c879768f04fa 100644
--- a/packages/cloud_firestore/cloud_firestore/example/macos/Runner.xcodeproj/project.pbxproj
+++ b/packages/cloud_firestore/cloud_firestore/example/macos/Runner.xcodeproj/project.pbxproj
@@ -26,12 +26,8 @@
33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; };
33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; };
33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; };
- 33D1A10422148B71006C7A3E /* FlutterMacOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 33D1A10322148B71006C7A3E /* FlutterMacOS.framework */; };
- 33D1A10522148B93006C7A3E /* FlutterMacOS.framework in Bundle Framework */ = {isa = PBXBuildFile; fileRef = 33D1A10322148B71006C7A3E /* FlutterMacOS.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
B550B1FA23F53055007DADD5 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = B550B1F923F53055007DADD5 /* GoogleService-Info.plist */; };
CF00B2C1BAC6C45C8CEC0ABB /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 20AC44AD05DF01F5CE774C68 /* Pods_Runner.framework */; };
- D73912F022F37F9E000D13A0 /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D73912EF22F37F9E000D13A0 /* App.framework */; };
- D73912F222F3801D000D13A0 /* App.framework in Bundle Framework */ = {isa = PBXBuildFile; fileRef = D73912EF22F37F9E000D13A0 /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@@ -51,8 +47,6 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
- D73912F222F3801D000D13A0 /* App.framework in Bundle Framework */,
- 33D1A10522148B93006C7A3E /* FlutterMacOS.framework in Bundle Framework */,
);
name = "Bundle Framework";
runOnlyForDeploymentPostprocessing = 0;
@@ -72,7 +66,6 @@
33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Debug.xcconfig"; sourceTree = ""; };
33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Release.xcconfig"; sourceTree = ""; };
33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = "Flutter-Generated.xcconfig"; path = "ephemeral/Flutter-Generated.xcconfig"; sourceTree = ""; };
- 33D1A10322148B71006C7A3E /* FlutterMacOS.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = FlutterMacOS.framework; path = Flutter/ephemeral/FlutterMacOS.framework; sourceTree = SOURCE_ROOT; };
33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = ""; };
33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = ""; };
33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; };
@@ -81,7 +74,6 @@
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; };
B550B1F923F53055007DADD5 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; };
BFF2C4019A4A6B2204D78167 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; };
- D73912EF22F37F9E000D13A0 /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/ephemeral/App.framework; sourceTree = SOURCE_ROOT; };
F84572E2CE6BA0CFCE7EC16B /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; };
/* End PBXFileReference section */
@@ -90,8 +82,6 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
- D73912F022F37F9E000D13A0 /* App.framework in Frameworks */,
- 33D1A10422148B71006C7A3E /* FlutterMacOS.framework in Frameworks */,
CF00B2C1BAC6C45C8CEC0ABB /* Pods_Runner.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -147,8 +137,6 @@
33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */,
33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */,
33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */,
- D73912EF22F37F9E000D13A0 /* App.framework */,
- 33D1A10322148B71006C7A3E /* FlutterMacOS.framework */,
);
path = Flutter;
sourceTree = "";
@@ -199,6 +187,7 @@
33CC110E2044A8840003C045 /* Bundle Framework */,
3399D490228B24CF009A79C7 /* ShellScript */,
975391D0C03E32306137DE4C /* [CP] Embed Pods Frameworks */,
+ BAB8F2C5684814BE2193F3E5 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
@@ -306,7 +295,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "echo \"$PRODUCT_NAME.app\" > \"$PROJECT_DIR\"/Flutter/ephemeral/.app_filename\n";
+ shellScript = "echo \"$PRODUCT_NAME.app\" > \"$PROJECT_DIR\"/Flutter/ephemeral/.app_filename && \"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh embed\n";
};
33CC111E2044C6BF0003C045 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
@@ -333,16 +322,31 @@
buildActionMask = 2147483647;
files = (
);
- inputFileListPaths = (
+ inputPaths = (
);
name = "[CP] Embed Pods Frameworks";
- outputFileListPaths = (
+ outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
+ BAB8F2C5684814BE2193F3E5 /* [CP] Copy Pods Resources */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ );
+ name = "[CP] Copy Pods Resources";
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
+ showEnvVarsInLog = 0;
+ };
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
diff --git a/packages/cloud_firestore/cloud_firestore/example/pubspec.yaml b/packages/cloud_firestore/cloud_firestore/example/pubspec.yaml
index fb2f069ccf84..4d4c8072f202 100755
--- a/packages/cloud_firestore/cloud_firestore/example/pubspec.yaml
+++ b/packages/cloud_firestore/cloud_firestore/example/pubspec.yaml
@@ -2,8 +2,8 @@ name: cloud_firestore_example
description: Demonstrates how to use the firestore plugin.
environment:
- sdk: ">=2.12.0 <3.0.0"
- flutter: ">=1.12.13+hotfix.4"
+ sdk: '>=2.12.0 <3.0.0'
+ flutter: '>=1.12.13+hotfix.4'
dependencies:
cloud_firestore:
@@ -27,7 +27,7 @@ dependency_overrides:
path: ../../../firebase_core/firebase_core_web
dev_dependencies:
- drive: ^0.1.0
+ drive: ^1.0.0-1.0.nullsafety.1
flutter_driver:
sdk: flutter
test: any
diff --git a/packages/cloud_firestore/cloud_firestore/example/test_driver/cloud_firestore_e2e.dart b/packages/cloud_firestore/cloud_firestore/example/test_driver/cloud_firestore_e2e.dart
index d1c6070b07a1..b5681b533452 100644
--- a/packages/cloud_firestore/cloud_firestore/example/test_driver/cloud_firestore_e2e.dart
+++ b/packages/cloud_firestore/cloud_firestore/example/test_driver/cloud_firestore_e2e.dart
@@ -1,4 +1,3 @@
-// @dart=2.9
// Copyright 2020, the Chromium project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@@ -12,6 +11,7 @@ import 'collection_reference_e2e.dart';
import 'document_change_e2e.dart';
import 'document_reference_e2e.dart';
import 'field_value_e2e.dart';
+import 'firebase_config.dart';
import 'geo_point_e2e.dart';
import 'instance_e2e.dart';
import 'query_e2e.dart';
@@ -25,7 +25,7 @@ bool kUseFirestoreEmulator = true;
void testsMain() {
setUpAll(() async {
- await Firebase.initializeApp();
+ await Firebase.initializeApp(options: TestFirebaseConfig.platformOptions);
if (kUseFirestoreEmulator) {
FirebaseFirestore.instance.useFirestoreEmulator('localhost', 8080);
diff --git a/packages/cloud_firestore/cloud_firestore/example/test_driver/cloud_firestore_e2e_test.dart b/packages/cloud_firestore/cloud_firestore/example/test_driver/cloud_firestore_e2e_test.dart
index d44896e41f7c..f9c0fa99a519 100644
--- a/packages/cloud_firestore/cloud_firestore/example/test_driver/cloud_firestore_e2e_test.dart
+++ b/packages/cloud_firestore/cloud_firestore/example/test_driver/cloud_firestore_e2e_test.dart
@@ -1,4 +1,3 @@
-// @dart=2.9
// Copyright 2020, the Chromium project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
diff --git a/packages/cloud_firestore/cloud_firestore/example/test_driver/field_value_e2e.dart b/packages/cloud_firestore/cloud_firestore/example/test_driver/field_value_e2e.dart
index 598f6506dad1..596b133294a2 100644
--- a/packages/cloud_firestore/cloud_firestore/example/test_driver/field_value_e2e.dart
+++ b/packages/cloud_firestore/cloud_firestore/example/test_driver/field_value_e2e.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart=2.9
-
import 'dart:async';
import 'package:flutter_test/flutter_test.dart';
@@ -11,7 +9,7 @@ import 'package:cloud_firestore/cloud_firestore.dart';
void runFieldValueTests() {
group('$FieldValue', () {
- FirebaseFirestore /*?*/ firestore;
+ late FirebaseFirestore firestore;
setUpAll(() async {
firestore = FirebaseFirestore.instance;
@@ -32,7 +30,7 @@ void runFieldValueTests() {
await doc.set({'foo': 2});
await doc.update({'foo': FieldValue.increment(1)});
DocumentSnapshot