feat:增加轮播图组件

This commit is contained in:
2025-07-24 23:00:37 +08:00
parent 502bb9df52
commit a2ed0f3d98
8 changed files with 287 additions and 221 deletions

View File

@@ -7,7 +7,6 @@ import 'package:tdesign_flutter/tdesign_flutter.dart';
class RecipeList extends StatefulWidget {
const RecipeList({super.key});
@override
State<RecipeList> createState() => _RecipeListState();
}
@@ -34,11 +33,14 @@ class _RecipeListState extends State<RecipeList> {
if (recipeList.isEmpty) {
return const TDEmpty(type: TDEmptyType.plain, emptyText: '暂无数据');
} else {
return ListView.builder(
return ListView.separated(
itemCount: recipeList.length,
itemBuilder: (context, index) {
return RecipeCard(recipe: recipeList[index]);
}
},
separatorBuilder: (BuildContext context, int index) {
return SizedBox(height: 10);
},
);
}
}