Files
tuiche/lib/pages/device_control/issue_list_page.dart
2025-06-03 09:34:31 +08:00

188 lines
7.6 KiB
Dart
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import 'package:ef/ef.dart';
import 'package:flutter/material.dart';
import 'package:vbvs_app/common/color/appFontsize.dart';
import 'package:vbvs_app/common/util/FitTool.dart';
import 'package:vbvs_app/common/util/MyUtils.dart';
import 'package:vbvs_app/pages/device_control/issue_preview_widget.dart';
import '../../controller/mh/issue_controller.dart';
class IssueListPage extends GetView<IssueListController> {
final scaffoldKey = GlobalKey<ScaffoldState>();
BoxConstraints? bodysize;
final ScrollController scrollController = ScrollController();
// IssueListPage() {
// controller.model.limit = AppConstants.limit;
// controller.model.offset = 0;
// controller.model.isLoading = false;
// controller.model.hasMore = true;
// controller.model.issueList!.clear();
// controller.initData();
// scrollController.addListener(() {
// if (scrollController.position.pixels ==
// scrollController.position.maxScrollExtent &&
// controller.model.hasMore) {
// controller.initData();
// controller.updateAll();
// }
// });
// }
// void initData() async {}
@override
Widget build(BuildContext context) {
return LayoutBuilder(builder: (context, cc) {
bodysize = cc;
controller.model.issueList = [
{'title': 'APP如何连接我的智能床'},
{'title': '智能床如何连接网络?'},
{'title': '跟换WIFI名称或密码或者刚换了路由器后我的智能床无法使用怎么办'},
{'title': '在APP中如何查看我的睡眠报告'},
{'title': '在APP中如何查看我的睡眠报告'},
{'title': '在APP中如何查看我的睡眠报告'}
];
return GestureDetector(
onTap: () => FocusScope.of(context).unfocus(),
child: Container(
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage('assets/images/new_background.png'), // 本地图片
fit: BoxFit.fill, // 填满整个 Container
),
),
child: Scaffold(
backgroundColor: Colors.transparent,
appBar: AppBar(
backgroundColor: Colors.transparent,
automaticallyImplyLeading: false,
iconTheme: IconThemeData(color: Colors.white),
titleSpacing: 0,
title: SizedBox(
width: double.infinity,
height: 180.rpx,
child: Stack(
alignment: Alignment.center,
children: [
// 中间居中的标题
Text(
'问题与帮助',
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
fontSize: 30.rpx,
),
),
// 左侧图标
Positioned(
left: 20.rpx,
child: returnIconButtomNew,
),
],
),
),
actions: [],
centerTitle: false,
),
// backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
body: Container(
width: bodysize!.maxWidth,
height: bodysize!.maxHeight * 1,
decoration: BoxDecoration(
// color: AppColors.bg_color,
// color: Color(0xFFF6F6F6),
),
child: Obx(() {
return Visibility(
visible: controller.model.issueList != null &&
controller.model.issueList!.isNotEmpty,
replacement: Container(
width: MediaQuery.sizeOf(context).width,
height: 100,
decoration: BoxDecoration(
color: FlutterFlowTheme.of(context).secondaryBackground,
),
child: Padding(
padding: EdgeInsetsDirectional.fromSTEB(31, 27, 0, 0),
child: Column(
mainAxisSize: MainAxisSize.max,
children: [
Align(
alignment: AlignmentDirectional(-1, 0),
child: Text(
'暂无内容!',
style: FlutterFlowTheme.of(context)
.bodyMedium
.override(
fontFamily: 'Readex Pro',
color: Color(0xFF9EA4B7),
fontSize: AppFontsize.title_size,
letterSpacing: 0,
fontWeight: FontWeight.w600,
),
),
),
],
),
),
),
child: Column(
mainAxisSize: MainAxisSize.max,
children: [
// TitleComponentWidget(
// titleName: '问题与帮助',
// ),
Flexible(
child: Padding(
padding:
EdgeInsetsDirectional.fromSTEB(15, 13, 15, 15),
child: Container(
width: bodysize!.maxWidth,
decoration: BoxDecoration(
// color: Colors.white,
// borderRadius: BorderRadius.circular(16),
),
child: Obx(() => ListView(
controller: scrollController,
padding: const EdgeInsets.fromLTRB(
0,
5,
0,
0,
),
shrinkWrap: true,
scrollDirection: Axis.vertical,
children: (controller.model.issueList!
.asMap()
.entries
.map((e) => IssuePreviewWidget(
index: e.key,
issueListController: controller))
.toList() as List<Widget>)
// .divide(const SizedBox(
// height: 30,
// ))
// .addToEnd(const SizedBox(
// height: 26,
// ))
// .addToStart(SizedBox(
// height: 16,
// ))
)),
),
),
),
],
),
);
}),
),
),
));
});
}
}