Repository navigation
Closed
Labels
f: scrollingViewports, list views, slivers, etc.found in release: 1.26Found to occur in 1.26has reproducible stepsThe issue has been confirmed reproducible and is ready to work onp: material_uimaterial_ui package in flutter/packageswaiting for PR to land (fixed)A fix is in flight
Description
There is ScrollBar with GridView as a child. Each GridView's child has scrollable area.
When I scrolling GridView everything is OK - the scrollbar works as intended. But If I scroll image inside any grid view item it cause ScrollBar scrolling also, it looks weird.
I think it's wrong and maybe even a bug. It shouldn't move scrollbar when I scroll something inside items.
I attached small video. Look at scrollbar's behaviour.
The same behaviour if run it on web.
the code:
import 'package:flutter/material.dart';
void main() => runApp(MaterialApp(debugShowCheckedModeBanner: false, home: Home()));
class Home extends StatelessWidget {
@override
Widget build(BuildContext context) => Scaffold(body: Demo());
}
class Demo extends StatefulWidget {
@override
_DemoState createState() => _DemoState();
}
class _DemoState extends State<Demo> {
ScrollController _scrollController;
@override
void initState() {
super.initState();
_scrollController = ScrollController();
}
@override
Widget build(BuildContext context) {
return Scrollbar(
controller: _scrollController,
isAlwaysShown: true,
child: GridView.count(
controller: _scrollController,
crossAxisCount: 3,
crossAxisSpacing: 64,
mainAxisSpacing: 64,
childAspectRatio: 0.5,
padding: const EdgeInsets.only(left: 48, right: 48, top: 24, bottom: 48),
children: List.generate(42, (i) => GridItem(i)),
),
);
}
@override
void dispose() {
_scrollController.dispose();
super.dispose();
}
}
class GridItem extends StatelessWidget {
GridItem(int i) : super(key: Key('$i'));
@override
Widget build(BuildContext context) {
return SingleChildScrollView(
child: SizedBox(
height: 700,
child: Image.network('https://picsum.photos/id/81/200/300.jpg', fit: BoxFit.fill),
),
);
}
}
flutter doctor:
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 1.20.3, on Mac OS X 10.15.6 19G2021, locale en-GB)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 12.3)
[!] Android Studio (version 4.1)
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
[✓] Connected device (1 available)
Screen.Recording.2021-01-11.at.11.17.25.mp4
Metadata
Metadata
Assignees
Labels
f: scrollingViewports, list views, slivers, etc.found in release: 1.26Found to occur in 1.26has reproducible stepsThe issue has been confirmed reproducible and is ready to work onp: material_uimaterial_ui package in flutter/packageswaiting for PR to land (fixed)A fix is in flight
Activity
xu-baolin commentedon Jan 11, 2021
Will be fixed by #71843
pedromassangocode commentedon Jan 11, 2021
I was able to reproduce this issue. Similar to #70771.
flutter doctor
[-]ScrollBar weird behaviour[/-][+]Nested ScrollBar has weird behavior[/+]github-actions commentedon Aug 7, 2021
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.