添加规程管理详情

hmxc
张萌 4 years ago
parent 42b89c3f83
commit 4cb2a1598a

@ -1,3 +1,5 @@
import 'package:common_utils/common_utils.dart';
class RulesManageListModel { class RulesManageListModel {
int id; int id;
String title; String title;
@ -21,4 +23,6 @@ class RulesManageListModel {
data['releaseDate'] = this.releaseDate; data['releaseDate'] = this.releaseDate;
return data; return data;
} }
String get releaseDateString => DateUtil.formatDateStr(this.releaseDate);
} }

@ -0,0 +1,78 @@
import 'package:aku_community_manager/models/manager/rules_manage/rules_manage_list_model.dart';
import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:common_utils/common_utils.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:velocity_x/velocity_x.dart';
class RulesManageDetailPage extends StatefulWidget {
final RulesManageListModel model;
RulesManageDetailPage({Key key, this.model}) : super(key: key);
@override
_RulesManageDetailPageState createState() => _RulesManageDetailPageState();
}
class _RulesManageDetailPageState extends State<RulesManageDetailPage> {
RulesManageListModel get _detailModel => widget.model;
@override
Widget build(BuildContext context) {
return AkuScaffold(
backgroundColor: Colors.white,
title: '规程管理',
body: ListView(
padding: EdgeInsets.symmetric(vertical: 24.w, horizontal: 32.w),
children: [
_detailModel.title.text
.size(32.sp)
.color(kTextPrimaryColor)
.bold
.align(TextAlign.center)
.make(),
24.w.heightBox,
SizedBox(
width: double.infinity,
child: _detailModel.content.text
.size(28.sp)
.color(kTextPrimaryColor)
.make(),
// child: RichText(
// text: TextSpan(
// children: List.generate(_parasedText.length, (index) {
// if (index.isEven) {
// return TextSpan(
// text: _parasedText[index],
// style: TextStyle(fontSize: 28.sp, color: ktextPrimary),
// );
// } else {
// return TextSpan(
// text: _parasedText[index],
// style: TextStyle(
// fontSize: 28.sp,
// color: Colors.lightBlue,
// ),
// recognizer: _tapLinkUrlLancher
// ..onTap = () {
// launch(_parasedText[index]);
// });
// }
// })),
// ),
),
40.w.heightBox,
Row(
children: [
Spacer(),
'发布于 ${DateUtil.formatDateStr(_detailModel.releaseDate, format: 'MM-dd HH:mm')}'
.text
.size(24.sp)
.color(kTextSubColor)
.make(),
],
)
],
),
);
}
}

@ -1,10 +1,12 @@
// Flutter imports: // Flutter imports:
import 'package:aku_community_manager/ui/manage_pages/rules_manage/rules_manage_detail_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
// Package imports: // Package imports:
import 'package:common_utils/common_utils.dart'; import 'package:common_utils/common_utils.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:velocity_x/velocity_x.dart'; import 'package:velocity_x/velocity_x.dart';
// Project imports: // Project imports:
@ -62,40 +64,45 @@ class _RulesManagePageState extends State<RulesManagePage> {
} }
Widget _buildCard(RulesManageListModel model) { Widget _buildCard(RulesManageListModel model) {
return Container( return GestureDetector(
color: Colors.white, onTap: () {
padding: EdgeInsets.symmetric(vertical: 24.w, horizontal: 32.w), Get.to(() => RulesManageDetailPage(model: model,));
width: double.infinity, },
child: Column( child: Container(
crossAxisAlignment: CrossAxisAlignment.start, color: Colors.white,
children: [ padding: EdgeInsets.symmetric(vertical: 24.w, horizontal: 32.w),
model.title.text width: double.infinity,
.size(32.sp) child: Column(
.color(kTextPrimaryColor) crossAxisAlignment: CrossAxisAlignment.start,
.maxLines(1) children: [
.overflow(TextOverflow.ellipsis) model.title.text
.bold .size(32.sp)
.make(), .color(kTextPrimaryColor)
32.w.heightBox, .maxLines(1)
model.content.text .overflow(TextOverflow.ellipsis)
.size(24.sp) .bold
.color(kTextSubColor) .make(),
.maxLines(3) 32.w.heightBox,
.overflow(TextOverflow.ellipsis) model.content.text
.make(), .size(24.sp)
32.w.heightBox, .color(kTextSubColor)
Row( .maxLines(3)
children: [ .overflow(TextOverflow.ellipsis)
'南宁人才公寓'.text.size(20.sp).color(kTextSubColor).make(), .make(),
Spacer(), 32.w.heightBox,
'发布于 ${DateUtil.formatDateStr(model.releaseDate, format: 'MM-dd HH:mm')}' Row(
.text children: [
.size(20.sp) '南宁人才公寓'.text.size(20.sp).color(kTextSubColor).make(),
.color(kTextSubColor) Spacer(),
.make(), '发布于 ${DateUtil.formatDateStr(model.releaseDate, format: 'MM-dd HH:mm')}'
], .text
), .size(20.sp)
], .color(kTextSubColor)
)); .make(),
],
),
],
)),
);
} }
} }

Loading…
Cancel
Save