206 lines
7.9 KiB
Dart
206 lines
7.9 KiB
Dart
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/mh_page/issue_preview_widget.dart';
|
||
|
||
import '../../controller/mh_controller/issue_controller.dart';
|
||
import 'package:flutter/services.dart';
|
||
|
||
class IssueListPage extends GetView<IssueListController> {
|
||
final scaffoldKey = GlobalKey<ScaffoldState>();
|
||
BoxConstraints? bodysize;
|
||
|
||
IssueListController controller = Get.put(IssueListController());
|
||
fetchData() async {
|
||
await controller.getIssueList();
|
||
}
|
||
|
||
@override
|
||
Widget build(BuildContext context) {
|
||
fetchData();
|
||
return LayoutBuilder(builder: (context, cc) {
|
||
bodysize = cc;
|
||
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(
|
||
systemOverlayStyle: SystemUiOverlayStyle(
|
||
statusBarColor: Colors.transparent, // 状态栏背景色
|
||
statusBarIconBrightness: Brightness.light, // 图标颜色(Android)
|
||
statusBarBrightness: Brightness.light, // 图标颜色(iOS)
|
||
),
|
||
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(
|
||
'问题与帮助'.tr,
|
||
textAlign: TextAlign.center,
|
||
style: TextStyle(
|
||
color: Colors.white,
|
||
fontSize: 30.rpx,
|
||
),
|
||
),
|
||
// 左侧图标
|
||
Positioned(
|
||
left: 0.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(() {
|
||
if (controller.model.isLoading) {
|
||
return Center(
|
||
child: CircularProgressIndicator(
|
||
strokeWidth: 2,
|
||
valueColor: AlwaysStoppedAnimation<Color>(
|
||
themeController.currentColor.sc1,
|
||
),
|
||
),
|
||
); // ✅ 加载中
|
||
}
|
||
|
||
if (controller.model.issueList.isEmpty) {
|
||
return Container(
|
||
width: MediaQuery.sizeOf(context).width,
|
||
height: 100,
|
||
child: Padding(
|
||
padding: EdgeInsetsDirectional.fromSTEB(31, 27, 0, 0),
|
||
child: Align(
|
||
alignment: AlignmentDirectional(-1, 0),
|
||
child: Text(
|
||
'暂无内容!'.tr,
|
||
style: TextStyle(
|
||
fontFamily: 'Readex Pro',
|
||
color: Color(0xFF9EA4B7),
|
||
fontSize: AppFontsize.title_size,
|
||
fontWeight: FontWeight.w600,
|
||
),
|
||
),
|
||
),
|
||
),
|
||
);
|
||
}
|
||
|
||
// 有数据时渲染列表
|
||
return ListView(
|
||
children: controller.model.issueList!
|
||
.asMap()
|
||
.entries
|
||
.map((e) => IssuePreviewWidget(
|
||
index: e.key,
|
||
issueListController: controller,
|
||
))
|
||
.toList(),
|
||
);
|
||
}),
|
||
|
||
// 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(
|
||
// 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>))),
|
||
// ),
|
||
// ),
|
||
// ),
|
||
// ],
|
||
// ),
|
||
// );
|
||
// }),
|
||
),
|
||
),
|
||
));
|
||
});
|
||
}
|
||
}
|