Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 6 additions & 12 deletions animations/codelab_rebuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -719,17 +719,14 @@ steps:
patch-u: |
--- b/animations/step_03_d/lib/question_screen.dart
+++ a/animations/step_03_d/lib/question_screen.dart
@@ -86,6 +86,15 @@ class QuestionCard extends StatelessWidget {
@@ -86,6 +86,12 @@ class QuestionCard extends StatelessWidget {
@override
Widget build(BuildContext context) {
return AnimatedSwitcher(
+ layoutBuilder: (currentChild, previousChildren) {
+ return Stack(
+ alignment: Alignment.topCenter,
+ children: <Widget>[
+ ...previousChildren,
+ if (currentChild != null) currentChild,
+ ],
+ children: <Widget>[...previousChildren, ?currentChild],
+ );
+ },
transitionBuilder: (child, animation) {
Expand Down Expand Up @@ -831,7 +828,7 @@ steps:
import 'scoreboard.dart';
import 'view_model.dart';

@@ -148,21 +149,24 @@ class AnswerCards extends StatelessWidget {
@@ -145,21 +146,24 @@ class AnswerCards extends StatelessWidget {
if (correctAnswer == index) {
color = Theme.of(context).colorScheme.tertiaryContainer;
}
Expand Down Expand Up @@ -904,7 +901,7 @@ steps:
patch-u: |
--- b/animations/step_04_b/lib/question_screen.dart
+++ a/animations/step_04_b/lib/question_screen.dart
@@ -150,6 +150,7 @@ class AnswerCards extends StatelessWidget {
@@ -147,6 +147,7 @@ class AnswerCards extends StatelessWidget {
color = Theme.of(context).colorScheme.tertiaryContainer;
}
return CardFlipEffect(
Expand Down Expand Up @@ -1133,18 +1130,15 @@ steps:
import 'package:flutter/material.dart';
import 'flip_effect.dart';
import 'scoreboard.dart';
@@ -86,28 +87,15 @@ class QuestionCard extends StatelessWidget {
@@ -86,25 +87,15 @@ class QuestionCard extends StatelessWidget {

@override
Widget build(BuildContext context) {
- return AnimatedSwitcher(
- layoutBuilder: (currentChild, previousChildren) {
- return Stack(
- alignment: Alignment.topCenter,
- children: <Widget>[
- ...previousChildren,
- if (currentChild != null) currentChild,
- ],
- children: <Widget>[...previousChildren, ?currentChild],
- );
+ return PageTransitionSwitcher(
+ layoutBuilder: (entries) {
Expand Down
5 changes: 1 addition & 4 deletions animations/step_03_d/lib/question_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,7 @@ class QuestionCard extends StatelessWidget {
layoutBuilder: (currentChild, previousChildren) {
return Stack(
alignment: Alignment.topCenter,
children: <Widget>[
...previousChildren,
if (currentChild != null) currentChild,
],
children: <Widget>[...previousChildren, ?currentChild],
);
},
transitionBuilder: (child, animation) {
Expand Down
5 changes: 1 addition & 4 deletions animations/step_04_a/lib/question_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,7 @@ class QuestionCard extends StatelessWidget {
layoutBuilder: (currentChild, previousChildren) {
return Stack(
alignment: Alignment.topCenter,
children: <Widget>[
...previousChildren,
if (currentChild != null) currentChild,
],
children: <Widget>[...previousChildren, ?currentChild],
);
},
transitionBuilder: (child, animation) {
Expand Down
5 changes: 1 addition & 4 deletions animations/step_04_b/lib/question_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,7 @@ class QuestionCard extends StatelessWidget {
layoutBuilder: (currentChild, previousChildren) {
return Stack(
alignment: Alignment.topCenter,
children: <Widget>[
...previousChildren,
if (currentChild != null) currentChild,
],
children: <Widget>[...previousChildren, ?currentChild],
);
},
transitionBuilder: (child, animation) {
Expand Down
5 changes: 1 addition & 4 deletions animations/step_04_c/lib/question_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,7 @@ class QuestionCard extends StatelessWidget {
layoutBuilder: (currentChild, previousChildren) {
return Stack(
alignment: Alignment.topCenter,
children: <Widget>[
...previousChildren,
if (currentChild != null) currentChild,
],
children: <Widget>[...previousChildren, ?currentChild],
);
},
transitionBuilder: (child, animation) {
Expand Down
5 changes: 1 addition & 4 deletions animations/step_04_d/lib/question_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,7 @@ class QuestionCard extends StatelessWidget {
layoutBuilder: (currentChild, previousChildren) {
return Stack(
alignment: Alignment.topCenter,
children: <Widget>[
...previousChildren,
if (currentChild != null) currentChild,
],
children: <Widget>[...previousChildren, ?currentChild],
);
},
transitionBuilder: (child, animation) {
Expand Down
5 changes: 1 addition & 4 deletions animations/step_05_a/lib/question_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,7 @@ class QuestionCard extends StatelessWidget {
layoutBuilder: (currentChild, previousChildren) {
return Stack(
alignment: Alignment.topCenter,
children: <Widget>[
...previousChildren,
if (currentChild != null) currentChild,
],
children: <Widget>[...previousChildren, ?currentChild],
);
},
transitionBuilder: (child, animation) {
Expand Down
5 changes: 1 addition & 4 deletions animations/step_05_b/lib/question_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,7 @@ class QuestionCard extends StatelessWidget {
layoutBuilder: (currentChild, previousChildren) {
return Stack(
alignment: Alignment.topCenter,
children: <Widget>[
...previousChildren,
if (currentChild != null) currentChild,
],
children: <Widget>[...previousChildren, ?currentChild],
);
},
transitionBuilder: (child, animation) {
Expand Down
Loading