Skip to content

Commit 0198afa

Browse files
authored
Reland "Remove dual_screen from new_gallery integration test" (#150873)
Relands flutter/flutter#150808 The original version of the pr [accidentally deleted the back button](flutter/flutter#150808 (comment)), which didn't block the app building but made the test hang because it couldn't back out of the demo pages. Repro-ed the failure, and then tested that ``` new_gallery_opengles_impeller__transition_perf new_gallery__transition_perf new_gallery_impeller_old_zoom__transition_perf new_gallery__crane_perf new_gallery_impeller__transition_perf ``` All pass on my pixel 7 pro, with ` dart bin/test_runner.dart test -t <test>`, after re-adding the mistakenly deleted content. Did not test on an iOS device (I don't have one), but those tests were failing for the same reason from what I can tell: ``` > reply@study [2024-06-26 12:49:21.884543] [STDOUT] stdout: [ ] scrolling to demo [2024-06-26 12:49:22.412479] [STDOUT] stdout: [ +527 ms] tapping demo [2024-06-26 12:49:28.075978] [STDOUT] stderr: [+5663 ms] VMServiceFlutterDriver: tap message is taking a long time to complete... ``` Which is the same error, and which makes sense - they got stuck because they couldn't back out of the page. Sorry for the churn �
1 parent c946a5a commit 0198afa

File tree

9 files changed

+55
-433
lines changed

9 files changed

+55
-433
lines changed

dev/integration_tests/new_gallery/lib/data/demos.dart

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ import '../demos/reference/motion_demo_shared_y_axis_transition.dart';
2626
import '../demos/reference/motion_demo_shared_z_axis_transition.dart';
2727
import '../demos/reference/transformations_demo.dart'
2828
deferred as transformations_demo;
29-
import '../demos/reference/two_pane_demo.dart'
30-
deferred as twopane_demo;
3129
import '../demos/reference/typography_demo.dart'
3230
deferred as typography;
3331
import '../gallery_localizations.dart';
@@ -1158,54 +1156,6 @@ class Demos {
11581156

11591157
static List<GalleryDemo> otherDemos(GalleryLocalizations localizations) {
11601158
return <GalleryDemo>[
1161-
GalleryDemo(
1162-
title: localizations.demoTwoPaneTitle,
1163-
icon: GalleryIcons.bottomSheetPersistent,
1164-
slug: 'two-pane',
1165-
subtitle: localizations.demoTwoPaneSubtitle,
1166-
configurations: <GalleryDemoConfiguration>[
1167-
GalleryDemoConfiguration(
1168-
title: localizations.demoTwoPaneFoldableLabel,
1169-
description: localizations.demoTwoPaneFoldableDescription,
1170-
documentationUrl:
1171-
'https://pub.dev/documentation/dual_screen/latest/dual_screen/TwoPane-class.html',
1172-
buildRoute: (_) => DeferredWidget(
1173-
twopane_demo.loadLibrary,
1174-
() => twopane_demo.TwoPaneDemo(
1175-
type: twopane_demo.TwoPaneDemoType.foldable,
1176-
restorationId: 'two_pane_foldable',
1177-
),
1178-
),
1179-
),
1180-
GalleryDemoConfiguration(
1181-
title: localizations.demoTwoPaneTabletLabel,
1182-
description: localizations.demoTwoPaneTabletDescription,
1183-
documentationUrl:
1184-
'https://pub.dev/documentation/dual_screen/latest/dual_screen/TwoPane-class.html',
1185-
buildRoute: (_) => DeferredWidget(
1186-
twopane_demo.loadLibrary,
1187-
() => twopane_demo.TwoPaneDemo(
1188-
type: twopane_demo.TwoPaneDemoType.tablet,
1189-
restorationId: 'two_pane_tablet',
1190-
),
1191-
),
1192-
),
1193-
GalleryDemoConfiguration(
1194-
title: localizations.demoTwoPaneSmallScreenLabel,
1195-
description: localizations.demoTwoPaneSmallScreenDescription,
1196-
documentationUrl:
1197-
'https://pub.dev/documentation/dual_screen/latest/dual_screen/TwoPane-class.html',
1198-
buildRoute: (_) => DeferredWidget(
1199-
twopane_demo.loadLibrary,
1200-
() => twopane_demo.TwoPaneDemo(
1201-
type: twopane_demo.TwoPaneDemoType.smallScreen,
1202-
restorationId: 'two_pane_single',
1203-
),
1204-
),
1205-
),
1206-
],
1207-
category: GalleryDemoCategory.other,
1208-
),
12091159
GalleryDemo(
12101160
title: localizations.demoMotionTitle,
12111161
icon: GalleryIcons.animation,

dev/integration_tests/new_gallery/lib/demos/reference/two_pane_demo.dart

Lines changed: 0 additions & 226 deletions
This file was deleted.

dev/integration_tests/new_gallery/lib/layout/adaptive.dart

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,20 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
import 'dart:ui';
6-
75
import 'package:adaptive_breakpoints/adaptive_breakpoints.dart';
8-
import 'package:dual_screen/dual_screen.dart';
96
import 'package:flutter/material.dart';
107

118
/// The maximum width taken up by each item on the home screen.
129
const double maxHomeItemWidth = 1400.0;
1310

1411
/// Returns a boolean value whether the window is considered medium or large size.
1512
///
16-
/// When running on a desktop device that is also foldable, the display is not
17-
/// considered desktop. Widgets using this method might consider the display is
13+
/// Widgets using this method might consider the display is
1814
/// large enough for certain layouts, which is not the case on foldable devices,
1915
/// where only part of the display is available to said widgets.
2016
///
2117
/// Used to build adaptive and responsive layouts.
2218
bool isDisplayDesktop(BuildContext context) =>
23-
!isDisplayFoldable(context) &&
2419
getWindowType(context) >= AdaptiveWindowType.medium;
2520

2621
/// Returns boolean value whether the window is considered medium size.
@@ -29,16 +24,3 @@ bool isDisplayDesktop(BuildContext context) =>
2924
bool isDisplaySmallDesktop(BuildContext context) {
3025
return getWindowType(context) == AdaptiveWindowType.medium;
3126
}
32-
33-
/// Returns a boolean value whether the display has a hinge that splits the
34-
/// screen into two, left and right sub-screens. Horizontal splits (top and
35-
/// bottom sub-screens) are ignored for this application.
36-
bool isDisplayFoldable(BuildContext context) {
37-
final DisplayFeature? hinge = MediaQuery.of(context).hinge;
38-
if (hinge == null) {
39-
return false;
40-
} else {
41-
// Vertical
42-
return hinge.bounds.size.aspectRatio < 1;
43-
}
44-
}

dev/integration_tests/new_gallery/lib/main.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
import 'package:dual_screen/dual_screen.dart';
65
import 'package:flutter/foundation.dart';
76
import 'package:flutter/material.dart';
87
import 'package:flutter/scheduler.dart' show timeDilation;
@@ -50,7 +49,6 @@ class GalleryApp extends StatelessWidget {
5049
child: Builder(
5150
builder: (BuildContext context) {
5251
final GalleryOptions options = GalleryOptions.of(context);
53-
final bool hasHinge = MediaQuery.of(context).hinge?.bounds != null;
5452
return MaterialApp(
5553
restorationScopeId: 'rootGallery',
5654
title: 'Flutter Gallery',
@@ -74,7 +72,7 @@ class GalleryApp extends StatelessWidget {
7472
return basicLocaleListResolution(locales, supportedLocales);
7573
},
7674
onGenerateRoute: (RouteSettings settings) =>
77-
RouteConfiguration.onGenerateRoute(settings, hasHinge),
75+
RouteConfiguration.onGenerateRoute(settings),
7876
);
7977
},
8078
),

0 commit comments

Comments
 (0)