79 lines
2.6 KiB
Dart
Executable File
79 lines
2.6 KiB
Dart
Executable File
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
import 'package:get/get.dart';
|
|
import 'package:star_lock/flavors.dart';
|
|
import 'package:star_lock/mine/message/messageDetail/messageDetail_state.dart';
|
|
|
|
import '../../../app_settings/app_colors.dart';
|
|
import '../../../tools/dateTool.dart';
|
|
import '../../../tools/titleAppBar.dart';
|
|
import 'messageDetail_logic.dart';
|
|
|
|
class MessageDetailPage extends StatefulWidget {
|
|
const MessageDetailPage({Key? key}) : super(key: key);
|
|
|
|
@override
|
|
State<MessageDetailPage> createState() => _MessageDetailPageState();
|
|
}
|
|
|
|
class _MessageDetailPageState extends State<MessageDetailPage> {
|
|
final MessageDetailLogic logic = Get.put(MessageDetailLogic());
|
|
final MessageDetailState state = Get.find<MessageDetailLogic>().state;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
backgroundColor: AppColors.mainBackgroundColor,
|
|
appBar: F.sw(
|
|
skyCall: () => TitleAppBar(
|
|
barTitle: '消息详情'.tr,
|
|
haveBack: true,
|
|
backgroundColor: AppColors.mainColor,
|
|
),
|
|
xhjCall: () => TitleAppBar(
|
|
barTitle: '消息详情'.tr,
|
|
haveBack: true,
|
|
backgroundColor: Colors.white,
|
|
iconColor: AppColors.blackColor,
|
|
titleColor: AppColors.blackColor,
|
|
),
|
|
),
|
|
body: Container(
|
|
margin: EdgeInsets.only(left: 20.w, right: 20.w, top: 20.h),
|
|
child: Obx(() => Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: <Widget>[
|
|
Text(
|
|
"${"创建时间".tr}:${DateTool().dateToYMDHNString(state.itemData.value.createdAt!.toString())}",
|
|
style: TextStyle(
|
|
fontSize: 22.sp, color: AppColors.placeholderTextColor),
|
|
),
|
|
SizedBox(height: 20.h),
|
|
textView(),
|
|
],
|
|
)),
|
|
));
|
|
}
|
|
|
|
Widget textView() {
|
|
Widget view = Text(
|
|
state.itemData.value.data!,
|
|
style: TextStyle(fontSize: 22.sp, color: AppColors.placeholderTextColor),
|
|
);
|
|
return F.sw(
|
|
skyCall: () => view,
|
|
xhjCall: () => Container(
|
|
padding: EdgeInsets.only(
|
|
top: 20.h, bottom: 20.h, left: 20.w, right: 20.w),
|
|
decoration: BoxDecoration(
|
|
color: Colors.white,
|
|
borderRadius: BorderRadius.all(Radius.circular(20.r))),
|
|
child: ClipRRect(
|
|
borderRadius: BorderRadius.circular(20.r),
|
|
child: view,
|
|
),
|
|
));
|
|
}
|
|
}
|