|
@@ -1,7 +1,6 @@
|
|
|
import 'dart:convert';
|
|
|
import 'dart:typed_data';
|
|
|
|
|
|
-
|
|
|
import 'package:autocomplete_textfield/autocomplete_textfield.dart';
|
|
|
import 'package:flutter/material.dart';
|
|
|
import 'package:flutter/services.dart';
|
|
@@ -12,18 +11,16 @@ import 'package:ustest/Services/UserService.dart';
|
|
|
|
|
|
import 'Services/ConsultationService.dart';
|
|
|
|
|
|
-class UserView extends StatefulWidget {
|
|
|
+class UserView extends StatefulWidget {
|
|
|
@override
|
|
|
State<StatefulWidget> createState() {
|
|
|
// TODO: implement createState
|
|
|
- return _UserView();
|
|
|
+ return _UserView();
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
-
|
|
|
- class _UserView extends State<UserView>{
|
|
|
|
|
|
- String? selectedType="我申请的";
|
|
|
+class _UserView extends State<UserView> {
|
|
|
+ String? selectedType = "我申请的";
|
|
|
|
|
|
@override
|
|
|
Widget build(BuildContext context) {
|
|
@@ -36,24 +33,19 @@ class UserView extends StatefulWidget {
|
|
|
}
|
|
|
var userName = user == null ? "" : user.userName;
|
|
|
var accessToken = user == null ? "" : user.accessToken;
|
|
|
-
|
|
|
- final items = <String>["我申请的","我组织的", "我参与的"];
|
|
|
- int selectedState=0;
|
|
|
- if(selectedType=="我申请的")
|
|
|
- {
|
|
|
- selectedState=0;
|
|
|
- }
|
|
|
- else if(selectedType=="我组织的")
|
|
|
- {
|
|
|
- selectedState=1;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- selectedState=2;
|
|
|
- }
|
|
|
- Future<List<Consultation>> future=fetchConsultations(selectedState);
|
|
|
- GlobalKey<AutoCompleteTextFieldState<String>> typeKey = GlobalKey();
|
|
|
- GlobalKey listKey = GlobalKey();
|
|
|
+
|
|
|
+ final items = <String>["我申请的", "我组织的", "我参与的"];
|
|
|
+ int selectedState = 0;
|
|
|
+ if (selectedType == "我申请的") {
|
|
|
+ selectedState = 0;
|
|
|
+ } else if (selectedType == "我组织的") {
|
|
|
+ selectedState = 1;
|
|
|
+ } else {
|
|
|
+ selectedState = 2;
|
|
|
+ }
|
|
|
+ Future<List<Consultation>> future = fetchConsultations(selectedState);
|
|
|
+ GlobalKey<AutoCompleteTextFieldState<String>> typeKey = GlobalKey();
|
|
|
+ GlobalKey listKey = GlobalKey();
|
|
|
return Scaffold(
|
|
|
body: Center(
|
|
|
child: Column(
|
|
@@ -84,28 +76,25 @@ class UserView extends StatefulWidget {
|
|
|
],
|
|
|
),
|
|
|
Padding(
|
|
|
- padding: const EdgeInsets.all(8.0),
|
|
|
- child: DropdownButtonFormField<String>(
|
|
|
- key: typeKey,
|
|
|
- value: selectedType,
|
|
|
- decoration:
|
|
|
- InputDecoration(hintText: "Select one state"),
|
|
|
- items: items
|
|
|
- .map((e) => DropdownMenuItem<String>(
|
|
|
- child: Text(e),
|
|
|
- value: e,
|
|
|
- ))
|
|
|
- .toList(),
|
|
|
- onChanged: (value) {
|
|
|
- selectedType = value;
|
|
|
- },
|
|
|
- )),
|
|
|
- Row(
|
|
|
+ padding: const EdgeInsets.all(8.0),
|
|
|
+ child: DropdownButtonFormField<String>(
|
|
|
+ key: typeKey,
|
|
|
+ value: selectedType,
|
|
|
+ decoration: InputDecoration(hintText: "Select one state"),
|
|
|
+ items: items
|
|
|
+ .map((e) => DropdownMenuItem<String>(
|
|
|
+ child: Text(e),
|
|
|
+ value: e,
|
|
|
+ ))
|
|
|
+ .toList(),
|
|
|
+ onChanged: (value) {
|
|
|
+ selectedType = value;
|
|
|
+ },
|
|
|
+ )),
|
|
|
+ Row(
|
|
|
children: [
|
|
|
TextButton.icon(
|
|
|
- onPressed: () =>setState(() {
|
|
|
-
|
|
|
- }),
|
|
|
+ onPressed: () => setState(() {}),
|
|
|
icon: Icon(Icons.search),
|
|
|
label: Text("Search")),
|
|
|
],
|
|
@@ -113,7 +102,7 @@ class UserView extends StatefulWidget {
|
|
|
Expanded(
|
|
|
child: Center(
|
|
|
child: FutureBuilder<List<Consultation>>(
|
|
|
- key: listKey,
|
|
|
+ key: listKey,
|
|
|
future: future,
|
|
|
builder: (context, snapshot) {
|
|
|
if (snapshot.hasError) {
|
|
@@ -130,8 +119,7 @@ class UserView extends StatefulWidget {
|
|
|
}
|
|
|
},
|
|
|
),
|
|
|
- )
|
|
|
- ),
|
|
|
+ )),
|
|
|
service.Channel != null
|
|
|
? StreamBuilder(
|
|
|
stream: service.Channel!.stream,
|
|
@@ -208,7 +196,7 @@ class UserView extends StatefulWidget {
|
|
|
try {
|
|
|
var service = GetIt.instance.get<ConsultationService>();
|
|
|
|
|
|
- var list = await service.FindConsultationsByPageAsync('id',selectedType);
|
|
|
+ var list = await service.FindConsultationsByPageAsync('id', selectedType);
|
|
|
return list;
|
|
|
} catch (ex) {
|
|
|
print('QueryExam.to ex' + ex.toString());
|
|
@@ -226,10 +214,8 @@ class UserView extends StatefulWidget {
|
|
|
print("onApplyConsultation click");
|
|
|
Navigator.of(context).pushNamed('/applyconsultation');
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|
|
|
-
|
|
|
enum NotificationTypeEnum {
|
|
|
Daiding,
|
|
|
|
|
@@ -286,11 +272,24 @@ enum NotificationTypeEnum {
|
|
|
placeholder19,
|
|
|
placeholder20,
|
|
|
placeholder21,
|
|
|
+ placeholder22,
|
|
|
+ placeholder23,
|
|
|
+ placeholder24,
|
|
|
|
|
|
/// <summary>
|
|
|
- ///InviteLiveConsultationNotification| 22 |开始会诊
|
|
|
+ /// InviteLiveConsultationNotification| 25 | 开始会诊的通知
|
|
|
/// </summary>
|
|
|
InviteLiveConsultationNotification,
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// AcceptLiveConsultationNotification| 26 | 接受会诊的通知
|
|
|
+ /// </summary>
|
|
|
+ AcceptLiveConsultationNotification,
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// RejectLiveConsultationNotification| 27 | 拒绝会诊的通知
|
|
|
+ /// </summary>
|
|
|
+ RejectLiveConsultationNotification,
|
|
|
}
|
|
|
|
|
|
class ConnectionNotification {
|