mirror of
https://mirror.ghproxy.com/https://github.com/StarCitizenToolBox/app.git
synced 2024-12-22 18:43:43 +08:00
fix: Swiper
This commit is contained in:
parent
494ae6468d
commit
c32de21fa1
BIN
assets/countdown/barcitizen_sz_2954.png
Normal file
BIN
assets/countdown/barcitizen_sz_2954.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 64 KiB |
BIN
assets/countdown/citizencon.png
Normal file
BIN
assets/countdown/citizencon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 58 KiB |
@ -135,3 +135,9 @@ Future<Uint8List?> widgetToPngImage(GlobalKey repaintBoundaryKey,
|
||||
|
||||
double roundDoubleTo(double value, double precision) =>
|
||||
(value * precision).round() / precision;
|
||||
|
||||
int getMinNumber(List<int> list) {
|
||||
if (list.isEmpty) return 0;
|
||||
list.sort((a, b) => a.compareTo(b));
|
||||
return list.first;
|
||||
}
|
||||
|
@ -356,7 +356,8 @@ class HomeUI extends HookConsumerWidget {
|
||||
child: makeLoading(context),
|
||||
)
|
||||
: Swiper(
|
||||
itemCount: homeState.rssVideoItems?.length ?? 0,
|
||||
itemCount: getMinNumber(
|
||||
[homeState.rssVideoItems?.length ?? 0, 6]),
|
||||
itemBuilder: (context, index) {
|
||||
final item = homeState.rssVideoItems![index];
|
||||
return GestureDetector(
|
||||
@ -712,7 +713,8 @@ class HomeUI extends HookConsumerWidget {
|
||||
width: width,
|
||||
height: 62,
|
||||
child: Swiper(
|
||||
itemCount: homeState.countdownFestivalListData!.length,
|
||||
itemCount: getMinNumber(
|
||||
[homeState.countdownFestivalListData!.length, 6]),
|
||||
autoplay: true,
|
||||
autoplayDelay: 5000,
|
||||
itemBuilder: (context, index) {
|
||||
|
Loading…
Reference in New Issue
Block a user