我正在测试ListWheelScrollView,并注意到放大镜正在跳过图像和图标。 我们可以以某种方式改变它吗? 这是一个样本。 另外,我们可以更改所选项目的颜色吗?例如,将当前缩放的项目涂上颜色,将其他项目涂成黑色和白色。
List<Widget> items = [
ListTile(
leading: Icon(Icons.local_activity, size: 50),
title: Text('Activity'),
subtitle: Text('Description here'),
),
ListTile(
leading: Icon(Icons.local_airport, size: 50),
title: Text('Airport'),
subtitle: Text('Description here'),
),
ListTile(
leading: Icon(Icons.local_atm, size: 50),
title: Text('ATM'),
subtitle: Text('Description here'),
),
ListTile(
leading: Icon(Icons.local_bar, size: 50),
title: Text('Bar'),
subtitle: Text('Description here'),
),
ListTile(
leading: Icon(Icons.local_cafe, size: 50),
title: Text('Cafe'),
subtitle: Text('Description here'),
),
ListTile(
leading: Icon(Icons.local_car_wash, size: 50),
title: Text('Car Wash'),
subtitle: Text('Description here'),
),
ListTile(
leading: Icon(Icons.local_convenience_store, size: 50),
title: Text('Heart Shaker'),
subtitle: Text('Description here'),
),
ListTile(
leading: Icon(Icons.local_dining, size: 50),
title: Text('Dining'),
subtitle: Text('Description here'),
),
ListTile(
leading: Icon(Icons.local_drink, size: 50),
title: Text('Drink'),
subtitle: Text('Description here'),
),
ListTile(
leading: Icon(Icons.local_florist, size: 50),
title: Text('Florist'),
subtitle: Text('Description here'),
),
ListTile(
leading: Icon(Icons.local_gas_station, size: 50),
title: Text('Gas Station'),
subtitle: Text('Description here'),
),
ListTile(
leading: Icon(Icons.local_grocery_store, size: 50),
title: Text('Grocery Store'),
subtitle: Text('Description here'),
),
];
Container(
height: 400,
child: ListWheelScrollView(
itemExtent: 75,
children: items,
useMagnifier: true,
magnification: 1.5,
physics: FixedExtentScrollPhysics(),
diameterRatio: 4,
perspective: 0.0000000001,
onSelectedItemChanged: (index) => {print(index)},
),
)
答案 0 :(得分:0)
与此同时,Google又回到了github。将offAxisFraction设置为.5 https://github.com/flutter/flutter/issues/59163