Comments (10)
Done, you can check it now.
from circle_indicator.
Tested and it works great 👍
from circle_indicator.
Thanks! Good point. In my project I do use a widget to navigate to another page. I'll add that right away. A name constructor would be fine?
from circle_indicator.
🤣 so I don't think I can integrate it in the Circle Widget. In my project I add it to the main page logic like this:
class StartPage extends StatefulWidget {
@override
State<StatefulWidget> createState() => new _StartPageState();
}
class _StartPageState extends State<StartPage> {
final PageController controller = new PageController();
Stack rootWidget;
bool showStart = false;
int previousPage = 0;
@override
Widget build(BuildContext context) {
rootWidget = createPages();
controller.addListener(pagerListener);
return new Scaffold(
body: new Container(
padding: new EdgeInsets.only(top: 16.0,),
decoration: new BoxDecoration(
color: primaryColor
),
child: rootWidget,
),
);
}
Stack createPages() {
var pageList = <StartPageItem>[
new StartPageItem("assets/ic_info_01.png"),
new StartPageItem("assets/ic_info_02.png"),
new StartPageItem("assets/ic_info_03.png"),
new StartPageItem("assets/ic_info_04.png"),
new StartPageItem("assets/ic_info_05.png"),
new StartPageItem("assets/ic_info_06.png"),
new StartPageItem("assets/ic_info_07.png"),
new StartPageItem("assets/ic_info_08.png"),
];
var childrenList = <Widget>[
new PageView.builder(
controller: controller,
itemCount: pageList.length,
itemBuilder: (_, int i) => pageList[i],
),
new Container(
margin: new EdgeInsets.only(
top: 16.0,
bottom: 16.0,
),
child: new CircleIndicator(
controller, pageList.length, 3.0,
Colors.white70, Colors.white),
),
];
if (showStart) {
childrenList.add(
new Container(
alignment: FractionalOffset.bottomRight,
margin: new EdgeInsets.all(16.0),
child: new GestureDetector(
onTap: startApp,
child: new Text("START",
style: Theme
.of(context)
.textTheme
.body1
.copyWith(
color: Colors.white,
fontFamily: "DancingScript-Regular",
),
),
),
),
);
}
return new Stack(
alignment: FractionalOffset.bottomCenter,
children: childrenList,
);
}
void pagerListener() {
setState(() => showStart = controller.page == 7);
}
void startApp() {
Navigator.popAndPushNamed(context, HomePage.routeName);
}
}
from circle_indicator.
I guess you can provide the widget like you do now but also a global page wrapper
from circle_indicator.
Something like new IntroductionView and the constructor take the PageList and the final action as parameters
from circle_indicator.
ooo, nice, so you only need to provide the pages, ok
from circle_indicator.
new CircleIntroduction( <Widget>[], onComplete => // Fade or navigate somewhere else )
from circle_indicator.
perfect
from circle_indicator.
Can you close this issue?
from circle_indicator.
Related Issues (8)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from circle_indicator.