Skip to content

Commit

Permalink
Merge pull request #1 from snkrdunk/fix/animation-controller
Browse files Browse the repository at this point in the history
animation controllerのインスタンスかを修正
  • Loading branch information
imajoriri authored Sep 15, 2023
2 parents a8864e2 + a1985f3 commit 854e8b8
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions lib/src/inner_infinite_scroll_tab_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,7 @@ class InnerInfiniteScrollTabViewState extends State<InnerInfiniteScrollTabView>
double get indicatorHeight =>
widget.indicatorHeight ?? widget.separator?.width ?? 2.0;

late final _indicatorAnimationController =
AnimationController(vsync: this, duration: _tabAnimationDuration)
..addListener(() {
if (_indicatorAnimation == null) return;
_indicatorSize.value = _indicatorAnimation!.value;
});
late final _indicatorAnimationController;
Animation<double>? _indicatorAnimation;

double _totalTabSizeCache = 0.0;
Expand Down Expand Up @@ -193,6 +188,13 @@ class InnerInfiniteScrollTabViewState extends State<InnerInfiniteScrollTabView>
void initState() {
super.initState();

_indicatorAnimationController =
AnimationController(vsync: this, duration: _tabAnimationDuration)
..addListener(() {
if (_indicatorAnimation == null) return;
_indicatorSize.value = _indicatorAnimation!.value;
});

calculateTabBehaviorElements(widget.textScaleFactor);

_indicatorSize = ValueNotifier(_tabTextSizes[0]);
Expand Down

0 comments on commit 854e8b8

Please sign in to comment.