104 lines
3.1 KiB
Dart
104 lines
3.1 KiB
Dart
|
|
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
import 'package:get/get.dart';
|
|
|
|
import '../../../../app_settings/app_colors.dart';
|
|
import '../../../../tools/noData.dart';
|
|
import '../../../../tools/titleAppBar.dart';
|
|
import 'videoLogDownLoad_logic.dart';
|
|
|
|
class VideoLogDownLoadPage extends StatefulWidget {
|
|
const VideoLogDownLoadPage({Key? key}) : super(key: key);
|
|
|
|
@override
|
|
State<VideoLogDownLoadPage> createState() => _VideoLogDownLoadPageState();
|
|
}
|
|
|
|
class _VideoLogDownLoadPageState extends State<VideoLogDownLoadPage> {
|
|
final logic = Get.put(VideoLogDownLoadLogic());
|
|
final state = Get.find<VideoLogDownLoadLogic>().state;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
backgroundColor: Colors.white,
|
|
appBar: TitleAppBar(
|
|
barTitle: "下载列表",
|
|
haveBack: true,
|
|
backgroundColor: AppColors.mainColor,
|
|
),
|
|
body: Column(
|
|
children: [
|
|
Expanded(
|
|
child: state.localList.isNotEmpty ? ListView.builder(
|
|
itemCount: 5,
|
|
itemBuilder: (c, index) {
|
|
return Column(children: [
|
|
Container(
|
|
margin: EdgeInsets.only(left:20.w, top: 15.w, bottom: 15.w),
|
|
child: Row(
|
|
children: [
|
|
Text("2023.10.23", style: TextStyle(fontSize: 20.sp)),
|
|
]
|
|
)),
|
|
mainListView(index)
|
|
],);
|
|
}): NoData(),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
|
|
var itemW = (1.sw - 15.w*4)/3;
|
|
var itemH = (1.sw - 15.w*4)/3+40.h;
|
|
Widget mainListView(int index){
|
|
return Container(
|
|
// margin: EdgeInsets.only(left: 10.w, right: 10.w, top: 40.h),
|
|
// color: Colors.blue,
|
|
child: GridView.builder(
|
|
padding: EdgeInsets.only(left: 15.w, right: 15.w),
|
|
itemCount: index+1,
|
|
shrinkWrap: true,
|
|
physics: const NeverScrollableScrollPhysics(),
|
|
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
|
//横轴元素个数
|
|
crossAxisCount: 3,
|
|
//纵轴间距
|
|
mainAxisSpacing: 10.w,
|
|
// 横轴间距
|
|
crossAxisSpacing: 15.w,
|
|
//子组件宽高长度比例
|
|
childAspectRatio: itemW/itemH
|
|
),
|
|
itemBuilder: (context, index) {
|
|
return videoItem();
|
|
},
|
|
),
|
|
);
|
|
}
|
|
|
|
Widget videoItem(){
|
|
return SizedBox(
|
|
width: itemW,
|
|
height: itemH,
|
|
child: Stack(
|
|
children: [
|
|
Column(
|
|
children: [
|
|
ClipRRect(
|
|
borderRadius: BorderRadius.circular(10.w),
|
|
child: Image(width: itemW, height: itemW, fit: BoxFit.fill, image: const AssetImage("images/main/icon_lockDetail_monitoringvoiceFrist.png")),
|
|
),
|
|
SizedBox(height:5.h),
|
|
Text("2023.10.23 10:00", style: TextStyle(fontSize: 20.sp))
|
|
],
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|