Skip to content

Commit

Permalink
Merge pull request #210 from orkun1675/master
Browse files Browse the repository at this point in the history
Fix dots animation bug on last page.
  • Loading branch information
ghenry authored Feb 5, 2024
2 parents 1cccd72 + c13bf6c commit ca8100e
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions lib/src/introduction_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ library introduction_screen;
import 'dart:async';
import 'dart:math';

import 'package:flutter/material.dart';

import 'package:collection/collection.dart';
import 'package:dots_indicator/dots_indicator.dart';
import 'package:flutter_keyboard_visibility/flutter_keyboard_visibility.dart';
import 'package:flutter/material.dart';

import '/src/helper.dart';
import '/src/model/page_view_model.dart';
import '/src/model/position.dart';
Expand Down Expand Up @@ -540,7 +542,7 @@ class IntroductionScreenState extends State<IntroductionScreen> {
final metrics = notification.metrics;
if (metrics is PageMetrics && metrics.page != null) {
if (mounted) {
setState(() => _currentPage = metrics.page!.toInt());
setState(() => _currentPage = metrics.page!.round());
}
}
return false;
Expand Down Expand Up @@ -568,7 +570,9 @@ class IntroductionScreenState extends State<IntroductionScreen> {
onPressed: _onSkip,
),
);
} else if (widget.showBackButton && getCurrentPage() > 0 && widget.canProgress(getCurrentPage())) {
} else if (widget.showBackButton &&
getCurrentPage() > 0 &&
widget.canProgress(getCurrentPage())) {
leftBtn = widget.overrideBack ??
IntroButton(
child: widget.back!,
Expand All @@ -589,7 +593,9 @@ class IntroductionScreenState extends State<IntroductionScreen> {
semanticLabel: widget.doneSemantic,
onPressed: !_isScrolling ? widget.onDone : null,
);
} else if (!isLastPage && widget.showNextButton && widget.canProgress(getCurrentPage())) {
} else if (!isLastPage &&
widget.showNextButton &&
widget.canProgress(getCurrentPage())) {
rightBtn = widget.overrideNext ??
IntroButton(
child: widget.next!,
Expand Down

0 comments on commit ca8100e

Please sign in to comment.