forked from flutter/packages
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[flutter_adaptive_scaffold] Fuchsia is mobile. (flutter#2727)
- Loading branch information
Showing
7 changed files
with
307 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
## 0.0.8 | ||
|
||
Make fuchsia a mobile platform. | ||
|
||
## 0.0.7 | ||
|
||
* Patch duplicate key error in SlotLayout. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
packages/flutter_adaptive_scaffold/test/breakpoint_test.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// Copyright 2013 The Flutter Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
import 'package:flutter/foundation.dart'; | ||
import 'package:flutter/widgets.dart'; | ||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'simulated_layout.dart'; | ||
|
||
void main() { | ||
testWidgets('Desktop breakpoints do not show on mobile device', | ||
(WidgetTester tester) async { | ||
// Pump a small layout on a mobile device. The small slot | ||
// should give the mobile slot layout, not the desktop layout. | ||
await tester.pumpWidget(SimulatedLayout.small.slot); | ||
await tester.pumpAndSettle(); | ||
expect(find.byKey(const Key('Breakpoints.smallMobile')), findsOneWidget); | ||
expect(find.byKey(const Key('Breakpoints.smallDesktop')), findsNothing); | ||
|
||
// Do the same with a medium layout on a mobile | ||
await tester.pumpWidget(SimulatedLayout.medium.slot); | ||
await tester.pumpAndSettle(); | ||
expect(find.byKey(const Key('Breakpoints.mediumMobile')), findsOneWidget); | ||
expect(find.byKey(const Key('Breakpoints.mediumDesktop')), findsNothing); | ||
|
||
// Large layout on mobile | ||
await tester.pumpWidget(SimulatedLayout.large.slot); | ||
await tester.pumpAndSettle(); | ||
expect(find.byKey(const Key('Breakpoints.largeMobile')), findsOneWidget); | ||
expect(find.byKey(const Key('Breakpoints.largeDesktop')), findsNothing); | ||
}, variant: TargetPlatformVariant.mobile()); | ||
|
||
testWidgets('Mobile breakpoints do not show on desktop device', | ||
(WidgetTester tester) async { | ||
// Pump a small layout on a desktop device. The small slot | ||
// should give the mobile slot layout, not the desktop layout. | ||
await tester.pumpWidget(SimulatedLayout.small.slot); | ||
await tester.pumpAndSettle(); | ||
expect(find.byKey(const Key('Breakpoints.smallDesktop')), findsOneWidget); | ||
expect(find.byKey(const Key('Breakpoints.smallMobile')), findsNothing); | ||
|
||
// Do the same with a medium layout on a desktop | ||
await tester.pumpWidget(SimulatedLayout.medium.slot); | ||
await tester.pumpAndSettle(); | ||
expect(find.byKey(const Key('Breakpoints.mediumDesktop')), findsOneWidget); | ||
expect(find.byKey(const Key('Breakpoints.mediumMobile')), findsNothing); | ||
|
||
// Large layout on desktop | ||
await tester.pumpWidget(SimulatedLayout.large.slot); | ||
await tester.pumpAndSettle(); | ||
expect(find.byKey(const Key('Breakpoints.largeDesktop')), findsOneWidget); | ||
expect(find.byKey(const Key('Breakpoints.largeMobile')), findsNothing); | ||
}, variant: TargetPlatformVariant.desktop()); | ||
} |
Oops, something went wrong.