你好,我想在 flutter 中进行旋转并将图像作为 url 从 firestore 导入到它,所以到目前为止我来的目的是如何在图像中制作列表:
import 'package:carousel_pro/carousel_pro.dart';
import 'package:chat_app/models/news.dart';
import 'package:chat_app/provider/news.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class NewNews extends StatelessWidget {
final NewsModel news ;
const NewNews({Key key,this.news}):super(key:key);
@override
Widget build(BuildContext context) {
final newsProvider = Provider.of<NewsProvider>(context);
return Container(
height: 230,
child: ListView.builder(
scrollDirection: Axis.horizontal,
itemCount: newsProvider.news.length,
itemBuilder: (_, index) {
return Carousel(
boxFit: BoxFit.cover,
images: [
],
autoplay: false,
// animationCurve: Curves.fastOutSlowIn,
// animationDuration: Duration(milliseconds: 1000),
dotSize: 4.0,
indicatorBgPadding: 2.0,
);
},
),
);
}
}