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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
154 changes: 124 additions & 30 deletions animations/codelab_rebuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: Add animation effects to your Flutter app
steps:
- name: step_01
steps:
- name: Remove generated code
rmdir: step_01
- name: Create project
flutter: create --empty quiz
- name: Strip DEVELOPMENT_TEAM
Expand Down Expand Up @@ -410,18 +408,14 @@ steps:
);
}
}
# - name: Build web app
# path: patterns_codelab
# flutter: build web
- name: Fetch dependencies
path: quiz
dart: pub get
- name: Run Dart Analzyer
path: quiz
dart: analyze --fatal-infos
# - name: Check formatting
# path: quiz
# dart: format --set-exit-if-changed
- name: Remove step_01
rmdir: step_01
- name: Copy step_01
copydir:
from: quiz
Expand Down Expand Up @@ -462,6 +456,12 @@ steps:
);
}
}
- name: Remove step_02_a
rmdir: step_02_a
- name: Copy step_02_a
copydir:
from: quiz
to: step_02_a
- name: Use Scoreboard widget
path: quiz/lib/question_screen.dart
patch-u: |
Expand Down Expand Up @@ -490,6 +490,12 @@ steps:
),
],
),
- name: Remove step_02_b
rmdir: step_02_b
- name: Copy step_02_b
copydir:
from: quiz
to: step_02_b
- name: Use an ImplicitlyAnimatedWidget
path: quiz/lib/scoreboard.dart
patch-u: |
Expand Down Expand Up @@ -534,6 +540,12 @@ steps:
+ );
+ }
+}
- name: Remove step_02_c
rmdir: step_02_c
- name: Copy step_02_c
copydir:
from: quiz
to: step_02_c
- name: Use a TweenAnimationBuilder to change the color
path: quiz/lib/scoreboard.dart
patch-u: |
Expand Down Expand Up @@ -563,6 +575,12 @@ steps:
),
);
}
- name: Remove step_02_d
rmdir: step_02_d
- name: Copy step_02_d
copydir:
from: quiz
to: step_02_d
- name: Use a Curve
path: quiz/lib/scoreboard.dart
patch-u: |
Expand All @@ -587,7 +605,16 @@ steps:
duration: _duration,
tween: ColorTween(
begin: _deactivatedColor,

- name: Remove step_02_e
rmdir: step_02_e
- name: Copy step_02_e
copydir:
from: quiz
to: step_02_e

# TODO(DomesticMouse): Delete step_02 once the codelab is published with individual steps
- name: Remove step_02
rmdir: step_02
- name: Copy step_02
copydir:
from: quiz
Expand All @@ -597,9 +624,9 @@ steps:
- name: Use AnimatedSwitcher
path: quiz/lib/question_screen.dart
patch-u: |
--- a/animations/step_02/lib/question_screen.dart
+++ b/animations/step_02/lib/question_screen.dart
@@ -88,13 +88,17 @@ class QuestionCard extends StatelessWidget {
--- b/animations/step_03_a/lib/question_screen.dart
+++ a/animations/step_03_a/lib/question_screen.dart
@@ -87,13 +87,17 @@ class QuestionCard extends StatelessWidget {

@override
Widget build(BuildContext context) {
Expand All @@ -624,6 +651,12 @@ steps:
),
),
);
- name: Remove step_03_a
rmdir: step_03_a
- name: Copy step_03_a
copydir:
from: quiz
to: step_03_a
- name: Use a custom transitionBuilder
path: quiz/lib/question_screen.dart
patch-u: |
Expand All @@ -644,6 +677,12 @@ steps:
duration: const Duration(milliseconds: 300),
child: Card(
key: ValueKey(question),
- name: Remove step_03_b
rmdir: step_03_b
- name: Copy step_03_b
copydir:
from: quiz
to: step_03_b
- name: Apply a fade effect to the transitionBuilder
path: quiz/lib/question_screen.dart
patch-u: |
Expand All @@ -662,6 +701,12 @@ steps:
},
duration: const Duration(milliseconds: 300),
child: Card(
- name: Remove step_03_c
rmdir: step_03_c
- name: Copy step_03_c
copydir:
from: quiz
to: step_03_c
- name: Customize the layoutBuilder
path: quiz/lib/question_screen.dart
patch-u: |
Expand All @@ -683,6 +728,15 @@ steps:
transitionBuilder: (Widget child, Animation<double> animation) {
final curveAnimation =
CurveTween(curve: Curves.easeInCubic).animate(animation);
- name: Remove step_03_d
rmdir: step_03_d
- name: Copy step_03_d
copydir:
from: quiz
to: step_03_d
# TODO(DomesticMouse): Delete step_03 once the codelab is published with individual steps
- name: Remove step_03
rmdir: step_03
- name: Copy step_03
copydir:
from: quiz
Expand Down Expand Up @@ -814,6 +868,12 @@ steps:
),
),
),
- name: Remove step_04_a
rmdir: step_04_a
- name: Copy step_04_a
copydir:
from: quiz
to: step_04_a
- name: Add delay using TweenSequence
path: quiz/lib/flip_effect.dart
patch-u: |
Expand All @@ -833,7 +893,31 @@ steps:
});

