-
Notifications
You must be signed in to change notification settings - Fork 30.1k
Closed as not planned
Closed as not planned
Copy link
Labels
f: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.f: scrollingViewports, list views, slivers, etc.Viewports, list views, slivers, etc.
Description
Part of #104363.
When using the new variants SliverAppBar.medium and SliverAppBar.large in a NestedScrollView without using SliverOverlapAbsorber and SliverOverlapInjector, content goes behind the SliverAppBar even though it fits on the screen. This behavior does not occur when using SliverAppBar in a CustomScrollView.
Expected result:
- The SliverList children should not go under the SliverAppBar when they all fit on the screen (when scrolling, only the expanded title should collapse, the SliverList children should not go under the collapsed SliverAppBar).
Actual result:
- The SliverList children go under the SliverAppBar when collapsing instead of remaining on the screen, though they fit the current layout.
nestedscrollview.1.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: NestedScrollView(
headerSliverBuilder: (context, innerBoxIsScrolled) => [
SliverAppBar.large(
title: const Text('Example App'),
forceElevated: innerBoxIsScrolled,
),
],
body: CustomScrollView(
slivers: [
SliverList(
delegate: SliverChildBuilderDelegate(
(context, index) {
return ListTile(
title: Text('Item ${index.toString()}'),
);
},
childCount: 5,
),
)
],
),
),
),
);
}
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
f: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.f: scrollingViewports, list views, slivers, etc.Viewports, list views, slivers, etc.