@@ -2031,18 +2031,17 @@ steps:
2031
2031
import 'src/widgets.dart';
2032
2032
2033
2033
class HomePage extends StatelessWidget {
2034
- @@ -19,6 +24,15 @@ class HomePage extends StatelessWidget {
2034
+ @@ -19,6 +24,14 @@ class HomePage extends StatelessWidget {
2035
2035
const SizedBox(height: 8),
2036
2036
const IconAndDetail(Icons.calendar_today, 'October 30'),
2037
2037
const IconAndDetail(Icons.location_city, 'San Francisco'),
2038
2038
+ Consumer<ApplicationState>(
2039
- + builder:
2040
- + (context, appState, _) => AuthFunc(
2041
- + loggedIn: appState.loggedIn,
2042
- + signOut: () {
2043
- + FirebaseAuth.instance.signOut();
2044
- + },
2045
- + ),
2039
+ + builder: (context, appState, _) => AuthFunc(
2040
+ + loggedIn: appState.loggedIn,
2041
+ + signOut: () {
2042
+ + FirebaseAuth.instance.signOut();
2043
+ + },
2044
+ + ),
2046
2045
+ ),
2047
2046
const Divider(
2048
2047
height: 8,
@@ -2179,25 +2178,23 @@ steps:
2179
2178
import 'src/authentication.dart';
2180
2179
import 'src/widgets.dart';
2181
2180
2182
- @@ -44 ,6 +45,22 @@ class HomePage extends StatelessWidget {
2181
+ @@ -43 ,6 +44,20 @@ class HomePage extends StatelessWidget {
2183
2182
const Paragraph(
2184
2183
'Join us for a day full of Firebase Workshops and Pizza!',
2185
2184
),
2186
2185
+ Consumer<ApplicationState>(
2187
- + builder:
2188
- + (context, appState, _) => Column(
2189
- + crossAxisAlignment: CrossAxisAlignment.start,
2190
- + children: [
2191
- + if (appState.loggedIn) ...[
2192
- + const Header('Discussion'),
2193
- + GuestBook(
2194
- + addMessage:
2195
- + (message) =>
2196
- + appState.addMessageToGuestBook(message),
2197
- + ),
2198
- + ],
2199
- + ],
2200
- + ),
2186
+ + builder: (context, appState, _) => Column(
2187
+ + crossAxisAlignment: CrossAxisAlignment.start,
2188
+ + children: [
2189
+ + if (appState.loggedIn) ...[
2190
+ + const Header('Discussion'),
2191
+ + GuestBook(
2192
+ + addMessage: (message) =>
2193
+ + appState.addMessageToGuestBook(message),
2194
+ + ),
2195
+ + ],
2196
+ + ],
2197
+ + ),
2201
2198
+ ),
2202
2199
],
2203
2200
),
@@ -2401,14 +2398,14 @@ steps:
2401
2398
patch-u : |
2402
2399
--- b/firebase-get-to-know-flutter/step_07/lib/home_page.dart
2403
2400
+++ a/firebase-get-to-know-flutter/step_07/lib/home_page.dart
2404
- @@ -56 ,6 +56 ,7 @@ class HomePage extends StatelessWidget {
2405
- addMessage:
2406
- (message) =>
2407
- appState.addMessageToGuestBook(message),
2408
- + messages: appState.guestBookMessages,
2409
- ),
2410
- ],
2411
- ],
2401
+ @@ -53 ,6 +53 ,7 @@ class HomePage extends StatelessWidget {
2402
+ GuestBook(
2403
+ addMessage: (message) =>
2404
+ appState.addMessageToGuestBook(message),
2405
+ + messages: appState.guestBookMessages,
2406
+ ),
2407
+ ],
2408
+ ],
2412
2409
- name : Copy step_07
2413
2410
copydir :
2414
2411
from : gtk_flutter
@@ -2611,28 +2608,27 @@ steps:
2611
2608
2612
2609
class HomePage extends StatelessWidget {
2613
2610
const HomePage({super.key});
2614
- @@ -23,7 +24,11 @@ class HomePage extends StatelessWidget {
2611
+ @@ -23,7 +24,10 @@ class HomePage extends StatelessWidget {
2615
2612
children: <Widget>[
2616
2613
Image.asset('assets/codelab.png'),
2617
2614
const SizedBox(height: 8),
2618
2615
- const IconAndDetail(Icons.calendar_today, 'October 30'),
2619
2616
+ Consumer<ApplicationState>(
2620
- + builder:
2621
- + (context, appState, _) =>
2622
- + IconAndDetail(Icons.calendar_today, appState.eventDate),
2617
+ + builder: (context, appState, _) =>
2618
+ + IconAndDetail(Icons.calendar_today, appState.eventDate),
2623
2619
+ ),
2624
2620
const IconAndDetail(Icons.location_city, 'San Francisco'),
2625
2621
Consumer<ApplicationState>(
2626
- builder:
2627
- @@ -32 ,6 +37 ,7 @@ class HomePage extends StatelessWidget {
2628
- signOut: () {
2629
- FirebaseAuth.instance.signOut();
2630
- },
2631
- + enableFreeSwag: appState.enableFreeSwag,
2632
- ),
2622
+ builder: (context, appState, _) => AuthFunc(
2623
+ @@ -31 ,6 +35 ,7 @@ class HomePage extends StatelessWidget {
2624
+ signOut: () {
2625
+ FirebaseAuth.instance.signOut();
2626
+ },
2627
+ + enableFreeSwag: appState.enableFreeSwag,
2628
+ ),
2633
2629
),
2634
2630
const Divider(
2635
- @@ -42,15 +48,25 @@ class HomePage extends StatelessWidget {
2631
+ @@ -41,14 +46,23 @@ class HomePage extends StatelessWidget {
2636
2632
color: Colors.grey,
2637
2633
),
2638
2634
const Header("What we'll be doing"),
@@ -2642,30 +2638,28 @@ steps:
2642
2638
+ builder: (context, appState, _) => Paragraph(appState.callToAction),
2643
2639
),
2644
2640
Consumer<ApplicationState>(
2645
- builder:
2646
- (context, appState, _) => Column(
2647
- crossAxisAlignment: CrossAxisAlignment.start,
2648
- children: [
2649
- + switch (appState.attendees) {
2650
- + 1 => const Paragraph('1 person going'),
2651
- + >= 2 => Paragraph('${appState.attendees} people going'),
2652
- + _ => const Paragraph('No one going'),
2653
- + },
2654
- if (appState.loggedIn) ...[
2655
- + YesNoSelection(
2656
- + state: appState.attending,
2657
- + onSelection:
2658
- + (attending) => appState.attending = attending,
2659
- + ),
2660
- const Header('Discussion'),
2661
- GuestBook(
2662
- addMessage:
2641
+ builder: (context, appState, _) => Column(
2642
+ crossAxisAlignment: CrossAxisAlignment.start,
2643
+ children: [
2644
+ + switch (appState.attendees) {
2645
+ + 1 => const Paragraph('1 person going'),
2646
+ + >= 2 => Paragraph('${appState.attendees} people going'),
2647
+ + _ => const Paragraph('No one going'),
2648
+ + },
2649
+ if (appState.loggedIn) ...[
2650
+ + YesNoSelection(
2651
+ + state: appState.attending,
2652
+ + onSelection: (attending) => appState.attending = attending,
2653
+ + ),
2654
+ const Header('Discussion'),
2655
+ GuestBook(
2656
+ addMessage: (message) =>
2663
2657
- name : Patch lib/main.dart
2664
2658
path : gtk_flutter/lib/main.dart
2665
2659
patch-u : |
2666
2660
--- b/firebase-get-to-know-flutter/step_09/lib/main.dart
2667
2661
+++ a/firebase-get-to-know-flutter/step_09/lib/main.dart
2668
- @@ -82,13 +82,28 @@ final _router = GoRouter(
2662
+ @@ -82,13 +82,27 @@ final _router = GoRouter(
2669
2663
GoRoute(
2670
2664
path: 'profile',
2671
2665
builder: (context, state) {
@@ -2677,27 +2671,26 @@ steps:
2677
2671
- }),
2678
2672
- ],
2679
2673
+ return Consumer<ApplicationState>(
2680
- + builder:
2681
- + (context, appState, _) => ProfileScreen(
2682
- + key: ValueKey(appState.emailVerified),
2683
- + providers: const [],
2684
- + actions: [
2685
- + SignedOutAction(((context) {
2686
- + context.pushReplacement('/');
2687
- + })),
2688
- + ],
2689
- + children: [
2690
- + Visibility(
2691
- + visible: !appState.emailVerified,
2692
- + child: OutlinedButton(
2693
- + child: const Text('Recheck Verification State'),
2694
- + onPressed: () {
2695
- + appState.refreshLoggedInUser();
2696
- + },
2697
- + ),
2698
- + ),
2699
- + ],
2674
+ + builder: (context, appState, _) => ProfileScreen(
2675
+ + key: ValueKey(appState.emailVerified),
2676
+ + providers: const [],
2677
+ + actions: [
2678
+ + SignedOutAction(((context) {
2679
+ + context.pushReplacement('/');
2680
+ + })),
2681
+ + ],
2682
+ + children: [
2683
+ + Visibility(
2684
+ + visible: !appState.emailVerified,
2685
+ + child: OutlinedButton(
2686
+ + child: const Text('Recheck Verification State'),
2687
+ + onPressed: () {
2688
+ + appState.refreshLoggedInUser();
2689
+ + },
2690
+ + ),
2700
2691
+ ),
2692
+ + ],
2693
+ + ),
2701
2694
);
2702
2695
},
2703
2696
),
0 commit comments