Skip to content

Commit f669208

Browse files
committed
Update firebase-auth-flutterfire-ui
1 parent b8a3831 commit f669208

File tree

21 files changed

+288
-289
lines changed

21 files changed

+288
-289
lines changed

firebase-auth-flutterfire-ui/codelab_rebuild.yaml

Lines changed: 47 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ steps:
9494
import 'package:firebase_core/firebase_core.dart' show FirebaseOptions;
9595
import 'package:flutter/foundation.dart'
9696
show defaultTargetPlatform, kIsWeb, TargetPlatform;
97-
97+
9898
/// Default [FirebaseOptions] for use with your Firebase apps.
9999
///
100100
/// Example:
@@ -120,10 +120,11 @@ steps:
120120
return macos;
121121
default:
122122
throw UnsupportedError(
123-
'DefaultFirebaseOptions are not supported for this platform.');
123+
'DefaultFirebaseOptions are not supported for this platform.',
124+
);
124125
}
125126
}
126-
127+
127128
// TODO (codelab user): Replace with your Firebase credentials
128129
// Generate this file with credentials with the FlutterFire CLI
129130
static const FirebaseOptions web = FirebaseOptions(
@@ -135,15 +136,15 @@ steps:
135136
storageBucket: 'flutterfire-ui-codelab.appspot.com',
136137
measurementId: 'MEASUREMENT ID',
137138
);
138-
139+
139140
static const FirebaseOptions android = FirebaseOptions(
140141
apiKey: 'YOUR API KEY',
141142
appId: 'YOUR APP ID',
142143
messagingSenderId: '',
143144
projectId: 'flutterfire-ui-codelab',
144145
storageBucket: 'flutterfire-ui-codelab.appspot.com',
145146
);
146-
147+
147148
static const FirebaseOptions ios = FirebaseOptions(
148149
apiKey: 'YOUR API KEY',
149150
appId: 'YOUR APP ID',
@@ -153,7 +154,7 @@ steps:
153154
iosClientId: 'IOS CLIENT ID',
154155
iosBundleId: 'com.example.BUNDLE',
155156
);
156-
157+
157158
static const FirebaseOptions macos = FirebaseOptions(
158159
apiKey: 'YOUR API KEY',
159160
appId: 'YOUR APP ID',
@@ -168,24 +169,19 @@ steps:
168169
path: start/lib/home.dart
169170
replace-contents: |
170171
import 'package:flutter/material.dart';
171-
172+
172173
class HomeScreen extends StatelessWidget {
173174
const HomeScreen({super.key});
174-
175+
175176
@override
176177
Widget build(BuildContext context) {
177178
return Scaffold(
178-
appBar: AppBar(
179-
automaticallyImplyLeading: false,
180-
),
179+
appBar: AppBar(automaticallyImplyLeading: false),
181180
body: Center(
182181
child: Column(
183182
children: [
184183
Image.asset('dash.png'),
185-
Text(
186-
'Welcome!',
187-
style: Theme.of(context).textTheme.displaySmall,
188-
),
184+
Text('Welcome!', style: Theme.of(context).textTheme.displaySmall),
189185
],
190186
),
191187
),
@@ -425,7 +421,6 @@ steps:
425421
flutter_additional_macos_build_settings(target)
426422
end
427423
end
428-
429424
- name: Mkdir assets
430425
path: start
431426
mkdir: assets
@@ -4919,7 +4914,7 @@ steps:
49194914
patch-u: |
49204915
--- b/firebase-auth-flutterfire-ui/complete/lib/auth_gate.dart
49214916
+++ a/firebase-auth-flutterfire-ui/complete/lib/auth_gate.dart
4922-
@@ -1,12 +1,56 @@
4917+
@@ -1,12 +1,57 @@
49234918
+import 'package:firebase_auth/firebase_auth.dart' hide EmailAuthProvider;
49244919
+import 'package:firebase_ui_auth/firebase_ui_auth.dart';
49254920
+import 'package:firebase_ui_oauth_google/firebase_ui_oauth_google.dart';
@@ -4955,9 +4950,10 @@ steps:
49554950
+ subtitleBuilder: (context, action) {
49564951
+ return Padding(
49574952
+ padding: const EdgeInsets.symmetric(vertical: 8.0),
4958-
+ child: action == AuthAction.signIn
4959-
+ ? const Text('Welcome to FlutterFire, please sign in!')
4960-
+ : const Text('Welcome to Flutterfire, please sign up!'),
4953+
+ child:
4954+
+ action == AuthAction.signIn
4955+
+ ? const Text('Welcome to FlutterFire, please sign in!')
4956+
+ : const Text('Welcome to Flutterfire, please sign up!'),
49614957
+ );
49624958
+ },
49634959
+ footerBuilder: (context, action) {
@@ -4987,49 +4983,50 @@ steps:
49874983
import 'package:flutter/material.dart';
49884984

49894985
class HomeScreen extends StatelessWidget {
4990-
@@ -7,6 +8,38 @@ class HomeScreen extends StatelessWidget {
4986+
@@ -6,12 +7,46 @@ class HomeScreen extends StatelessWidget {
4987+
@override
49914988
Widget build(BuildContext context) {
49924989
return Scaffold(
4993-
appBar: AppBar(
4990+
- appBar: AppBar(automaticallyImplyLeading: false),
4991+
+ appBar: AppBar(
49944992
+ actions: [
49954993
+ IconButton(
49964994
+ icon: const Icon(Icons.person),
49974995
+ onPressed: () {
49984996
+ Navigator.push(
49994997
+ context,
50004998
+ MaterialPageRoute<ProfileScreen>(
5001-
+ builder: (context) => ProfileScreen(
5002-
+ appBar: AppBar(
5003-
+ title: const Text('User Profile'),
5004-
+ ),
5005-
+ actions: [
5006-
+ SignedOutAction((context) {
5007-
+ Navigator.of(context).pop();
5008-
+ })
5009-
+ ],
5010-
+ children: [
5011-
+ const Divider(),
5012-
+ Padding(
5013-
+ padding: const EdgeInsets.all(2),
5014-
+ child: AspectRatio(
5015-
+ aspectRatio: 1,
5016-
+ child: Image.asset('flutterfire_300x.png'),
5017-
+ ),
4999+
+ builder:
5000+
+ (context) => ProfileScreen(
5001+
+ appBar: AppBar(title: const Text('User Profile')),
5002+
+ actions: [
5003+
+ SignedOutAction((context) {
5004+
+ Navigator.of(context).pop();
5005+
+ }),
5006+
+ ],
5007+
+ children: [
5008+
+ const Divider(),
5009+
+ Padding(
5010+
+ padding: const EdgeInsets.all(2),
5011+
+ child: AspectRatio(
5012+
+ aspectRatio: 1,
5013+
+ child: Image.asset('flutterfire_300x.png'),
5014+
+ ),
5015+
+ ),
5016+
+ ],
50185017
+ ),
5019-
+ ],
5020-
+ ),
50215018
+ ),
50225019
+ );
50235020
+ },
5024-
+ )
5021+
+ ),
50255022
+ ],
5026-
automaticallyImplyLeading: false,
5027-
),
5023+
+ automaticallyImplyLeading: false,
5024+
+ ),
50285025
body: Center(
5029-
@@ -17,6 +50,7 @@ class HomeScreen extends StatelessWidget {
5030-
'Welcome!',
5031-
style: Theme.of(context).textTheme.displaySmall,
5032-
),
5026+
child: Column(
5027+
children: [
5028+
Image.asset('dash.png'),
5029+
Text('Welcome!', style: Theme.of(context).textTheme.displaySmall),
50335030
+ const SignOutButton(),
50345031
],
50355032
),
@@ -5039,7 +5036,7 @@ steps:
50395036
patch-u: |
50405037
--- b/firebase-auth-flutterfire-ui/complete/lib/main.dart
50415038
+++ a/firebase-auth-flutterfire-ui/complete/lib/main.dart
5042-
@@ -1,10 +1,17 @@
5039+
@@ -1,10 +1,15 @@
50435040
+import 'package:firebase_core/firebase_core.dart';
50445041
import 'package:flutter/material.dart';
50455042

@@ -5051,9 +5048,7 @@ steps:
50515048

50525049
void main() async {
50535050
+ WidgetsFlutterBinding.ensureInitialized();
5054-
+ await Firebase.initializeApp(
5055-
+ options: DefaultFirebaseOptions.currentPlatform,
5056-
+ );
5051+
+ await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);
50575052
+
50585053
runApp(const MyApp());
50595054
}

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
plugins {
2-
id "com.android.application"
3-
id "kotlin-android"
2+
id("com.android.application")
3+
id("kotlin-android")
44
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
5-
id "dev.flutter.flutter-gradle-plugin"
5+
id("dev.flutter.flutter-gradle-plugin")
66
}
77

88
android {
@@ -16,7 +16,7 @@ android {
1616
}
1717

1818
kotlinOptions {
19-
jvmTarget = JavaVersion.VERSION_1_8
19+
jvmTarget = JavaVersion.VERSION_1_8.toString()
2020
}
2121

2222
defaultConfig {
@@ -34,7 +34,7 @@ android {
3434
release {
3535
// TODO: Add your own signing config for the release build.
3636
// Signing with the debug keys for now, so `flutter run --release` works.
37-
signingConfig = signingConfigs.debug
37+
signingConfig = signingConfigs.getByName("debug")
3838
}
3939
}
4040
}

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

Lines changed: 0 additions & 18 deletions
This file was deleted.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
allprojects {
2+
repositories {
3+
google()
4+
mavenCentral()
5+
}
6+
}
7+
8+
val newBuildDir: Directory = rootProject.layout.buildDirectory.dir("../../build").get()
9+
rootProject.layout.buildDirectory.value(newBuildDir)
10+
11+
subprojects {
12+
val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name)
13+
project.layout.buildDirectory.value(newSubprojectBuildDir)
14+
}
15+
subprojects {
16+
project.evaluationDependsOn(":app")
17+
}
18+
19+
tasks.register<Delete>("clean") {
20+
delete(rootProject.layout.buildDirectory)
21+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
org.gradle.jvmargs=-Xmx4G -XX:MaxMetaspaceSize=2G -XX:+HeapDumpOnOutOfMemoryError
1+
org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError
22
android.useAndroidX=true
33
android.enableJetifier=true

firebase-auth-flutterfire-ui/complete/android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
33
zipStoreBase=GRADLE_USER_HOME
44
zipStorePath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip

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

Lines changed: 0 additions & 25 deletions
This file was deleted.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
pluginManagement {
2+
val flutterSdkPath = run {
3+
val properties = java.util.Properties()
4+
file("local.properties").inputStream().use { properties.load(it) }
5+
val flutterSdkPath = properties.getProperty("flutter.sdk")
6+
require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" }
7+
flutterSdkPath
8+
}
9+
10+
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
11+
12+
repositories {
13+
google()
14+
mavenCentral()
15+
gradlePluginPortal()
16+
}
17+
}
18+
19+
plugins {
20+
id("dev.flutter.flutter-plugin-loader") version "1.0.0"
21+
id("com.android.application") version "8.7.0" apply false
22+
id("org.jetbrains.kotlin.android") version "1.8.22" apply false
23+
}
24+
25+
include(":app")

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ flutter_ios_podfile_setup
2929

3030
target 'Runner' do
3131
use_frameworks!
32-
use_modular_headers!
3332

3433
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
3534
target 'RunnerTests' do

0 commit comments

Comments
 (0)