@override
@@ -19,19 +21,32 @@ class _CardFlipEffectState extends State<CardFlipEffect>
- name: Add delay to question screen
path: quiz/lib/question_screen.dart
patch-u: |
--- a/animations/step_04/lib/question_screen.dart
+++ b/animations/step_04/lib/question_screen.dart
@@ -151,6 +151,7 @@ class AnswerCards extends StatelessWidget {
}

return CardFlipEffect(
+ delayAmount: index.toDouble() / 2,
duration: const Duration(milliseconds: 300),
child: Card.filled(
key: ValueKey(answers[index]),
- name: Remove step_04_b
rmdir: step_04_b
- name: Copy step_04_b
copydir:
from: quiz
to: step_04_b
- name: Add delay using TweenSequence, part 2
path: quiz/lib/flip_effect.dart
patch-u: |
--- b/animations/step_04_c/lib/flip_effect.dart
+++ a/animations/step_04_c/lib/flip_effect.dart
@@ -21,19 +21,32 @@ class _CardFlipEffectState extends State<CardFlipEffect>
with SingleTickerProviderStateMixin {
late final AnimationController _animationController;
Widget? _previousChild;
Expand Down Expand Up @@ -867,7 +951,18 @@ steps:
}

@override
@@ -51,14 +66,14 @@ class _CardFlipEffectState extends State<CardFlipEffect>
- name: Remove step_04_c
rmdir: step_04_c
- name: Copy step_04_c
copydir:
from: quiz
to: step_04_c
- name: Add delay using TweenSequence, part 3
path: quiz/lib/flip_effect.dart
patch-u: |
--- b/animations/step_04_d/lib/flip_effect.dart
+++ a/animations/step_04_d/lib/flip_effect.dart
@@ -66,14 +66,14 @@ class _CardFlipEffectState extends State<CardFlipEffect>
@override
Widget build(BuildContext context) {
return AnimatedBuilder(
Expand All @@ -885,19 +980,16 @@ steps:
? _previousChild
: Transform.flip(flipY: true, child: widget.child)
: widget.child,
- name: Add delay to question screen
path: quiz/lib/question_screen.dart
patch-u: |
--- a/animations/step_04/lib/question_screen.dart
+++ b/animations/step_04/lib/question_screen.dart
@@ -151,6 +151,7 @@ class AnswerCards extends StatelessWidget {
}

return CardFlipEffect(
+ delayAmount: index.toDouble() / 2,
duration: const Duration(milliseconds: 300),
child: Card.filled(
key: ValueKey(answers[index]),
- name: Remove step_04_d
rmdir: step_04_d
- name: Copy step_04_d
copydir:
from: quiz
to: step_04_d

# TODO(DomesticMouse): Delete step_04 once the codelab is published with individual steps
- name: Remove step_04
rmdir: step_04
- name: Copy step_04
copydir:
from: quiz
Expand Down Expand Up @@ -1236,9 +1328,7 @@ steps:
),
);
}
- name: dart analyze
path: quiz
dart: analyze --fatal-infos

- name: Build Android app
platforms: [ macos ]
path: quiz
Expand All @@ -1262,6 +1352,10 @@ steps:
- name: Build Web app
path: quiz
flutter: build web

# TODO(DomesticMouse): Delete step_05 once the codelab is published with individual steps
- name: Remove step_05
rmdir: step_05
- name: Copy step_05
copydir:
from: quiz
Expand Down
43 changes: 43 additions & 0 deletions animations/step_02_a/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
migrate_working_dir/

# IntelliJ related
*.iml
*.ipr
*.iws
.idea/

# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/

# Flutter/Dart/Pub related
**/doc/api/
**/ios/Flutter/.last_build_id
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.pub-cache/
.pub/
/build/

# Symbolication related
app.*.symbols

# Obfuscation related
app.*.map.json

# Android Studio will place build artifacts here
/android/app/debug
/android/app/profile
/android/app/release
9 changes: 9 additions & 0 deletions animations/step_02_a/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
include: package:flutter_lints/flutter.yaml

linter:
rules:
prefer_const_constructors: false
prefer_const_constructors_in_immutables: false
prefer_const_declarations: false
prefer_const_literals_to_create_immutables: false
annotate_overrides: false
13 changes: 13 additions & 0 deletions animations/step_02_a/android/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
gradle-wrapper.jar
/.gradle
/captures/
/gradlew
/gradlew.bat
/local.properties
GeneratedPluginRegistrant.java

# Remember to never publicly share your keystore.
# See https://flutter.dev/to/reference-keystore
key.properties
**/*.keystore
**/*.jks
44 changes: 44 additions & 0 deletions animations/step_02_a/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
plugins {
id "com.android.application"
id "kotlin-android"
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
id "dev.flutter.flutter-gradle-plugin"
}

android {
namespace = "com.example.quiz"
compileSdk = flutter.compileSdkVersion
ndkVersion = flutter.ndkVersion

compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8
}

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId = "com.example.quiz"
// You can update the following values to match your application needs.
// For more information, see: https://flutter.dev/to/review-gradle-config.
minSdk = flutter.minSdkVersion
targetSdk = flutter.targetSdkVersion
versionCode = flutter.versionCode
versionName = flutter.versionName
}

buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig = signingConfigs.debug
}
}
}

flutter {
source = "../.."
}
Loading
Loading