import 'dart:convert';
import 'dart:io';
import 'dart:typed_data';

import 'package:eitc_erm_app/utils/Component.dart';
import 'package:eitc_erm_app/utils/Constants.dart';
import 'package:eitc_erm_app/widget/loading.dart';
import 'package:flutter/material.dart';
import 'package:flutter_html/flutter_html.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:http/http.dart' as http;

import 'bean/favourite_doctor_list.dart';
import 'bean/message_box_s_list_entity.dart';
import 'bean/normal_response.dart';
import 'bean/notice_manage_list.dart';
import 'bean/pda_patrol_time_list.dart';
import 'doctor_detail.dart';

void main() {
  WidgetsFlutterBinding.ensureInitialized();
  runApp(NoticeDetail("", 0));
}

NoticeManageList mNoticeManageList = new NoticeManageList();
int mWhich = 0;

class NoticeDetail extends StatefulWidget {
  NoticeDetail(noticeManageList, which) {
    mNoticeManageList = noticeManageList;
    mWhich = which;
  }
  @override
  State<StatefulWidget> createState() => NoticeDetailState();
}

class NoticeDetailState extends State<NoticeDetail> {
  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: new AppBar(
          title: new Text('公告详情',
              style: TextStyle(
                color: Colors.white,
              )),
          centerTitle: true,
          elevation: 0.5,
          backgroundColor: Global.StatusBarColor,
          leading: new IconButton(
            tooltip: '返回上一页',
            icon: const Icon(
              Icons.arrow_back_ios,
              color: Colors.white,
            ),
            onPressed: () {
              Navigator.of(context).pop();
              //_nextPage(-1);
            },
          ),
        ),
        body: Expanded(
          child: Column(
              mainAxisAlignment: MainAxisAlignment.start,
              mainAxisSize: MainAxisSize.max,
              children: [
                SizedBox(
                  height: 20,
                ),
                Container(
                  width: MediaQuery.of(context).size.width - 50,
                  child: Text(
                    mNoticeManageList.data![mWhich].noticeTitle
                        .toString(),
                    style: const TextStyle(fontSize: 18),
                    maxLines: 3,
                  ),
                ),
                Text(
                  mNoticeManageList.data![mWhich].noticeStartTime
                      .toString(),
                  style: const TextStyle(
                      fontSize: 15, color: Colors.orange),
                  maxLines: 1,
                  textAlign: TextAlign.left,
                ),
                SizedBox(
                  height: 5,
                ),
                Row(children: [
                  Padding(
                    padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
                    child: Container(
                      width: MediaQuery.of(context).size.width - 60,
                      child: Html(
                          data: mNoticeManageList.data![mWhich].noticeContent,
                          ),/*Text(
                        "    ${mNoticeManageList.data![mWhich].noticeContent}",
                        style: const TextStyle(
                            fontSize: 13, color: Colors.grey),
                      ),*/
                    ),
                  ),
                ]),
              ]),
        ),
      ),
    );
  }
}
