-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Closed
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: error messageError messages from the Flutter frameworkError messages from the Flutter frameworka: qualityA truly polished experienceA truly polished experiencef: 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.waiting for PR to land (fixed)A fix is in flightA fix is in flight
Description
The SliverOverlapAbsorber and SliverOverlapInjector are meant to be used together in the NestedScrollView. If a developer inserts a SliverOverlapInjector into the body of a NestedScrollView and does not make use of a SliverOverlapAbsorber, then the app crashes without a helpful error message:
Null check operator used on a null value
This is very hard to understand why and how to fix. 🙃
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: NestedScrollView(
headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) {
return <Widget>[
const SliverAppBar(),
];
},
body: Builder(builder: (BuildContext context) {
return CustomScrollView(
slivers: <Widget>[
SliverOverlapInjector(
handle:
NestedScrollView.sliverOverlapAbsorberHandleFor(context),
),
],
);
}),
),
),
);
}
}Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: error messageError messages from the Flutter frameworkError messages from the Flutter frameworka: qualityA truly polished experienceA truly polished experiencef: 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.waiting for PR to land (fixed)A fix is in flightA fix is in flight
