Skip to content

Instantly share code, notes, and snippets.

@reime005
Last active January 20, 2021 20:40
Show Gist options
  • Save reime005/786c3a3c9a37a49f010c9811ddd674d6 to your computer and use it in GitHub Desktop.
Save reime005/786c3a3c9a37a49f010c9811ddd674d6 to your computer and use it in GitHub Desktop.
flutter-onboarding-experience-2
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