Skip to content
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
36 changes: 19 additions & 17 deletions examples/api/lib/widgets/sensitive_content/sensitive_content.0.dart
Original file line number Diff line number Diff line change
Expand Up @@ -202,23 +202,25 @@ class _AccountDetailsContent extends StatelessWidget {

@override
Widget build(BuildContext context) {
return const Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
'Checking Account',
style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold),
),
SizedBox(height: 12.0),
Text('Account number: 123456789'),
Text('Routing number: 987654321'),
SizedBox(height: 12.0),
Text('One-time passcode: 246810'),
SizedBox(height: 12.0),
Text(
'Use ContentSensitivity.sensitive for screens that should be obscured when the app screen is shared.',
),
],
return const SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
'Checking Account',
style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold),
),
SizedBox(height: 12.0),
Text('Account number: 123456789'),
Text('Routing number: 987654321'),
SizedBox(height: 12.0),
Text('One-time passcode: 246810'),
SizedBox(height: 12.0),
Text(
'Use ContentSensitivity.sensitive for screens that should be obscured when the app screen is shared.',
),
],
),
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,27 @@ void main() {
},
variant: TargetPlatformVariant.only(TargetPlatform.android),
);

testWidgets(
'Account details widget is scrollable when vertical space is constrained',
(WidgetTester tester) async {
tester.view.physicalSize = const Size(800.0, 450.0);
tester.view.devicePixelRatio = 1.0;
addTearDown(tester.view.reset);

await tester.pumpWidget(const example.SensitiveContentApp());
await tester.pumpAndSettle();

expect(find.byType(SingleChildScrollView), findsOneWidget);
expect(tester.takeException(), isNull);

await tester.drag(
find.byType(SingleChildScrollView),
const Offset(0.0, -120.0),
);
await tester.pump();

expect(tester.takeException(), isNull);
},
);
}