Flutter 1.17.1 cherrypicks (#57052)
* Always remove the workspace settings (#56703)
* [flutter_tools] hide tree-shake-icons (#56924)
* fix pushAndRemoveUntil incorrectly removes the routes below the first… (#56732)
* Update engine hash for 1.17.1
* fix customer_testing-windows
Co-authored-by: Jenn Magder <magder@google.com>
Co-authored-by: Jonah Williams <campfish91@gmail.com>
Co-authored-by: chunhtai <47866232+chunhtai@users.noreply.github.com>
diff --git a/.cirrus.yml b/.cirrus.yml
index c24ff61..710b622 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -265,6 +265,8 @@
script:
- rm -rf bin/cache/pkg/tests
- git clone https://github.com/flutter/tests.git bin/cache/pkg/tests
+ # For hotfix only, pin this
+ - (cd bin/cache/pkg/tests; git checkout e52a08b377a2a954b0778f0eb94a44040efdd9f4)
- dart --enable-asserts dev/customer_testing/run_tests.dart --skip-on-fetch-failure --skip-template bin/cache/pkg/tests/registry/*.test
- name: firebase_test_lab_tests-linux # linux-only
@@ -481,6 +483,10 @@
script:
- CMD /S /C "IF EXIST "bin\cache\pkg\tests\" RMDIR /S /Q bin\cache\pkg\tests"
- git clone https://github.com/flutter/tests.git bin\cache\pkg\tests
+ # For hotfix only, pin this
+ - CD bin\cache\pkg\tests
+ - git checkout e52a08b377a2a954b0778f0eb94a44040efdd9f4
+ - CD ..\..\..\..
- dart --enable-asserts dev\customer_testing\run_tests.dart --skip-on-fetch-failure --skip-template bin/cache/pkg/tests/registry/*.test
# MACOS SHARDS
@@ -593,6 +599,8 @@
- ulimit -S -n 2048 # https://github.com/flutter/flutter/issues/2976
- rm -rf bin/cache/pkg/tests
- git clone https://github.com/flutter/tests.git bin/cache/pkg/tests
+ # For hotfix only, pin this
+ - (cd bin/cache/pkg/tests; git checkout e52a08b377a2a954b0778f0eb94a44040efdd9f4)
- dart --enable-asserts dev/customer_testing/run_tests.dart --skip-on-fetch-failure --skip-template bin/cache/pkg/tests/registry/*.test
- name: deploy_gallery-macos # linux- and macos- only
diff --git a/bin/internal/engine.version b/bin/internal/engine.version
index af4d6af..d9d42ce 100644
--- a/bin/internal/engine.version
+++ b/bin/internal/engine.version
@@ -1 +1 @@
-540786dd51f112885a89792d678296b95e6622e5
+6bc433c6b6b5b98dcf4cc11aff31cdee90849f32
diff --git a/packages/flutter/lib/src/widgets/navigator.dart b/packages/flutter/lib/src/widgets/navigator.dart
index b57d352..5e48bb5 100644
--- a/packages/flutter/lib/src/widgets/navigator.dart
+++ b/packages/flutter/lib/src/widgets/navigator.dart
@@ -3412,9 +3412,8 @@
assert(predicate != null);
int index = _history.length - 1;
_history.add(_RouteEntry(newRoute, initialState: _RouteLifecycle.push));
- while (index >= 0) {
- final _RouteEntry entry = _history[index];
- if (entry.isPresent && !predicate(entry.route))
+ while (index >= 0 && !predicate(_history[index].route)) {
+ if (_history[index].isPresent)
_history[index].remove();
index -= 1;
}
diff --git a/packages/flutter/test/widgets/navigator_test.dart b/packages/flutter/test/widgets/navigator_test.dart
index 51855e6..b06007f 100644
--- a/packages/flutter/test/widgets/navigator_test.dart
+++ b/packages/flutter/test/widgets/navigator_test.dart
@@ -682,6 +682,42 @@
expect(find.text('B'), isOnstage);
});
+ testWidgets('pushAndRemoveUntil does not remove routes below the first route that pass the predicate', (WidgetTester tester) async {
+ // Regression https://github.com/flutter/flutter/issues/56688
+ final GlobalKey<NavigatorState> navigator = GlobalKey<NavigatorState>();
+ final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{
+ '/': (BuildContext context) => const Text('home'),
+ '/A': (BuildContext context) => const Text('page A'),
+ '/A/B': (BuildContext context) => OnTapPage(
+ id: 'B',
+ onTap: () {
+ Navigator.of(context).pushNamedAndRemoveUntil('/D', ModalRoute.withName('/A'));
+ },
+ ),
+ '/D': (BuildContext context) => const Text('page D'),
+ };
+
+ await tester.pumpWidget(
+ MaterialApp(
+ navigatorKey: navigator,
+ routes: routes,
+ initialRoute: '/A/B',
+ )
+ );
+ await tester.pumpAndSettle();
+ await tester.tap(find.text('B'));
+ await tester.pumpAndSettle();
+ expect(find.text('page D'), isOnstage);
+
+ navigator.currentState.pop();
+ await tester.pumpAndSettle();
+ expect(find.text('page A'), isOnstage);
+
+ navigator.currentState.pop();
+ await tester.pumpAndSettle();
+ expect(find.text('home'), isOnstage);
+ });
+
testWidgets('replaceNamed returned value', (WidgetTester tester) async {
Future<String> value;
diff --git a/packages/flutter_tools/lib/src/ios/migrations/xcode_build_system_migration.dart b/packages/flutter_tools/lib/src/ios/migrations/xcode_build_system_migration.dart
index 0faf22b..55b90d5 100644
--- a/packages/flutter_tools/lib/src/ios/migrations/xcode_build_system_migration.dart
+++ b/packages/flutter_tools/lib/src/ios/migrations/xcode_build_system_migration.dart
@@ -28,14 +28,10 @@
final String contents = _xcodeWorkspaceSharedSettings.readAsStringSync();
- // Only delete this file when it matches the original Flutter template.
+ // Only delete this file when it is pointing to the legacy build system.
const String legacyBuildSettingsWorkspace = '''
-<plist version="1.0">
-<dict>
<key>BuildSystemType</key>
- <string>Original</string>
-</dict>
-</plist>''';
+ <string>Original</string>''';
// contains instead of equals to ignore newline file ending variance.
if (contents.contains(legacyBuildSettingsWorkspace)) {
diff --git a/packages/flutter_tools/lib/src/runner/flutter_command.dart b/packages/flutter_tools/lib/src/runner/flutter_command.dart
index a6d7d2b..9c67f7a 100644
--- a/packages/flutter_tools/lib/src/runner/flutter_command.dart
+++ b/packages/flutter_tools/lib/src/runner/flutter_command.dart
@@ -413,6 +413,7 @@
negatable: true,
defaultsTo: kIconTreeShakerEnabledDefault,
help: 'Tree shake icon fonts so that only glyphs used by the application remain.',
+ hide: true,
);
}
diff --git a/packages/flutter_tools/test/general.shard/ios/ios_project_migration_test.dart b/packages/flutter_tools/test/general.shard/ios/ios_project_migration_test.dart
index 7e9c7a2..d5d0058 100644
--- a/packages/flutter_tools/test/general.shard/ios/ios_project_migration_test.dart
+++ b/packages/flutter_tools/test/general.shard/ios/ios_project_migration_test.dart
@@ -322,6 +322,8 @@
<dict>
<key>BuildSystemType</key>
<string>Original</string>
+ <key>PreviewsEnabled</key>
+ <false/>
</dict>
</plist>''';
xcodeWorkspaceSharedSettings.writeAsStringSync(contents);