mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-29 10:17:16 +08:00
Move the PageController into a state widget
Doesn't it have some state since it's fundamentally storing which page we are one? Or where is that stored otherwise?
This commit is contained in:
@ -3,14 +3,22 @@ import 'package:shared_preferences/shared_preferences.dart';
|
|||||||
|
|
||||||
import 'package:journal/storage/git.dart';
|
import 'package:journal/storage/git.dart';
|
||||||
|
|
||||||
class OnBoardingScreen extends StatelessWidget {
|
class OnBoardingScreen extends StatefulWidget {
|
||||||
final Function onBoardingCompletedFunction;
|
final Function onBoardingCompletedFunction;
|
||||||
|
|
||||||
OnBoardingScreen(this.onBoardingCompletedFunction);
|
OnBoardingScreen(this.onBoardingCompletedFunction);
|
||||||
|
|
||||||
|
@override
|
||||||
|
OnBoardingScreenState createState() {
|
||||||
|
return new OnBoardingScreenState();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class OnBoardingScreenState extends State<OnBoardingScreen> {
|
||||||
|
var pageController = PageController();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
var pageController = PageController();
|
|
||||||
var pageView = PageView(
|
var pageView = PageView(
|
||||||
controller: pageController,
|
controller: pageController,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
@ -31,7 +39,7 @@ class OnBoardingScreen extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
OnBoardingGitClone(
|
OnBoardingGitClone(
|
||||||
doneFunction: this.onBoardingCompletedFunction,
|
doneFunction: this.widget.onBoardingCompletedFunction,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user