import 'package:flutter/material.dart';
void main() => runApp(MainApp());
class MainApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: HomePage(),
debugShowCheckedModeBanner: false,
);
}
}
class HomePage extends StatefulWidget {
@override
_HomePageState createState() => _HomePageState();
}
class _HomePageState extends State<HomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Page View'),
centerTitle: true,
elevation: 0.0,
),
body: Container(
width: double.infinity,
height: 300.0,
child: PageView(
physics: BouncingScrollPhysics(),
// scrollDirection: Axis.vertical,
children: [
PaperLoading(Colors.orange),
PaperLoading(Colors.red),
PaperLoading(Colors.green),
],
),
),
);
}
}
class PaperLoading extends StatelessWidget {
final Color color;
const PaperLoading(this.color);
@override
Widget build(BuildContext context) {
return Container(
width: double.infinity,
height: double.infinity,
color: this.color,
);
}
}
Output:
0 comments:
Post a Comment