Skip to content

Remove dual_screen from new_gallery integration test #150808

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 26, 2024
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
50 changes: 0 additions & 50 deletions dev/integration_tests/new_gallery/lib/data/demos.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ import '../demos/reference/motion_demo_shared_y_axis_transition.dart';
import '../demos/reference/motion_demo_shared_z_axis_transition.dart';
import '../demos/reference/transformations_demo.dart'
deferred as transformations_demo;
import '../demos/reference/two_pane_demo.dart'
deferred as twopane_demo;
import '../demos/reference/typography_demo.dart'
deferred as typography;
import '../gallery_localizations.dart';
Expand Down Expand Up @@ -1158,54 +1156,6 @@ class Demos {

static List<GalleryDemo> otherDemos(GalleryLocalizations localizations) {
return <GalleryDemo>[
GalleryDemo(
title: localizations.demoTwoPaneTitle,
icon: GalleryIcons.bottomSheetPersistent,
slug: 'two-pane',
subtitle: localizations.demoTwoPaneSubtitle,
configurations: <GalleryDemoConfiguration>[
GalleryDemoConfiguration(
title: localizations.demoTwoPaneFoldableLabel,
description: localizations.demoTwoPaneFoldableDescription,
documentationUrl:
'https://pub.dev/documentation/dual_screen/latest/dual_screen/TwoPane-class.html',
buildRoute: (_) => DeferredWidget(
twopane_demo.loadLibrary,
() => twopane_demo.TwoPaneDemo(
type: twopane_demo.TwoPaneDemoType.foldable,
restorationId: 'two_pane_foldable',
),
),
),
GalleryDemoConfiguration(
title: localizations.demoTwoPaneTabletLabel,
description: localizations.demoTwoPaneTabletDescription,
documentationUrl:
'https://pub.dev/documentation/dual_screen/latest/dual_screen/TwoPane-class.html',
buildRoute: (_) => DeferredWidget(
twopane_demo.loadLibrary,
() => twopane_demo.TwoPaneDemo(
type: twopane_demo.TwoPaneDemoType.tablet,
restorationId: 'two_pane_tablet',
),
),
),
GalleryDemoConfiguration(
title: localizations.demoTwoPaneSmallScreenLabel,
description: localizations.demoTwoPaneSmallScreenDescription,
documentationUrl:
'https://pub.dev/documentation/dual_screen/latest/dual_screen/TwoPane-class.html',
buildRoute: (_) => DeferredWidget(
twopane_demo.loadLibrary,
() => twopane_demo.TwoPaneDemo(
type: twopane_demo.TwoPaneDemoType.smallScreen,
restorationId: 'two_pane_single',
),
),
),
],
category: GalleryDemoCategory.other,
),
GalleryDemo(
title: localizations.demoMotionTitle,
icon: GalleryIcons.animation,
Expand Down

This file was deleted.

20 changes: 1 addition & 19 deletions dev/integration_tests/new_gallery/lib/layout/adaptive.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,20 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'dart:ui';

import 'package:adaptive_breakpoints/adaptive_breakpoints.dart';
import 'package:dual_screen/dual_screen.dart';
import 'package:flutter/material.dart';

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

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

/// Returns boolean value whether the window is considered medium size.
Expand All @@ -29,16 +24,3 @@ bool isDisplayDesktop(BuildContext context) =>
bool isDisplaySmallDesktop(BuildContext context) {
return getWindowType(context) == AdaptiveWindowType.medium;
}

/// Returns a boolean value whether the display has a hinge that splits the
/// screen into two, left and right sub-screens. Horizontal splits (top and
/// bottom sub-screens) are ignored for this application.
bool isDisplayFoldable(BuildContext context) {
final DisplayFeature? hinge = MediaQuery.of(context).hinge;
if (hinge == null) {
return false;
} else {
// Vertical
return hinge.bounds.size.aspectRatio < 1;
}
}
4 changes: 1 addition & 3 deletions dev/integration_tests/new_gallery/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'package:dual_screen/dual_screen.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart' show timeDilation;
Expand Down Expand Up @@ -50,7 +49,6 @@ class GalleryApp extends StatelessWidget {
child: Builder(
builder: (BuildContext context) {
final GalleryOptions options = GalleryOptions.of(context);
final bool hasHinge = MediaQuery.of(context).hinge?.bounds != null;
return MaterialApp(
restorationScopeId: 'rootGallery',
title: 'Flutter Gallery',
Expand All @@ -74,7 +72,7 @@ class GalleryApp extends StatelessWidget {
return basicLocaleListResolution(locales, supportedLocales);
},
onGenerateRoute: (RouteSettings settings) =>
RouteConfiguration.onGenerateRoute(settings, hasHinge),
RouteConfiguration.onGenerateRoute(settings),
);
},
),
Expand Down
Loading