-
Notifications
You must be signed in to change notification settings - Fork 30.1k
Closed
Labels
f: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.f: scrollingViewports, list views, slivers, etc.Viewports, list views, slivers, etc.found in release: 1.22Found to occur in 1.22Found to occur in 1.22found in release: 1.26Found to occur in 1.26Found to occur in 1.26frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer version
Description
As you can see on this video, CustomScrollView with shrinkWrap: true has it's scroll all weird, SliverAppBar goes up instead on down, the slivers bellow the SliverAppBar pass on top of it, this is a reproducible code:
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MyHomePage(),
);
}
}
class MyHomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
List<String> items = List.generate(10, (v) => v.toString());
return Scaffold(
body: CustomScrollView(
shrinkWrap: true,
physics: BouncingScrollPhysics(),
slivers: <Widget>[
SliverAppBar(pinned: true, title: Text('Test')),
SliverList(
delegate: SliverChildBuilderDelegate(
(BuildContext context, int index) {
return ListItem(items[index]);
},
childCount: items.length,
),
),
],
),
);
}
}
class ListItem extends StatelessWidget {
ListItem(this.value);
final String value;
@override
Widget build(BuildContext context) {
return Card(
margin: const EdgeInsets.all(16),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
side: BorderSide(
color: Colors.red,
width: 2,
),
),
elevation: 0,
child: Padding(
padding: const EdgeInsets.all(16),
child: Center(child: Text(value)),
),
);
}
}My real code needs shrinkWrap: true otherwise I get rendering errors, so I am really stuck on this one.
This was the expected behavior.
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.found in release: 1.22Found to occur in 1.22Found to occur in 1.22found in release: 1.26Found to occur in 1.26Found to occur in 1.26frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer version