Skip to content

Commit ce437d4

Browse files
Breaking up Step 5 of animations (#2260)
This is a fast follow PR finishing the work of #2258 ## Pre-launch Checklist - [x] I read the [Effective Dart: Style] _recently_, and have followed its advice. - [x] I signed the [CLA]. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-devrel channel on [Discord]. <!-- Links --> [Effective Dart: Style]: https://dart.dev/guides/language/effective-dart/style [CLA]: https://cla.developers.google.com/ [Discord]: https://github.com/flutter/flutter/blob/master/docs/contributing/Chat.md
1 parent cfa3cf5 commit ce437d4

File tree

521 files changed

+19782
-17
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

521 files changed

+19782
-17
lines changed

animations/codelab_rebuild.yaml

Lines changed: 40 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,8 +1002,8 @@ steps:
10021002
- name: Use PageRouteBuilder
10031003
path: quiz/lib/home_screen.dart
10041004
patch-u: |
1005-
--- a/animations/step_05/lib/home_screen.dart
1006-
+++ b/animations/step_05/lib/home_screen.dart
1005+
--- b/animations/step_05_a/lib/home_screen.dart
1006+
+++ a/animations/step_05_a/lib/home_screen.dart
10071007
@@ -26,14 +26,19 @@ class HomeScreen extends StatelessWidget {
10081008
// Show the question screen to start the game
10091009
Navigator.push(
@@ -1015,9 +1015,9 @@ steps:
10151015
- ),
10161016
+ PageRouteBuilder(
10171017
+ pageBuilder: (context, animation, secondaryAnimation) {
1018-
+ return const QuestionScreen();
1019-
+ }, transitionsBuilder:
1020-
+ (context, animation, secondaryAnimation, child) {
1018+
+ return const QuestionScreen();
1019+
+ }, transitionsBuilder:
1020+
+ (context, animation, secondaryAnimation, child) {
10211021
+ return FadeTransition(
10221022
+ opacity: animation,
10231023
+ child: child,
@@ -1030,20 +1030,26 @@ steps:
10301030
),
10311031
],
10321032
),
1033+
- name: Remove step_05_a
1034+
rmdir: step_05_a
1035+
- name: Copy step_05_a
1036+
copydir:
1037+
from: quiz
1038+
to: step_05_a
10331039
- name: Use package:animations FadeThroughTransition
10341040
path: quiz/lib/home_screen.dart
10351041
patch-u: |
1036-
--- a/animations/step_05/lib/home_screen.dart
1037-
+++ b/animations/step_05/lib/home_screen.dart
1042+
--- b/animations/step_05_b/lib/home_screen.dart
1043+
+++ a/animations/step_05_b/lib/home_screen.dart
10381044
@@ -1,3 +1,4 @@
10391045
+import 'package:animations/animations.dart';
10401046
import 'package:flutter/material.dart';
10411047
import 'question_screen.dart';
10421048
10431049
@@ -31,8 +32,9 @@ class HomeScreen extends StatelessWidget {
1044-
return const QuestionScreen();
1045-
}, transitionsBuilder:
1046-
(context, animation, secondaryAnimation, child) {
1050+
return const QuestionScreen();
1051+
}, transitionsBuilder:
1052+
(context, animation, secondaryAnimation, child) {
10471053
- return FadeTransition(
10481054
- opacity: animation,
10491055
+ return FadeThroughTransition(
@@ -1078,11 +1084,17 @@ steps:
10781084
),
10791085
home: HomeScreen(),
10801086
);
1087+
- name: Remove step_05_b
1088+
rmdir: step_05_b
1089+
- name: Copy step_05_b
1090+
copydir:
1091+
from: quiz
1092+
to: step_05_b
10811093
- name: Change back to MaterialPageRoute
10821094
path: quiz/lib/home_screen.dart
10831095
patch-u: |
1084-
--- a/animations/step_05/lib/home_screen.dart
1085-
+++ b/animations/step_05/lib/home_screen.dart
1096+
--- b/animations/step_05_c/lib/home_screen.dart
1097+
+++ a/animations/step_05_c/lib/home_screen.dart
10861098
@@ -1,4 +1,3 @@
10871099
-import 'package:animations/animations.dart';
10881100
import 'package:flutter/material.dart';
@@ -1094,16 +1106,15 @@ steps:
10941106
context,
10951107
- PageRouteBuilder(
10961108
- pageBuilder: (context, animation, secondaryAnimation) {
1097-
- return const QuestionScreen();
1098-
- }, transitionsBuilder:
1099-
- (context, animation, secondaryAnimation, child) {
1109+
+ MaterialPageRoute(builder: (context) {
1110+
return const QuestionScreen();
1111+
- }, transitionsBuilder:
1112+
- (context, animation, secondaryAnimation, child) {
11001113
- return FadeThroughTransition(
11011114
- animation: animation,
11021115
- secondaryAnimation: secondaryAnimation,
11031116
- child: child,
11041117
- );
1105-
+ MaterialPageRoute(builder: (context) {
1106-
+ return const QuestionScreen();
11071118
}),
11081119
);
11091120
},
@@ -1156,6 +1167,12 @@ steps:
11561167
child: Card(
11571168
key: ValueKey(question),
11581169
elevation: 4,
1170+
- name: Remove step_05_c
1171+
rmdir: step_05_c
1172+
- name: Copy step_05_c
1173+
copydir:
1174+
from: quiz
1175+
to: step_05_c
11591176
- name: Use OpenContainer
11601177
path: quiz/lib/question_screen.dart
11611178
patch-u: |
@@ -1330,6 +1347,12 @@ steps:
13301347
),
13311348
);
13321349
}
1350+
- name: Remove step_05_d
1351+
rmdir: step_05_d
1352+
- name: Copy step_05_d
1353+
copydir:
1354+
from: quiz
1355+
to: step_05_d
13331356
- name: dart analyze
13341357
path: quiz
13351358
dart: analyze --fatal-infos

animations/step_05_a/.gitignore

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Miscellaneous
2+
*.class
3+
*.log
4+
*.pyc
5+
*.swp
6+
.DS_Store
7+
.atom/
8+
.buildlog/
9+
.history
10+
.svn/
11+
migrate_working_dir/
12+
13+
# IntelliJ related
14+
*.iml
15+
*.ipr
16+
*.iws
17+
.idea/
18+
19+
# The .vscode folder contains launch configuration and tasks you configure in
20+
# VS Code which you may wish to be included in version control, so this line
21+
# is commented out by default.
22+
#.vscode/
23+
24+
# Flutter/Dart/Pub related
25+
**/doc/api/
26+
**/ios/Flutter/.last_build_id
27+
.dart_tool/
28+
.flutter-plugins
29+
.flutter-plugins-dependencies
30+
.pub-cache/
31+
.pub/
32+
/build/
33+
34+
# Symbolication related
35+
app.*.symbols
36+
37+
# Obfuscation related
38+
app.*.map.json
39+
40+
# Android Studio will place build artifacts here
41+
/android/app/debug
42+
/android/app/profile
43+
/android/app/release
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
include: package:flutter_lints/flutter.yaml
2+
3+
analyzer:
4+
errors:
5+
unused_field: ignore
6+
7+
linter:
8+
rules:
9+
annotate_overrides: false
10+
prefer_const_constructors: false
11+
prefer_const_constructors_in_immutables: false
12+
prefer_const_declarations: false
13+
prefer_const_literals_to_create_immutables: false
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
gradle-wrapper.jar
2+
/.gradle
3+
/captures/
4+
/gradlew
5+
/gradlew.bat
6+
/local.properties
7+
GeneratedPluginRegistrant.java
8+
9+
# Remember to never publicly share your keystore.
10+
# See https://flutter.dev/to/reference-keystore
11+
key.properties
12+
**/*.keystore
13+
**/*.jks
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
plugins {
2+
id "com.android.application"
3+
id "kotlin-android"
4+
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
5+
id "dev.flutter.flutter-gradle-plugin"
6+
}
7+
8+
android {
9+
namespace = "com.example.quiz"
10+
compileSdk = flutter.compileSdkVersion
11+
ndkVersion = flutter.ndkVersion
12+
13+
compileOptions {
14+
sourceCompatibility = JavaVersion.VERSION_1_8
15+
targetCompatibility = JavaVersion.VERSION_1_8
16+
}
17+
18+
kotlinOptions {
19+
jvmTarget = JavaVersion.VERSION_1_8
20+
}
21+
22+
defaultConfig {
23+
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
24+
applicationId = "com.example.quiz"
25+
// You can update the following values to match your application needs.
26+
// For more information, see: https://flutter.dev/to/review-gradle-config.
27+
minSdk = flutter.minSdkVersion
28+
targetSdk = flutter.targetSdkVersion
29+
versionCode = flutter.versionCode
30+
versionName = flutter.versionName
31+
}
32+
33+
buildTypes {
34+
release {
35+
// TODO: Add your own signing config for the release build.
36+
// Signing with the debug keys for now, so `flutter run --release` works.
37+
signingConfig = signingConfigs.debug
38+
}
39+
}
40+
}
41+
42+
flutter {
43+
source = "../.."
44+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
2+
<!-- The INTERNET permission is required for development. Specifically,
3+
the Flutter tool needs it to communicate with the running application
4+
to allow setting breakpoints, to provide hot reload, etc.
5+
-->
6+
<uses-permission android:name="android.permission.INTERNET"/>
7+
</manifest>
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
2+
<application
3+
android:label="quiz"
4+
android:name="${applicationName}"
5+
android:icon="@mipmap/ic_launcher">
6+
<activity
7+
android:name=".MainActivity"
8+
android:exported="true"
9+
android:launchMode="singleTop"
10+
android:taskAffinity=""
11+
android:theme="@style/LaunchTheme"
12+
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
13+
android:hardwareAccelerated="true"
14+
android:windowSoftInputMode="adjustResize">
15+
<!-- Specifies an Android theme to apply to this Activity as soon as
16+
the Android process has started. This theme is visible to the user
17+
while the Flutter UI initializes. After that, this theme continues
18+
to determine the Window background behind the Flutter UI. -->
19+
<meta-data
20+
android:name="io.flutter.embedding.android.NormalTheme"
21+
android:resource="@style/NormalTheme"
22+
/>
23+
<intent-filter>
24+
<action android:name="android.intent.action.MAIN"/>
25+
<category android:name="android.intent.category.LAUNCHER"/>
26+
</intent-filter>
27+
</activity>
28+
<!-- Don't delete the meta-data below.
29+
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
30+
<meta-data
31+
android:name="flutterEmbedding"
32+
android:value="2" />
33+
</application>
34+
<!-- Required to query activities that can process text, see:
35+
https://developer.android.com/training/package-visibility and
36+
https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT.
37+
38+
In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. -->
39+
<queries>
40+
<intent>
41+
<action android:name="android.intent.action.PROCESS_TEXT"/>
42+
<data android:mimeType="text/plain"/>
43+
</intent>
44+
</queries>
45+
</manifest>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package com.example.quiz
2+
3+
import io.flutter.embedding.android.FlutterActivity
4+
5+
class MainActivity: FlutterActivity()
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- Modify this file to customize your launch splash screen -->
3+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
4+
<item android:drawable="?android:colorBackground" />
5+
6+
<!-- You can insert your own image assets here -->
7+
<!-- <item>
8+
<bitmap
9+
android:gravity="center"
10+
android:src="@mipmap/launch_image" />
11+
</item> -->
12+
</layer-list>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- Modify this file to customize your launch splash screen -->
3+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
4+
<item android:drawable="@android:color/white" />
5+
6+
<!-- You can insert your own image assets here -->
7+
<!-- <item>
8+
<bitmap
9+
android:gravity="center"
10+
android:src="@mipmap/launch_image" />
11+
</item> -->
12+
</layer-list>

0 commit comments

Comments
 (0)