고원빈

temp

1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<module type="JAVA_MODULE" version="4">
3 + <component name="NewModuleRootManager" inherit-compiler-output="true">
4 + <exclude-output />
5 + <content url="file://$MODULE_DIR$" />
6 + <orderEntry type="inheritedJdk" />
7 + <orderEntry type="sourceFolder" forTests="false" />
8 + </component>
9 +</module>
...\ No newline at end of file ...\ No newline at end of file
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<project version="4">
3 + <component name="ProjectModuleManager">
4 + <modules>
5 + <module fileurl="file://$PROJECT_DIR$/.idea/frontend.iml" filepath="$PROJECT_DIR$/.idea/frontend.iml" />
6 + </modules>
7 + </component>
8 +</project>
...\ No newline at end of file ...\ No newline at end of file
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<project version="4">
3 + <component name="VcsDirectoryMappings">
4 + <mapping directory="" vcs="Git" />
5 + </component>
6 +</project>
...\ No newline at end of file ...\ No newline at end of file
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<project version="4">
3 + <component name="ChangeListManager">
4 + <list default="true" id="147dc7b8-1063-4e12-b6bb-adb3717b8080" name="Default Changelist" comment="" />
5 + <option name="SHOW_DIALOG" value="false" />
6 + <option name="HIGHLIGHT_CONFLICTS" value="true" />
7 + <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
8 + <option name="LAST_RESOLUTION" value="IGNORE" />
9 + </component>
10 + <component name="Git.Settings">
11 + <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
12 + </component>
13 + <component name="ProjectId" id="1wtiCZt9s9osC3izQmO4Etd3c5k" />
14 + <component name="ProjectViewState">
15 + <option name="hideEmptyMiddlePackages" value="true" />
16 + <option name="showLibraryContents" value="true" />
17 + </component>
18 + <component name="PropertiesComponent">
19 + <property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
20 + <property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
21 + <property name="last_opened_file_path" value="$PROJECT_DIR$/flutter_application_1" />
22 + <property name="project.structure.last.edited" value="Project" />
23 + <property name="project.structure.proportion" value="0.0" />
24 + <property name="project.structure.side.proportion" value="0.0" />
25 + </component>
26 + <component name="SvnConfiguration">
27 + <configuration />
28 + </component>
29 + <component name="TaskManager">
30 + <task active="true" id="Default" summary="Default task">
31 + <changelist id="147dc7b8-1063-4e12-b6bb-adb3717b8080" name="Default Changelist" comment="" />
32 + <created>1629284158268</created>
33 + <option name="number" value="Default" />
34 + <option name="presentableId" value="Default" />
35 + <updated>1629284158268</updated>
36 + </task>
37 + <servers />
38 + </component>
39 + <component name="WindowStateProjectService">
40 + <state x="740" y="278" key="FileChooserDialogImpl" timestamp="1629284197342">
41 + <screen x="0" y="0" width="1920" height="1040" />
42 + </state>
43 + <state x="740" y="278" key="FileChooserDialogImpl/-1920.0.1920.1040/0.0.1920.1040@0.0.1920.1040" timestamp="1629284197342" />
44 + <state x="440" y="98" key="SettingsEditor" timestamp="1629284186082">
45 + <screen x="0" y="0" width="1920" height="1040" />
46 + </state>
47 + <state x="440" y="98" key="SettingsEditor/-1920.0.1920.1040/0.0.1920.1040@0.0.1920.1040" timestamp="1629284186082" />
48 + </component>
49 +</project>
...\ No newline at end of file ...\ No newline at end of file
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
15 <application 15 <application
16 android:name="io.flutter.app.FlutterApplication" 16 android:name="io.flutter.app.FlutterApplication"
17 android:label="Smart_Medicine_Box" 17 android:label="Smart_Medicine_Box"
18 + android:requestLegacyExternalStorage="true"
18 android:icon="@mipmap/ic_launcher"> 19 android:icon="@mipmap/ic_launcher">
19 <activity 20 <activity
20 android:name=".MainActivity" 21 android:name=".MainActivity"
......
...@@ -2,3 +2,4 @@ org.gradle.jvmargs=-Xmx1536M ...@@ -2,3 +2,4 @@ org.gradle.jvmargs=-Xmx1536M
2 android.useAndroidX=true 2 android.useAndroidX=true
3 android.enableJetifier=true 3 android.enableJetifier=true
4 android.enableR8=true 4 android.enableR8=true
5 +org.gradle.jvmargs=-Xmx4608m
...\ No newline at end of file ...\ No newline at end of file
......
1 import 'dart:convert'; 1 import 'dart:convert';
2 +import 'package:Smart_Medicine_Box/src/screens/Register/DoctorRequest.dart';
2 import 'package:flutter/material.dart'; 3 import 'package:flutter/material.dart';
3 import 'package:flutter/services.dart'; 4 import 'package:flutter/services.dart';
4 import 'package:http/http.dart' as http; 5 import 'package:http/http.dart' as http;
5 import 'package:flutter_dotenv/flutter_dotenv.dart'; 6 import 'package:flutter_dotenv/flutter_dotenv.dart';
6 -import '../models/Bottle.dart'; 7 +import 'models/Bottle.dart';
7 -import '../DashBoard.dart'; 8 +import 'DashBoard.dart';
8 -import '../../utils/user_secure_stoarge.dart'; 9 +import '../utils/user_secure_stoarge.dart';
9 10
10 class BottleList extends StatefulWidget { 11 class BottleList extends StatefulWidget {
11 BottleList({Key key}) : super(key: key); 12 BottleList({Key key}) : super(key: key);
...@@ -15,9 +16,12 @@ class BottleList extends StatefulWidget { ...@@ -15,9 +16,12 @@ class BottleList extends StatefulWidget {
15 } 16 }
16 17
17 class _BottleListState extends State<BottleList> { 18 class _BottleListState extends State<BottleList> {
19 + int newalarm = 0;
20 +
18 String valueText; 21 String valueText;
19 List<Bottle> _bottleList = new List<Bottle>(); 22 List<Bottle> _bottleList = new List<Bottle>();
20 TextEditingController _textFieldController = TextEditingController(); 23 TextEditingController _textFieldController = TextEditingController();
24 +
21 Future<String> getBottleList() async { 25 Future<String> getBottleList() async {
22 String hubid = await UserSecureStorage.getHubId(); 26 String hubid = await UserSecureStorage.getHubId();
23 String usertoken = await UserSecureStorage.getUserToken(); 27 String usertoken = await UserSecureStorage.getUserToken();
...@@ -90,7 +94,7 @@ class _BottleListState extends State<BottleList> { ...@@ -90,7 +94,7 @@ class _BottleListState extends State<BottleList> {
90 width: size.width, 94 width: size.width,
91 child: Center( 95 child: Center(
92 child: Text( 96 child: Text(
93 - '등록된 약병 리스트', 97 + 'BOTTLE LIST',
94 textScaleFactor: 1.0, 98 textScaleFactor: 1.0,
95 style: TextStyle( 99 style: TextStyle(
96 fontSize: 28, 100 fontSize: 28,
...@@ -133,13 +137,13 @@ class _BottleListState extends State<BottleList> { ...@@ -133,13 +137,13 @@ class _BottleListState extends State<BottleList> {
133 style: BorderStyle.solid), 137 style: BorderStyle.solid),
134 ), 138 ),
135 ), 139 ),
136 - height: 40, 140 + height: 30,
137 child: Row( 141 child: Row(
138 mainAxisAlignment: 142 mainAxisAlignment:
139 MainAxisAlignment.spaceBetween, 143 MainAxisAlignment.spaceBetween,
140 children: [ 144 children: [
141 Container( 145 Container(
142 - height: 40, 146 + height: 30,
143 child: Center( 147 child: Center(
144 child: Text( 148 child: Text(
145 '${_bottleList[index].bottleId}', 149 '${_bottleList[index].bottleId}',
...@@ -151,35 +155,29 @@ class _BottleListState extends State<BottleList> { ...@@ -151,35 +155,29 @@ class _BottleListState extends State<BottleList> {
151 ), 155 ),
152 ), 156 ),
153 ), 157 ),
154 - Container(
155 - child: IconButton(
156 - alignment: Alignment(0.9, 0),
157 - icon: Icon(
158 - Icons.create_sharp,
159 - color: Colors.black,
160 - ),
161 - onPressed: () {},
162 - ),
163 - ),
164 ], 158 ],
165 ), 159 ),
166 ), 160 ),
167 - SizedBox(height: 10), 161 + SizedBox(height: 5),
168 Container( 162 Container(
169 - height: 90, 163 + height: 70,
170 child: Icon( 164 child: Icon(
171 Icons.medical_services_outlined, 165 Icons.medical_services_outlined,
172 - size: 100, 166 + size: 70,
173 ), 167 ),
174 ) 168 )
175 ], 169 ],
176 ), 170 ),
177 ), 171 ),
178 onTap: () { 172 onTap: () {
179 - UserSecureStorage.setBottleId( 173 + if (_bottleList[index].medicineId == null) {
180 - _bottleList[index].bottleId.toString()); 174 + //약병에 약이 없는 경우
181 - UserSecureStorage.setMedicineId( 175 + } else {
182 - _bottleList[index].medicineId.toString()); 176 + UserSecureStorage.setBottleId(
177 + _bottleList[index].bottleId.toString());
178 + UserSecureStorage.setMedicineId(
179 + _bottleList[index].medicineId.toString());
180 + }
183 Navigator.push( 181 Navigator.push(
184 context, 182 context,
185 MaterialPageRoute( 183 MaterialPageRoute(
...@@ -199,6 +197,53 @@ class _BottleListState extends State<BottleList> { ...@@ -199,6 +197,53 @@ class _BottleListState extends State<BottleList> {
199 } 197 }
200 }, 198 },
201 ), 199 ),
200 + floatingActionButton: Container(
201 + child: FittedBox(
202 + child: Stack(
203 + alignment: Alignment(1.4, -1.5),
204 + children: [
205 + FloatingActionButton(
206 + onPressed: () {
207 + //여기 누르면 넘어가는데 아마 숫자가 있을 경우만 넘어가도록 하기
208 + Navigator.push(
209 + context,
210 + MaterialPageRoute(
211 + builder: (BuildContext context) => DoctorRequest(),
212 + ),
213 + );
214 + },
215 + child: Icon(Icons.email_outlined),
216 + backgroundColor: Colors.blue,
217 + ),
218 + newalarm != 0
219 + ? Container(
220 + // This is your Badge
221 + child: Center(
222 + // child 문을 ? : 를 이용하여 구분하자
223 + child: Text(newalarm.toString(),
224 + style: TextStyle(color: Colors.white)),
225 + ),
226 + padding: EdgeInsets.all(8),
227 + constraints:
228 + BoxConstraints(minHeight: 32, minWidth: 32),
229 + decoration: BoxDecoration(
230 + // This controls the shadow
231 + boxShadow: [
232 + BoxShadow(
233 + spreadRadius: 1,
234 + blurRadius: 5,
235 + color: Colors.black.withAlpha(50))
236 + ],
237 + borderRadius: BorderRadius.circular(16),
238 + color:
239 + Colors.blue, // This would be color of the Badge
240 + ),
241 + )
242 + : new Container()
243 + ],
244 + ),
245 + ),
246 + ),
202 ), 247 ),
203 onWillPop: () { 248 onWillPop: () {
204 SystemNavigator.pop(); 249 SystemNavigator.pop();
......
This diff is collapsed. Click to expand it.
1 +import 'dart:convert';
2 +import 'package:flutter/cupertino.dart';
3 +import 'package:flutter/material.dart';
4 +import 'package:http/http.dart' as http;
5 +import 'package:flutter_dotenv/flutter_dotenv.dart';
6 +import '../../utils/user_secure_stoarge.dart';
7 +
8 +class DoctorRequest extends StatefulWidget {
9 + @override
10 + _DoctorRequestState createState() => _DoctorRequestState();
11 +}
12 +
13 +class _DoctorRequestState extends State<DoctorRequest> {
14 + List<int> _doctorlist = new List<int>();
15 +
16 + Future<String> getDoctorRequestList() async {
17 + String usertoken = await UserSecureStorage.getUserToken();
18 + http.Response response = await http.get(
19 + Uri.encodeFull(DotEnv().env['SERVER_URL'] + 'hub'),
20 + headers: {"authorization": usertoken},
21 + );
22 + List<dynamic> values = new List<dynamic>();
23 + if (_doctorlist.length != 0) {
24 + _doctorlist.clear();
25 + }
26 + if (response.statusCode == 200) {
27 + values = json.decode(response.body);
28 + for (int i = 0; i < values.length; i++) {
29 + _doctorlist.add(values[i]['hubId']);
30 + }
31 + return "get완료";
32 + } else if (response.statusCode == 404) {
33 + return "Not Found";
34 + } else {
35 + return "Error";
36 + }
37 + }
38 +
39 + Widget build(BuildContext context) {
40 + final Size size = MediaQuery.of(context).size;
41 + return Scaffold(
42 + appBar: AppBar(
43 + backgroundColor: Colors.white,
44 + leading: new Icon(Icons.medical_services_rounded,
45 + color: Colors.black, size: 45.0),
46 + title: Text(
47 + 'Smart Medicine Box',
48 + style: TextStyle(
49 + color: Colors.black,
50 + fontSize: 23,
51 + fontFamily: 'Noto',
52 + fontWeight: FontWeight.bold),
53 + ),
54 + ),
55 + body: FutureBuilder(
56 + future: getDoctorRequestList(),
57 + builder: (BuildContext context, AsyncSnapshot snapshot) {
58 + if (snapshot.hasData == false) {
59 + return CircularProgressIndicator();
60 + } else if (snapshot.hasError) {
61 + return Padding(
62 + padding: const EdgeInsets.all(8.0),
63 + child: Text(
64 + 'Error: ${snapshot.error}',
65 + style: TextStyle(fontSize: 15),
66 + ),
67 + );
68 + } else {
69 + return Container(
70 + height: size.height,
71 + child: Column(
72 + mainAxisAlignment: MainAxisAlignment.center,
73 + children: <Widget>[
74 + Container(
75 + height: size.height * 0.1,
76 + width: size.width,
77 + child: Center(
78 + child: Text(
79 + '담당의 등록 요청',
80 + textScaleFactor: 1.0,
81 + style: TextStyle(
82 + fontSize: 24,
83 + fontFamily: 'Noto',
84 + fontWeight: FontWeight.bold),
85 + ),
86 + ),
87 + decoration:
88 + BoxDecoration(border: Border.all(), color: Colors.blue),
89 + ),
90 + SizedBox(height: 30),
91 + Expanded(
92 + child: ListView.separated(
93 + padding: const EdgeInsets.all(30),
94 + itemCount: _doctorlist.length,
95 + itemBuilder: (BuildContext context, int index) {
96 + return Container(
97 + padding: EdgeInsets.all(8.0),
98 + decoration: BoxDecoration(
99 + border: Border.all(),
100 + borderRadius:
101 + BorderRadius.all(Radius.circular(25.0)),
102 + ),
103 + child: ListTile(
104 + title: Text(
105 + 'DoctorID: ' + '${_doctorlist[index]}',
106 + style: TextStyle(
107 + color: Colors.black,
108 + fontSize: 20,
109 + fontFamily: 'Noto',
110 + fontWeight: FontWeight.bold),
111 + ),
112 + trailing: Icon(Icons.check),
113 + onTap: () async {
114 + await showDialog(
115 + context: context,
116 + builder: (BuildContext context) {
117 + return AlertDialog(
118 + title: new Text('담당의 등록'),
119 + content: new Text('담당의 등록이 완료 되었습니다.'),
120 + actions: <Widget>[
121 + new FlatButton(
122 + child: new Text('Close'),
123 + onPressed: () {
124 + Navigator.of(context).pop();
125 + },
126 + ),
127 + ],
128 + );
129 + },
130 + );
131 + Navigator.of(context).pop();
132 + },
133 + ),
134 + );
135 + },
136 + separatorBuilder: (BuildContext contetx, int index) =>
137 + const Divider(),
138 + ),
139 + )
140 + ],
141 + ),
142 + );
143 + }
144 + },
145 + ),
146 + );
147 + }
148 +}
1 -import 'package:Smart_Medicine_Box/src/screens/DashBoard.dart';
2 -import 'package:Smart_Medicine_Box/src/screens/Register/BottleList.dart';
3 import 'package:flutter/cupertino.dart'; 1 import 'package:flutter/cupertino.dart';
4 import 'dart:convert'; 2 import 'dart:convert';
5 import 'package:flutter/material.dart'; 3 import 'package:flutter/material.dart';
...@@ -7,6 +5,7 @@ import 'package:http/http.dart' as http; ...@@ -7,6 +5,7 @@ import 'package:http/http.dart' as http;
7 import 'package:flutter_dotenv/flutter_dotenv.dart'; 5 import 'package:flutter_dotenv/flutter_dotenv.dart';
8 6
9 import 'SearchMedicine.dart'; 7 import 'SearchMedicine.dart';
8 +import '../BottleList.dart';
10 import '../../utils/user_secure_stoarge.dart'; 9 import '../../utils/user_secure_stoarge.dart';
11 10
12 class RegisterBottle extends StatefulWidget { 11 class RegisterBottle extends StatefulWidget {
...@@ -139,7 +138,6 @@ class _RegisterBottleState extends State<RegisterBottle> { ...@@ -139,7 +138,6 @@ class _RegisterBottleState extends State<RegisterBottle> {
139 ); 138 );
140 } else if (saveMessage == "등록 완료" && 139 } else if (saveMessage == "등록 완료" &&
141 widget.modify_bottle == true) { 140 widget.modify_bottle == true) {
142 - print('asdg');
143 await showDialog( 141 await showDialog(
144 context: context, 142 context: context,
145 builder: (BuildContext context) { 143 builder: (BuildContext context) {
......
...@@ -8,6 +8,13 @@ packages: ...@@ -8,6 +8,13 @@ packages:
8 url: "https://pub.dartlang.org" 8 url: "https://pub.dartlang.org"
9 source: hosted 9 source: hosted
10 version: "2.5.0-nullsafety.1" 10 version: "2.5.0-nullsafety.1"
11 + badges:
12 + dependency: "direct main"
13 + description:
14 + name: badges
15 + url: "https://pub.dartlang.org"
16 + source: hosted
17 + version: "1.2.0"
11 boolean_selector: 18 boolean_selector:
12 dependency: transitive 19 dependency: transitive
13 description: 20 description:
...@@ -125,6 +132,13 @@ packages: ...@@ -125,6 +132,13 @@ packages:
125 url: "https://pub.dartlang.org" 132 url: "https://pub.dartlang.org"
126 source: hosted 133 source: hosted
127 version: "1.0.1" 134 version: "1.0.1"
135 + flutter_picker:
136 + dependency: "direct main"
137 + description:
138 + name: flutter_picker
139 + url: "https://pub.dartlang.org"
140 + source: hosted
141 + version: "1.1.5"
128 flutter_screenutil: 142 flutter_screenutil:
129 dependency: "direct main" 143 dependency: "direct main"
130 description: 144 description:
......
...@@ -38,9 +38,12 @@ dependencies: ...@@ -38,9 +38,12 @@ dependencies:
38 http: ^0.12.0+4 38 http: ^0.12.0+4
39 flutter_dotenv: ^2.1.0 39 flutter_dotenv: ^2.1.0
40 numberpicker: ^1.3.0 40 numberpicker: ^1.3.0
41 - flutter_secure_storage: ^3.3.5 41 + flutter_secure_storage: ^3.3.5
42 sqflite: ^1.1.6 42 sqflite: ^1.1.6
43 path_provider: ^1.2.0 43 path_provider: ^1.2.0
44 + badges: ^1.1.1
45 + flutter_picker: ^1.1.5
46 +
44 47
45 dev_dependencies: 48 dev_dependencies:
46 flutter_test: 49 flutter_test:
......