고원빈

Merge branch 'frontend'

Showing 102 changed files with 6933 additions and 0 deletions
{
// IntelliSense를 사용하여 가능한 특성에 대해 알아보세요.
// 기존 특성에 대한 설명을 보려면 가리킵니다.
// 자세한 내용을 보려면 https://go.microsoft.com/fwlink/?linkid=830387을(를) 방문하세요.
"version": "0.2.0",
"configurations": [
{
"name": "flutter_application_1",
"cwd": "frontend\\flutter_application_1",
"request": "launch",
"type": "dart"
}
]
}
\ No newline at end of file
{
"dart.previewFlutterUiGuides": true
}
\ No newline at end of file
# 스마트 약병 IoT FRONTEND 개발
## 지도교수
+ 유인태 교수님
## 팀원
+ 2016104102 컴퓨터공학과 고원빈
## 일정
+ 2021-04-27 : Flutter 앱 생성 및 개발 환경 설정
+ 2021-04-27 : 시작화면 router 생성
### 2021-04-28
+ flutter version 변경 작업
### 2021-04-29
+ Main 화면 작업 완료
![로그인_화면](/uploads/d12f35739c9263e37009cc9b3bbe06d4/로그인_화면.PNG)
+ 로그인 페이지 작업 완료
![222](/uploads/8cc867cd159e28c04ff2a09e3a42c2d6/222.PNG)
### 2021-05-09
+ Appbar 기능 구현
appbar 관련 디자인은 추후 구현 예정
### 2021-05-10
+ Appbar 디자인 변경 및 Navgation Bar 구현
+ Setting은 별도의 페이지로 구성
### 2021-05-11
+ Inside Information 화면 구성
<img src = "https://user-images.githubusercontent.com/56704722/117849827-aadc6400-b2bf-11eb-8cdb-2c7f37833d01.png" width="400">
+ Outside Information 화면 구성
<img src ="https://user-images.githubusercontent.com/56704722/117849959-cd6e7d00-b2bf-11eb-86b7-bc97356c7665.png" width="400">
+ Setting Page 화면 구성
<img src = "https://user-images.githubusercontent.com/56704722/117850038-e24b1080-b2bf-11eb-8dcd-5cb96a9056e0.png" width="400">
### 2021-05-13
+ flutter notification 추가 알람 설정 완료
+ datetime picker widget을 이용하여 시간 선택 구현 예정
+ 알람 설정을 위한 Android Mainfest 설정 , 사용자 권한 요구
### 2021-05-14
+ datetime picker 를 이용하여 알람 설정 완료
+ 현재 알람 페이지와 알람 수정 페이지가 같은 곳에 위치 이에 따라 보이는 데이터만 존재하고 수정 여부를 묻는 것을 만들지 고민중
### 2021-05-15
+ 회원 정보 수정 Page 구현
+ API 연동 중에 추가로 개발 예정
+ build용 파일 구현
### 2021-05-17
+ server test 완료
### 2021-05-18
+ 회원 가입 SERVER 연동
### 2021-05-19
+ Login 연동
+ 약병 등록 ,허브 등록 구현
### 2021-05-20
+ 시나리오 수정
### 2021-05-21
+ 약병 ,허브 리스트 출력 구현
### 2021-05-22
+ 약병 검색 기능 구현 중
### 2021-05-23
+ 로그인 하여 메인페이지 과정 구현 완료
+ 폴더 정리
### 2021-05-24
회원 가입 --> 허브 등록 --> 약병 등록 -->로그인 페이지로
로그인 --> 허브 리스트 --> 약병 리스트 --> 메인 페이지
+ 시나리오 수정 완료
+ 메인 페이지 데이터 출력 완료
### 2021-05-25
+ 로그인 권한 문제 해결
### 2021-05-26
+ future buillder 변경
### 2021-05-27
+ app 뒤로가기 설정 변경
### 2021-05-29
+ 약병 리스트 ui 변경
+ DashBoard 새로고침
### 2021-05-30
+ Sqlite 생성
### 2021-06-01
+ datetime 형식 한국 시간으로 변경
### 2021-06-02
+ 약병 , 허브 추가 제거 관리 페이지 구현
SERVER_URL=http://192.168.0.3:4717/api/
\ No newline at end of file
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
# IntelliJ related
*.iml
*.ipr
*.iws
.idea/
# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/
# Flutter/Dart/Pub related
**/doc/api/
**/ios/Flutter/.last_build_id
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.packages
.pub-cache/
.pub/
/build/
# Web related
lib/generated_plugin_registrant.dart
# Symbolication related
app.*.symbols
# Obfuscation related
app.*.map.json
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.
version:
revision: 9b2d32b605630f28625709ebd9d78ab3016b2bf6
channel: stable
project_type: app
# flutter_application_1
A new Flutter project.
## Getting Started
This project is a starting point for a Flutter application.
A few resources to get you started if this is your first Flutter project:
- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab)
- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook)
For help getting started with Flutter, view our
[online documentation](https://flutter.dev/docs), which offers tutorials,
samples, guidance on mobile development, and a full API reference.
gradle-wrapper.jar
/.gradle
/captures/
/gradlew
/gradlew.bat
/local.properties
GeneratedPluginRegistrant.java
# Remember to never publicly share your keystore.
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
key.properties
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion 29
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
lintOptions {
disable 'InvalidPackage'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.Smart_Medicine_Box"
minSdkVersion 19
targetSdkVersion 29
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
}
flutter {
source '../..'
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.flutter_application_1">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.flutter_application_1">
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<application
android:name="io.flutter.app.FlutterApplication"
android:label="Smart_Medicine_Box"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
<!-- Displays an Android View that continues showing the launch screen
Drawable until Flutter paints its first frame, then this splash
screen fades out. A splash screen is useful to avoid any visual
gap between the end of Android's launch screen and the painting of
Flutter's first frame. -->
<meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="@drawable/launch_background"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<receiver android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationBootReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
<action android:name="android.intent.action.MY_PACKAGE_REPLACED"/>
</intent-filter>
</receiver>
<receiver android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationReceiver" />
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
</manifest>
package com.example.flutter_application_1
import io.flutter.embedding.android.FlutterActivity
class MainActivity: FlutterActivity() {
}
<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@android:color/white" />
<!-- You can insert your own image assets here -->
<!-- <item>
<bitmap
android:gravity="center"
android:src="@mipmap/launch_image" />
</item> -->
</layer-list>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Theme applied to the Android Window while the process is starting -->
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
<!-- Show a splash screen on the activity. Automatically removed when
Flutter draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your
Flutter UI initializes, as well as behind your Flutter UI while its
running.
This Theme is only used starting with V2 of Flutter's Android embedding. -->
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
<item name="android:windowBackground">@android:color/white</item>
</style>
</resources>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.flutter_application_1">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>
buildscript {
ext.kotlin_version = '1.3.50'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
google()
jcenter()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
}
org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
android.enableR8=true
#Fri Jun 23 08:50:38 CEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
include ':app'
def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
def properties = new Properties()
assert localPropertiesFile.exists()
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
*.mode1v3
*.mode2v3
*.moved-aside
*.pbxuser
*.perspectivev3
**/*sync/
.sconsign.dblite
.tags*
**/.vagrant/
**/DerivedData/
Icon?
**/Pods/
**/.symlinks/
profile
xcuserdata
**/.generated/
Flutter/App.framework
Flutter/Flutter.framework
Flutter/Flutter.podspec
Flutter/Generated.xcconfig
Flutter/app.flx
Flutter/app.zip
Flutter/flutter_assets/
Flutter/flutter_export_environment.sh
ServiceDefinitions.json
Runner/GeneratedPluginRegistrant.*
# Exceptions to above rules.
!default.mode1v3
!default.mode2v3
!default.pbxuser
!default.perspectivev3
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>App</string>
<key>CFBundleIdentifier</key>
<string>io.flutter.flutter.app</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>App</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>8.0</string>
</dict>
</plist>
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
9705A1C41CF9048500538489 /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
97C146EB1CF9000F007C117D /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
9740EEB11CF90186004384FC /* Flutter */ = {
isa = PBXGroup;
children = (
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
9740EEB21CF90195004384FC /* Debug.xcconfig */,
7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
9740EEB31CF90195004384FC /* Generated.xcconfig */,
);
name = Flutter;
sourceTree = "<group>";
};
97C146E51CF9000F007C117D = {
isa = PBXGroup;
children = (
9740EEB11CF90186004384FC /* Flutter */,
97C146F01CF9000F007C117D /* Runner */,
97C146EF1CF9000F007C117D /* Products */,
);
sourceTree = "<group>";
};
97C146EF1CF9000F007C117D /* Products */ = {
isa = PBXGroup;
children = (
97C146EE1CF9000F007C117D /* Runner.app */,
);
name = Products;
sourceTree = "<group>";
};
97C146F01CF9000F007C117D /* Runner */ = {
isa = PBXGroup;
children = (
97C146FA1CF9000F007C117D /* Main.storyboard */,
97C146FD1CF9000F007C117D /* Assets.xcassets */,
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
97C147021CF9000F007C117D /* Info.plist */,
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
74858FAE1ED2DC5600515810 /* AppDelegate.swift */,
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */,
);
path = Runner;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
97C146ED1CF9000F007C117D /* Runner */ = {
isa = PBXNativeTarget;
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
buildPhases = (
9740EEB61CF901F6004384FC /* Run Script */,
97C146EA1CF9000F007C117D /* Sources */,
97C146EB1CF9000F007C117D /* Frameworks */,
97C146EC1CF9000F007C117D /* Resources */,
9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
);
buildRules = (
);
dependencies = (
);
name = Runner;
productName = Runner;
productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1020;
ORGANIZATIONNAME = "";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
CreatedOnToolsVersion = 7.3.1;
LastSwiftMigration = 1100;
};
};
};
buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
compatibilityVersion = "Xcode 9.3";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 97C146E51CF9000F007C117D;
productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
97C146ED1CF9000F007C117D /* Runner */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
97C146EC1CF9000F007C117D /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Thin Binary";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
};
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Run Script";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
97C146EA1CF9000F007C117D /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */,
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
97C146FA1CF9000F007C117D /* Main.storyboard */ = {
isa = PBXVariantGroup;
children = (
97C146FB1CF9000F007C117D /* Base */,
);
name = Main.storyboard;
sourceTree = "<group>";
};
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
97C147001CF9000F007C117D /* Base */,
);
name = LaunchScreen.storyboard;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
249021D3217E4FDB00AE95B9 /* Profile */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
name = Profile;
};
249021D4217E4FDB00AE95B9 /* Profile */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterApplication1;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
};
name = Profile;
};
97C147031CF9000F007C117D /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
97C147041CF9000F007C117D /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
97C147061CF9000F007C117D /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterApplication1;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
};
name = Debug;
};
97C147071CF9000F007C117D /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterApplication1;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = {
isa = XCConfigurationList;
buildConfigurations = (
97C147031CF9000F007C117D /* Debug */,
97C147041CF9000F007C117D /* Release */,
249021D3217E4FDB00AE95B9 /* Profile */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = {
isa = XCConfigurationList;
buildConfigurations = (
97C147061CF9000F007C117D /* Debug */,
97C147071CF9000F007C117D /* Release */,
249021D4217E4FDB00AE95B9 /* Profile */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 97C146E61CF9000F007C117D /* Project object */;
}
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:Runner.xcodeproj">
</FileRef>
</Workspace>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PreviewsEnabled</key>
<false/>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Profile"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:Runner.xcodeproj">
</FileRef>
</Workspace>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PreviewsEnabled</key>
<false/>
</dict>
</plist>
import UIKit
import Flutter
@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
GeneratedPluginRegistrant.register(with: self)
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
}
{
"images" : [
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "Icon-App-20x20@2x.png",
"scale" : "2x"
},
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "Icon-App-20x20@3x.png",
"scale" : "3x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-App-29x29@1x.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-App-29x29@2x.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-App-29x29@3x.png",
"scale" : "3x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Icon-App-40x40@2x.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Icon-App-40x40@3x.png",
"scale" : "3x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "Icon-App-60x60@2x.png",
"scale" : "2x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "Icon-App-60x60@3x.png",
"scale" : "3x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "Icon-App-20x20@1x.png",
"scale" : "1x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "Icon-App-20x20@2x.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "Icon-App-29x29@1x.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "Icon-App-29x29@2x.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Icon-App-40x40@1x.png",
"scale" : "1x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Icon-App-40x40@2x.png",
"scale" : "2x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "Icon-App-76x76@1x.png",
"scale" : "1x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "Icon-App-76x76@2x.png",
"scale" : "2x"
},
{
"size" : "83.5x83.5",
"idiom" : "ipad",
"filename" : "Icon-App-83.5x83.5@2x.png",
"scale" : "2x"
},
{
"size" : "1024x1024",
"idiom" : "ios-marketing",
"filename" : "Icon-App-1024x1024@1x.png",
"scale" : "1x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
{
"images" : [
{
"idiom" : "universal",
"filename" : "LaunchImage.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "LaunchImage@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "LaunchImage@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
# Launch Screen Assets
You can customize the launch screen with your own desired assets by replacing the image files in this directory.
You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12121" systemVersion="16G29" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="Ydg-fD-yQy"/>
<viewControllerLayoutGuide type="bottom" id="xbc-2k-c8Z"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" image="LaunchImage" translatesAutoresizingMaskIntoConstraints="NO" id="YRO-k0-Ey4">
</imageView>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="YRO-k0-Ey4" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="1a2-6s-vTC"/>
<constraint firstItem="YRO-k0-Ey4" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" id="4X2-HB-R7a"/>
</constraints>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
<resources>
<image name="LaunchImage" width="168" height="185"/>
</resources>
</document>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
</dependencies>
<scenes>
<!--Flutter View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="FlutterViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
</scene>
</scenes>
</document>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>flutter_application_1</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>$(FLUTTER_BUILD_NAME)</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(FLUTTER_BUILD_NUMBER)</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
</dict>
</plist>
import 'package:flutter/material.dart';
import './src/screens/Homepage.dart';
import 'package:flutter_dotenv/flutter_dotenv.dart';
Future main() async {
await DotEnv().load('.env');
runApp(MyApp());
}
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'SMART MEDICINE BOX',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: HomePage(),
);
}
}
import 'package:flutter/material.dart';
import 'dart:convert';
import 'package:http/http.dart' as http;
import 'package:flutter_dotenv/flutter_dotenv.dart';
import 'package:intl/intl.dart';
import '../utils/user_secure_stoarge.dart';
import 'models/Bottle.dart';
import 'models/Medicine.dart';
import 'package:Smart_Medicine_Box/src/screens/SettingPage.dart';
import 'Register/BottleList.dart';
import 'Register/SearchMedicine.dart';
import 'package:intl/date_symbol_data_local.dart';
class DashBoard extends StatefulWidget {
int pageNumber;
DashBoard({
Key key,
this.pageNumber,
}) : super(key: key);
@override
_DashBoardState createState() => _DashBoardState();
}
class _DashBoardState extends State<DashBoard> {
int _selectedIndex = 0;
List<Bottle> _bottleList = new List<Bottle>();
//Get BottleList
Future<String> getBottleList() async {
String usertoken = await UserSecureStorage.getUserToken();
String hubid = await UserSecureStorage.getHubId();
http.Response response = await http.get(
Uri.encodeFull(DotEnv().env['SERVER_URL'] + 'bottle/hub/' + hubid),
headers: {"authorization": usertoken},
);
if (_bottleList.length != 0) {
_bottleList.clear();
}
if (response.statusCode == 200) {
List<dynamic> values = new List<dynamic>();
values = json.decode(response.body);
for (int i = 0; i < values.length; i++) {
Map<String, dynamic> map = values[i];
_bottleList.add(Bottle.fromJson(map));
return "GET";
}
} else if (response.statusCode == 404) {
return "Not Found";
} else {
return "Error";
}
return "Error";
}
Widget build(BuildContext context) {
_selectedIndex = widget.pageNumber;
var _tabs = [
ineerInformationpage(context),
mainpage(context),
outerInformationpage(context),
];
return WillPopScope(
child: Scaffold(
backgroundColor: Color(0xffe5f4ff),
appBar: AppBar(
iconTheme: IconThemeData(color: Colors.black),
backgroundColor: Colors.white,
title: Text(
'Smart Medicine Box',
style: TextStyle(
color: Colors.black,
fontSize: 20,
fontFamily: 'Noto',
fontWeight: FontWeight.bold),
),
actions: [
IconButton(
icon: Icon(
Icons.settings,
color: Colors.black,
),
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) => SettingPage(),
));
},
)
],
),
drawer: Drawer(
child: ListView(
children: [
DrawerHeader(
child: Text('Drawer Header'),
decoration: BoxDecoration(
color: Colors.blue,
),
),
],
),
),
body: _tabs[_selectedIndex],
floatingActionButton: FloatingActionButton(
onPressed: () {
setState(() {});
},
child: const Icon(Icons.refresh_outlined),
backgroundColor: Colors.blue,
),
bottomNavigationBar: BottomNavigationBar(
type: BottomNavigationBarType.fixed,
backgroundColor: Colors.grey,
selectedItemColor: Colors.blue,
unselectedItemColor: Colors.white.withOpacity(.60),
selectedFontSize: 14,
unselectedFontSize: 14,
currentIndex: _selectedIndex,
onTap: (int index) => {
setState(() {
_onItemTapped(index);
})
},
items: [
BottomNavigationBarItem(
icon: Icon(Icons.device_thermostat), label: 'In'),
BottomNavigationBarItem(icon: Icon(Icons.home), label: 'Home'),
BottomNavigationBarItem(
label: 'Out',
icon: Icon(Icons.access_time),
)
],
),
),
onWillPop: () async {
await getBottleList();
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) => BottleList(),
));
},
);
}
void _onItemTapped(int index) {
setState(() {
widget.pageNumber = index;
});
}
}
Widget mainpage(BuildContext context) {
Medicine _medicineInformation = new Medicine();
Future<Medicine> _getmedicine() async {
String usertoken = await UserSecureStorage.getUserToken();
String medicineid = await UserSecureStorage.getMedicineId();
http.Response medicineresponse = await http.get(
Uri.encodeFull(
DotEnv().env['SERVER_URL'] + 'medicine/' + medicineid.toString()),
headers: {"authorization": usertoken},
);
if (medicineresponse.statusCode == 200) {
Map<String, dynamic> data = jsonDecode(medicineresponse.body);
_medicineInformation = Medicine.fromJson(data);
}
return _medicineInformation;
}
final Size size = MediaQuery.of(context).size;
return Scaffold(
backgroundColor: Colors.white,
body: SingleChildScrollView(
child: FutureBuilder(
future: _getmedicine(),
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(
margin: EdgeInsets.fromLTRB(0, 30, 0, 0),
padding: EdgeInsets.fromLTRB(5, 0, 5, 5),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
SizedBox(height: 20),
Container(
width: size.width,
padding: EdgeInsets.fromLTRB(5, 0, 5, 5),
margin: EdgeInsets.all(15),
decoration: BoxDecoration(
border: Border.all(),
borderRadius: BorderRadius.all(Radius.circular(
25.0) // <--- border radius here
),
),
child: Column(
children: [
SizedBox(height: 30),
Container(
child: Center(
child: Text(
'${snapshot.data.name}' == null
? '-'
: '${snapshot.data.name}',
style: TextStyle(
color: Colors.black,
fontSize: 24,
fontFamily: 'NotoSansKR',
fontWeight: FontWeight.w700)),
),
),
SizedBox(height: 30),
Container(
width: size.width,
alignment: Alignment(0.9, 0),
child: Wrap(
children: [
Text(
'제조사: ',
style: TextStyle(
color: Colors.grey,
fontSize: 14,
),
),
Text(
_medicineInformation.company == null
? '-'
: _medicineInformation.company,
style: TextStyle(
color: Colors.grey,
fontSize: 14,
),
),
],
),
),
SizedBox(height: 30),
Container(
width: size.width,
padding: EdgeInsets.fromLTRB(5, 0, 5, 0),
alignment: Alignment(-1, 0),
child: Wrap(
children: [
Text(
'타겟 층 : ',
style: TextStyle(
color: Colors.grey,
fontSize: 14,
),
),
Text(
_medicineInformation.target == null
? '-'
: _medicineInformation.target,
style: TextStyle(
color: Colors.grey,
fontSize: 14,
),
),
],
),
),
SizedBox(height: 15),
Container(
width: size.width,
padding: EdgeInsets.fromLTRB(5, 0, 5, 0),
alignment: Alignment(-1, 0),
child: Wrap(
children: [
Text(
'복약 정보 : ',
style: TextStyle(
color: Colors.grey,
fontSize: 14,
),
),
Text(
_medicineInformation.dosage == null
? '-'
: _medicineInformation.dosage,
style: TextStyle(
color: Colors.grey,
fontSize: 14,
),
),
],
),
),
SizedBox(height: 10),
Container(
width: size.width,
padding: EdgeInsets.fromLTRB(5, 10, 5, 10),
alignment: Alignment(-1, 0),
child: Column(
children: [
SizedBox(
height: 12,
),
Container(
width: size.width,
child: Text(
'경고',
style: TextStyle(
color: Colors.redAccent, fontSize: 14),
),
),
SizedBox(height: 12),
Container(
width: size.width,
child: Text(
_medicineInformation.warn == null
? '-'
: _medicineInformation.warn,
style: TextStyle(
color: Colors.redAccent, fontSize: 14),
),
),
],
),
),
],
),
),
GestureDetector(
child: Container(
width: size.width * 0.8,
height: 46,
margin: EdgeInsets.only(bottom: 0),
child: FlatButton(
padding: EdgeInsets.fromLTRB(0, 5, 0, 5),
onPressed: () async {
String bottleid =
await UserSecureStorage.getBottleId();
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) => SearchMedicine(
bottleId: bottleid,
),
),
);
},
child: Text(
'약 검색',
textScaleFactor: 1.0,
style: TextStyle(
color: Colors.white,
fontSize: 16,
fontFamily: 'Noto',
fontWeight: FontWeight.bold),
),
color: Color(0xff1674f6),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(50)),
),
),
),
],
),
);
}
},
),
),
);
}
Widget ineerInformationpage(BuildContext context) {
//get bottle
Future<Bottle> _getbottle() async {
String usertoken = await UserSecureStorage.getUserToken();
String bottleid = await UserSecureStorage.getBottleId();
Bottle _bottleinformation = new Bottle();
http.Response response = await http.get(
Uri.encodeFull(DotEnv().env['SERVER_URL'] + 'bottle/' + bottleid),
headers: {"authorization": usertoken});
if (response.statusCode == 200) {
Map<String, dynamic> jsonData = jsonDecode(response.body);
_bottleinformation = Bottle.fromJson(jsonData);
}
return _bottleinformation;
}
final Size size = MediaQuery.of(context).size;
return Scaffold(
backgroundColor: Colors.white,
body: FutureBuilder(
future: _getbottle(),
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 * 0.9,
margin: EdgeInsets.fromLTRB(0, 30, 0, 0),
padding: EdgeInsets.fromLTRB(5, 0, 5, 5),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Container(
padding: EdgeInsets.fromLTRB(5, 5, 5, 5),
height: size.height * 0.08,
width: size.width,
child: Center(
child: Text(
'Inside Information',
textAlign: TextAlign.center,
textScaleFactor: 1.0,
style: TextStyle(
color: Colors.black,
fontSize: 32,
fontFamily: 'NotoSansKR',
fontWeight: FontWeight.w700),
),
),
),
Container(
padding: EdgeInsets.fromLTRB(5, 0, 5, 5),
margin: EdgeInsets.fromLTRB(0, 10, 0, 0),
height: size.height * 0.25,
width: size.width,
child: Column(
children: <Widget>[
Flexible(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Container(
width: size.width * 0.43,
height: size.width * 0.45,
margin: const EdgeInsets.all(5.0),
padding: const EdgeInsets.fromLTRB(10, 5, 10, 10),
decoration: BoxDecoration(
color: Color(0xff8E97FD),
borderRadius: BorderRadius.circular(10.0),
),
child: Column(
children: [
Container(
width: size.width,
height: size.height * 0.05,
child: Center(
child: Text(
'약병 내부 온도',
textAlign: TextAlign.center,
textScaleFactor: 1.0,
style: TextStyle(
color: Colors.white,
fontSize: 24,
fontFamily: 'NotoSansKR',
fontWeight: FontWeight.w800),
),
),
),
Container(
width: size.width,
height: size.height * 0.145,
child: Center(
child: Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: [
Text(
'${snapshot.data.temperature}' ==
null
? '-'
: '${snapshot.data.temperature}',
textAlign: TextAlign.center,
textScaleFactor: 1.0,
style: TextStyle(
color: Colors.white,
fontSize: 50,
fontFamily: 'NotoSansKR',
fontWeight: FontWeight.w800),
),
Text(
'℃',
textAlign: TextAlign.center,
textScaleFactor: 1.0,
style: TextStyle(
color: Colors.white,
fontSize: 50,
fontFamily: 'NotoSansKR',
fontWeight: FontWeight.w800),
)
],
),
),
),
],
),
),
Container(
width: size.width * 0.43,
height: size.width * 0.45,
margin: const EdgeInsets.all(5.0),
padding: const EdgeInsets.fromLTRB(10, 5, 10, 10),
decoration: BoxDecoration(
color: Color(0xff8E97FD),
borderRadius: BorderRadius.circular(10.0),
),
child: Column(
children: [
Container(
width: size.width,
height: size.height * 0.05,
child: Center(
child: Text(
'약병 내부 습도',
textAlign: TextAlign.center,
textScaleFactor: 1.0,
style: TextStyle(
color: Colors.white,
fontSize: 24,
fontFamily: 'NotoSansKR',
fontWeight: FontWeight.w800),
),
),
),
Container(
width: size.width,
height: size.height * 0.14,
child: Center(
child: Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: [
Text(
snapshot.data.humidity.toString() ==
null
? '-'
: snapshot.data.humidity
.toString(),
textAlign: TextAlign.center,
textScaleFactor: 1.0,
style: TextStyle(
color: Colors.white,
fontSize: 50,
fontFamily: 'NotoSansKR',
fontWeight: FontWeight.w800),
),
Text(
'%',
textAlign: TextAlign.center,
textScaleFactor: 1.0,
style: TextStyle(
color: Colors.white,
fontSize: 50,
fontFamily: 'NotoSansKR',
fontWeight: FontWeight.w800),
)
],
),
),
),
],
),
),
],
),
),
],
),
),
Container(
padding: EdgeInsets.fromLTRB(5, 0, 5, 5),
margin: EdgeInsets.fromLTRB(0, 0, 0, 0),
height: size.height * 0.3,
width: size.width,
child: Column(
children: <Widget>[
Flexible(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Container(
width: size.width * 0.43,
height: size.width * 0.45,
margin: const EdgeInsets.all(5.0),
padding: const EdgeInsets.fromLTRB(10, 5, 10, 10),
decoration: BoxDecoration(
color: Color(0xff8E97FD),
borderRadius: BorderRadius.circular(10.0),
),
child: Column(
children: [
Container(
width: size.width,
height: size.height * 0.05,
child: Center(
child: Text(
'약병 내부 잔량',
textAlign: TextAlign.center,
textScaleFactor: 1.0,
style: TextStyle(
color: Colors.white,
fontSize: 24,
fontFamily: 'NotoSansKR',
fontWeight: FontWeight.w800),
),
),
),
Container(
width: size.width,
height: size.height * 0.14,
child: Center(
child: Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: [
Text(
snapshot.data.balance.toString() ==
null
? '-'
: snapshot.data.balance
.toString(),
textAlign: TextAlign.center,
textScaleFactor: 1.0,
style: TextStyle(
color: Colors.white,
fontSize: 80,
fontFamily: 'NotoSansKR',
fontWeight: FontWeight.w800),
),
Text(
'%',
textAlign: TextAlign.center,
textScaleFactor: 1.0,
style: TextStyle(
color: Colors.white,
fontSize: 60,
fontFamily: 'NotoSansKR',
fontWeight: FontWeight.w800),
)
],
),
),
),
],
),
),
Container(
width: size.width * 0.43,
height: size.width * 0.45,
margin: const EdgeInsets.all(5.0),
padding: const EdgeInsets.fromLTRB(10, 5, 10, 10),
decoration: BoxDecoration(
color: Color(0xff8E97FD),
borderRadius: BorderRadius.circular(10.0),
),
child: Column(
children: [
Container(
width: size.width,
height: size.height * 0.05,
child: Center(
child: Text(
'최근 개폐 시간',
textAlign: TextAlign.center,
textScaleFactor: 1.0,
style: TextStyle(
color: Colors.white,
fontSize: 24,
fontFamily: 'NotoSansKR',
fontWeight: FontWeight.w800),
),
),
),
Container(
width: size.width,
height: size.height * 0.14,
child: Center(
child: Text(
snapshot.data.recentOpen == null
? '-'
: DateFormat.Hm().format(
snapshot.data.recentOpen),
textAlign: TextAlign.center,
textScaleFactor: 1.0,
style: TextStyle(
color: Colors.white,
fontSize: 60,
fontFamily: 'NotoSansKR',
fontWeight: FontWeight.w800),
),
),
),
],
),
),
],
),
),
],
),
),
],
),
);
}
},
),
);
}
Widget outerInformationpage(BuildContext context) {
Bottle _bottleinformation = new Bottle();
//get bottle
Future<Bottle> _getbottle() async {
String usertoken = await UserSecureStorage.getUserToken();
String bottleid = await UserSecureStorage.getBottleId();
Bottle _bottleinformation = new Bottle();
http.Response response = await http.get(
Uri.encodeFull(DotEnv().env['SERVER_URL'] + 'bottle/' + bottleid),
headers: {"authorization": usertoken});
if (response.statusCode == 200) {
Map<String, dynamic> jsonData = jsonDecode(response.body);
_bottleinformation = Bottle.fromJson(jsonData);
}
return _bottleinformation;
}
final Size size = MediaQuery.of(context).size;
return Scaffold(
backgroundColor: Colors.white,
body: FutureBuilder(
future: _getbottle(),
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 * 0.9,
margin: EdgeInsets.fromLTRB(0, 30, 0, 0),
padding: EdgeInsets.fromLTRB(5, 0, 5, 5),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Container(
padding: EdgeInsets.fromLTRB(5, 5, 5, 5),
height: size.height * 0.08,
width: size.width,
child: Center(
child: Text(
'Outside Information',
textAlign: TextAlign.center,
textScaleFactor: 1.0,
style: TextStyle(
color: Colors.black,
fontSize: 32,
fontFamily: 'NotoSansKR',
fontWeight: FontWeight.w700),
),
),
),
Container(
padding: EdgeInsets.fromLTRB(5, 0, 5, 5),
margin: EdgeInsets.fromLTRB(0, 10, 0, 0),
height: size.height * 0.20,
width: size.width,
child: Column(
children: <Widget>[
Flexible(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Container(
padding: EdgeInsets.fromLTRB(5, 5, 5, 0),
width: size.width * 0.9,
height: size.height * 0.18,
decoration: BoxDecoration(
color: Color(0xff8E97FD),
borderRadius: BorderRadius.circular(10.0),
),
child: Column(
children: [
Container(
width: size.width,
height: size.height * 0.05,
child: Center(
child: Text(
'권장 약 복용량',
textAlign: TextAlign.center,
textScaleFactor: 1.0,
style: TextStyle(
color: Colors.white,
fontSize: 28,
fontFamily: 'NotoSansKR',
fontWeight: FontWeight.w800),
),
),
),
Container(
width: size.width,
height: size.height * 0.12,
child: Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: [
Text(
snapshot.data.dosage == null
? '-'
: snapshot.data.dosage
.toString(),
textAlign: TextAlign.center,
textScaleFactor: 1.0,
style: TextStyle(
color: Colors.white,
fontSize: 80,
fontFamily: 'NotoSansKR',
fontWeight: FontWeight.w800),
),
Text(
' 개',
textScaleFactor: 1.0,
style: TextStyle(
color: Colors.white,
fontSize: 64,
fontFamily: 'NotoSansKR',
fontWeight: FontWeight.w800),
)
],
),
),
],
),
),
],
),
),
],
),
),
],
),
);
}
}),
);
}
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import '../shared/colors.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import './Register/SignInPage.dart';
import 'Register/SignUpLocal.dart';
class HomePage extends StatefulWidget {
HomePage({Key key}) : super(key: key);
@override
_HomePageState createState() => _HomePageState();
}
/// first page class
class _HomePageState extends State<HomePage> {
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
final Size size = MediaQuery.of(context).size;
return Scaffold(
body: GestureDetector(
child: Container(
color: Colors.white,
height: size.height,
child: Center(
child: MediaQuery(
data: MediaQuery.of(context).copyWith(textScaleFactor: 1.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Container(
height: size.height * 0.5,
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text(
'SMART MEDICINE BOX',
textScaleFactor: 1.0,
style: TextStyle(
color: Color(0xff004ca2),
fontSize: 30,
fontFamily: 'Noto',
fontWeight: FontWeight.bold),
),
],
),
AnimatedOpacity(
opacity: 1,
duration: Duration(milliseconds: 500),
child: Container(
padding: EdgeInsets.fromLTRB(0, 0, 0, 20),
child: Image.asset('images/main_logo.png',
width: 200, height: 250)),
),
],
),
),
Container(
height: size.height * 0.3,
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
GestureDetector(
child: Container(
width: size.width * 0.8,
height: 46,
margin: EdgeInsets.only(bottom: 0),
child: FlatButton(
padding: EdgeInsets.fromLTRB(0, 5, 0, 5),
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) =>
SignInPage(),
),
);
},
child: Text(
'로그인',
textScaleFactor: 1.0,
style: TextStyle(
color: Colors.white,
fontSize: 16,
fontFamily: 'Noto',
fontWeight: FontWeight.bold),
),
color: Color(0xff1674f6),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(50)),
),
),
),
GestureDetector(
child: Container(
width: size.width * 0.8,
padding: EdgeInsets.all(0),
child: OutlineButton(
padding: EdgeInsets.fromLTRB(0, 25, 0, 15),
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) =>
SignUpLocal(),
),
);
},
child: Text(
'회원 가입',
textScaleFactor: 1.0,
style:
TextStyle(fontSize: 16, fontFamily: 'Noto'),
),
textColor: Colors.black,
highlightedBorderColor: highlightColor,
borderSide: BorderSide.none,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(50)),
),
),
),
],
),
),
],
),
)),
),
),
backgroundColor: bgColor,
);
}
}
import 'dart:convert';
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';
class BottleList extends StatefulWidget {
BottleList({Key key}) : super(key: key);
@override
_BottleListState createState() => _BottleListState();
}
class _BottleListState extends State<BottleList> {
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();
http.Response response = await http.get(
Uri.encodeFull(
DotEnv().env['SERVER_URL'] + 'bottle/hub/' + hubid.toString()),
headers: {"authorization": usertoken},
);
if (_bottleList.length != 0) {
_bottleList.clear();
}
if (response.statusCode == 200) {
List<dynamic> values = new List<dynamic>();
values = json.decode(response.body);
for (int i = 0; i < values.length; i++) {
Map<String, dynamic> map = values[i];
_bottleList.add(Bottle.fromJson(map));
}
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 WillPopScope(
child: 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: getBottleList(),
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>[
SizedBox(height: 10),
Container(
height: size.height * 0.07,
width: size.width,
child: Center(
child: Text(
'등록된 약병 리스트',
textScaleFactor: 1.0,
style: TextStyle(
fontSize: 28,
fontFamily: 'Noto',
fontWeight: FontWeight.bold),
),
),
),
SizedBox(height: 10),
Expanded(
child: GridView.builder(
padding: const EdgeInsets.all(30),
itemCount:
_bottleList.length == null ? 0 : _bottleList.length,
gridDelegate: SliverGridDelegateWithMaxCrossAxisExtent(
maxCrossAxisExtent: 200,
crossAxisSpacing: 10,
mainAxisSpacing: 10,
),
itemBuilder: (BuildContext context, int index) {
return InkResponse(
splashColor: Colors.transparent,
child: Container(
height: 140,
padding: const EdgeInsets.all(10),
decoration: BoxDecoration(
border: Border.all(),
borderRadius: BorderRadius.all(
Radius.circular(16.0),
),
),
child: Column(
children: [
Container(
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Colors.black,
width: 1,
style: BorderStyle.solid),
),
),
height: 40,
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Container(
height: 40,
child: Center(
child: Text(
'${_bottleList[index].bottleId}',
style: TextStyle(
color: Colors.black,
fontSize: 20,
fontFamily: 'Noto',
fontWeight: FontWeight.bold),
),
),
),
Container(
child: IconButton(
alignment: Alignment(0.9, 0),
icon: Icon(
Icons.create_sharp,
color: Colors.black,
),
onPressed: () {},
),
),
],
),
),
SizedBox(height: 10),
Container(
height: 90,
child: Icon(
Icons.medical_services_outlined,
size: 100,
),
)
],
),
),
onTap: () {
UserSecureStorage.setBottleId(
_bottleList[index].bottleId.toString());
UserSecureStorage.setMedicineId(
_bottleList[index].medicineId.toString());
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) => DashBoard(
pageNumber: 0,
),
),
);
},
);
},
),
)
],
),
);
}
},
),
),
onWillPop: () {
SystemNavigator.pop();
},
);
}
}
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';
import 'package:http/http.dart' as http;
import 'package:flutter_dotenv/flutter_dotenv.dart';
import '../models/Medicine.dart';
import '../../utils/user_secure_stoarge.dart';
class DetailMedicine extends StatefulWidget {
Medicine searchMedicine;
String bottleId;
DetailMedicine({Key key, this.searchMedicine, this.bottleId})
: super(key: key);
@override
_DetailMedicineState createState() => _DetailMedicineState();
}
class _DetailMedicineState extends State<DetailMedicine> {
final medicineDosageController = TextEditingController();
//약 등록
Future<String> patchMedcine() async {
String usertoken = await UserSecureStorage.getUserToken();
http.Response response = await http.patch(
Uri.encodeFull(
DotEnv().env['SERVER_URL'] + 'bottle/' + widget.bottleId),
headers: {
"Content-Type": "application/json",
"authorization": usertoken
},
body: jsonEncode({
'medicineId': widget.searchMedicine.medicineId,
'dosage': medicineDosageController.text
}));
if (response.statusCode == 200) {
String usertoken = await UserSecureStorage.setMedicineId(
widget.searchMedicine.medicineId.toString());
return "Complete";
} else if (response.statusCode == 404) {
return "약병이 존재하지 않습니다.";
} else if (response.statusCode == 403) {
return "약병에 접근할 권한이 없습니다.";
} else {
return "알 수 없는 오류";
}
}
Widget build(BuildContext context) {
final Size size = MediaQuery.of(context).size;
return MaterialApp(
home: 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: SingleChildScrollView(
scrollDirection: Axis.vertical,
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
SizedBox(height: 30),
Container(
padding: EdgeInsets.fromLTRB(5, 5, 5, 5),
height: size.height * 0.08,
width: size.width,
child: Center(
child: Text(
'세부 약 정보',
textAlign: TextAlign.center,
textScaleFactor: 1.0,
style: TextStyle(
color: Colors.black,
fontSize: 36,
fontFamily: 'NotoSansKR',
fontWeight: FontWeight.w700),
),
),
),
SizedBox(height: 5),
Container(
width: size.width,
padding: EdgeInsets.fromLTRB(5, 0, 5, 5),
margin: EdgeInsets.all(15),
decoration: BoxDecoration(
border: Border.all(),
borderRadius: BorderRadius.all(
Radius.circular(25.0) // <--- border radius here
),
),
child: Column(
children: [
SizedBox(height: 40),
Container(
child: Center(
child: Text(widget.searchMedicine.name,
style: TextStyle(
color: Colors.black,
fontSize: 24,
fontFamily: 'NotoSansKR',
fontWeight: FontWeight.w700)),
),
),
SizedBox(height: 15),
Container(
width: size.width,
alignment: Alignment(0.9, 0),
child: Text(
'제조사: ' + widget.searchMedicine.company,
style: TextStyle(
color: Colors.grey,
fontSize: 20,
),
),
),
SizedBox(height: 30),
Container(
width: size.width,
padding: EdgeInsets.fromLTRB(5, 0, 5, 0),
alignment: Alignment(-1, 0),
child: Text(
'타겟 층 : ' + widget.searchMedicine.target,
style: TextStyle(color: Colors.black, fontSize: 16),
),
),
SizedBox(height: 15),
Container(
width: size.width,
padding: EdgeInsets.fromLTRB(5, 0, 5, 0),
alignment: Alignment(-1, 0),
child: Text(
'복약 정보 : ' + widget.searchMedicine.dosage,
style: TextStyle(color: Colors.black, fontSize: 16),
),
),
SizedBox(height: 10),
Container(
width: size.width,
padding: EdgeInsets.fromLTRB(5, 10, 5, 10),
alignment: Alignment(-1, 0),
child: Column(
children: [
SizedBox(
height: 12,
),
Container(
width: size.width,
child: Text(
'경고',
style: TextStyle(
color: Colors.redAccent, fontSize: 14),
),
),
SizedBox(height: 12),
Container(
width: size.width,
child: Text(
widget.searchMedicine.warn,
style: TextStyle(
color: Colors.redAccent, fontSize: 14),
),
),
],
),
),
],
),
),
SizedBox(height: 12),
Container(
height: size.height * 0.1,
padding: const EdgeInsets.fromLTRB(20, 10, 20, 5),
child: TextFormField(
keyboardType: TextInputType.text,
controller: medicineDosageController,
decoration: InputDecoration(
border: OutlineInputBorder(),
errorBorder: InputBorder.none,
disabledBorder: InputBorder.none,
hintText: '하루에 섭취할 적정 복용량을 숫자만 입력하세요',
),
style: TextStyle(
fontSize: 16,
fontFamily: 'NotoSansKR',
fontWeight: FontWeight.w600)),
),
SizedBox(height: 12),
Container(
height: size.height * 0.07,
width: size.width * 0.8,
child: FlatButton(
padding: EdgeInsets.fromLTRB(0, 5, 0, 5),
onPressed: () async {
String saveMessage = await patchMedcine();
if (saveMessage == "Complete") {
showDialog(
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: new Text('약 등록'),
content: new Text('약 등록이 완료 되었습니다.'),
actions: <Widget>[
new FlatButton(
child: new Text('Close'),
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) =>
DashBoard(
pageNumber: 1,
),
),
);
})
],
);
});
}
},
child: Text(
'약 등록',
textScaleFactor: 1.0,
style: TextStyle(
color: Colors.white,
fontSize: 20,
fontFamily: 'Noto',
fontWeight: FontWeight.bold),
),
color: Color(0xff1674f6),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(50)),
),
),
SizedBox(height: 30)
],
),
),
),
);
}
}
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'dart:convert';
import 'package:http/http.dart' as http;
import 'package:flutter_dotenv/flutter_dotenv.dart';
// Screen import
import 'RegisterBottle.dart';
import '../models/Bottle.dart';
import 'BottleList.dart';
import '../../utils/user_secure_stoarge.dart';
class HubList extends StatefulWidget {
List<int> hublist;
HubList({Key key, this.hublist}) : super(key: key);
@override
_HubListState createState() => _HubListState();
}
class _HubListState extends State<HubList> {
List<Bottle> _bottleList = new List<Bottle>();
//Get BottleList
Future<String> getBottleList(int hubid) async {
String usertoken = await UserSecureStorage.getUserToken();
http.Response response = await http.get(
Uri.encodeFull(
DotEnv().env['SERVER_URL'] + 'bottle/hub/' + hubid.toString()),
headers: {"authorization": usertoken},
);
if (_bottleList.length != 0) {
_bottleList.clear();
}
if (response.statusCode == 200) {
List<dynamic> values = new List<dynamic>();
values = json.decode(response.body);
for (int i = 0; i < values.length; i++) {
Map<String, dynamic> map = values[i];
_bottleList.add(Bottle.fromJson(map));
return "GET";
}
} else if (response.statusCode == 404) {
return "Not Found";
} else {
return "Error";
}
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: 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: 28,
fontFamily: 'Noto',
fontWeight: FontWeight.bold),
),
),
decoration: BoxDecoration(border: Border.all()),
),
SizedBox(height: 30),
Expanded(
child: ListView.separated(
padding: const EdgeInsets.all(30),
itemCount: widget.hublist.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(
'HUB ID: ' + '${widget.hublist[index]}',
style: TextStyle(
color: Colors.black,
fontSize: 20,
fontFamily: 'Noto',
fontWeight: FontWeight.bold),
),
trailing: Icon(Icons.arrow_forward),
onTap: () async {
//허브 id로 가져와서 있으면 바로 넘기기
var result =
await getBottleList(widget.hublist[index]);
if (result == "GET") {
UserSecureStorage.setHubId(
widget.hublist[index].toString());
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) =>
BottleList(),
));
} else if (result == "Not Found") {
showDialog(
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: new Text('Error'),
content: new Text('등록된 약병이 없습니다.'),
actions: <Widget>[
new FlatButton(
child: new Text('등록'),
onPressed: () {
UserSecureStorage.setHubId(
widget.hublist[index].toString());
Navigator.push(
context,
MaterialPageRoute(
builder:
(BuildContext context) =>
RegisterBottle(),
));
})
],
);
},
);
}
},
),
);
},
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';
import 'package:http/http.dart' as http;
import 'package:flutter_dotenv/flutter_dotenv.dart';
import 'SearchMedicine.dart';
import '../../utils/user_secure_stoarge.dart';
class RegisterBottle extends StatefulWidget {
final String hubid;
final bool modify_bottle;
RegisterBottle({Key key, this.hubid, this.modify_bottle}) : super(key: key);
@override
_RegisterBottleState createState() => _RegisterBottleState();
}
class _RegisterBottleState extends State<RegisterBottle> {
final medicineBottleIDController = TextEditingController();
Future<String> registerhub_Validate() async {
String usertoken = await UserSecureStorage.getUserToken();
String hubid = await UserSecureStorage.getHubId();
http.Response bottleresponse = await http.post(
Uri.encodeFull(DotEnv().env['SERVER_URL'] + 'bottle'),
headers: {
"Content-Type": "application/json",
"authorization": usertoken
},
body: jsonEncode(
{'bottleId': medicineBottleIDController.text, 'hubId': hubid}));
if (bottleresponse.statusCode == 201) {
return "등록 완료";
} else if (bottleresponse.statusCode == 404) {
return "Hub 없음";
} else if (bottleresponse.statusCode == 403) {
return "유저 정보 없음 ";
} else if (bottleresponse.statusCode == 404) {
return "HOST 없음";
} else {
return "오류";
}
}
Widget build(BuildContext context) {
final Size size = MediaQuery.of(context).size;
// int goals = 60;
// int points = 75;
return Scaffold(
backgroundColor: Colors.white,
body: ListView(
children: <Widget>[
Padding(
padding: const EdgeInsets.fromLTRB(20, 25, 20, 0),
child: Row(
children: <Widget>[
Text(
'약병 등록',
textScaleFactor: 1.0,
style: TextStyle(fontSize: 34),
)
],
),
),
Padding(
padding: const EdgeInsets.fromLTRB(20, 10, 20, 0),
child: Row(
children: <Widget>[
Text(
'SmartMedicine 회원가입',
textScaleFactor: 1.0,
style: TextStyle(fontSize: 16),
)
],
),
),
MediaQuery(
data: MediaQuery.of(context).copyWith(textScaleFactor: 1.0),
child: Container(
height: size.height * 0.6,
child: Padding(
padding: const EdgeInsets.fromLTRB(20, 5, 20, 20),
child: new Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
TextFormField(
keyboardType: TextInputType.text,
controller: medicineBottleIDController,
decoration: InputDecoration(
labelText: '약병 ID',
helperText: '현재 사용하시는 약병의 고유번호를 입력하세요',
),
),
],
),
),
),
),
Container(
height: 80,
padding: const EdgeInsets.fromLTRB(20, 20, 20, 20),
child: RaisedButton(
onPressed: () async {
String saveMessage = await registerhub_Validate();
print(saveMessage);
print(widget.modify_bottle);
if (saveMessage == "등록 완료" && widget.modify_bottle == false) {
showDialog(
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: new Text('약병 등록'),
content: new Text('약병 등록이 완료 되었습니다.'),
actions: <Widget>[
new FlatButton(
child: new Text('Close'),
onPressed: () {
UserSecureStorage.setBottleId(
medicineBottleIDController.text);
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) =>
SearchMedicine(
bottleId: medicineBottleIDController.text,
),
),
);
},
),
],
);
},
);
} else if (saveMessage == "등록 완료" &&
widget.modify_bottle == true) {
print('asdg');
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();
} else {
showDialog(
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: new Text('오류'),
content: new Text(saveMessage),
actions: <Widget>[
new FlatButton(
child: new Text('Close'),
onPressed: () {
Navigator.of(context).pop();
},
)
],
);
},
);
}
},
shape: RoundedRectangleBorder(
borderRadius: new BorderRadius.circular(18.0),
side: BorderSide(color: Colors.blue)),
color: Color(0xff1674f6),
child: Text(
'약병 등록',
textScaleFactor: 1.0,
style: TextStyle(
fontSize: 16,
color: Colors.white,
fontWeight: FontWeight.bold),
),
),
)
],
),
);
}
}
import 'package:Smart_Medicine_Box/src/screens/SettingPage/HubModifyList.dart';
import 'package:flutter/cupertino.dart';
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;
import 'package:flutter_dotenv/flutter_dotenv.dart';
import 'RegisterBottle.dart';
import '../../utils/user_secure_stoarge.dart';
class RegisterHub extends StatefulWidget {
final int modify_hub;
RegisterHub({Key key, this.modify_hub}) : super(key: key);
@override
_RegisterHubState createState() => _RegisterHubState();
}
class _RegisterHubState extends State<RegisterHub> {
final medicineBottleIDController = TextEditingController();
final medicineHubIDController = TextEditingController();
final medicineHubPortController = TextEditingController();
final medicineHubHostController = TextEditingController();
Future<String> registerhub_Validate() async {
String usertoken = await UserSecureStorage.getUserToken();
http.Response hubresponse = await http.post(
Uri.encodeFull(DotEnv().env['SERVER_URL'] + 'hub'),
headers: {
"Content-Type": "application/json",
"authorization": usertoken
},
body: jsonEncode({
'hubId': medicineHubIDController.text,
'host': medicineHubHostController.text,
'port': medicineHubPortController.text,
}));
print(hubresponse.statusCode);
if (hubresponse.statusCode == 201) {
return "허브 등록 완료";
} else if (hubresponse.statusCode == 409) {
return "이미 존재하는 hub";
} else {
return "오류";
}
}
Widget build(BuildContext context) {
final Size size = MediaQuery.of(context).size;
// int goals = 60;
// int points = 75;
return Scaffold(
backgroundColor: Colors.white,
body: ListView(
children: <Widget>[
Padding(
padding: const EdgeInsets.fromLTRB(20, 25, 20, 0),
child: Row(
children: <Widget>[
Text(
'허브 등록',
textScaleFactor: 1.0,
style: TextStyle(fontSize: 34),
)
],
),
),
Padding(
padding: const EdgeInsets.fromLTRB(20, 10, 20, 0),
child: Row(
children: <Widget>[
Text(
'SmartMedicine 허브 등록',
textScaleFactor: 1.0,
style: TextStyle(fontSize: 16),
)
],
),
),
MediaQuery(
data: MediaQuery.of(context).copyWith(textScaleFactor: 1.0),
child: Container(
height: size.height * 0.6,
child: Padding(
padding: const EdgeInsets.fromLTRB(20, 5, 20, 20),
child: new Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
TextFormField(
keyboardType: TextInputType.text,
controller: medicineHubIDController,
decoration: InputDecoration(
labelText: '허브 ID',
helperText: '현자 등록하시는 허브의 고유 번호를 입력하세요',
),
),
TextFormField(
keyboardType: TextInputType.text,
controller: medicineHubHostController,
decoration: InputDecoration(
labelText: 'Host',
helperText: '현재 사용하시는 허브의 HOST를 입력하세요',
),
),
TextFormField(
keyboardType: TextInputType.text,
controller: medicineHubPortController,
decoration: InputDecoration(
labelText: 'Port',
helperText: '현재 사용하시는 허브의 PORT를 입력하세요',
),
),
],
),
),
),
),
Container(
height: 80,
padding: const EdgeInsets.fromLTRB(20, 20, 20, 20),
child: RaisedButton(
onPressed: () async {
String saveMessage = await registerhub_Validate();
print(saveMessage);
print(widget.modify_hub);
if (saveMessage == "허브 등록 완료" && widget.modify_hub == 0) {
UserSecureStorage.setHubId(medicineHubIDController.text);
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) => RegisterBottle(
hubid: medicineHubIDController.text,
modify_bottle: false,
),
),
);
} else if (saveMessage == "허브 등록 완료" &&
widget.modify_hub == 1) {
Navigator.of(context).pop();
} else {
showDialog(
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: new Text('오류'),
content: new Text(saveMessage),
actions: <Widget>[
new FlatButton(
child: new Text('close'),
onPressed: () {
Navigator.of(context).pop();
},
)
],
);
},
);
}
},
shape: RoundedRectangleBorder(
borderRadius: new BorderRadius.circular(18.0),
side: BorderSide(color: Colors.blue)),
color: Color(0xff1674f6),
child: Text(
'허브 등록 ',
textScaleFactor: 1.0,
style: TextStyle(
fontSize: 16,
color: Colors.white,
fontWeight: FontWeight.bold),
),
),
)
],
),
);
}
}
import 'dart:convert';
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/Medicine.dart';
import 'DetailMedicine.dart';
import '../../utils/user_secure_stoarge.dart';
class SearchMedicine extends StatefulWidget {
String bottleId;
SearchMedicine({Key key, this.bottleId}) : super(key: key);
@override
_SearchMedicineState createState() => _SearchMedicineState();
}
class _SearchMedicineState extends State<SearchMedicine> {
List<Medicine> _medicineList = new List<Medicine>();
final medicineNameController = TextEditingController();
final medicineCompanyController = TextEditingController();
Future<String> postMeicineList() async {
String usertoken = await UserSecureStorage.getUserToken();
http.Response response = await http.post(
Uri.encodeFull(DotEnv().env['SERVER_URL'] + 'medicine'),
headers: {
"Content-Type": "application/json",
"authorization": usertoken
},
body: jsonEncode({
'name': medicineNameController.text,
'company': medicineCompanyController.text,
}));
if (_medicineList.length != 0) {
_medicineList.clear();
}
if (response.statusCode == 200) {
List<dynamic> values = new List<dynamic>();
values = json.decode(response.body);
for (int i = 0; i < values.length; i++) {
Map<String, dynamic> map = values[i];
_medicineList.add(Medicine.fromJson(map));
}
return "GET";
} else {
return "Not Found";
}
}
Widget build(BuildContext context) {
bool isForward = false;
final Size size = MediaQuery.of(context).size;
// int goals = 60;
// int points = 75;
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: Container(
height: size.height,
padding: const EdgeInsets.all(10),
decoration: BoxDecoration(
border: Border.all(),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
SizedBox(height: 20),
Container(
height: size.height * 0.13,
decoration: BoxDecoration(
border: Border.all(),
color: Colors.white,
borderRadius: BorderRadius.circular(25),
),
child: Row(
children: [
Column(
children: [
Container(
height: size.height * 0.0635,
width: size.width * 0.75,
child: Row(
children: [
Container(
width: size.width * 0.16,
padding: const EdgeInsets.fromLTRB(10, 0, 0, 0),
child: Text('약이름:',
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 16,
fontFamily: 'NotoSansKR',
fontWeight: FontWeight.w600)),
),
Container(
padding: const EdgeInsets.fromLTRB(5, 0, 0, 0),
width: size.width * 0.55,
child: TextFormField(
keyboardType: TextInputType.text,
controller: medicineNameController,
decoration: InputDecoration(
border: InputBorder.none,
focusedBorder: InputBorder.none,
enabledBorder: InputBorder.none,
errorBorder: InputBorder.none,
disabledBorder: InputBorder.none,
hintText: '약 이름을 입력하세요',
),
style: TextStyle(
fontSize: 16,
fontFamily: 'NotoSansKR',
fontWeight: FontWeight.w600)),
)
],
),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Colors.black,
width: 1,
style: BorderStyle.solid),
right: BorderSide(
color: Colors.black,
width: 1,
style: BorderStyle.solid),
),
),
),
Container(
height: size.height * 0.0635,
width: size.width * 0.75,
child: Row(
children: [
Container(
width: size.width * 0.16,
padding: const EdgeInsets.fromLTRB(5, 0, 0, 3),
child: Text('제조사:',
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 16,
fontFamily: 'NotoSansKR',
fontWeight: FontWeight.w600)),
),
Container(
padding: const EdgeInsets.fromLTRB(6, 0, 0, 0),
width: size.width * 0.50,
child: TextFormField(
keyboardType: TextInputType.text,
controller: medicineCompanyController,
decoration: InputDecoration(
border: InputBorder.none,
focusedBorder: InputBorder.none,
enabledBorder: InputBorder.none,
errorBorder: InputBorder.none,
disabledBorder: InputBorder.none,
hintText: '약 제조사 이름을 입력하세요',
),
style: TextStyle(
fontSize: 16,
fontFamily: 'NotoSansKR',
fontWeight: FontWeight.w600)),
)
],
),
decoration: BoxDecoration(
border: Border(
right: BorderSide(
color: Colors.black,
width: 1,
style: BorderStyle.solid),
),
),
),
],
),
Container(
height: size.height * 0.0635 * 2,
width: size.width * 0.14,
padding: const EdgeInsets.fromLTRB(10, 0, 0, 0),
child: IconButton(
icon: Icon(Icons.search, size: 40),
onPressed: () async {
String saveMessage = await postMeicineList();
if (saveMessage == "GET") {
setState(() {});
}
//검색 함수를 여기다가
},
),
),
],
),
),
SizedBox(height: 20),
Expanded(
child: ListView.separated(
itemBuilder: (BuildContext context, int index) {
return Container(
padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(border: Border.all()),
child: ListTile(
title: Text(
'Medicine: ' + _medicineList[index].name,
style: TextStyle(
color: Colors.black,
fontSize: 20,
fontFamily: 'Noto',
fontWeight: FontWeight.bold),
),
trailing: Icon(Icons.arrow_forward),
onTap: () async {
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) =>
DetailMedicine(
searchMedicine: _medicineList[index],
bottleId: widget.bottleId,
),
));
}),
);
},
separatorBuilder: (BuildContext contetx, int index) =>
const Divider(),
itemCount: _medicineList.length == null
? 0
: _medicineList.length))
],
),
),
);
}
}
import 'dart:convert';
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 '../../utils/user_secure_stoarge.dart';
import 'HubList.dart';
import 'RegsiterHub.dart';
import '../models/User.dart';
class SignInPage extends StatefulWidget {
@override
_SignInPageState createState() => _SignInPageState();
}
///
class _SignInPageState extends State<SignInPage> {
bool passwordVisible = false;
bool _validateEmail = false;
bool _validatePassword = false;
final emailController = TextEditingController();
final passwordController = TextEditingController();
User user;
List<int> _hublist = new List<int>(); //허브이름을 만들어야 할 것 같은데 임시로 허브 id만 고르게 함
//Login 함수
Future<String> login(String _email, String _password) async {
http.Response response = await http.post(
Uri.encodeFull(DotEnv().env['SERVER_URL'] + 'auth/login'),
headers: {"Content-Type": "application/json"},
body: jsonEncode(
{
'userId': _email,
'password': _password,
},
),
);
if (response.statusCode == 200) {
Map<String, dynamic> data = jsonDecode(response.body);
user = User.fromJson(data);
UserSecureStorage.setUserToken(user.token);
UserSecureStorage.setUserId(user.userId);
return "로그인 성공";
} else if (response.statusCode == 400) {
return "올바르지 않은 아이디 및 패스워드";
} else {
return "존재하지 않는 아이디 이거나 비밀번호가 불일치 합니다.";
}
}
//Get Hub List 함수
Future<String> getHubList() 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 (_hublist.length != 0) {
_hublist.clear();
}
if (response.statusCode == 200) {
values = json.decode(response.body);
for (int i = 0; i < values.length; i++) {
_hublist.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;
final mqData = MediaQuery.of(context);
final mqDataScale = mqData.copyWith(textScaleFactor: 1.0);
return WillPopScope(
onWillPop: () {
if (Navigator.canPop(context)) {
//Navigator.pop(context);
Navigator.of(context).pop();
} else {
SystemNavigator.pop();
}
},
child: Scaffold(
body: Builder(
builder: (BuildContext context) {
return ListView(
children: <Widget>[
Padding(
padding: EdgeInsets.only(top: 25, left: 18, right: 18),
child: Stack(
children: <Widget>[
Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Padding(
padding: const EdgeInsets.fromLTRB(20, 0, 0, 0),
child: Text('로그인',
textScaleFactor: 1.0,
style: TextStyle(
fontSize: 34,
fontFamily: 'Noto',
fontWeight: FontWeight.bold)),
),
SizedBox(
height: 40,
),
Padding(
padding: const EdgeInsets.fromLTRB(20, 0, 20, 0),
child: new Column(
children: <Widget>[
MediaQuery(
data: mqDataScale,
child: TextFormField(
keyboardType: TextInputType.text,
controller: emailController,
decoration: InputDecoration(
labelText: '이메일',
helperText: '이메일 주소를 입력해주세요.',
contentPadding:
EdgeInsets.fromLTRB(0, 5, 0, 5),
errorText: _validateEmail
? '등록되지 않은 아이디입니다.'
: null,
labelStyle: TextStyle(
fontSize: 14,
color: Color(0xff000000)),
helperStyle: TextStyle(
fontSize: 12,
color: Color(0xffb2b2b2)),
// Here is key idea
),
),
)
],
),
),
Padding(
padding: const EdgeInsets.fromLTRB(20, 0, 20, 20),
child: new Column(
children: <Widget>[
MediaQuery(
data: mqDataScale,
child: TextFormField(
keyboardType: TextInputType.text,
controller: passwordController,
obscureText:
!passwordVisible, //This will obscure text dynamically
decoration: InputDecoration(
labelText: '비밀번호',
helperText: '비밀번호를 입력해 주세요.',
errorText: _validatePassword
? '비밀번호가 일치하지 않습니다.'
: null,
labelStyle: TextStyle(
fontSize: 14,
color: Color(0xff000000)),
helperStyle: TextStyle(
fontSize: 12,
color: Color(0xffb2b2b2)),
// Here is key idea
suffixIcon: IconButton(
icon: Icon(
// Based on passwordVisible state choose the icon
passwordVisible
? Icons.visibility
: Icons.visibility_off,
color: Color(0xff2c2c2c),
),
onPressed: () {
// Update the state i.e. toogle the state of passwordVisible variable
setState(() {
passwordVisible = !passwordVisible;
});
},
),
),
),
)
],
),
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Container(
width: size.width * 0.8,
height: 46,
child: RaisedButton(
color: Color(0xff1674f6),
child: Text("로그인",
textScaleFactor: 1.0,
style: TextStyle(
color: Colors.white,
fontSize: 16,
fontFamily: 'Noto',
fontWeight: FontWeight.bold)),
onPressed: () async {
String saveMessage = await login(
emailController.text,
passwordController.text);
if (emailController.text.isEmpty ||
passwordController.text.isEmpty) {
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();
})
],
);
});
} else {
if (saveMessage == "로그인 성공") {
var result = await getHubList();
if (result == "Not Found") {
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext
context) =>
RegisterHub(modify_hub: 0),
));
} else if (result == "get완료") {
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) =>
HubList(hublist: _hublist),
),
);
} else {}
} else {
print('Error');
}
}
},
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20)),
),
),
],
),
],
),
],
),
),
],
);
},
),
),
);
}
}
import 'dart:convert';
import 'package:Smart_Medicine_Box/src/screens/Homepage.dart';
import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;
import 'package:flutter_dotenv/flutter_dotenv.dart';
import 'RegsiterHub.dart';
class SignUpLocal extends StatefulWidget {
@override
_SignUpLocalState createState() => _SignUpLocalState();
}
class _SignUpLocalState extends State<SignUpLocal> {
final emailController = TextEditingController();
final passwordController = TextEditingController();
final passwordValidController = TextEditingController();
bool _validate = false;
int userRole = 0;
// Initially password is obscure
bool passwordVisible = false;
bool passwordValidationVisible = false;
Future<String> signup_Validate() async {
http.Response response = await http.post(
Uri.encodeFull(DotEnv().env['SERVER_URL'] + 'auth/register'),
headers: {"Content-Type": "application/json"},
body: jsonEncode(
{
'userId': emailController.text,
'password': passwordController.text,
'passwordCheck': passwordValidController.text
},
),
);
if (response.statusCode == 201) {
return "정보 입력 완료";
} else {
return "오류";
}
}
@override
Widget build(BuildContext context) {
final Size size = MediaQuery.of(context).size;
// int goals = 60;
// int points = 75;
return Scaffold(
backgroundColor: Colors.white,
body: ListView(
children: <Widget>[
Padding(
padding: const EdgeInsets.fromLTRB(20, 25, 20, 0),
child: Row(
children: <Widget>[
Text(
'회원 가입',
textScaleFactor: 1.0,
style: TextStyle(fontSize: 34),
)
],
),
),
Padding(
padding: const EdgeInsets.fromLTRB(20, 10, 20, 0),
child: Row(
children: <Widget>[
Text(
'SmartMedicine 회원가입',
textScaleFactor: 1.0,
style: TextStyle(fontSize: 16),
)
],
),
),
MediaQuery(
data: MediaQuery.of(context).copyWith(textScaleFactor: 1.0),
child: Container(
height: size.height * 0.6,
child: Padding(
padding: const EdgeInsets.fromLTRB(20, 5, 20, 20),
child: new Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
TextFormField(
controller: emailController,
keyboardType: TextInputType.text,
decoration: InputDecoration(
labelText: '이메일',
helperText: '아아디로 사용할 이메일 주소를 입력해주세요.',
),
),
TextFormField(
keyboardType: TextInputType.text,
controller: passwordController,
obscureText:
!passwordVisible, //This will obscure text dynamically
decoration: InputDecoration(
labelText: '비밀번호',
helperText: '비밀번호를 입력해주세요',
// Here is key idea
suffixIcon: IconButton(
icon: Icon(
// Based on passwordVisible state choose the icon
passwordVisible
? Icons.visibility
: Icons.visibility_off,
color: Theme.of(context).primaryColorDark,
),
onPressed: () {
// Update the state i.e. toogle the state of passwordVisible variable
setState(() {
passwordVisible = !passwordVisible;
});
},
),
),
),
TextFormField(
onChanged: (text) {
if (passwordController.text == text) {
setState(() {
_validate = false;
});
} else {
setState(() {
_validate = true;
});
}
},
keyboardType: TextInputType.text,
controller: passwordValidController,
obscureText:
!passwordValidationVisible, //This will obscure text dynamically
decoration: InputDecoration(
labelText: '비밀번호 확인',
helperText: '비밀번호를 확인해주세요',
errorText:
_validate ? '두 비밀번호가 다릅니다. 다시 확인해주세요.' : null,
// Here is key idea
suffixIcon: IconButton(
icon: Icon(
// Based on passwordVisible state choose the icon
passwordValidationVisible
? Icons.visibility
: Icons.visibility_off,
color: Theme.of(context).primaryColorDark,
),
onPressed: () {
// Update the state i.e. toogle the state of passwordVisible variable
setState(() {
passwordValidationVisible =
!passwordValidationVisible;
});
},
),
),
),
],
),
),
),
),
Container(
height: 80,
padding: const EdgeInsets.fromLTRB(20, 20, 20, 20),
child: RaisedButton(
onPressed: () async {
String saveMessage = await signup_Validate();
if (saveMessage == "정보 입력 완료") {
showDialog(
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: new Text('회원 가입'),
content: new Text('회원 가입이 완료 되었습니다.'),
actions: <Widget>[
new FlatButton(
child: new Text('Close'),
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) =>
HomePage()));
})
],
);
});
} else {
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();
})
],
);
});
}
},
shape: RoundedRectangleBorder(
borderRadius: new BorderRadius.circular(18.0),
side: BorderSide(color: Colors.blue)),
color: Color(0xff1674f6),
child: Text(
'회원 가입',
textScaleFactor: 1.0,
style: TextStyle(
fontSize: 16,
color: Colors.white,
fontWeight: FontWeight.bold),
),
),
)
],
),
bottomNavigationBar: BottomAppBar(
elevation: 0,
child: Container(
height: 70,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Padding(
padding: const EdgeInsets.fromLTRB(70, 0, 70, 0),
child: Text(
'회원 가입시, 이용 약관 및 개인정보 처리 방침에 동의하는 것으로 간주합니다..',
style: TextStyle(fontSize: 12, color: Color(0xff747474)),
textAlign: TextAlign.center,
),
)
],
),
),
),
);
}
}
import 'package:Smart_Medicine_Box/src/screens/SettingPage/HubModifyList.dart';
import 'package:flutter/material.dart';
import 'package:Smart_Medicine_Box/src/screens/DashBoard.dart';
import 'package:Smart_Medicine_Box/src/screens/SettingPage/Alarm.dart';
import 'package:Smart_Medicine_Box/src/screens/SettingPage/DEVInformation.dart';
import 'package:Smart_Medicine_Box/src/screens/SettingPage/BottleModifyList.dart';
class SettingPage extends StatefulWidget {
@override
_SettingPageState createState() => _SettingPageState();
}
class _SettingPageState extends State<SettingPage> {
Widget build(BuildContext context) {
final Size size = MediaQuery.of(context).size;
return MaterialApp(
title: 'Welcome to Flutter',
home: Scaffold(
appBar: AppBar(
iconTheme: IconThemeData(color: Colors.black),
backgroundColor: Colors.white,
title: Text(
'Smart Medicine Box',
style: TextStyle(
color: Colors.black,
fontSize: 20,
fontFamily: 'Noto',
fontWeight: FontWeight.bold),
),
actions: [
IconButton(
icon: Icon(
Icons.settings,
color: Colors.black,
),
onPressed: () {},
)
],
),
drawer: Drawer(
child: ListView(
children: [
DrawerHeader(
child: Text('Drawer Header'),
decoration: BoxDecoration(
color: Colors.blue,
),
),
ListTile(
title: Text('Test 1'),
onTap: () {},
),
ListTile(
title: Text('Test 2'),
onTap: () {},
),
ListTile(
title: Text('Test 3'),
onTap: () {},
),
],
),
),
body: Container(
height: size.height * 0.9,
margin: EdgeInsets.fromLTRB(0, 30, 0, 0),
padding: EdgeInsets.fromLTRB(5, 0, 5, 5),
child: Column(
children: <Widget>[
Container(
padding: EdgeInsets.fromLTRB(5, 5, 5, 5),
height: size.height * 0.08,
width: size.width,
child: Center(
child: Text(
'Setting',
textAlign: TextAlign.center,
textScaleFactor: 1.0,
style: TextStyle(
color: Colors.black,
fontSize: 32,
fontFamily: 'NotoSansKR',
fontWeight: FontWeight.w700),
),
),
),
Container(
height: size.height * 0.6,
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Container(
padding: EdgeInsets.fromLTRB(0, 20, 0, 20),
width: size.width * 0.8,
height: size.height * 0.13,
margin: EdgeInsets.only(bottom: 0),
child: FlatButton(
height: size.height * 0.07,
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) => Alarm(),
));
},
child: Text(
'알림 설정',
textScaleFactor: 1.0,
style: TextStyle(
color: Colors.white,
fontSize: 24,
fontFamily: 'Noto',
fontWeight: FontWeight.bold),
),
color: Color(0xff0B1E33),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(50)),
),
),
Container(
padding: EdgeInsets.fromLTRB(0, 20, 0, 20),
width: size.width * 0.8,
height: size.height * 0.13,
margin: EdgeInsets.only(bottom: 0),
child: FlatButton(
height: size.height * 0.07,
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) =>
HubModifyList(),
));
},
child: Text(
'허브 관리',
textScaleFactor: 1.0,
style: TextStyle(
color: Colors.white,
fontSize: 24,
fontFamily: 'Noto',
fontWeight: FontWeight.bold),
),
color: Color(0xff0B1E33),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(50)),
),
),
Container(
padding: EdgeInsets.fromLTRB(0, 20, 0, 20),
width: size.width * 0.8,
height: size.height * 0.13,
margin: EdgeInsets.only(bottom: 0),
child: FlatButton(
height: size.height * 0.07,
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) =>
BottleModifyList(),
));
},
child: Text(
'약병 관리',
textScaleFactor: 1.0,
style: TextStyle(
color: Colors.white,
fontSize: 24,
fontFamily: 'Noto',
fontWeight: FontWeight.bold),
),
color: Color(0xff0B1E33),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(50)),
),
),
],
),
),
],
),
),
bottomNavigationBar: BottomNavigationBar(
type: BottomNavigationBarType.fixed,
backgroundColor: Colors.grey,
selectedItemColor: Colors.white.withOpacity(.60),
unselectedItemColor: Colors.white.withOpacity(.60),
selectedFontSize: 14,
unselectedFontSize: 14,
currentIndex: 0,
onTap: (int index) => {
setState(
() {
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) =>
DashBoard(pageNumber: index),
),
);
},
)
},
items: [
BottomNavigationBarItem(
icon: Icon(Icons.device_thermostat), label: 'In'),
BottomNavigationBarItem(icon: Icon(Icons.home), label: 'Home'),
BottomNavigationBarItem(
label: 'Out',
icon: Icon(Icons.access_time),
)
],
),
),
);
}
}
import 'package:flutter/material.dart';
import 'package:rxdart/subjects.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter_datetime_picker/flutter_datetime_picker.dart';
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
import 'package:Smart_Medicine_Box/src/screens/SettingPage.dart';
import 'package:Smart_Medicine_Box/src/screens/SettingPage/customTimepicker.dart';
final FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin =
FlutterLocalNotificationsPlugin();
// Streams are created so that app can respond to notification-related events since the plugin is initialised in the `main` function
final BehaviorSubject<ReceivedNotification> didReceiveLocalNotificationSubject =
BehaviorSubject<ReceivedNotification>();
final BehaviorSubject<String> selectNotificationSubject =
BehaviorSubject<String>();
NotificationAppLaunchDetails notificationAppLaunchDetails;
class ReceivedNotification {
final int id;
final String title;
final String body;
final String payload;
ReceivedNotification({
@required this.id,
@required this.title,
@required this.body,
@required this.payload,
});
}
class Alarm extends StatefulWidget {
@override
_AlarmnState createState() => _AlarmnState();
}
class _AlarmnState extends State<Alarm> {
FlutterLocalNotificationsPlugin fltrNotification;
List<Widget> alarmList = [];
List<dynamic> weekdays = [];
List<String> times = [];
List<int> timesHours = [];
List<int> timesMinutes = [];
List<dynamic> saveIndex = [];
List<dynamic> isSwitched = [];
List<bool> _weekday = [false, false, false, false, false, false, false];
void initState() {
super.initState();
main();
}
Future<void> main() async {
// needed if you intend to initialize in the `main` function
WidgetsFlutterBinding.ensureInitialized();
// NOTE: if you want to find out if the app was launched via notification then you could use the following call and then do something like
// change the default route of the app
// var notificationAppLaunchDetails =
// await flutterLocalNotificationsPlugin.getNotificationAppLaunchDetails();
var initializationSettingsAndroid =
new AndroidInitializationSettings('app_icon');
var initializationSettingsIOS = IOSInitializationSettings(
requestAlertPermission: true,
requestBadgePermission: true,
requestSoundPermission: true,
onDidReceiveLocalNotification:
(int id, String title, String body, String payload) async {});
var initializationSettings = InitializationSettings(
initializationSettingsAndroid, initializationSettingsIOS);
await flutterLocalNotificationsPlugin.initialize(initializationSettings,
onSelectNotification: (String payload) async {
if (payload != null) {
debugPrint('notification payload: ' + payload);
}
});
}
void _requestIOSPermissions() {
flutterLocalNotificationsPlugin
.resolvePlatformSpecificImplementation<
IOSFlutterLocalNotificationsPlugin>()
?.requestPermissions(
alert: true,
badge: true,
sound: true,
);
}
void insertAlarm() {
setState(() {
weekdays.add([false, false, false, false, false, false, false]);
times.add(' ');
timesHours.add(0);
timesMinutes.add(0);
isSwitched.add(false);
var length = saveIndex.length;
if (saveIndex.length == 0) {
saveIndex.add(1);
} else {
saveIndex.add(saveIndex[length - 1] + 1);
}
length = saveIndex.length;
/*
_prefs.setString('alarmList', weekdays.toString());
for (var i = 0; i < times.length; i++) {
_prefs.setString('time' + (saveIndex[i]).toString(),
'${timesHours[i]}:${timesMinutes[i]}');
}
_prefs.setString('timeIndex', saveIndex.toString());
_prefs.setString('toggle', isSwitched.toString());
*/
print(saveIndex);
});
}
void rerendering() {
print(weekdays);
print(times);
print(timesHours);
print(timesMinutes);
setState(() {});
}
void _configureDidReceiveLocalNotificationSubject() {
didReceiveLocalNotificationSubject.stream
.listen((ReceivedNotification receivedNotification) async {
await showDialog(
context: context,
builder: (BuildContext context) => CupertinoAlertDialog(
title: receivedNotification.title != null
? Text(receivedNotification.title)
: null,
content: receivedNotification.body != null
? Text(receivedNotification.body)
: null,
actions: [
CupertinoDialogAction(
isDefaultAction: true,
child: Text('Ok'),
onPressed: () async {
Navigator.of(context, rootNavigator: true).pop();
await Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
SecondScreen(receivedNotification.payload),
),
);
},
)
],
),
);
});
}
void _configureSelectNotificationSubject() {
selectNotificationSubject.stream.listen((String payload) async {
await Navigator.push(
context,
MaterialPageRoute(builder: (context) => SecondScreen(payload)),
);
});
}
@override
void dispose() {
didReceiveLocalNotificationSubject.close();
selectNotificationSubject.close();
super.dispose();
}
Widget build(BuildContext context) {
final Size size = MediaQuery.of(context).size;
return MaterialApp(
title: 'Welcome to Flutter',
home: Scaffold(
appBar: AppBar(
iconTheme: IconThemeData(color: Colors.black),
backgroundColor: Colors.white,
title: Text(
'Smart Medicine Box',
style: TextStyle(
color: Colors.black,
fontSize: 20,
fontFamily: 'Noto',
fontWeight: FontWeight.bold),
),
actions: [
IconButton(
icon: Icon(
Icons.settings,
color: Colors.black,
),
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) => SettingPage(),
));
},
)
],
),
drawer: Drawer(
child: ListView(
children: [
DrawerHeader(
child: Text('Drawer Header'),
decoration: BoxDecoration(
color: Colors.blue,
),
),
ListTile(
title: Text('Test 1'),
onTap: () {},
),
ListTile(
title: Text('Test 2'),
onTap: () {},
),
ListTile(
title: Text('Test 3'),
onTap: () {},
),
],
),
),
body: SingleChildScrollView(
scrollDirection: Axis.vertical,
child: Padding(
padding: EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Container(
width: 180,
height: 80,
padding: const EdgeInsets.all(20.0),
child: RaisedButton(
onPressed: () async {
insertAlarm();
},
shape: RoundedRectangleBorder(
borderRadius: new BorderRadius.circular(30.0),
side: BorderSide(color: Colors.blue)),
color: Color(0xff1674f6),
child: Text(
'알람 추가',
textScaleFactor: 1.0,
style: TextStyle(
fontSize: 16,
color: Colors.white,
fontWeight: FontWeight.bold),
),
),
),
],
),
for (var i = 0; i < weekdays.length; i++)
inAlarmData(
context,
weekdays,
weekdays[i],
_showWeeklyAtDayAndTime,
times[i],
timesHours[i],
timesMinutes[i],
i + 1,
rerendering,
size,
)
],
),
),
),
),
);
}
Widget inAlarmData(
BuildContext context,
var allweekddata,
var weekdayArray,
var activeFunctions,
var timeString,
var timeHour,
var timesMinite,
var index,
var rerendering,
Size size,
) {
SharedPreferences _prefs;
var savetimeStrings;
var setDaysString = ['월', '화', '수', '목', '금', '토', '일'];
return Container(
margin: EdgeInsets.fromLTRB(0, 0, 0, 20),
decoration: BoxDecoration(
border: Border.all(
color: Color(0xffd0d0d0),
),
borderRadius: BorderRadius.all(Radius.circular(5)),
),
child: Column(
children: <Widget>[
Container(
alignment: Alignment.center,
width: size.width,
height: 50.0,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
for (var i = 0; i < weekdayArray.length; i++)
GestureDetector(
onTap: () async {
_prefs = await SharedPreferences.getInstance();
if (weekdayArray[i] == false) {
weekdayArray[i] = true;
} else {
weekdayArray[i] = false;
}
_prefs.setString(
'alarmList', allweekddata.toString());
rerendering();
},
child: Container(
margin: EdgeInsets.fromLTRB(15, 0, 0, 0),
width: size.width * 0.09,
child: Text(
setDaysString[i],
style: TextStyle(
color: weekdayArray[i] == false
? Colors.teal
: Colors.red,
fontWeight: FontWeight.bold,
fontSize: 20.0),
)),
),
],
)
],
),
color: Colors.white,
),
RaisedButton(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(5.0)),
elevation: 4.0,
onPressed: () async {
_prefs = await SharedPreferences.getInstance();
var abc = await DatePicker.showPicker(
context,
theme: DatePickerTheme(
containerHeight: 210.0,
),
showTitleActions: true,
onConfirm: (time) {
print('confirm $time');
// realTime = new DateTime(time.hour, time.minute);
timeHour = time.hour;
timesMinite = time.minute;
savetimeStrings = '${time.hour}:${time.minute}';
var minutString;
if (timesMinite.toString().length == 1) {
minutString = '0' + timesMinite.toString();
} else {
minutString = timesMinite.toString();
}
if (timeHour - 12 < 0) {
timeString = '오전 ${time.hour}:' + minutString;
} else {
if (timeHour == 12) {
timeString = '오후 ${time.hour}:' + minutString;
} else {
timeString = '오후 ${time.hour - 12}:' + minutString;
}
}
},
pickerModel: CustomPicker(
currentTime: DateTime.now(), locale: LocaleType.ko),
);
times[index - 1] = timeString;
timesHours[index - 1] = timeHour;
timesMinutes[index - 1] = timesMinite;
_prefs.setString('time' + (saveIndex[index - 1]).toString(),
savetimeStrings);
print(savetimeStrings);
setState(() {
savetimeStrings = savetimeStrings;
});
// rerendering();
},
child: Container(
alignment: Alignment.center,
height: 50.0,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Icon(
Icons.access_time,
size: 18.0,
color: Colors.teal,
),
Text(
" " + timeString,
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.teal,
fontWeight: FontWeight.bold,
fontSize: 18.0),
),
],
),
)
],
),
],
),
),
color: Colors.white,
),
Container(
padding: EdgeInsets.fromLTRB(20, 0, 20, 0),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(5.0),
color: Colors.white),
child: Container(
alignment: Alignment.center,
height: 50.0,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Text(
"알람 설정",
style: TextStyle(
color: Colors.teal,
fontWeight: FontWeight.bold,
fontSize: 18.0),
),
Switch(
value: isSwitched[index - 1],
onChanged: (value) async {
print(savetimeStrings);
if (value == true) {
_prefs = await SharedPreferences.getInstance();
int count = 1;
bool allDayFalse = true;
for (var i = 0; i < weekdayArray.length; i++) {
if (weekdayArray[i] == true) {
await activeFunctions(timeHour, timesMinite,
i + 1, index * 10, count);
count++;
allDayFalse = false;
}
}
if (allDayFalse == true) {
showDialog(
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: new Text('요일 선택 오류'),
content:
new Text('선택된 요일이 없습니다. 요일을 선택해주세요.'),
actions: <Widget>[
new FlatButton(
child: new Text('닫기'),
onPressed: () {
Navigator.of(context).pop();
})
],
);
});
} else if (_prefs.getString('time' +
(saveIndex[index - 1]).toString()) ==
null) {
showDialog(
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: new Text('시간 설정 오류'),
content:
new Text('설정된 시간이 없습니다. 시간을 설정해주세요.'),
actions: <Widget>[
new FlatButton(
child: new Text('닫기'),
onPressed: () {
Navigator.of(context).pop();
})
],
);
});
} else {
setState(() {
print(value);
isSwitched[index - 1] = value;
_prefs.setString(
'alarmList', allweekddata.toString());
// _prefs.setString(
// 'time' + saveIndex[index - 1].toString(),
// savetimeStrings);
_prefs.setString(
'timeIndex', saveIndex.toString());
_prefs.setString(
'toggle', isSwitched.toString());
print('time' + index.toString());
showDialog(
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: new Text('알람'),
content: new Text('알람 설정을 완료 하였습니다.'),
actions: <Widget>[
new FlatButton(
child: new Text('확인'),
onPressed: () {
Navigator.of(context).pop();
})
],
);
});
});
}
} else {
_prefs = await SharedPreferences.getInstance();
int count = 1;
for (var i = 0; i < weekdayArray.length; i++) {
if (weekdayArray[i] == true) {
await flutterLocalNotificationsPlugin
.cancel((index * 10) + count);
count++;
}
}
setState(() {
isSwitched[index - 1] = value;
_prefs.setString('toggle', isSwitched.toString());
});
}
}),
GestureDetector(
onTap: () async {
showDialog(
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: new Text('알람 삭제'),
content: new Text('선택한 알람을 삭제하시겠습니까?'),
actions: <Widget>[
new FlatButton(
child: new Text('취소'),
onPressed: () {
Navigator.of(context).pop();
}),
new FlatButton(
child: new Text('삭제'),
onPressed: () async {
_prefs = await SharedPreferences
.getInstance();
int count = 1;
for (var i = 0;
i < weekdayArray.length;
i++) {
if (weekdayArray[i] == true) {
await flutterLocalNotificationsPlugin
.cancel((index * 10) + count);
count++;
}
}
print(saveIndex);
allweekddata.removeAt(index - 1);
_prefs.remove('time' +
saveIndex[index - 1].toString());
times.removeAt(index - 1);
saveIndex.removeAt(index - 1);
isSwitched.removeAt(index - 1);
_prefs.setString('alarmList',
allweekddata.toString());
_prefs.setString('timeIndex',
saveIndex.toString());
_prefs.setString(
'toggle', isSwitched.toString());
rerendering();
Navigator.of(context).pop();
})
],
);
});
},
child: Icon(
Icons.close,
))
],
),
),
),
],
));
}
/// weekday 가 1부터 7순으로 일 월 화 수 목 금 토 일 순서로 구성이 되어 있음 이에 따라 설정한 Weekday time 에 학습 알람을 뛰어주는 역할을 해주는 함수
Future<void> _showWeeklyAtDayAndTime(
int a, int b, int weekday, int index, int idindex) async {
Day setDay;
if (weekday == 1) {
setDay = Day.Monday;
} else if (weekday == 2) {
setDay = Day.Tuesday;
} else if (weekday == 3) {
setDay = Day.Wednesday;
} else if (weekday == 4) {
setDay = Day.Thursday;
} else if (weekday == 5) {
setDay = Day.Friday;
} else if (weekday == 6) {
setDay = Day.Saturday;
} else if (weekday == 7) {
setDay = Day.Sunday;
}
print('dd');
var time = Time(a, b, 0);
var androidPlatformChannelSpecifics = AndroidNotificationDetails(
'show weekly channel id',
'show weekly channel name',
'show weekly description');
var iOSPlatformChannelSpecifics = IOSNotificationDetails();
var platformChannelSpecifics = NotificationDetails(
androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics);
await flutterLocalNotificationsPlugin.showWeeklyAtDayAndTime(
index + idindex,
'약통 알람 ',
'알약 섭취 시간인 ${_toTwoDigitString(time.hour)}:${_toTwoDigitString(time.minute)}이 되었습니다.',
setDay,
time,
platformChannelSpecifics);
}
String _toTwoDigitString(int value) {
return value.toString().padLeft(2, '0');
}
Future<void> onDidReceiveLocalNotification(
int id, String title, String body, String payload) async {
// display a dialog with the notification details, tap ok to go to another page
await showDialog(
context: context,
builder: (BuildContext context) => CupertinoAlertDialog(
title: title != null ? Text(title) : null,
content: body != null ? Text(body) : null,
actions: [
CupertinoDialogAction(
isDefaultAction: true,
child: Text('Ok'),
onPressed: () async {
Navigator.of(context, rootNavigator: true).pop();
await Navigator.push(
context,
MaterialPageRoute(
builder: (context) => SecondScreen(payload),
),
);
},
)
],
),
);
}
}
class SecondScreen extends StatefulWidget {
SecondScreen(this.payload);
final String payload;
@override
State<StatefulWidget> createState() => SecondScreenState();
}
class SecondScreenState extends State<SecondScreen> {
String _payload;
@override
void initState() {
super.initState();
_payload = widget.payload;
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Second Screen with payload: ${(_payload ?? '')}'),
),
body: Center(
child: RaisedButton(
onPressed: () {
Navigator.pop(context);
},
child: Text('Go back!'),
),
),
);
}
}
import 'dart:convert';
import 'package:Smart_Medicine_Box/src/screens/Register/RegisterBottle.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 '../../utils/user_secure_stoarge.dart';
class BottleModifyList extends StatefulWidget {
BottleModifyList({Key key}) : super(key: key);
@override
_BottleModifyListState createState() => _BottleModifyListState();
}
class _BottleModifyListState extends State<BottleModifyList> {
List<Bottle> _bottleList = new List<Bottle>();
Future<String> getBottleList() async {
String hubid = await UserSecureStorage.getHubId();
String usertoken = await UserSecureStorage.getUserToken();
http.Response response = await http.get(
Uri.encodeFull(
DotEnv().env['SERVER_URL'] + 'bottle/hub/' + hubid.toString()),
headers: {"authorization": usertoken},
);
if (_bottleList.length != 0) {
_bottleList.clear();
}
if (response.statusCode == 200) {
List<dynamic> values = new List<dynamic>();
values = json.decode(response.body);
for (int i = 0; i < values.length; i++) {
Map<String, dynamic> map = values[i];
_bottleList.add(Bottle.fromJson(map));
}
return "GET";
} else if (response.statusCode == 404) {
return "Not Found";
} else {
return "Error";
}
}
Future<String> deleteBottle(int index) async {
String usertoken = await UserSecureStorage.getUserToken();
http.Response response = await http.delete(
Uri.encodeFull(DotEnv().env['SERVER_URL'] + 'bottle/' + index.toString()),
headers: {"authorization": usertoken},
);
print('asdgasdga');
print(response.statusCode);
if (response.statusCode == 204) {
return "Delete";
} 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: getBottleList(),
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>[
SizedBox(height: 10),
Container(
height: size.height * 0.07,
width: size.width,
child: Center(
child: Text(
'등록된 약병 리스트',
textScaleFactor: 1.0,
style: TextStyle(
fontSize: 28,
fontFamily: 'Noto',
fontWeight: FontWeight.bold),
),
),
),
SizedBox(height: 10),
Expanded(
child: GridView.builder(
padding: const EdgeInsets.all(30),
itemCount:
_bottleList.length == null ? 0 : _bottleList.length,
gridDelegate: SliverGridDelegateWithMaxCrossAxisExtent(
maxCrossAxisExtent: 200,
crossAxisSpacing: 10,
mainAxisSpacing: 10,
),
itemBuilder: (BuildContext context, int index) {
return InkResponse(
splashColor: Colors.transparent,
child: Container(
height: 140,
padding: const EdgeInsets.all(10),
decoration: BoxDecoration(
border: Border.all(),
borderRadius: BorderRadius.all(
Radius.circular(16.0),
),
),
child: Column(
children: [
Container(
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Colors.black,
width: 1,
style: BorderStyle.solid),
),
),
height: 40,
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Container(
height: 40,
child: Center(
child: Text(
'${_bottleList[index].bottleId}',
style: TextStyle(
color: Colors.black,
fontSize: 20,
fontFamily: 'Noto',
fontWeight: FontWeight.bold),
),
),
),
Container(
child: IconButton(
alignment: Alignment(0.9, 0),
icon: Icon(
Icons.create_sharp,
color: Colors.black,
),
onPressed: () {},
),
),
],
),
),
SizedBox(height: 10),
Container(
height: 90,
child: Icon(
Icons.medical_services_outlined,
size: 100,
),
)
],
),
),
onTap: () {
if (_bottleList.length == 1) {
showDialog(
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: new Text('약병 삭제'),
content:
new Text('등록된 약병이 하나이므로 해제가 불가능 합니다.'),
actions: <Widget>[
new FlatButton(
child: new Text('Cloes'),
onPressed: () {
Navigator.of(context).pop();
}),
],
);
},
);
} else {
showDialog(
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: new Text('약병 삭제'),
content: new Text(
_bottleList[index].bottleId.toString() +
'을 삭제 하시겠습니까?'),
actions: <Widget>[
new FlatButton(
child: new Text('삭제'),
onPressed: () async {
print('dfg');
await deleteBottle(
_bottleList[index].bottleId);
setState(() {});
Navigator.of(context).pop();
},
),
new FlatButton(
child: new Text('취소'),
onPressed: () {
Navigator.of(context).pop();
},
)
],
);
},
);
}
},
);
},
),
),
Container(
padding: EdgeInsets.fromLTRB(0, 20, 0, 20),
width: size.width * 0.8,
height: size.height * 0.13,
margin: EdgeInsets.only(bottom: 0),
child: FlatButton(
height: size.height * 0.06,
onPressed: () async {
await Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) =>
RegisterBottle(modify_bottle: true),
),
);
setState(() {});
},
child: Text(
'약병 추가',
textScaleFactor: 1.0,
style: TextStyle(
color: Colors.white,
fontSize: 24,
fontFamily: 'Noto',
fontWeight: FontWeight.bold),
),
color: Color(0xff0B1E33),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(50)),
),
),
],
),
);
}
},
),
);
}
}
import 'package:flutter/material.dart';
import 'package:Smart_Medicine_Box/src/screens/SettingPage.dart';
class DEVInformation extends StatefulWidget {
@override
_DEVInformationState createState() => _DEVInformationState();
}
class _DEVInformationState extends State<DEVInformation> {
Widget build(BuildContext context) {
final Size size = MediaQuery.of(context).size;
return Scaffold(
appBar: AppBar(
iconTheme: IconThemeData(color: Colors.black),
backgroundColor: Colors.white,
title: Text(
'Smart Medicine Box',
style: TextStyle(
color: Colors.black,
fontSize: 20,
fontFamily: 'Noto',
fontWeight: FontWeight.bold),
),
actions: [
IconButton(
icon: Icon(
Icons.settings,
color: Colors.black,
),
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) => SettingPage(),
));
},
)
],
),
body: Text('1234'),
);
}
}
import 'package:Smart_Medicine_Box/src/screens/Register/RegsiterHub.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'dart:convert';
import 'package:http/http.dart' as http;
import 'package:flutter_dotenv/flutter_dotenv.dart';
// Screen import
import '../../utils/user_secure_stoarge.dart';
class HubModifyList extends StatefulWidget {
List<int> hublist;
HubModifyList({Key key, this.hublist}) : super(key: key);
@override
_HubModifyListState createState() => _HubModifyListState();
}
class _HubModifyListState extends State<HubModifyList> {
List<int> _hublist = new List<int>();
//Get Hub List 함수
Future<String> getHubList() 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 (_hublist.length != 0) {
_hublist.clear();
}
if (response.statusCode == 200) {
values = json.decode(response.body);
for (int i = 0; i < values.length; i++) {
_hublist.add(values[i]['hubId']);
}
print(_hublist);
return "get완료";
} else if (response.statusCode == 404) {
return "Not Found";
} else {
return "Error";
}
}
Future<String> deleteHub(int index) async {
String usertoken = await UserSecureStorage.getUserToken();
http.Response response = await http.delete(
Uri.encodeFull(DotEnv().env['SERVER_URL'] + 'hub/' + index.toString()),
headers: {"authorization": usertoken},
);
if (response.statusCode == 204) {
return "Delete";
} 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: getHubList(),
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: 28,
fontFamily: 'Noto',
fontWeight: FontWeight.bold),
),
),
decoration: BoxDecoration(border: Border.all()),
),
SizedBox(height: 30),
Expanded(
child: ListView.separated(
padding: const EdgeInsets.all(30),
itemCount:
_hublist.length == null ? 0 : _hublist.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(
'HUB ID: ' + '${_hublist[index]}',
style: TextStyle(
color: Colors.black,
fontSize: 20,
fontFamily: 'Noto',
fontWeight: FontWeight.bold),
),
trailing: Icon(Icons.highlight_remove),
onTap: () async {
if (_hublist.length == 1) {
showDialog(
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: new Text('허브 삭제'),
content: new Text(
'등록된 허브가 하나이므로 해제가 불가능 합니다.'),
actions: <Widget>[
new FlatButton(
child: new Text('Cloes'),
onPressed: () {
Navigator.of(context).pop();
}),
],
);
},
);
} else {
showDialog(
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: new Text('허브 삭제'),
content: new Text(
_hublist[index].toString() +
'을 삭제 하시겠습니까?'),
actions: <Widget>[
new FlatButton(
child: new Text('삭제'),
onPressed: () async {
await deleteHub(_hublist[index]);
setState(() {});
Navigator.of(context).pop();
},
),
new FlatButton(
child: new Text('취소'),
onPressed: () {
Navigator.of(context).pop();
},
)
],
);
},
);
}
},
),
);
},
separatorBuilder: (BuildContext contetx, int index) =>
const Divider(),
),
),
Container(
padding: EdgeInsets.fromLTRB(0, 20, 0, 20),
width: size.width * 0.8,
height: size.height * 0.13,
margin: EdgeInsets.only(bottom: 0),
child: FlatButton(
height: size.height * 0.07,
onPressed: () async {
await Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) =>
RegisterHub(modify_hub: 1),
),
);
setState(() {});
},
child: Text(
'허브 추가',
textScaleFactor: 1.0,
style: TextStyle(
color: Colors.white,
fontSize: 24,
fontFamily: 'Noto',
fontWeight: FontWeight.bold),
),
color: Color(0xff0B1E33),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(50)),
),
),
],
),
);
}
}),
);
}
}
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:Smart_Medicine_Box/src/screens/SettingPage.dart';
class InformationModify extends StatefulWidget {
@override
_InformationModifyState createState() => _InformationModifyState();
}
class _InformationModifyState extends State<InformationModify> {
final passwordController = TextEditingController();
final passwordValidController = TextEditingController();
final medicineNameController = TextEditingController();
final medicineFactureController = TextEditingController();
bool _validate = false;
int userRole = 0;
// Initially password is obscure
bool passwordVisible = false;
bool passwordValidationVisible = true;
Widget build(BuildContext context) {
final Size size = MediaQuery.of(context).size;
return Scaffold(
appBar: AppBar(
iconTheme: IconThemeData(color: Colors.black),
backgroundColor: Colors.white,
title: Text(
'Smart Medicine Box',
style: TextStyle(
color: Colors.black,
fontSize: 20,
fontFamily: 'Noto',
fontWeight: FontWeight.bold),
),
actions: [
IconButton(
icon: Icon(
Icons.settings,
color: Colors.black,
),
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) => SettingPage(),
));
},
)
],
),
body: ListView(
children: <Widget>[
Container(
height: size.height * 0.9,
margin: EdgeInsets.fromLTRB(0, 10, 0, 0),
padding: EdgeInsets.fromLTRB(5, 0, 5, 5),
child: Column(
children: <Widget>[
Container(
padding: EdgeInsets.fromLTRB(5, 5, 5, 5),
height: size.height * 0.08,
width: size.width,
child: Center(
child: Text(
'회원 정보 수정',
textAlign: TextAlign.center,
textScaleFactor: 1.0,
style: TextStyle(
color: Colors.black,
fontSize: 32,
fontFamily: 'NotoSansKR',
fontWeight: FontWeight.w700),
),
),
),
MediaQuery(
data: MediaQuery.of(context).copyWith(textScaleFactor: 1.0),
child: Container(
height: size.height * 0.6,
child: Padding(
padding: const EdgeInsets.fromLTRB(20, 5, 20, 20),
child: new Column(
children: <Widget>[
SizedBox(height: 15),
Container(
height: size.height * 0.091,
padding: const EdgeInsets.fromLTRB(5, 10, 5, 5),
child: Container(
width: size.width * 0.85,
padding: const EdgeInsets.fromLTRB(5, 16, 5, 3),
decoration: BoxDecoration(
color: Color(0xffBDBDBD),
border: Border.all(),
borderRadius:
BorderRadius.all(Radius.circular(5))),
child: Text(
'test@naver.com',
textScaleFactor: 1.0,
style: TextStyle(
color: Colors.black,
fontSize: 18,
fontFamily: 'NotoSansKR',
),
),
),
),
SizedBox(height: 15),
Container(
height: size.height * 0.13,
padding: const EdgeInsets.fromLTRB(5, 10, 5, 5),
child: TextFormField(
keyboardType: TextInputType.text,
controller: passwordController,
obscureText:
!passwordVisible, //This will obscure text dynamically
decoration: InputDecoration(
border: OutlineInputBorder(
borderSide:
BorderSide(color: Colors.black)),
labelText: '비밀번호',
helperText: '비밀번호를 입력해주세요',
// Here is key idea
suffixIcon: IconButton(
icon: Icon(
// Based on passwordVisible state choose the icon
passwordVisible
? Icons.visibility
: Icons.visibility_off,
color: Theme.of(context).primaryColorDark,
),
onPressed: () {
// Update the state i.e. toogle the state of passwordVisible variable
setState(() {
passwordVisible = !passwordVisible;
});
},
),
),
),
),
Container(
height: size.height * 0.13,
padding: const EdgeInsets.fromLTRB(5, 10, 5, 5),
child: TextFormField(
keyboardType: TextInputType.text,
controller: medicineNameController,
decoration: InputDecoration(
border: OutlineInputBorder(),
labelText: '약 이름',
helperText: '약의 이름을 읿력하세요',
),
),
),
Container(
height: size.height * 0.13,
padding: const EdgeInsets.fromLTRB(5, 10, 5, 5),
child: TextFormField(
keyboardType: TextInputType.text,
controller: medicineFactureController,
decoration: InputDecoration(
border: OutlineInputBorder(),
labelText: '약 제조사 이름',
helperText: '약 제조사의 이름을 읿력하세요',
),
),
),
],
),
),
),
),
Container(
height: 100,
width: size.width * 0.7,
padding: const EdgeInsets.fromLTRB(20, 20, 20, 20),
child: RaisedButton(
onPressed: () async {},
shape: RoundedRectangleBorder(
borderRadius: new BorderRadius.circular(20.0),
side: BorderSide(color: Colors.blue)),
color: Color(0xff1674f6),
child: Text(
'회원 정보 수정',
textScaleFactor: 1.0,
style: TextStyle(
fontSize: 16,
color: Colors.white,
fontWeight: FontWeight.bold),
),
),
)
],
),
),
],
),
);
}
}
import 'package:flutter_datetime_picker/flutter_datetime_picker.dart';
class CustomPicker extends CommonPickerModel {
var indexs;
String digits(int value, int length) {
return '$value'.padLeft(length, "0");
}
CustomPicker({DateTime currentTime, LocaleType locale})
: super(locale: LocaleType.ko) {
this.currentTime = currentTime ?? DateTime.now();
var _dayPeriod = 0;
this.setLeftIndex(this.currentTime.hour);
this.setMiddleIndex(this.currentTime.minute);
this.setRightIndex(_dayPeriod);
_fillRightList();
}
@override
String leftStringAtIndex(int index) {
if (index >= 1 && index < 13) {
return this.digits(index, 2);
} else {
return null;
}
}
@override
String middleStringAtIndex(int index) {
if (index >= 0 && index < 60) {
return this.digits(index, 2);
} else {
return null;
}
}
@override
String rightStringAtIndex(int index) {
if (index == 0) {
return 'AM';
} else if (index == 1) {
return 'PM';
}
return null;
}
void _fillRightList() {
this.rightList = List.generate(2, (int index) {
return '$index';
});
}
@override
void setRightIndex(int index) {
super.setRightIndex(index);
indexs = index;
_fillRightList();
}
@override
String leftDivider() {
return ":";
}
@override
String rightDivider() {
return " ";
}
@override
List<int> layoutProportions() {
return [1, 1, 1];
}
@override
DateTime finalTime() {
var leftindex;
if (indexs == 1) {
if (this.currentLeftIndex() == 12) {
leftindex = 12;
} else {
leftindex = this.currentLeftIndex() + 12;
}
} else if (indexs == 0) {
if (this.currentLeftIndex() == 12) {
leftindex = 0;
} else {
leftindex = this.currentLeftIndex();
}
}
return currentTime.isUtc
? DateTime.utc(currentTime.year, currentTime.month, currentTime.day,
leftindex, this.currentMiddleIndex(), this.currentRightIndex())
: DateTime(currentTime.year, currentTime.month, currentTime.day,
leftindex, this.currentMiddleIndex(), this.currentRightIndex());
}
}
class Bottle {
final int bottleId;
final String temperature;
final String humidity;
final String balance;
final DateTime recentOpen;
final int medicineId;
final int hubId;
final int dosage;
Bottle(
{this.bottleId,
this.temperature,
this.humidity,
this.balance,
this.recentOpen,
this.medicineId,
this.hubId,
this.dosage});
factory Bottle.fromJson(Map<String, dynamic> parsedJson) {
return Bottle(
bottleId: parsedJson['bottleId'],
temperature: parsedJson['temperature'].toString(),
humidity: parsedJson['humidity'].toString(),
balance: parsedJson['balance'].toString(),
recentOpen: DateTime.parse(parsedJson['recentOpen']).toLocal(),
medicineId: parsedJson['medicineId'],
hubId: parsedJson['hubId'],
dosage: parsedJson['dosage'],
);
}
Map<String, dynamic> toJson() => {
"bottleId": bottleId,
"temperature": temperature,
"humidity:": humidity,
"balance": balance,
"recentOpen": recentOpen,
"medicineId": medicineId,
"hubId": hubId,
"dosage": dosage,
};
}
import 'Medicine.dart';
class Data {
final int totalItem;
final List<Medicine> result;
Data({this.totalItem, this.result});
factory Data.fromJson(Map<String, dynamic> parsedJson) {
var list = parsedJson['result'] as List;
List<Medicine> resultList = list.map((i) => Medicine.fromJson(i)).toList();
return Data(
totalItem: parsedJson['totalItem'],
result: resultList,
);
}
Map<String, dynamic> toJson() => {
"totalItem": totalItem,
"result": result,
};
}
class Medicine {
final int medicineId;
final String antiEffect;
final String company;
final String dosage;
final String name;
final String target;
final String warn;
Medicine(
{this.medicineId,
this.antiEffect,
this.company,
this.dosage,
this.name,
this.target,
this.warn});
factory Medicine.fromJson(Map<String, dynamic> parsedJson) {
return Medicine(
medicineId: parsedJson['medicineId'],
antiEffect: parsedJson['antiEffect'],
company: parsedJson['company'],
dosage: parsedJson['dosage'],
name: parsedJson['name'],
target: parsedJson['target'],
warn: parsedJson['warn'],
);
}
Map<String, dynamic> toJson() => {
"medicineId": medicineId,
"antiEffect": antiEffect,
"company": company,
"dosage": dosage,
"name": name,
"target": target,
"warn": warn,
};
}
class User {
final String userId;
final String token;
User({this.userId, this.token});
factory User.fromJson(Map<String, dynamic> parsedJson) {
return User(
userId: parsedJson['userId'],
token: parsedJson['token'],
);
}
Map<String, dynamic> toJson() => {
"userId": userId,
"token": token,
};
}
import 'package:flutter/material.dart';
const Color bgColor = Color(0xffF4F7FA);
// const Color primaryColor = Colors.green;
const Color primaryColor = Color(0xff44c662);
const Color white = Colors.white;
const Color darkText = Colors.black54;
const Color highlightColor = Colors.green;
import 'package:flutter/material.dart';
import './colors.dart';
import './styles.dart';
Container fryoTextInput(String hintText,
{onTap, onChanged, onEditingComplete, onSubmitted}) {
return Container(
margin: EdgeInsets.only(top: 13),
child: TextField(
onTap: onTap,
onChanged: onChanged,
onEditingComplete: onEditingComplete,
onSubmitted: onSubmitted,
cursorColor: primaryColor,
style: inputFieldTextStyle,
decoration: InputDecoration(
hintText: hintText,
hintStyle: inputFieldHintTextStyle,
focusedBorder: inputFieldFocusedBorderStyle,
contentPadding: EdgeInsets.symmetric(horizontal: 20, vertical: 10),
border: inputFieldDefaultBorderStyle),
),
);
}
Container fryoEmailInput(String hintText,
{onTap, onChanged, onEditingComplete, onSubmitted}) {
return Container(
margin: EdgeInsets.only(top: 13),
child: TextField(
onTap: onTap,
onChanged: onChanged,
onEditingComplete: onEditingComplete,
onSubmitted: onSubmitted,
keyboardType: TextInputType.emailAddress,
cursorColor: primaryColor,
style: inputFieldTextStyle,
decoration: InputDecoration(
hintText: hintText,
hintStyle: inputFieldHintTextStyle,
focusedBorder: inputFieldFocusedBorderStyle,
contentPadding: EdgeInsets.symmetric(horizontal: 20, vertical: 10),
border: inputFieldDefaultBorderStyle),
),
);
}
Container fryoPasswordInput(String hintText,
{onTap, onChanged, onEditingComplete, onSubmitted}) {
return Container(
margin: EdgeInsets.only(top: 13),
child: TextField(
onTap: onTap,
onChanged: onChanged,
onEditingComplete: onEditingComplete,
onSubmitted: onSubmitted,
obscureText: true,
cursorColor: primaryColor,
style: inputFieldHintPaswordTextStyle,
decoration: InputDecoration(
hintText: hintText,
hintStyle: inputFieldHintPaswordTextStyle,
focusedBorder: inputFieldFocusedBorderStyle,
contentPadding: EdgeInsets.symmetric(horizontal: 20, vertical: 10),
border: inputFieldDefaultBorderStyle),
),
);
}
import 'package:flutter/material.dart';
import './colors.dart';
/////////////////////////////////
/// TEXT STYLES
////////////////////////////////
const logoStyle = TextStyle(
fontFamily: 'Pacifico',
fontSize: 30,
color: Colors.black54,
letterSpacing: 2);
const logoWhiteStyle = TextStyle(
fontFamily: 'Pacifico',
fontSize: 21,
letterSpacing: 2,
color: Colors.white);
const whiteText = TextStyle(color: Colors.white, fontFamily: 'Poppins');
const disabledText = TextStyle(color: Colors.grey, fontFamily: 'Poppins');
const contrastText = TextStyle(color: primaryColor, fontFamily: 'Poppins');
const contrastTextBold = TextStyle(
color: primaryColor, fontFamily: 'Poppins', fontWeight: FontWeight.w600);
const h3 = TextStyle(
color: Colors.black,
fontSize: 24,
fontWeight: FontWeight.w800,
fontFamily: 'Poppins');
const h4 = TextStyle(
color: Colors.black,
fontSize: 18,
fontWeight: FontWeight.w700,
fontFamily: 'Poppins');
const h5 = TextStyle(
color: Colors.black,
fontSize: 18,
fontWeight: FontWeight.w500,
fontFamily: 'Poppins');
const h6 = TextStyle(
color: Colors.black,
fontSize: 16,
fontWeight: FontWeight.w500,
fontFamily: 'Poppins');
const priceText = TextStyle(
color: Colors.black,
fontSize: 19,
fontWeight: FontWeight.w800,
fontFamily: 'Poppins');
const foodNameText = TextStyle(
color: Colors.black,
fontSize: 17,
fontWeight: FontWeight.w600,
fontFamily: 'Poppins');
const tabLinkStyle =
TextStyle(fontWeight: FontWeight.w500);
const taglineText = TextStyle(color: Colors.grey, fontFamily: 'Poppins');
const categoryText = TextStyle(
color: Color(0xff444444),
fontWeight: FontWeight.w700,
fontFamily: 'Poppins');
const inputFieldTextStyle =
TextStyle(fontFamily: 'Poppins', fontWeight: FontWeight.w500);
const inputFieldHintTextStyle =
TextStyle(fontFamily: 'Poppins', color: Color(0xff444444));
const inputFieldPasswordTextStyle = TextStyle(
fontFamily: 'Poppins', fontWeight: FontWeight.w500, letterSpacing: 3);
const inputFieldHintPaswordTextStyle = TextStyle(
fontFamily: 'Poppins', color: Color(0xff444444), letterSpacing: 2);
///////////////////////////////////
/// BOX DECORATION STYLES
//////////////////////////////////
const authPlateDecoration = BoxDecoration(
color: white,
boxShadow: [
BoxShadow(
color: Color.fromRGBO(0, 0, 0, .1),
blurRadius: 10,
spreadRadius: 5,
offset: Offset(0, 1))
],
borderRadius: BorderRadiusDirectional.only(
bottomEnd: Radius.circular(20), bottomStart: Radius.circular(20)));
/////////////////////////////////////
/// INPUT FIELD DECORATION STYLES
////////////////////////////////////
const inputFieldFocusedBorderStyle = OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(6)),
borderSide: BorderSide(
color: primaryColor,
));
const inputFieldDefaultBorderStyle = OutlineInputBorder(
gapPadding: 0, borderRadius: BorderRadius.all(Radius.circular(6)));
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
class UserSecureStorage {
static final _storage = FlutterSecureStorage();
static const _keyToken = 'usertoken';
static const _keyUserId = 'userid';
static const _keyBottleId = 'bottleid';
static const _keyMedicineId = 'medicineid';
static const _keyhubId = 'hubid';
static Future setUserId(String userid) async =>
await _storage.write(key: _keyUserId, value: userid);
static Future<String> getUserID() async =>
await _storage.read(key: _keyUserId);
static Future setUserToken(String userToken) async =>
await _storage.write(key: _keyToken, value: userToken);
static Future<String> getUserToken() async =>
await _storage.read(key: _keyToken);
static Future setBottleId(String bottleid) async =>
await _storage.write(key: _keyBottleId, value: bottleid);
static Future<String> getBottleId() async =>
await _storage.read(key: _keyBottleId);
static Future setMedicineId(String medicineid) async =>
await _storage.write(key: _keyMedicineId, value: medicineid);
static Future<String> getMedicineId() async =>
await _storage.read(key: _keyMedicineId);
static Future setHubId(String hubid) async =>
await _storage.write(key: _keyhubId, value: hubid);
static Future<String> getHubId() async => await _storage.read(key: _keyhubId);
}
# Generated by pub
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
async:
dependency: transitive
description:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.5.0-nullsafety.1"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0-nullsafety.1"
characters:
dependency: transitive
description:
name: characters
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0-nullsafety.3"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0-nullsafety.1"
clock:
dependency: transitive
description:
name: clock
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0-nullsafety.1"
collection:
dependency: transitive
description:
name: collection
url: "https://pub.dartlang.org"
source: hosted
version: "1.15.0-nullsafety.3"
convert:
dependency: transitive
description:
name: convert
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
cupertino_icons:
dependency: "direct main"
description:
name: cupertino_icons
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.3"
fake_async:
dependency: transitive
description:
name: fake_async
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0-nullsafety.1"
ffi:
dependency: transitive
description:
name: ffi
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.3"
file:
dependency: transitive
description:
name: file
url: "https://pub.dartlang.org"
source: hosted
version: "5.2.1"
fixnum:
dependency: transitive
description:
name: fixnum
url: "https://pub.dartlang.org"
source: hosted
version: "0.10.11"
flutter:
dependency: "direct main"
description: flutter
source: sdk
version: "0.0.0"
flutter_blue:
dependency: "direct main"
description:
name: flutter_blue
url: "https://pub.dartlang.org"
source: hosted
version: "0.7.2"
flutter_datetime_picker:
dependency: "direct main"
description:
name: flutter_datetime_picker
url: "https://pub.dartlang.org"
source: hosted
version: "1.5.0"
flutter_dotenv:
dependency: "direct main"
description:
name: flutter_dotenv
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
flutter_local_notifications:
dependency: "direct main"
description:
name: flutter_local_notifications
url: "https://pub.dartlang.org"
source: hosted
version: "1.5.0+1"
flutter_local_notifications_platform_interface:
dependency: transitive
description:
name: flutter_local_notifications_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.1"
flutter_screenutil:
dependency: "direct main"
description:
name: flutter_screenutil
url: "https://pub.dartlang.org"
source: hosted
version: "0.7.0"
flutter_secure_storage:
dependency: "direct main"
description:
name: flutter_secure_storage
url: "https://pub.dartlang.org"
source: hosted
version: "3.3.5"
flutter_test:
dependency: "direct dev"
description: flutter
source: sdk
version: "0.0.0"
flutter_web_plugins:
dependency: transitive
description: flutter
source: sdk
version: "0.0.0"
http:
dependency: "direct main"
description:
name: http
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.2"
http_parser:
dependency: transitive
description:
name: http_parser
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:
name: intl
url: "https://pub.dartlang.org"
source: hosted
version: "0.16.1"
logging:
dependency: transitive
description:
name: logging
url: "https://pub.dartlang.org"
source: hosted
version: "0.11.4"
mailer:
dependency: "direct main"
description:
name: mailer
url: "https://pub.dartlang.org"
source: hosted
version: "3.3.0"
matcher:
dependency: transitive
description:
name: matcher
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.10-nullsafety.1"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0-nullsafety.3"
mime:
dependency: transitive
description:
name: mime
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:
name: page_transition
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.7+6"
path:
dependency: transitive
description:
name: path
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0-nullsafety.1"
path_provider:
dependency: "direct main"
description:
name: path_provider
url: "https://pub.dartlang.org"
source: hosted
version: "1.6.28"
path_provider_linux:
dependency: transitive
description:
name: path_provider_linux
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.1+2"
path_provider_macos:
dependency: transitive
description:
name: path_provider_macos
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.4+8"
path_provider_platform_interface:
dependency: transitive
description:
name: path_provider_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.4"
path_provider_windows:
dependency: transitive
description:
name: path_provider_windows
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.4+3"
pedantic:
dependency: transitive
description:
name: pedantic
url: "https://pub.dartlang.org"
source: hosted
version: "1.9.0"
platform:
dependency: transitive
description:
name: platform
url: "https://pub.dartlang.org"
source: hosted
version: "2.2.1"
plugin_platform_interface:
dependency: transitive
description:
name: plugin_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.3"
process:
dependency: transitive
description:
name: process
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.13"
protobuf:
dependency: transitive
description:
name: protobuf
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.3"
rxdart:
dependency: "direct main"
description:
name: rxdart
url: "https://pub.dartlang.org"
source: hosted
version: "0.24.1"
shared_preferences:
dependency: "direct main"
description:
name: shared_preferences
url: "https://pub.dartlang.org"
source: hosted
version: "0.5.12+4"
shared_preferences_linux:
dependency: transitive
description:
name: shared_preferences_linux
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.2+4"
shared_preferences_macos:
dependency: transitive
description:
name: shared_preferences_macos
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.1+11"
shared_preferences_platform_interface:
dependency: transitive
description:
name: shared_preferences_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.4"
shared_preferences_web:
dependency: transitive
description:
name: shared_preferences_web
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.2+7"
shared_preferences_windows:
dependency: transitive
description:
name: shared_preferences_windows
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.2+3"
sky_engine:
dependency: transitive
description: flutter
source: sdk
version: "0.0.99"
source_span:
dependency: transitive
description:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0-nullsafety.2"
sqflite:
dependency: "direct main"
description:
name: sqflite
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.1+2"
sqflite_common:
dependency: transitive
description:
name: sqflite_common
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.3+3"
stack_trace:
dependency: transitive
description:
name: stack_trace
url: "https://pub.dartlang.org"
source: hosted
version: "1.10.0-nullsafety.1"
stream_channel:
dependency: transitive
description:
name: stream_channel
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0-nullsafety.1"
string_scanner:
dependency: transitive
description:
name: string_scanner
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0-nullsafety.1"
synchronized:
dependency: transitive
description:
name: synchronized
url: "https://pub.dartlang.org"
source: hosted
version: "2.2.0+2"
term_glyph:
dependency: transitive
description:
name: term_glyph
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0-nullsafety.1"
test_api:
dependency: transitive
description:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.19-nullsafety.2"
timezone:
dependency: "direct main"
description:
name: timezone
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.1"
typed_data:
dependency: transitive
description:
name: typed_data
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0-nullsafety.3"
vector_math:
dependency: transitive
description:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0-nullsafety.3"
win32:
dependency: transitive
description:
name: win32
url: "https://pub.dartlang.org"
source: hosted
version: "1.7.4+1"
xdg_directories:
dependency: transitive
description:
name: xdg_directories
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.0"
sdks:
dart: ">=2.10.0-110 <2.11.0"
flutter: ">=1.20.0 <2.0.0"
name: Smart_Medicine_Box
description: A new Flutter project.
# The following line prevents the package from being accidentally published to
# pub.dev using `pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.0+1
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
flutter_screenutil: ^0.7.0
page_transition: '^1.1.5'
mailer: '^3.0.4'
flutter_local_notifications: ^1.4.4+5
rxdart: ^0.24.0
flutter_datetime_picker: ^1.3.4
timezone: ^0.6.0
intl : ^0.16.1
shared_preferences: ^0.5.12+2
flutter_blue: ^0.7.2
cupertino_icons: ^0.1.3
http: ^0.12.0+4
flutter_dotenv: ^2.1.0
numberpicker: ^1.3.0
flutter_secure_storage: ^3.3.5
sqflite: ^1.1.6
path_provider: ^1.2.0
dev_dependencies:
flutter_test:
sdk: flutter
flutter:
uses-material-design: true
assets:
- .env
- images/
- images/main_logo.png
- images/setting.png
fonts:
# - family: Raleway
# fonts:
# - asset: fonts/Raleway-Regular.ttf
# - asset: fonts/Raleway-Italic.ttf
# style: italic
- family: NotoSansKR
fonts:
- asset: assets/fonts/NotoSansKR-Regular.otf
- asset: assets/fonts/NotoSansKR-Bold.otf
weight: 500
- asset: assets/fonts/NotoSansKR-Black.otf
weight: 700
\ No newline at end of file
// This is a basic Flutter widget test.
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility that Flutter provides. For example, you can send tap and scroll
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:Smart_Medicine_Box/main.dart';
void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
// Build our app and trigger a frame.
await tester.pumpWidget(MyApp());
// Verify that our counter starts at 0.
expect(find.text('0'), findsOneWidget);
expect(find.text('1'), findsNothing);
// Tap the '+' icon and trigger a frame.
await tester.tap(find.byIcon(Icons.add));
await tester.pump();
// Verify that our counter has incremented.
expect(find.text('0'), findsNothing);
expect(find.text('1'), findsOneWidget);
});
}