Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- The following assertion was thrown while handling a gesture:
- PageController.page cannot be accessed before a PageView is built with
- it. 'package:flutter/src/widgets/page_view.dart': Failed assertion: line
- 96 pos 7:'positions.isNotEmpty'
- ...
- PageController _pageController;
- @override
- void initState{
- _pageController = PageController(initialPage: 100, viewportFraction: 0.2);
- }
- @override
- Widget build(BuildContext context) {
- return Center(
- child: FlatButton(
- onPressed: (){
- print(_pageController.page);
- }
- )
- );
- }
Add Comment
Please, Sign In to add comment