Skip to content

Commit

Permalink
refs #91 体温系の処理Done
Browse files Browse the repository at this point in the history
  • Loading branch information
yukiho committed Nov 7, 2020
1 parent f4434f2 commit 6cd1dca
Show file tree
Hide file tree
Showing 11 changed files with 337 additions and 55 deletions.
4 changes: 4 additions & 0 deletions front/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
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.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.NFC" />
<application
android:name="io.flutter.app.FlutterApplication"
android:label="design"
Expand Down
1 change: 1 addition & 0 deletions front/android/settings_aar.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include ':app'
42 changes: 42 additions & 0 deletions front/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
PODS:
- Flutter (1.0.0)
- flutter_blue (0.0.1):
- Flutter
- flutter_blue/Protos (= 0.0.1)
- flutter_blue/Protos (0.0.1):
- Flutter
- Protobuf (~> 3.11.4)
- flutter_nfc_reader (0.0.1):
- Flutter
- VYNFCKit
- Protobuf (3.11.4)
- VYNFCKit (0.3.2)

DEPENDENCIES:
- Flutter (from `Flutter`)
- flutter_blue (from `.symlinks/plugins/flutter_blue/ios`)
- flutter_nfc_reader (from `.symlinks/plugins/flutter_nfc_reader/ios`)

SPEC REPOS:
trunk:
- Protobuf
- VYNFCKit

EXTERNAL SOURCES:
Flutter:
:path: Flutter
flutter_blue:
:path: ".symlinks/plugins/flutter_blue/ios"
flutter_nfc_reader:
:path: ".symlinks/plugins/flutter_nfc_reader/ios"

SPEC CHECKSUMS:
Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
flutter_blue: eeb381dc4727a0954dede73515f683865494b370
flutter_nfc_reader: 67d71071d779d28b827ea50dcbe00d09286f253d
Protobuf: 176220c526ad8bd09ab1fb40a978eac3fef665f7
VYNFCKit: 86a9b711fd1f34f6f7128a2a883cd58dbd781b9d

PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c

COCOAPODS: 1.10.0
68 changes: 68 additions & 0 deletions front/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
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 */; };
BD0415987DA1D438C4275D1C /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAC4FB2A5C7DF28B46B430A /* Pods_Runner.framework */; };
/* End PBXBuildFile section */

