notice_detail.dart 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. import 'package:eitc_erm_app/utils/Constants.dart';
  2. import 'package:flutter/material.dart';
  3. import 'package:flutter_html/flutter_html.dart';
  4. import 'bean/notice_manage_list.dart';
  5. void main() {
  6. WidgetsFlutterBinding.ensureInitialized();
  7. runApp(NoticeDetail("", 0));
  8. }
  9. NoticeManageList mNoticeManageList = new NoticeManageList();
  10. int mWhich = 0;
  11. class NoticeDetail extends StatefulWidget {
  12. NoticeDetail(noticeManageList, which) {
  13. mNoticeManageList = noticeManageList;
  14. mWhich = which;
  15. }
  16. @override
  17. State<StatefulWidget> createState() => NoticeDetailState();
  18. }
  19. class NoticeDetailState extends State<NoticeDetail> {
  20. @override
  21. void initState() {
  22. super.initState();
  23. }
  24. @override
  25. Widget build(BuildContext context) {
  26. return Scaffold(
  27. appBar: AppBar(
  28. title: const Text('公告详情',
  29. style: TextStyle(
  30. color: Colors.white,
  31. )),
  32. centerTitle: true,
  33. elevation: 0.5,
  34. backgroundColor: Global.StatusBarColor,
  35. leading: IconButton(
  36. tooltip: '返回上一页',
  37. icon: const Icon(
  38. Icons.arrow_back_ios,
  39. color: Colors.white,
  40. ),
  41. onPressed: () {
  42. Navigator.of(context).pop();
  43. //_nextPage(-1);
  44. },
  45. ),
  46. ),
  47. body: Padding(
  48. padding: const EdgeInsets.all(10),
  49. child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
  50. Text(
  51. mNoticeManageList.data![mWhich].noticeTitle ?? "",
  52. style: Theme.of(context).textTheme.titleLarge,
  53. ),
  54. Align(
  55. alignment: Alignment.centerRight,
  56. child: Text(
  57. mNoticeManageList.data![mWhich].noticeStartTime ?? "",
  58. style: Theme.of(context)
  59. .textTheme
  60. .bodySmall
  61. ?.copyWith(color: Colors.grey),
  62. ),
  63. ),
  64. const SizedBox(
  65. height: 5,
  66. ),
  67. Html(
  68. data: mNoticeManageList.data![mWhich].noticeContent,
  69. ),
  70. ]),
  71. ),
  72. );
  73. }
  74. }