고원빈

temp

<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/frontend.iml" filepath="$PROJECT_DIR$/.idea/frontend.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="147dc7b8-1063-4e12-b6bb-adb3717b8080" name="Default Changelist" comment="" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="ProjectId" id="1wtiCZt9s9osC3izQmO4Etd3c5k" />
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent">
<property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/flutter_application_1" />
<property name="project.structure.last.edited" value="Project" />
<property name="project.structure.proportion" value="0.0" />
<property name="project.structure.side.proportion" value="0.0" />
</component>
<component name="SvnConfiguration">
<configuration />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="147dc7b8-1063-4e12-b6bb-adb3717b8080" name="Default Changelist" comment="" />
<created>1629284158268</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1629284158268</updated>
</task>
<servers />
</component>
<component name="WindowStateProjectService">
<state x="740" y="278" key="FileChooserDialogImpl" timestamp="1629284197342">
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state x="740" y="278" key="FileChooserDialogImpl/-1920.0.1920.1040/0.0.1920.1040@0.0.1920.1040" timestamp="1629284197342" />
<state x="440" y="98" key="SettingsEditor" timestamp="1629284186082">
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state x="440" y="98" key="SettingsEditor/-1920.0.1920.1040/0.0.1920.1040@0.0.1920.1040" timestamp="1629284186082" />
</component>
</project>
\ No newline at end of file
......@@ -15,6 +15,7 @@
<application
android:name="io.flutter.app.FlutterApplication"
android:label="Smart_Medicine_Box"
android:requestLegacyExternalStorage="true"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
......
......@@ -2,3 +2,4 @@ org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
android.enableR8=true
org.gradle.jvmargs=-Xmx4608m
\ No newline at end of file
......
import 'dart:convert';
import 'package:Smart_Medicine_Box/src/screens/Register/DoctorRequest.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:http/http.dart' as http;
import 'package:flutter_dotenv/flutter_dotenv.dart';
import '../models/Bottle.dart';
import '../DashBoard.dart';
import '../../utils/user_secure_stoarge.dart';
import 'models/Bottle.dart';
import 'DashBoard.dart';
import '../utils/user_secure_stoarge.dart';
class BottleList extends StatefulWidget {
BottleList({Key key}) : super(key: key);
......@@ -15,9 +16,12 @@ class BottleList extends StatefulWidget {
}
class _BottleListState extends State<BottleList> {
int newalarm = 0;
String valueText;
List<Bottle> _bottleList = new List<Bottle>();
TextEditingController _textFieldController = TextEditingController();
Future<String> getBottleList() async {
String hubid = await UserSecureStorage.getHubId();
String usertoken = await UserSecureStorage.getUserToken();
......@@ -90,7 +94,7 @@ class _BottleListState extends State<BottleList> {
width: size.width,
child: Center(
child: Text(
'등록된 약병 리스트',
'BOTTLE LIST',
textScaleFactor: 1.0,
style: TextStyle(
fontSize: 28,
......@@ -133,13 +137,13 @@ class _BottleListState extends State<BottleList> {
style: BorderStyle.solid),
),
),
height: 40,
height: 30,
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Container(
height: 40,
height: 30,
child: Center(
child: Text(
'${_bottleList[index].bottleId}',
......@@ -151,35 +155,29 @@ class _BottleListState extends State<BottleList> {
),
),
),
Container(
child: IconButton(
alignment: Alignment(0.9, 0),
icon: Icon(
Icons.create_sharp,
color: Colors.black,
),
onPressed: () {},
),
),
],
),
),
SizedBox(height: 10),
SizedBox(height: 5),
Container(
height: 90,
height: 70,
child: Icon(
Icons.medical_services_outlined,
size: 100,
size: 70,
),
)
],
),
),
onTap: () {
UserSecureStorage.setBottleId(
_bottleList[index].bottleId.toString());
UserSecureStorage.setMedicineId(
_bottleList[index].medicineId.toString());
if (_bottleList[index].medicineId == null) {
//약병에 약이 없는 경우
} else {
UserSecureStorage.setBottleId(
_bottleList[index].bottleId.toString());
UserSecureStorage.setMedicineId(
_bottleList[index].medicineId.toString());
}
Navigator.push(
context,
MaterialPageRoute(
......@@ -199,6 +197,53 @@ class _BottleListState extends State<BottleList> {
}
},
),
floatingActionButton: Container(
child: FittedBox(
child: Stack(
alignment: Alignment(1.4, -1.5),
children: [
FloatingActionButton(
onPressed: () {
//여기 누르면 넘어가는데 아마 숫자가 있을 경우만 넘어가도록 하기
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) => DoctorRequest(),
),
);
},
child: Icon(Icons.email_outlined),
backgroundColor: Colors.blue,
),
newalarm != 0
? Container(
// This is your Badge
child: Center(
// child 문을 ? : 를 이용하여 구분하자
child: Text(newalarm.toString(),
style: TextStyle(color: Colors.white)),
),
padding: EdgeInsets.all(8),
constraints:
BoxConstraints(minHeight: 32, minWidth: 32),
decoration: BoxDecoration(
// This controls the shadow
boxShadow: [
BoxShadow(
spreadRadius: 1,
blurRadius: 5,
color: Colors.black.withAlpha(50))
],
borderRadius: BorderRadius.circular(16),
color:
Colors.blue, // This would be color of the Badge
),
)
: new Container()
],
),
),
),
),
onWillPop: () {
SystemNavigator.pop();
......
This diff is collapsed. Click to expand it.
import 'dart:convert';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;
import 'package:flutter_dotenv/flutter_dotenv.dart';
import '../../utils/user_secure_stoarge.dart';
class DoctorRequest extends StatefulWidget {
@override
_DoctorRequestState createState() => _DoctorRequestState();
}
class _DoctorRequestState extends State<DoctorRequest> {
List<int> _doctorlist = new List<int>();
Future<String> getDoctorRequestList() async {
String usertoken = await UserSecureStorage.getUserToken();
http.Response response = await http.get(
Uri.encodeFull(DotEnv().env['SERVER_URL'] + 'hub'),
headers: {"authorization": usertoken},
);
List<dynamic> values = new List<dynamic>();
if (_doctorlist.length != 0) {
_doctorlist.clear();
}
if (response.statusCode == 200) {
values = json.decode(response.body);
for (int i = 0; i < values.length; i++) {
_doctorlist.add(values[i]['hubId']);
}
return "get완료";
} else if (response.statusCode == 404) {
return "Not Found";
} else {
return "Error";
}
}
Widget build(BuildContext context) {
final Size size = MediaQuery.of(context).size;
return Scaffold(
appBar: AppBar(
backgroundColor: Colors.white,
leading: new Icon(Icons.medical_services_rounded,
color: Colors.black, size: 45.0),
title: Text(
'Smart Medicine Box',
style: TextStyle(
color: Colors.black,
fontSize: 23,
fontFamily: 'Noto',
fontWeight: FontWeight.bold),
),
),
body: FutureBuilder(
future: getDoctorRequestList(),
builder: (BuildContext context, AsyncSnapshot snapshot) {
if (snapshot.hasData == false) {
return CircularProgressIndicator();
} else if (snapshot.hasError) {
return Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
'Error: ${snapshot.error}',
style: TextStyle(fontSize: 15),
),
);
} else {
return Container(
height: size.height,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Container(
height: size.height * 0.1,
width: size.width,
child: Center(
child: Text(
'담당의 등록 요청',
textScaleFactor: 1.0,
style: TextStyle(
fontSize: 24,
fontFamily: 'Noto',
fontWeight: FontWeight.bold),
),
),
decoration:
BoxDecoration(border: Border.all(), color: Colors.blue),
),
SizedBox(height: 30),
Expanded(
child: ListView.separated(
padding: const EdgeInsets.all(30),
itemCount: _doctorlist.length,
itemBuilder: (BuildContext context, int index) {
return Container(
padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
border: Border.all(),
borderRadius:
BorderRadius.all(Radius.circular(25.0)),
),
child: ListTile(
title: Text(
'DoctorID: ' + '${_doctorlist[index]}',
style: TextStyle(
color: Colors.black,
fontSize: 20,
fontFamily: 'Noto',
fontWeight: FontWeight.bold),
),
trailing: Icon(Icons.check),
onTap: () async {
await showDialog(
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: new Text('담당의 등록'),
content: new Text('담당의 등록이 완료 되었습니다.'),
actions: <Widget>[
new FlatButton(
child: new Text('Close'),
onPressed: () {
Navigator.of(context).pop();
},
),
],
);
},
);
Navigator.of(context).pop();
},
),
);
},
separatorBuilder: (BuildContext contetx, int index) =>
const Divider(),
),
)
],
),
);
}
},
),
);
}
}
import 'package:Smart_Medicine_Box/src/screens/DashBoard.dart';
import 'package:Smart_Medicine_Box/src/screens/Register/BottleList.dart';
import 'package:flutter/cupertino.dart';
import 'dart:convert';
import 'package:flutter/material.dart';
......@@ -7,6 +5,7 @@ import 'package:http/http.dart' as http;
import 'package:flutter_dotenv/flutter_dotenv.dart';
import 'SearchMedicine.dart';
import '../BottleList.dart';
import '../../utils/user_secure_stoarge.dart';
class RegisterBottle extends StatefulWidget {
......@@ -139,7 +138,6 @@ class _RegisterBottleState extends State<RegisterBottle> {
);
} else if (saveMessage == "등록 완료" &&
widget.modify_bottle == true) {
print('asdg');
await showDialog(
context: context,
builder: (BuildContext context) {
......
......@@ -8,6 +8,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.5.0-nullsafety.1"
badges:
dependency: "direct main"
description:
name: badges
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
boolean_selector:
dependency: transitive
description:
......@@ -125,6 +132,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.1"
flutter_picker:
dependency: "direct main"
description:
name: flutter_picker
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.5"
flutter_screenutil:
dependency: "direct main"
description:
......
......@@ -38,9 +38,12 @@ dependencies:
http: ^0.12.0+4
flutter_dotenv: ^2.1.0
numberpicker: ^1.3.0
flutter_secure_storage: ^3.3.5
flutter_secure_storage: ^3.3.5
sqflite: ^1.1.6
path_provider: ^1.2.0
badges: ^1.1.1
flutter_picker: ^1.1.5
dev_dependencies:
flutter_test:
......