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 }
0 commit comments