Disable auto scrollbars on desktop for legacy flutter gallery (#84812)

This commit is contained in:
Kate Lovett 2021-06-21 16:24:02 -05:00 committed by GitHub
parent 46c546684f
commit a1a360bf13
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -138,6 +138,11 @@ class _GalleryAppState extends State<GalleryApp> {
return ScopedModel<AppStateModel>( return ScopedModel<AppStateModel>(
model: model, model: model,
child: MaterialApp( child: MaterialApp(
// The automatically applied scrollbars on desktop can cause a crash for
// demos where many scrollables are all attached to the same
// PrimaryScrollController. The gallery needs to be migrated before
// enabling this. https://github.com/flutter/gallery/issues/523
scrollBehavior: const MaterialScrollBehavior().copyWith(scrollbars: false),
theme: kLightGalleryTheme.copyWith(platform: _options!.platform, visualDensity: _options!.visualDensity!.visualDensity), theme: kLightGalleryTheme.copyWith(platform: _options!.platform, visualDensity: _options!.visualDensity!.visualDensity),
darkTheme: kDarkGalleryTheme.copyWith(platform: _options!.platform, visualDensity: _options!.visualDensity!.visualDensity), darkTheme: kDarkGalleryTheme.copyWith(platform: _options!.platform, visualDensity: _options!.visualDensity!.visualDensity),
themeMode: _options!.themeMode, themeMode: _options!.themeMode,

View File

@ -55,5 +55,5 @@ void main() {
await tester.pump(const Duration(milliseconds: 200)); await tester.pump(const Duration(milliseconds: 200));
await tester.pump(const Duration(hours: 100)); // for testing await tester.pump(const Duration(hours: 100)); // for testing
}); }, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.android, TargetPlatform.macOS }));
} }