拆组建
This commit is contained in:
parent
b579588881
commit
04a487fec9
@ -1,6 +1,8 @@
|
||||
// ignore_for_file: dead_code
|
||||
// import 'dart:js';
|
||||
|
||||
import 'dart:ffi';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:get/get.dart';
|
||||
@ -45,13 +47,19 @@ class HomePageView extends GetView <HomePageController> {
|
||||
childAspectRatio: 0.7,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10),
|
||||
children: List.generate(controller.typeList.length, (index) {
|
||||
return Stack(//堆叠效果
|
||||
return getBodyItem(controller.typeList[index].data![0].previewThumb!,controller.typeList[index].name!,index);
|
||||
}),
|
||||
));
|
||||
}
|
||||
|
||||
Stack getBodyItem(String imgUrl,String title,int index){
|
||||
return Stack(//堆叠效果
|
||||
children: [
|
||||
FadeInImage.memoryNetwork(
|
||||
width: double.infinity,
|
||||
height: double.infinity,
|
||||
placeholder: kTransparentImage,
|
||||
image: controller.typeList[index].data![0].previewThumb!,
|
||||
image: imgUrl,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
|
||||
@ -60,7 +68,7 @@ class HomePageView extends GetView <HomePageController> {
|
||||
color: Colors.transparent,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
print("dsfadf");
|
||||
print("xxaaa");
|
||||
},
|
||||
child: Align(
|
||||
alignment: Alignment.bottomCenter,
|
||||
@ -71,7 +79,7 @@ class HomePageView extends GetView <HomePageController> {
|
||||
child: Align(
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
controller.typeList[index].name!,
|
||||
title,
|
||||
style: const TextStyle(
|
||||
color: Colors.white
|
||||
),
|
||||
@ -79,15 +87,12 @@ class HomePageView extends GetView <HomePageController> {
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
|
||||
],
|
||||
);
|
||||
}),
|
||||
));
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
//初始化顶部数据
|
||||
|
||||
Loading…
Reference in New Issue
Block a user