我想在这里在flutter中实现这种类型的视图。
我建议对这种类型的无限循环视图寻呼机使用 flutter_carousel_widget 包。它可能与您的不一样,但它是我见过的最好的之一。
简单实现
FlutterCarousel(
options: CarouselOptions(
height: 400.0,
showIndicator: true,
slideIndicator: CircularSlideIndicator(),
),
items: [1,2,3,4,5].map((i) {
return Builder(
builder: (BuildContext context) {
return Container(
width: MediaQuery.of(context).size.width,
margin: EdgeInsets.symmetric(horizontal: 5.0),
decoration: BoxDecoration(
color: Colors.amber
),
child: Text('text $i', style: TextStyle(fontSize: 16.0),)
);
},
);
}).toList(),
)