-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Open
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listd: api docsIssues with https://api.flutter.dev/Issues with https://api.flutter.dev/d: examplesSample code and demosSample code and demosf: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.f: scrollingViewports, list views, slivers, etc.Viewports, list views, slivers, etc.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.team-designOwned by Design Languages teamOwned by Design Languages teamtriaged-designTriaged by Design Languages teamTriaged by Design Languages team
Description
Part of #104363.
When using the new variants SliverAppBar.medium and SliverAppBar.large in a CustomScrollView, scrolling in that CustomScrollView applies the overscroll effect on the SliverAppBar itself. This behavior should not be occuring.
Expected result:
- Scrolling through the CustomScrollView shows the overscroll effect only on the SliverList, not on the entire CustomScrollView.
Actual result:
- Scrolling through the CustomScrollView shows the overscroll effect on the SliverAppBar too, resulting in strange behavior.
MaterialScrollBehavior.mp4
Code sample:
import 'package:flutter/material.dart';
void main() {
runApp(const TestApp());
}
class TestApp extends StatelessWidget {
const TestApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData.from(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.blue),
useMaterial3: true,
),
home: Scaffold(
body: CustomScrollView(
slivers: [
SliverAppBar.large(
title: const Text('Example App'),
),
SliverList(
delegate: SliverChildBuilderDelegate(
(context, index) {
return ListTile(
title: Text('Item ${index.toString()}'),
);
},
childCount: 20,
),
)
],
),
),
);
}
}However, when the CustomScrollView scrollBehavior is set to CupertinoScrollBehavior, this issue does not occur.
CupertinoScrollBehavior.mp4
Code sample:
import 'package:flutter/material.dart';
void main() {
runApp(const TestApp());
}
class TestApp extends StatelessWidget {
const TestApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
theme: ThemeData.from(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.blue),
useMaterial3: true,
),
home: Scaffold(
body: CustomScrollView(
scrollBehavior: const CupertinoScrollBehavior(),
slivers: [
SliverAppBar.large(
title: const Text('Example App'),
),
SliverList(
delegate: SliverChildBuilderDelegate(
(context, index) {
return ListTile(
title: Text('Item ${index.toString()}'),
);
},
childCount: 20,
),
)
],
),
),
);
}
}jakeaaron, austinried, JonathanPeterCole, manuel-plavsic, feinstein and 5 more
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listd: api docsIssues with https://api.flutter.dev/Issues with https://api.flutter.dev/d: examplesSample code and demosSample code and demosf: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.f: scrollingViewports, list views, slivers, etc.Viewports, list views, slivers, etc.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.team-designOwned by Design Languages teamOwned by Design Languages teamtriaged-designTriaged by Design Languages teamTriaged by Design Languages team