Last active
January 20, 2021 20:40
-
-
Save reime005/786c3a3c9a37a49f010c9811ddd674d6 to your computer and use it in GitHub Desktop.
flutter-onboarding-experience-2
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 HomePage extends StatefulWidget { | |
@override | |
_HomePageState createState() => _HomePageState(); | |
} | |
class _HomePageState extends State<HomePage> { | |
final _controller = PageController(); | |
int _currentIndex = 0; | |
createCircle({int index}) { | |
return AnimatedContainer( | |
duration: Duration(milliseconds: 100), | |
margin: EdgeInsets.only(right: 4), | |
height: 5, | |
width: _currentIndex == index ? 15 : 5, // current indicator is wider | |
decoration: BoxDecoration( | |
color: Colors.white, borderRadius: BorderRadius.circular(3))); | |
} | |
// build function | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment