import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; class Singleimage extends StatefulWidget { late final String foldername; late final int categorynumber; late final int index; late final String categoryname; Singleimage(this.foldername, this.categorynumber, this.index, this.categoryname); @override _SingleimageState createState() => _SingleimageState(); } class _SingleimageState extends State<singleimage> { PageController controller = PageController(); Duration pageTurnDuration = Duration(milliseconds: 500); Curve pageTurnCurve = Curves.ease; @override void initState() { super.initState(); } @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title:Text('Name'), ), body: PageView.builder( onPageChanged: (int page) { // this page variable is the new page and will change before the pageController fully reaches the full, rounded int value }, itemBuilder: (context, position) { return Container( child: Text('${position}',style: TextStyle( fontSize: 20 ),), color: Colors.red, ); }, itemCount: 10, ) ); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)