I have been trying to use ListWheelScrollView and I am getting a quite strange result.
So this is the code that I am using to show WheelScroll of months.
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(
body: Center(
child: MyWidget(),
),
),
);
}
}
class MyWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
var monthsOfTheYear = [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December",
];
FixedExtentScrollController fixedExtentScrollController =
new FixedExtentScrollController();
return ListWheelScrollView(
controller: fixedExtentScrollController,
physics: FixedExtentScrollPhysics(),
children: monthsOfTheYear.map(
(month) {
return LimitedBox(
maxHeight: 120,
child: Card(
child: Row(
children: <Widget>[
Expanded(
child: Padding(
padding: const EdgeInsets.all(0.0),
child: Text(
month,
textAlign: TextAlign.center,
style: TextStyle(fontSize: 18.0),
),
),
),
],
),
),
);
},
).toList(),
itemExtent: 60.0,
);
}
}
I get different results on iPhone simulator and dartpad.
iOS simulator
Dartpad
Why is it not behaving like it is supposed to be in iPhone Simulator?
Does anyone know the issue that causes this?