Open name27 opened 1 year ago
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
var pageController = PageController();
return MaterialApp(
home: Scaffold(
body: DefaultTextStyle(
style: TextStyle(fontSize: 36, color: Colors.black),
child: SafeArea(
child: PageView(
physics: NeverScrollableScrollPhysics(),
controller: pageController,
onPageChanged: ((v) {
print(v);
}),
children: [
Text('A페이지'),
Text('B페이지'),
Text('C페이지')
],
),
),
),
floatingActionButton: FloatingActionButton(
onPressed: (){
pageController.previousPage(duration: Duration(seconds: 2), curve: Curves.easeIn);
},
child: Icon(Icons.navigate_next),
),
),
);
}
}