123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299 |
- import 'package:eitc_erm_app/record_registration.dart';
- import 'package:eitc_erm_app/utils/Constants.dart';
- import 'package:flutter/cupertino.dart';
- import 'package:flutter/material.dart';
- import 'package:permission_handler/permission_handler.dart';
- import 'home.dart';
- /*void main() {
- WidgetsFlutterBinding.ensureInitialized();
- runApp(SuccessRegistration());
- }*/
- String mPatient = "";
- String mVisitTime = "";
- String mDeptName = "";
- String mDoctorName = "";
- String mRemark = "";
- class SuccessRegistration extends StatefulWidget {
- SuccessRegistration(
- {required Key key, required patient, required visitTime, required deptName, required doctorName, required remark})
- : super(key: key) {
- mPatient = patient;
- mVisitTime = visitTime;
- mDeptName = deptName;
- mDoctorName = doctorName;
- mRemark = remark;
- }
- @override
- State<StatefulWidget> createState() => SuccessRegistrationState();
- }
- class SuccessRegistrationState extends State<SuccessRegistration> {
- final GlobalKey<ScaffoldState> _scaffoldKey =
- GlobalKey<ScaffoldState>(); //重要代码 需要绑定key不然切换页面会停止摄像头采集
- @override
- void initState() {
- super.initState();
- initPlatformState(); //检查权限
- //延迟1秒 直播推流
- Future.delayed(Duration(milliseconds: 1000), () {});
- }
- Future<void> initPlatformState() async {
- //相机权限
- if (await requestCameraPermission() == false) {
- return;
- }
- //录音权限
- if (await requestMicrophonePermission() == false) {
- return;
- }
- }
- Future<bool> requestCameraPermission() async {
- var status = await Permission.camera.status;
- if (status == PermissionStatus.granted) {
- return true;
- } else {
- status = await Permission.camera.request();
- if (status == PermissionStatus.granted) {
- return true;
- } else {
- return false;
- }
- }
- }
- Future<bool> requestMicrophonePermission() async {
- var status = await Permission.microphone.status;
- if (status == PermissionStatus.granted) {
- return true;
- } else {
- status = await Permission.microphone.request();
- if (status == PermissionStatus.granted) {
- return true;
- } else {
- return false;
- }
- }
- }
- @override
- Widget build(BuildContext context) {
- return MaterialApp(
- home: Scaffold(
- resizeToAvoidBottomInset: false,
- backgroundColor: Global.BackgroundColor,
- appBar: new AppBar(title: new Text('预约挂号'), centerTitle: true),
- body: SingleChildScrollView(
- child:Container(
- padding: EdgeInsets.all(10),
- child: Column(
- mainAxisSize: MainAxisSize.min,
- crossAxisAlignment: CrossAxisAlignment.center,
- children: <Widget>[
- ClipRRect(
- borderRadius: BorderRadius.circular(10.0),
- child: Container(
- color: Global.BackgroundColor,
- padding: EdgeInsets.all(10),
- child: const Column(
- mainAxisSize: MainAxisSize.min,
- crossAxisAlignment: CrossAxisAlignment.start,
- children: <Widget>[
- Padding(
- padding: EdgeInsets.all(10),
- child: Icon(
- Icons.check_circle,
- size: 85.0, // 设置Icon的大小
- color: Colors.blueAccent, // 设置Icon的颜色
- ),
- ),
- Text(
- '挂号成功',
- style: TextStyle(
- fontSize: 28,
- color: Colors.blue,
- ),
- )
- ]),
- ),
- ),
- SizedBox(height: 8),
- ClipRRect(
- borderRadius: BorderRadius.circular(10.0),
- child: Container(
- color: Colors.white,
- padding: const EdgeInsets.all(10),
- child: Column(
- mainAxisSize: MainAxisSize.min,
- crossAxisAlignment: CrossAxisAlignment.start,
- children: <Widget>[
- /*Padding(
- padding: EdgeInsets.all(10),
- child: Row(
- mainAxisAlignment:
- MainAxisAlignment.spaceBetween,
- children: [
- Text(
- '挂号费',
- style: TextStyle(
- fontSize: 15, color: Colors.grey),
- ),
- Text(
- '¥12.5',
- style: TextStyle(fontSize: 15),
- ),
- ]),
- ),*/
- Padding(
- padding: EdgeInsets.all(10),
- child: Row(
- mainAxisAlignment:
- MainAxisAlignment.spaceBetween,
- children: [
- Text(
- '就诊人',
- style: TextStyle(
- fontSize: 15, color: Colors.grey),
- ),
- Text(
- mPatient,
- style: TextStyle(fontSize: 15),
- ),
- ]),
- ),
- Padding(
- padding: EdgeInsets.all(10),
- child: Row(
- mainAxisAlignment:
- MainAxisAlignment.spaceBetween,
- children: [
- Text(
- '就诊时间',
- style: TextStyle(
- fontSize: 15, color: Colors.grey),
- ),
- Text(
- mVisitTime,
- style: TextStyle(fontSize: 15),
- ),
- ]),
- ),
- Padding(
- padding: EdgeInsets.all(10),
- child: Row(
- mainAxisAlignment:
- MainAxisAlignment.spaceBetween,
- children: [
- Text(
- '挂号科室',
- style: TextStyle(
- fontSize: 15, color: Colors.grey),
- ),
- Text(
- mDeptName,
- style: TextStyle(fontSize: 15),
- ),
- ]),
- ),
- Padding(
- padding: EdgeInsets.all(10),
- child: Row(
- mainAxisAlignment:
- MainAxisAlignment.spaceBetween,
- children: [
- Text(
- '医生姓名',
- style: TextStyle(
- fontSize: 15, color: Colors.grey),
- ),
- Text(
- mDoctorName,
- style: TextStyle(fontSize: 15),
- ),
- ]),
- ),
- ]),
- ),
- ),
- SizedBox(height: 8),
- ClipRRect(
- borderRadius: BorderRadius.circular(10.0),
- child: Container(
- color: Colors.white,
- padding: const EdgeInsets.all(10),
- child: Column(
- mainAxisSize: MainAxisSize.min,
- crossAxisAlignment: CrossAxisAlignment.start,
- children: <Widget>[
- Padding(
- padding: EdgeInsets.all(10),
- child: Row(
- mainAxisAlignment:
- MainAxisAlignment.spaceBetween,
- children: [
- Expanded(
- child: TextField(
- maxLines: 5, // 设置最大行数
- enabled: false,
- decoration: InputDecoration(
- border: OutlineInputBorder(),
- hintText: mRemark,
- ),
- ),
- ),
- ]),
- ),
- ]),
- ),
- ),
- Padding(
- padding: EdgeInsets.all(10),
- child: Row(
- mainAxisAlignment: MainAxisAlignment.spaceEvenly,
- children: [
- ElevatedButton(
- style: ButtonStyle(
- backgroundColor:
- MaterialStateProperty.all(Colors.white),
- ),
- child: Text(
- '返回',
- style: const TextStyle(
- fontSize: 15, color: Colors.black),
- ),
- onPressed: () {
- Navigator.pop(context);
- },
- ),
- ElevatedButton(
- style: ButtonStyle(
- backgroundColor:
- MaterialStateProperty.all(Colors.blue),
- ),
- child: Text(
- '预约列表',
- style: const TextStyle(
- fontSize: 15, color: Colors.white),
- ),
- onPressed: () {
- Navigator.push(
- context,
- MaterialPageRoute(
- builder: (context) => RecordRegistration()),
- );
- },
- ),
- ]),
- ),
- ])))));
- }
- }
|