Skip to content

Instantly share code, notes, and snippets.

@marcoredz
marcoredz / sliver_flexible_header.dart
Created October 21, 2022 20:53
Sliver header that can be floating or pinned based on a parameter
import 'dart:math' as math;
import 'package:flutter/rendering.dart';
import 'package:flutter/widgets.dart';
class SliverFlexibleHeader extends SingleChildRenderObjectWidget {
const SliverFlexibleHeader({
Key key,
@required Widget child,
this.floating = false, // pinned as default