The Container Widget | 3 Things I’ve Learnt

Photo by Paul Teysen on Unsplash
@override
Widget build(BuildContext context) {
return Container(
child: PageView.builder(
itemCount: 5,
itemBuilder: (context, position) {
return _buildPageItem(position);
},
),
);
return Stack(
children: [
Container (...), // yellow Container
Align (
alignment: Alignment.bottomCenter,
child: Container (...), // green Container
),
],
);
Note the change in scale when the sides are scrolled
Widget _buildPageItem(int index) {
Matrix4 matrix = Matrix4.identity();

//insert matrix scaling and requirements
//this will based on the page value of the slider
return Transform (
transform: matrix,
child: Stack (
children: [
Container (...), // yellow Container
Align (
alignment: Alignment.bottomCenter,
child: Container (...), // green Container
),
],
),
);
}

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store