+import 'package:fluids/designs/onboarding/dots_indicator.dart';
+import 'package:flutter/material.dart';
+class _OnboardingMainPageState extends State<OnboardingMainPage> {
+ final _controller = new PageController();
+ final List<Widget> _pages = [
+ Widget build(BuildContext context) {
+ bool isDone = page == _pages.length - 1;
+ backgroundColor: Colors.transparent,
+ child: new PageView.builder(
+ physics: new AlwaysScrollableScrollPhysics(),
+ controller: _controller,
+ itemCount: _pages.length,
+ itemBuilder: (BuildContext context, int index) {
+ return _pages[index % _pages.length];
+ onPageChanged: (int p){
+ backgroundColor: Colors.transparent,
+ title: Text('Onboarding Example'),
+ child: Text(isDone ? 'DONE' : 'NEXT', style: TextStyle(color: Colors.white),),
+ onPressed: isDone ? (){
+ Navigator.pop(context);
+ _controller.animateToPage(page + 1, duration: Duration(milliseconds: 300), curve: Curves.easeIn);
+ padding: const EdgeInsets.all(8.0),
+ child: new DotsIndicator(
+ controller: _controller,
+ itemCount: _pages.length,
+ onPageSelected: (int page) {
+ _controller.animateToPage(
+ duration: const Duration(milliseconds: 300),
+ mainAxisAlignment: MainAxisAlignment.spaceEvenly,
+ decoration: BoxDecoration(
+ gradient: new LinearGradient(
+ begin: Alignment(0.5, -1.0),
+ end: Alignment(0.5, 1.0)
+ borderRadius: new BorderRadius.circular(30.0),
+ child: Text('I\'M NEW',
+ style: Theme.of(context).textTheme.button.copyWith(color: Colors.white),
+ highlightColor: Colors.orange.withOpacity(0.5),
+ splashColor: Colors.orange.withOpacity(0.5),
+ color: Colors.transparent,
+ borderRadius: new BorderRadius.circular(30.0),
+ decoration: BoxDecoration(
+ borderRadius: new BorderRadius.circular(30.0),
+ border: Border.all(color: Colors.white, width: 1.0),
+ color: Colors.transparent,
+ style: Theme.of(context).textTheme.button.copyWith(color: Colors.white),
+ highlightColor: Colors.white30,
+ splashColor: Colors.white30,
+ color: Colors.transparent,
+ borderRadius: new BorderRadius.circular(30.0),
+class OnboardingMainPage extends StatefulWidget {
+ OnboardingMainPage({Key key}) : super(key: key);
+ _OnboardingMainPageState createState() => new _OnboardingMainPageState();