Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix linter warnings #79

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions lib/sticky_headers/widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,13 @@ typedef StickyHeaderWidgetBuilder = Widget Function(BuildContext context, double
class StickyHeader extends MultiChildRenderObjectWidget {
/// Constructs a new [StickyHeader] widget.
StickyHeader({
Key? key,
super.key,
required this.header,
required this.content,
this.overlapHeaders = false,
this.controller,
this.callback,
}) : super(
key: key,
// Note: The order of the children must be preserved for the RenderObject.
children: [content, header],
);
Expand All @@ -60,7 +59,7 @@ class StickyHeader extends MultiChildRenderObjectWidget {

@override
RenderStickyHeader createRenderObject(BuildContext context) {
final scrollPosition = controller?.position ?? Scrollable.of(context)!.position;
final scrollPosition = controller?.position ?? Scrollable.of(context).position;
return RenderStickyHeader(
scrollPosition: scrollPosition,
callback: callback,
Expand All @@ -70,7 +69,7 @@ class StickyHeader extends MultiChildRenderObjectWidget {

@override
void updateRenderObject(BuildContext context, RenderStickyHeader renderObject) {
final scrollPosition = controller?.position ?? Scrollable.of(context)!.position;
final scrollPosition = controller?.position ?? Scrollable.of(context).position;
renderObject
..scrollPosition = scrollPosition
..callback = callback
Expand All @@ -88,12 +87,12 @@ class StickyHeader extends MultiChildRenderObjectWidget {
class StickyHeaderBuilder extends StatefulWidget {
/// Constructs a new [StickyHeaderBuilder] widget.
const StickyHeaderBuilder({
Key? key,
super.key,
required this.builder,
required this.content,
this.overlapHeaders = false,
this.controller,
}) : super(key: key);
});

/// Called when the sticky amount changes for the header.
/// This builder must not return null.
Expand Down