/* Begin PBXCopyFilesBuildPhase section */
Expand All @@ -31,7 +32,9 @@
/* 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>"; };
30F1770DF4635C996EE8E56D /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
3DAC4FB2A5C7DF28B46B430A /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
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>"; };
Expand All @@ -42,19 +45,41 @@
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>"; };
C2FDC04290EA6164F598793C /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
CF7C45D1D5DDEE41373F31FD /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
97C146EB1CF9000F007C117D /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
BD0415987DA1D438C4275D1C /* Pods_Runner.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
31DFC141E9177474E6A6C9FF /* Frameworks */ = {
isa = PBXGroup;
children = (
3DAC4FB2A5C7DF28B46B430A /* Pods_Runner.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
485B5F077DC96AD9DB9E4B87 /* Pods */ = {
isa = PBXGroup;
children = (
30F1770DF4635C996EE8E56D /* Pods-Runner.debug.xcconfig */,
CF7C45D1D5DDEE41373F31FD /* Pods-Runner.release.xcconfig */,
C2FDC04290EA6164F598793C /* Pods-Runner.profile.xcconfig */,
);
name = Pods;
path = Pods;
sourceTree = "<group>";
};
9740EEB11CF90186004384FC /* Flutter */ = {
isa = PBXGroup;
children = (
Expand All @@ -72,6 +97,8 @@
9740EEB11CF90186004384FC /* Flutter */,
97C146F01CF9000F007C117D /* Runner */,
97C146EF1CF9000F007C117D /* Products */,
485B5F077DC96AD9DB9E4B87 /* Pods */,
31DFC141E9177474E6A6C9FF /* Frameworks */,
);
sourceTree = "<group>";
};
Expand Down Expand Up @@ -105,12 +132,14 @@
isa = PBXNativeTarget;
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
buildPhases = (
6806E96B85DB019C39FD6686 /* [CP] Check Pods Manifest.lock */,
9740EEB61CF901F6004384FC /* Run Script */,
97C146EA1CF9000F007C117D /* Sources */,
97C146EB1CF9000F007C117D /* Frameworks */,
97C146EC1CF9000F007C117D /* Resources */,
9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
50164F27F11B94728878B8C8 /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
Expand Down Expand Up @@ -183,6 +212,45 @@
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
};
50164F27F11B94728878B8C8 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
6806E96B85DB019C39FD6686 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
Expand Down
3 changes: 3 additions & 0 deletions front/ios/Runner.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

107 changes: 78 additions & 29 deletions front/lib/routes/RegTempDevice.dart
Original file line number Diff line number Diff line change
@@ -1,48 +1,97 @@
import 'package:amazon_cognito_identity_dart_2/cognito.dart';
import 'package:flutter/material.dart';
import 'package:flutter_blue/flutter_blue.dart';
import './AccountMenu.dart';

class RegTempDevice extends StatelessWidget {
class RegTempDevice extends StatefulWidget {
final CognitoUserSession _session;

RegTempDevice(this._session);

@override
_RegTempDeviceState createState() => _RegTempDeviceState(_session);
}

class _RegTempDeviceState extends State<RegTempDevice> {
final CognitoUserSession _session;

List<ScanResult> deviceList;

_RegTempDeviceState(this._session);

@override
void initState() {
super.initState();
_scan();
}

@override
Widget build(BuildContext context) {
List<Widget> _widgets = [];

if(deviceList == null) {
deviceList = [];
}
for(var result in deviceList) {
_widgets.add(Card(
child: ListTile(
title: Text(result.device.name),
trailing: Icon(Icons.arrow_right),
onTap: () => {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => AccountMenu(_session))
)
},
),
));
}

var base = <Widget>[
ListTile(title: Text('検温デバイス設定')),
Padding(
padding: EdgeInsets.only(top: 10.0, right: 30.0, bottom: 10.0, left: 30.0),
child: Text(
'下に表示されるリストの中から、登録するデバイスを選択してください。'
),
),
Padding(
padding: EdgeInsets.only(top: 10.0, right: 30.0, bottom: 10.0, left: 30.0),
child: Text(
'表示されない場合は、以下の2点をご確認ください。\n ・機器の電源が入っているか\n ・スマートフォンと機器を近づけているか'
),
),
ListTile(title: Text('検出した検温デバイス一覧')),
];

base.addAll(_widgets);

return Scaffold(
appBar: AppBar(
title: Text('検温デバイス設定'),
),
body: ListView(
children: <Widget>[
ListTile(title: Text('検温デバイス設定')),
Padding(
padding: EdgeInsets.only(top: 10.0, right: 30.0, bottom: 10.0, left: 30.0),
child: Text(
'下に表示されるリストの中から、登録するデバイスを選択してください。'
),
),
Padding(
padding: EdgeInsets.only(top: 10.0, right: 30.0, bottom: 10.0, left: 30.0),
child: Text(
'表示されない場合は、以下の2点をご確認ください。\n ・機器の電源が入っているか\n ・スマートフォンと機器を近づけているか'
),
),
ListTile(title: Text('検出した検温デバイス一覧')),
Card(
child: ListTile(
title: Text('MAKURA Device'),
trailing: Icon(Icons.arrow_right),
onTap: () => {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => AccountMenu(_session))
)
},
),
),
],
children: base,
)
);
}

_scan() {
FlutterBlue flutterBlue = FlutterBlue.instance;
// Start scanning
flutterBlue.startScan(timeout: Duration(seconds: 4));

// Listen to scan results
flutterBlue.scanResults.listen((results) {
// do something with scan results
for (ScanResult r in results) {
print('${r.device.name} found! rssi: ${r.rssi}');
}
// deviceList = results;
});

// Stop scanning
flutterBlue.stopScan();
print('Scan stoped.');
}
}
2 changes: 1 addition & 1 deletion front/lib/routes/TempLog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class TempLog extends StatelessWidget {
onTap: () => {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => TempLogTempDevice())
MaterialPageRoute(builder: (context) => TempLogTempDevice(_session))
)
},
),
Expand Down
Loading

0 comments on commit 6cd1dca

Please sign in to comment.