From 54edd788071cc225c663c680be5461bccc19be5c Mon Sep 17 00:00:00 2001 From: _juliotati Date: Wed, 25 Jan 2023 22:51:47 +0000 Subject: [PATCH] Expose `ScrollController` on `HeatMap` For cases when the `HeatMap` is `scrollable ` a `ScrollController` is much needed as it is absent by default. --- CHANGELOG.md | 4 ++++ lib/src/heatmap.dart | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e23a36..67250e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.6 + +- fix: Expose `ScrollController` on `HeatMap`. + ## 1.0.5 - feat: Created the `onMonthChange` callback on the `HeatMapCalendar`. diff --git a/lib/src/heatmap.dart b/lib/src/heatmap.dart index e884860..eec3ecb 100644 --- a/lib/src/heatmap.dart +++ b/lib/src/heatmap.dart @@ -74,6 +74,10 @@ class HeatMap extends StatefulWidget { /// default value is false. final bool scrollable; + /// An object that can be used to control the position to which this scroll + /// view is scrolled. + final ScrollController? scrollController; + /// Widgets which shown at left and right side of colorTip. /// /// First value is the left side widget and second value is the right side widget. @@ -104,6 +108,7 @@ class HeatMap extends StatefulWidget { this.showText = false, this.showColorTip = true, this.scrollable = false, + this.scrollController, this.colorTipHelper, this.colorTipCount, this.colorTipSize, @@ -119,6 +124,7 @@ class _HeatMap extends State { return widget.scrollable ? SingleChildScrollView( reverse: true, + controller: widget.scrollController, scrollDirection: Axis.horizontal, child: child, )