Skip to content

Commit b7d1dd0

Browse files
Update Firebase codelabs (#1583)
## Pre-launch Checklist - [x] I read the [Effective Dart: Style] _recently_, and have followed its advice. - [x] I signed the [CLA]. - [x] I updated/added relevant documentation (doc comments with `///`). - [ ] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-devrel channel on [Discord]. <!-- Links --> [Effective Dart: Style]: https://dart.dev/guides/language/effective-dart/style [CLA]: https://cla.developers.google.com/ [Discord]: https://github.com/flutter/flutter/wiki/Chat
1 parent f5011e7 commit b7d1dd0

File tree

215 files changed

+6673
-668
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

215 files changed

+6673
-668
lines changed

firebase-auth-flutterfire-ui/codelab_rebuild.yaml

+4,921
Large diffs are not rendered by default.

firebase-auth-flutterfire-ui/complete/.gitignore

-3
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@ migrate_working_dir/
3232
.pub/
3333
/build/
3434

35-
# Web related
36-
lib/generated_plugin_registrant.dart
37-
3835
# Symbolication related
3936
app.*.symbols
4037

firebase-auth-flutterfire-ui/complete/analysis_options.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ include: ../../analysis_options.yaml
33
linter:
44
rules:
55
avoid_print: false
6-
constant_identifier_names: false
6+
constant_identifier_names: false

firebase-auth-flutterfire-ui/complete/android/app/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ android {
4646
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
4747
applicationId "com.example.complete"
4848
// You can update the following values to match your application needs.
49-
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
49+
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
5050
minSdkVersion flutter.minSdkVersion
5151
targetSdkVersion flutter.targetSdkVersion
5252
versionCode flutterVersionCode.toInteger()

firebase-auth-flutterfire-ui/complete/android/build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
buildscript {
2-
ext.kotlin_version = '1.6.10'
2+
ext.kotlin_version = '1.7.10'
33
repositories {
44
google()
55
mavenCentral()
66
}
77

88
dependencies {
9-
classpath 'com.android.tools.build:gradle:7.1.2'
9+
classpath 'com.android.tools.build:gradle:7.2.0'
1010
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1111
}
1212
}
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
#Fri Jun 23 08:50:38 CEST 2017
21
distributionBase=GRADLE_USER_HOME
32
distributionPath=wrapper/dists
43
zipStoreBase=GRADLE_USER_HOME
54
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip

firebase-auth-flutterfire-ui/complete/ios/Flutter/AppFrameworkInfo.plist

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
<key>CFBundleVersion</key>
2222
<string>1.0</string>
2323
<key>MinimumOSVersion</key>
24-
<string>9.0</string>
24+
<string>11.0</string>
2525
</dict>
2626
</plist>

firebase-auth-flutterfire-ui/complete/ios/Podfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Uncomment this line to define a global platform for your project
2-
# platform :ios, '9.0'
2+
# platform :ios, '11.0'
33

44
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
55
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

firebase-auth-flutterfire-ui/complete/ios/Runner.xcodeproj/project.pbxproj

+7-9
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 50;
6+
objectVersion = 54;
77
objects = {
88

99
/* Begin PBXBuildFile section */
1010
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
11-
19D58F2B289476D60051E914 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 19D58F2A289476D60051E914 /* GoogleService-Info.plist */; };
1211
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
1312
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
1413
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
@@ -32,7 +31,6 @@
3231
/* Begin PBXFileReference section */
3332
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
3433
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
35-
19D58F2A289476D60051E914 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
3634
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
3735
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
3836
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
@@ -88,7 +86,6 @@
8886
97C146F01CF9000F007C117D /* Runner */ = {
8987
isa = PBXGroup;
9088
children = (
91-
19D58F2A289476D60051E914 /* GoogleService-Info.plist */,
9289
97C146FA1CF9000F007C117D /* Main.storyboard */,
9390
97C146FD1CF9000F007C117D /* Assets.xcassets */,
9491
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
@@ -164,7 +161,6 @@
164161
files = (
165162
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
166163
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
167-
19D58F2B289476D60051E914 /* GoogleService-Info.plist in Resources */,
168164
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
169165
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
170166
);
@@ -175,6 +171,7 @@
175171
/* Begin PBXShellScriptBuildPhase section */
176172
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
177173
isa = PBXShellScriptBuildPhase;
174+
alwaysOutOfDate = 1;
178175
buildActionMask = 2147483647;
179176
files = (
180177
);
@@ -189,6 +186,7 @@
189186
};
190187
9740EEB61CF901F6004384FC /* Run Script */ = {
191188
isa = PBXShellScriptBuildPhase;
189+
alwaysOutOfDate = 1;
192190
buildActionMask = 2147483647;
193191
files = (
194192
);
@@ -276,7 +274,7 @@
276274
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
277275
GCC_WARN_UNUSED_FUNCTION = YES;
278276
GCC_WARN_UNUSED_VARIABLE = YES;
279-
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
277+
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
280278
MTL_ENABLE_DEBUG_INFO = NO;
281279
SDKROOT = iphoneos;
282280
SUPPORTED_PLATFORMS = iphoneos;
@@ -353,7 +351,7 @@
353351
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
354352
GCC_WARN_UNUSED_FUNCTION = YES;
355353
GCC_WARN_UNUSED_VARIABLE = YES;
356-
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
354+
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
357355
MTL_ENABLE_DEBUG_INFO = YES;
358356
ONLY_ACTIVE_ARCH = YES;
359357
SDKROOT = iphoneos;
@@ -402,7 +400,7 @@
402400
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
403401
GCC_WARN_UNUSED_FUNCTION = YES;
404402
GCC_WARN_UNUSED_VARIABLE = YES;
405-
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
403+
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
406404
MTL_ENABLE_DEBUG_INFO = NO;
407405
SDKROOT = iphoneos;
408406
SUPPORTED_PLATFORMS = iphoneos;
@@ -482,4 +480,4 @@
482480
/* End XCConfigurationList section */
483481
};
484482
rootObject = 97C146E61CF9000F007C117D /* Project object */;
485-
}
483+
}

firebase-auth-flutterfire-ui/complete/ios/Runner/GoogleService-Info.plist

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@
3131
<key>GOOGLE_APP_ID</key>
3232
<string>1:963656261848:ios:d9e01cfe8b675dfcb237ad</string>
3333
</dict>
34-
</plist>
34+
</plist>

firebase-auth-flutterfire-ui/complete/ios/Runner/Info.plist

+2
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,7 @@
4545
<false/>
4646
<key>CADisableMinimumFrameDurationOnPhone</key>
4747
<true/>
48+
<key>UIApplicationSupportsIndirectInputEvents</key>
49+
<true/>
4850
</dict>
4951
</plist>

firebase-auth-flutterfire-ui/complete/macos/Podfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
platform :osx, '10.11'
1+
platform :osx, '10.14'
22

33
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
44
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

firebase-auth-flutterfire-ui/complete/macos/Runner.xcodeproj/project.pbxproj

+5-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 51;
6+
objectVersion = 54;
77
objects = {
88

99
/* Begin PBXAggregateTarget section */
@@ -235,6 +235,7 @@
235235
/* Begin PBXShellScriptBuildPhase section */
236236
3399D490228B24CF009A79C7 /* ShellScript */ = {
237237
isa = PBXShellScriptBuildPhase;
238+
alwaysOutOfDate = 1;
238239
buildActionMask = 2147483647;
239240
files = (
240241
);
@@ -344,7 +345,7 @@
344345
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
345346
GCC_WARN_UNUSED_FUNCTION = YES;
346347
GCC_WARN_UNUSED_VARIABLE = YES;
347-
MACOSX_DEPLOYMENT_TARGET = 10.11;
348+
MACOSX_DEPLOYMENT_TARGET = 10.14;
348349
MTL_ENABLE_DEBUG_INFO = NO;
349350
SDKROOT = macosx;
350351
SWIFT_COMPILATION_MODE = wholemodule;
@@ -423,7 +424,7 @@
423424
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
424425
GCC_WARN_UNUSED_FUNCTION = YES;
425426
GCC_WARN_UNUSED_VARIABLE = YES;
426-
MACOSX_DEPLOYMENT_TARGET = 10.11;
427+
MACOSX_DEPLOYMENT_TARGET = 10.14;
427428
MTL_ENABLE_DEBUG_INFO = YES;
428429
ONLY_ACTIVE_ARCH = YES;
429430
SDKROOT = macosx;
@@ -470,7 +471,7 @@
470471
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
471472
GCC_WARN_UNUSED_FUNCTION = YES;
472473
GCC_WARN_UNUSED_VARIABLE = YES;
473-
MACOSX_DEPLOYMENT_TARGET = 10.11;
474+
MACOSX_DEPLOYMENT_TARGET = 10.14;
474475
MTL_ENABLE_DEBUG_INFO = NO;
475476
SDKROOT = macosx;
476477
SWIFT_COMPILATION_MODE = wholemodule;

firebase-auth-flutterfire-ui/complete/macos/Runner/Configs/AppInfo.xcconfig

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ PRODUCT_NAME = complete
1111
PRODUCT_BUNDLE_IDENTIFIER = com.example.complete
1212

1313
// The copyright displayed in application information
14-
PRODUCT_COPYRIGHT = Copyright © 2022 com.example. All rights reserved.
14+
PRODUCT_COPYRIGHT = Copyright © 2023 com.example. All rights reserved.

firebase-auth-flutterfire-ui/complete/macos/Runner/GoogleService-Info.plist

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@
3131
<key>GOOGLE_APP_ID</key>
3232
<string>1:963656261848:ios:d9e01cfe8b675dfcb237ad</string>
3333
</dict>
34-
</plist>
34+
</plist>

firebase-auth-flutterfire-ui/complete/macos/Runner/Release.entitlements

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
<key>com.apple.security.app-sandbox</key>
66
<true/>
77
<key>com.apple.security.network.server</key>
8-
<true/>
8+
<true/>
99
</dict>
1010
</plist>

firebase-auth-flutterfire-ui/complete/pubspec.yaml

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
name: complete
22
description: A new Flutter project.
3-
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
4-
version: 1.0.0+1
3+
publish_to: 'none'
4+
version: 0.1.0
55

66
environment:
7-
sdk: ">=2.17.5 <3.0.0"
7+
sdk: '>=2.19.6 <3.0.0'
88

99
dependencies:
10+
cloud_firestore: ^4.5.3
11+
firebase_auth: ^4.4.2
12+
firebase_core: ^2.10.0
1013
flutter:
1114
sdk: flutter
12-
firebase_core: ^2.4.1
13-
firebase_auth: ^4.2.4
14-
cloud_firestore: ^4.3.1
1515
flutterfire_ui: ^0.4.3+20
16-
google_sign_in: ^5.4.0
16+
google_sign_in: ^5.4.4
1717

1818
dev_dependencies:
1919
flutter_test:

firebase-auth-flutterfire-ui/complete/web/index.html

+5-5
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,18 @@
4242
<script src="flutter.js" defer></script>
4343
</head>
4444
<body>
45-
4645
<script>
4746
window.addEventListener('load', function(ev) {
4847
// Download main.dart.js
4948
_flutter.loader.loadEntrypoint({
5049
serviceWorker: {
5150
serviceWorkerVersion: serviceWorkerVersion,
51+
},
52+
onEntrypointLoaded: function(engineInitializer) {
53+
engineInitializer.initializeEngine().then(function(appRunner) {
54+
appRunner.runApp();
55+
});
5256
}
53-
}).then(function(engineInitializer) {
54-
return engineInitializer.initializeEngine();
55-
}).then(function(appRunner) {
56-
return appRunner.runApp();
5757
});
5858
});
5959
</script>

firebase-auth-flutterfire-ui/complete/windows/runner/CMakeLists.txt

+8
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,20 @@ add_executable(${BINARY_NAME} WIN32
2020
# that need different build settings.
2121
apply_standard_settings(${BINARY_NAME})
2222

23+
# Add preprocessor definitions for the build version.
24+
target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"")
25+
target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}")
26+
target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}")
27+
target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_PATCH=${FLUTTER_VERSION_PATCH}")
28+
target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTTER_VERSION_BUILD}")
29+
2330
# Disable Windows macros that collide with C++ standard library functions.
2431
target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX")
2532

2633
# Add dependency libraries and include directories. Add any application-specific
2734
# dependencies here.
2835
target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app)
36+
target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib")
2937
target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}")
3038

3139
# Run the Flutter tool portions of the build. This must not be removed.

firebase-auth-flutterfire-ui/complete/windows/runner/Runner.rc

+6-6
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,14 @@ IDI_APP_ICON ICON "resources\\app_icon.ico"
6060
// Version
6161
//
6262

63-
#ifdef FLUTTER_BUILD_NUMBER
64-
#define VERSION_AS_NUMBER FLUTTER_BUILD_NUMBER
63+
#if defined(FLUTTER_VERSION_MAJOR) && defined(FLUTTER_VERSION_MINOR) && defined(FLUTTER_VERSION_PATCH) && defined(FLUTTER_VERSION_BUILD)
64+
#define VERSION_AS_NUMBER FLUTTER_VERSION_MAJOR,FLUTTER_VERSION_MINOR,FLUTTER_VERSION_PATCH,FLUTTER_VERSION_BUILD
6565
#else
66-
#define VERSION_AS_NUMBER 1,0,0
66+
#define VERSION_AS_NUMBER 1,0,0,0
6767
#endif
6868

69-
#ifdef FLUTTER_BUILD_NAME
70-
#define VERSION_AS_STRING #FLUTTER_BUILD_NAME
69+
#if defined(FLUTTER_VERSION)
70+
#define VERSION_AS_STRING FLUTTER_VERSION
7171
#else
7272
#define VERSION_AS_STRING "1.0.0"
7373
#endif
@@ -93,7 +93,7 @@ BEGIN
9393
VALUE "FileDescription", "complete" "\0"
9494
VALUE "FileVersion", VERSION_AS_STRING "\0"
9595
VALUE "InternalName", "complete" "\0"
96-
VALUE "LegalCopyright", "Copyright (C) 2022 com.example. All rights reserved." "\0"
96+
VALUE "LegalCopyright", "Copyright (C) 2023 com.example. All rights reserved." "\0"
9797
VALUE "OriginalFilename", "complete.exe" "\0"
9898
VALUE "ProductName", "complete" "\0"
9999
VALUE "ProductVersion", VERSION_AS_STRING "\0"

firebase-auth-flutterfire-ui/complete/windows/runner/flutter_window.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ bool FlutterWindow::OnCreate() {
2626
}
2727
RegisterPlugins(flutter_controller_->engine());
2828
SetChildContent(flutter_controller_->view()->GetNativeWindow());
29+
30+
flutter_controller_->engine()->SetNextFrameCallback([&]() {
31+
this->Show();
32+
});
33+
2934
return true;
3035
}
3136

firebase-auth-flutterfire-ui/complete/windows/runner/main.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev,
2727
FlutterWindow window(project);
2828
Win32Window::Point origin(10, 10);
2929
Win32Window::Size size(1280, 720);
30-
if (!window.CreateAndShow(L"complete", origin, size)) {
30+
if (!window.Create(L"complete", origin, size)) {
3131
return EXIT_FAILURE;
3232
}
3333
window.SetQuitOnClose(true);

firebase-auth-flutterfire-ui/complete/windows/runner/runner.exe.manifest

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
</application>
88
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
99
<application>
10-
<!-- Windows 10 -->
10+
<!-- Windows 10 and Windows 11 -->
1111
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
1212
<!-- Windows 8.1 -->
1313
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>

0 commit comments

Comments
 (0)