Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2021-1-capstone-design1
/
RIT_Project1
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
1
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
고원빈
2021-05-24 23:54:13 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
be50621b661c651a63a7a28a9d4b807067dc7e98
be50621b
1 parent
d290ec8c
[frontend] DashBoard 1차 작업 완료
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
76 additions
and
20 deletions
frontend/README.md
frontend/flutter_application_1/lib/src/screens/DashBoard.dart
frontend/flutter_application_1/lib/src/screens/Register/BottleList.dart
frontend/flutter_application_1/lib/src/screens/Register/DetailMedicine.dart
frontend/flutter_application_1/lib/src/screens/Register/HubList.dart
frontend/flutter_application_1/lib/src/screens/Register/RegisterBottle.dart
frontend/flutter_application_1/lib/src/screens/Register/SearchMedicine.dart
frontend/flutter_application_1/lib/src/screens/Register/SignUpLocal.dart
frontend/flutter_application_1/pubspec.lock
frontend/flutter_application_1/pubspec.yaml
frontend/README.md
View file @
be50621
...
...
@@ -70,7 +70,15 @@ appbar 관련 디자인은 추후 구현 예정
### 2021-05-22
+
약병 검색 기능 구현 중
### 2021-0523
### 2021-05
-
23
+
로그인 하여 메인페이지 과정 구현 완료
+
폴더 정리
### 2021-05-24
회원 가입 --> 허브 등록 --> 약병 등록 -->로그인 페이지로
로그인 --> 허브 리스트 --> 약병 리스트 --> 메인 페이지
+
시나리오 수정 완료
+
메인 페이지 데이터 출력 완료
...
...
frontend/flutter_application_1/lib/src/screens/DashBoard.dart
View file @
be50621
This diff is collapsed. Click to expand it.
frontend/flutter_application_1/lib/src/screens/Register/BottleList.dart
View file @
be50621
...
...
@@ -5,18 +5,46 @@ import 'package:http/http.dart' as http;
import
'package:flutter_dotenv/flutter_dotenv.dart'
;
import
'../models/Bottle.dart'
;
import
'../DashBoard.dart'
;
import
'../models/Medicine.dart'
;
class
BottleList
extends
StatefulWidget
{
List
<
Bottle
>
bottlelist
;
BottleList
({
Key
key
,
this
.
bottlelist
})
:
super
(
key:
key
);
String
hubid
;
BottleList
({
Key
key
,
this
.
bottlelist
,
this
.
hubid
})
:
super
(
key:
key
);
@override
_BottleListState
createState
()
=>
_BottleListState
();
}
class
_BottleListState
extends
State
<
BottleList
>
{
Bottle
_bottleinformation
=
new
Bottle
();
Medicine
_medicineinformation
=
new
Medicine
();
Future
<
Bottle
>
getbottle
(
int
index
)
async
{
http
.
Response
response
=
await
http
.
get
(
Uri
.
encodeFull
(
DotEnv
().
env
[
'SERVER_URL'
]
+
'bottle/'
+
widget
.
bottlelist
[
index
].
bottleId
.
toString
()));
if
(
response
.
statusCode
==
200
)
{
Map
<
String
,
dynamic
>
jsonData
=
jsonDecode
(
response
.
body
);
print
(
jsonData
);
_bottleinformation
=
Bottle
.
fromJson
(
jsonData
);
}
}
Future
<
Bottle
>
getmedicine
(
int
index
)
async
{
http
.
Response
medicineresponse
=
await
http
.
get
(
Uri
.
encodeFull
(
DotEnv
().
env
[
'SERVER_URL'
]
+
'medicine/'
+
widget
.
bottlelist
[
index
].
medicineId
.
toString
()));
if
(
medicineresponse
.
statusCode
==
200
)
{
Map
<
String
,
dynamic
>
data
=
jsonDecode
(
medicineresponse
.
body
);
_medicineinformation
=
Medicine
.
fromJson
(
data
);
}
}
Widget
build
(
BuildContext
context
)
{
print
(
widget
.
bottlelist
);
final
Size
size
=
MediaQuery
.
of
(
context
).
size
;
return
Scaffold
(
body:
Container
(
...
...
@@ -62,13 +90,19 @@ class _BottleListState extends State<BottleList> {
fontWeight:
FontWeight
.
bold
),
),
trailing:
Icon
(
Icons
.
arrow_forward
),
onTap:
()
{
onTap:
()
async
{
getbottle
(
index
);
getmedicine
(
index
);
print
(
_bottleinformation
);
print
(
_medicineinformation
);
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
BuildContext
context
)
=>
DashBoard
(
pageNumber:
1
,
bottleID:
widget
.
bottlelist
[
index
].
bottleId
,
bottleInformation:
_bottleinformation
,
medicineInformation:
_medicineinformation
,
),
));
}),
...
...
frontend/flutter_application_1/lib/src/screens/Register/DetailMedicine.dart
View file @
be50621
import
'package:Smart_Medicine_Box/src/screens/DashBoard.dart'
;
import
'package:Smart_Medicine_Box/src/screens/Homepage.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/cupertino.dart'
;
import
'dart:convert'
;
...
...
@@ -28,7 +29,6 @@ class _DetailMedicineState extends State<DetailMedicine> {
'dosage'
:
medicineDosageController
.
text
}));
print
(
response
.
statusCode
);
if
(
response
.
statusCode
==
200
)
{
return
"Complete"
;
}
else
if
(
response
.
statusCode
==
404
)
{
...
...
@@ -210,11 +210,9 @@ class _DetailMedicineState extends State<DetailMedicine> {
context
,
MaterialPageRoute
(
builder:
(
BuildContext
context
)
=>
DashBoard
(
pageNumber:
1
,
bottleID:
int
.
parse
(
widget
.
bottleId
),
)));
HomePage
(),
),
);
})
],
);
...
...
frontend/flutter_application_1/lib/src/screens/Register/HubList.dart
View file @
be50621
...
...
@@ -95,7 +95,8 @@ class _HubListState extends State<HubList> {
builder:
(
BuildContext
context
)
=>
BottleList
(
bottlelist:
_bottleList
,
),
hubid:
widget
.
hublist
[
index
]
.
toString
()),
));
}
else
if
(
result
==
"Not Found"
)
{
showDialog
(
...
...
frontend/flutter_application_1/lib/src/screens/Register/RegisterBottle.dart
View file @
be50621
...
...
@@ -117,11 +117,12 @@ class _RegisterBottleState extends State<RegisterBottle> {
MaterialPageRoute
(
builder:
(
BuildContext
context
)
=>
SearchMedicine
(
bottleId:
medicineBottleIDController
.
text
,
)));
})
bottleId:
medicineBottleIDController
.
text
,
),
),
);
},
),
],
);
});
...
...
frontend/flutter_application_1/lib/src/screens/Register/SearchMedicine.dart
View file @
be50621
...
...
@@ -8,7 +8,6 @@ import 'DetailMedicine.dart';
class
SearchMedicine
extends
StatefulWidget
{
String
bottleId
;
SearchMedicine
({
Key
key
,
this
.
bottleId
})
:
super
(
key:
key
);
@override
_SearchMedicineState
createState
()
=>
_SearchMedicineState
();
...
...
frontend/flutter_application_1/lib/src/screens/Register/SignUpLocal.dart
View file @
be50621
...
...
@@ -3,7 +3,7 @@ import 'package:flutter/material.dart';
import
'package:http/http.dart'
as
http
;
import
'package:flutter_dotenv/flutter_dotenv.dart'
;
import
'
../Homepage
.dart'
;
import
'
RegsiterHub
.dart'
;
class
SignUpLocal
extends
StatefulWidget
{
@override
...
...
@@ -182,7 +182,7 @@ class _SignUpLocalState extends State<SignUpLocal> {
context
,
MaterialPageRoute
(
builder:
(
BuildContext
context
)
=>
HomePage
()));
RegisterHub
()));
})
],
);
...
...
frontend/flutter_application_1/pubspec.lock
View file @
be50621
...
...
@@ -156,6 +156,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "3.1.4"
infinite_listview:
dependency: transitive
description:
name: infinite_listview
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.1+1"
intl:
dependency: "direct main"
description:
...
...
@@ -198,6 +205,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.9.7"
numberpicker:
dependency: "direct main"
description:
name: numberpicker
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0"
page_transition:
dependency: "direct main"
description:
...
...
frontend/flutter_application_1/pubspec.yaml
View file @
be50621
...
...
@@ -37,6 +37,7 @@ dependencies:
cupertino_icons
:
^0.1.3
http
:
^0.12.0+4
flutter_dotenv
:
^2.1.0
numberpicker
:
^1.3.0
dev_dependencies
:
flutter_test
:
...
...
Please
register
or
login
to post a comment