From f546482c9ee66da389e44d7f2500fc72199ae928 Mon Sep 17 00:00:00 2001 From: snapsl <32878439+snapsl@users.noreply.github.com> Date: Sun, 2 Jun 2024 16:32:58 +0000 Subject: [PATCH] update dots_indicator --- CHANGELOG.md | 5 +++++ lib/src/introduction_screen.dart | 8 ++++---- pubspec.yaml | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 50d2119..6b2cc13 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [3.1.15] - TODO + +### Update +- Update dependencies to latest version (dots_indicator to 3.0.0) + ## [3.1.14] - 2024-03-23 ### Fixed diff --git a/lib/src/introduction_screen.dart b/lib/src/introduction_screen.dart index 692b062..1b93c4f 100644 --- a/lib/src/introduction_screen.dart +++ b/lib/src/introduction_screen.dart @@ -399,7 +399,7 @@ class IntroductionScreen extends StatefulWidget { class IntroductionScreenState extends State { late PageController _pageController; - double _currentPage = 0.0; + int _currentPage = 0; bool _isSkipPressed = false; bool _isScrolling = false; late bool _showBottom; @@ -413,7 +413,7 @@ class IntroductionScreenState extends State { final int initialPage = min(widget.initialPage, getPagesLength() - 1); _pageController = PageController(initialPage: initialPage); _showBottom = widget.showBottomPart; - _currentPage = initialPage.toDouble(); + _currentPage = initialPage; _autoScroll(widget.autoScrollDuration); if (widget.hideBottomOnKeyboard) { final keyboardVisibilityController = KeyboardVisibilityController(); @@ -539,7 +539,7 @@ class IntroductionScreenState extends State { final metrics = notification.metrics; if (metrics is PageMetrics && metrics.page != null) { if (mounted) { - setState(() => _currentPage = metrics.page!); + setState(() => _currentPage = metrics.page!.toInt()); } } return false; @@ -687,7 +687,7 @@ class IntroductionScreenState extends State { child: DotsIndicator( reversed: widget.rtl, dotsCount: getPagesLength(), - position: _currentPage.toDouble(), + position: _currentPage, decorator: widget.dotsDecorator, onTap: widget.isProgressTap && !widget.freeze diff --git a/pubspec.yaml b/pubspec.yaml index 5857771..33b92f0 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -12,7 +12,7 @@ dependencies: sdk: flutter collection: ^1.18.0 - dots_indicator: ^2.1.2 + dots_indicator: ^3.0.0 flutter_keyboard_visibility: ^6.0.0 dev_dependencies: