Created
October 30, 2023 08:25
-
-
Save KoheiKanagu/be6caa384531983e2f676f448e85118a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CustomSliverPersistentHeader extends SingleChildRenderObjectWidget { | |
const CustomSliverPersistentHeader({ | |
super.key, | |
required super.child, | |
}); | |
@override | |
RenderObject createRenderObject(BuildContext context) => | |
_RenderCustomSliverPersistentHeader(); | |
} | |
class _RenderCustomSliverPersistentHeader | |
extends RenderSliverPinnedPersistentHeader { | |
@override | |
double get maxExtent => | |
child!.getMaxIntrinsicHeight(constraints.crossAxisExtent); | |
@override | |
double get minExtent => 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment