Skip to content
This repository has been archived by the owner on Jun 13, 2024. It is now read-only.

Enable scrollbars #735

Merged
merged 3 commits into from
Jul 13, 2022
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
2 changes: 1 addition & 1 deletion lib/l10n/intl_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -1431,7 +1431,7 @@
"@demoCupertinoScrollbarTitle": {
"description": "Title for the cupertino scrollbar demo."
},
"demoCupertinoScrollbarSubtitle": "iOS style scrollbar",
"demoCupertinoScrollbarSubtitle": "iOS-style scrollbar",
"@demoCupertinoScrollbarSubtitle": {
"description": "Subtitle for the cupertino scrollbar demo."
},
Expand Down
2 changes: 1 addition & 1 deletion lib/l10n/intl_en_US.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1324,7 +1324,7 @@
<string
name="demoCupertinoScrollbarSubtitle"
description="Subtitle for the cupertino scrollbar demo."
>iOS style scrollbar</string>
>iOS-style scrollbar</string>
<string
name="demoCupertinoScrollbarDescription"
description="Description for the cupertino scrollbar demo."
Expand Down
6 changes: 0 additions & 6 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,6 @@ class GalleryApp extends StatelessWidget {
builder: (context) {
final options = GalleryOptions.of(context);
return MaterialApp(
// By default on desktop, scrollbars are applied by the
// ScrollBehavior. This overrides that. All vertical scrollables in
// the gallery need to be audited before enabling this feature,
// see https://github.com/flutter/gallery/issues/523
scrollBehavior:
const MaterialScrollBehavior().copyWith(scrollbars: false),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the error presented itself in other demo apps in the gallery as well. We recently changed the default PrimaryScrollController behavior (flutter/flutter#102099) to better avoid that error in general, so it may be ok.

I think the Shrine app was one that also had this issue.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see. Can't repro on Shrine anymore.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fab!

restorationScopeId: 'rootGallery',
title: 'Flutter Gallery',
debugShowCheckedModeBanner: false,
Expand Down
2 changes: 2 additions & 0 deletions lib/pages/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,7 @@ class _DesktopCategoryItem extends StatelessWidget {
child: ListView.builder(
// Makes integration tests possible.
key: ValueKey('${category.name}DemoList'),
primary: false,
itemBuilder: (context, index) =>
CategoryDemoItem(demo: demos[index]),
itemCount: demos.length,
Expand Down Expand Up @@ -907,6 +908,7 @@ class _DesktopCarouselState extends State<_DesktopCarousel> {
),
child: ListView.builder(
scrollDirection: Axis.horizontal,
primary: false,
physics: const _SnappingScrollPhysics(),
controller: _controller,
itemExtent: itemWidth,
Expand Down