YSHomeMsgDetail.dart 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. import 'package:flutter/cupertino.dart';
  2. import 'package:flutter/material.dart';
  3. import 'package:ysairplane/base/YSBase.dart';
  4. import 'package:ysairplane/tools/YSNetWorking.dart';
  5. import 'package:ysairplane/tools/YSTools.dart';
  6. class YSHomeMsgDetail extends StatefulWidget {
  7. final detailDict;
  8. const YSHomeMsgDetail({Key key, this.detailDict}) : super(key: key);
  9. @override
  10. _YSHomeMsgDetailState createState() => _YSHomeMsgDetailState();
  11. }
  12. class _YSHomeMsgDetailState extends State<YSHomeMsgDetail> {
  13. @override
  14. void initState() {
  15. Future.delayed(Duration(seconds: 0)).then((value){
  16. _getMsgDetailData();
  17. });
  18. super.initState();
  19. }
  20. @override
  21. Widget build(BuildContext context) {
  22. return YSBase(
  23. ystitle: '消息详情',
  24. yschild: Container(
  25. width: MediaQuery.of(context).size.width,
  26. height: MediaQuery.of(context).size.height-MediaQuery.of(context).padding.top-44,
  27. color: Color(0xFFF1F2F3),
  28. child: Column(
  29. children: [
  30. Container(
  31. padding: EdgeInsets.all(hsp(30)),
  32. color: Color(0xFFFAFAFA),
  33. child: Column(
  34. crossAxisAlignment: CrossAxisAlignment.start,
  35. children: [
  36. Text('${widget.detailDict['createTime']}',style: TextStyle(fontSize: zsp(22),color: Color(0xFFCCCCCC)),),
  37. Container(
  38. margin: EdgeInsets.only(top: hsp(20),bottom: hsp(20)),
  39. child: Text('${widget.detailDict['title']}',style: TextStyle(fontSize: zsp(34),color: Color(0xFF000000),fontWeight: FontWeight.bold),),
  40. ),
  41. Text('${widget.detailDict['content']}',style: TextStyle(fontSize: zsp(26),color: Color(0xFFB7B7B7)),),
  42. ],
  43. ),
  44. )
  45. ],
  46. ),
  47. ),
  48. );
  49. }
  50. _getMsgDetailData() async{
  51. Map dict = await ysRequestHttp(context,type: requestType.get,api: '/app/applets/message/get',parameter: {'id':widget.detailDict['id']},
  52. isToken: true,refresh: (){_getMsgDetailData();});
  53. if(dict!=null){
  54. }
  55. }
  56. }