Skip to content

Commit c1ef424

Browse files
authored
Merge pull request #26 from OpenRowingCommunity/de-future
De future
2 parents 1fcfef8 + dca6ab0 commit c1ef424

File tree

22 files changed

+373
-255
lines changed

22 files changed

+373
-255
lines changed

.github/workflows/dart.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,19 @@ jobs:
1616
runs-on: ubuntu-latest
1717

1818
steps:
19-
- uses: actions/checkout@v2
19+
- uses: actions/checkout@v4
2020

2121
# Note: This workflow uses the latest stable version of the Dart SDK.
2222
# You can specify other versions if desired, see documentation here:
2323
# https://github.com/dart-lang/setup-dart/blob/main/README.md
24-
# - uses: dart-lang/setup-dart@v1
25-
- uses: dart-lang/setup-dart@9a04e6d73cca37bd455e0608d7e5092f881fd603
24+
- uses: dart-lang/setup-dart@v1
25+
with:
26+
sdk: 3.1.3
2627

2728
- uses: subosito/flutter-action@v1
2829
with:
2930
channel: 'stable'
31+
flutter-version: 3.13.0
3032

3133
- name: Install dependencies
3234
run: flutter pub get
@@ -37,7 +39,7 @@ jobs:
3739

3840
# Consider passing '--fatal-infos' for slightly stricter analysis.
3941
- name: Analyze project source
40-
run: flutter analyze
42+
run: flutter analyze --no-fatal-infos --no-fatal-warnings
4143

4244
# Your project will need to have tests in test/ and a dependency on
4345
# package:test for this step to succeed. Note that Flutter projects will

.idea/libraries/Dart_SDK.xml

Lines changed: 19 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/workspace.xml

Lines changed: 64 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 22 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -109,32 +109,28 @@ myErg.monitorForWorkoutSummary().listen((workoutSummary) {
109109
```
110110

111111
Each workout summary is a flutter object that contains the following fields:
112-
- `Future<DateTime> timestamp`
113-
- `Future<double> workTime`
114-
- `Future<double> workDistance`
115-
- `Future<int> avgSPM`
116-
- `Future<int> endHeartRate`
117-
- `Future<int> avgHeartRate`
118-
- `Future<int> minHeartRate`
119-
- `Future<int> maxHeartRate`
120-
- `Future<int> avgDragFactor`
121-
- `Future<int> recoveryHeartRate`
122-
- `Future<WorkoutType> workoutType`
123-
- `Future<double> avgPace`
124-
- `Future<IntervalType> intervalType`
125-
- `Future<int> intervalSize`
126-
- `Future<int> intervalCount`
127-
- `Future<int> totalCalories`
128-
- `Future<int> watts`
129-
- `Future<int> totalRestDistance`
130-
- `Future<int> intervalRestTime`
131-
- `Future<int> avgCalories`
132-
133-
Futures are handy here since the erg can send back different data at different times. The primary reason for this is the `recoveryHeartRate` field which the erg sends after the user has been resting for 1 minute. If the workout is cancelled or the erg is turned off before the end of this minute, the data may never arrive. See #10.
134-
135-
Overall this method of accessing workout summary data is not the most ideal, and is likely to change later if a better solution is found. See #11.
136-
137-
112+
- `timestamp`
113+
- `workTime`
114+
- `workDistance`
115+
- `avgSPM`
116+
- `endHeartRate`
117+
- `avgHeartRate`
118+
- `minHeartRate`
119+
- `maxHeartRate`
120+
- `avgDragFactor`
121+
- `recoveryHeartRate`
122+
- `workoutType`
123+
- `avgPace`
124+
- `intervalType`
125+
- `intervalSize`
126+
- `intervalCount`
127+
- `totalCalories`
128+
- `watts`
129+
- `totalRestDistance`
130+
- `intervalRestTime`
131+
- `avgCalories`
132+
133+
The `recoveryHeartRate` field is one that the erg sends after the rower has been resting for 1 minute. If the workout is cancelled or the erg is turned off before the end of this minute, the data may never arrive. See #10. This is likely to change later if a better solution is found. See #11.
138134

139135

140136

c2bluetooth.iml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@
99
<excludeFolder url="file://$MODULE_DIR$/.idea" />
1010
<excludeFolder url="file://$MODULE_DIR$/.pub" />
1111
<excludeFolder url="file://$MODULE_DIR$/build" />
12+
<excludeFolder url="file://$MODULE_DIR$/example/build" />
13+
<excludeFolder url="file://$MODULE_DIR$/example/.dart_tool" />
14+
<excludeFolder url="file://$MODULE_DIR$/example/.pub" />
15+
<excludeFolder url="file://$MODULE_DIR$/example/ios/.symlinks/plugins/flutter_ble_lib_ios_15/example/.dart_tool" />
16+
<excludeFolder url="file://$MODULE_DIR$/example/ios/.symlinks/plugins/flutter_ble_lib_ios_15/example/.pub" />
17+
<excludeFolder url="file://$MODULE_DIR$/example/ios/.symlinks/plugins/flutter_ble_lib_ios_15/example/build" />
18+
<excludeFolder url="file://$MODULE_DIR$/example/ios/.symlinks/plugins/flutter_ble_lib_ios_15/.dart_tool" />
19+
<excludeFolder url="file://$MODULE_DIR$/example/ios/.symlinks/plugins/flutter_ble_lib_ios_15/.pub" />
20+
<excludeFolder url="file://$MODULE_DIR$/example/ios/.symlinks/plugins/flutter_ble_lib_ios_15/build" />
1221
</content>
1322
<orderEntry type="jdk" jdkName="Android API 29 Platform" jdkType="Android SDK" />
1423
<orderEntry type="sourceFolder" forTests="false" />

example/android/app/build.gradle

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ apply plugin: 'kotlin-android'
2626
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
2727

2828
android {
29-
compileSdkVersion 30
29+
// Any value starting with "flutter." get its value from
30+
// the Flutter Gradle plugin.
31+
compileSdk flutter.compileSdkVersion
3032

3133
sourceSets {
3234
main.java.srcDirs += 'src/main/kotlin'
@@ -35,8 +37,10 @@ android {
3537
defaultConfig {
3638
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
3739
applicationId "com.example.fresh_example"
38-
minSdkVersion 18
39-
targetSdkVersion 30
40+
// You can update the following value to match your application needs.
41+
minSdk flutter.minSdkVersion
42+
targetSdk flutter.targetSdkVersion
43+
// You can set these values in the property declaration or use a variable
4044
versionCode flutterVersionCode.toInteger()
4145
versionName flutterVersionName
4246
}

example/android/app/src/main/AndroidManifest.xml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
22
package="com.example.fresh_example">
3+
<!-- https://developer.android.com/guide/topics/connectivity/bluetooth/permissions -->
4+
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" android:usesPermissionFlags="neverForLocation" />
5+
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
6+
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" android:maxSdkVersion="30" />
7+
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" android:maxSdkVersion="30" />
8+
39
<application
410
android:label="fresh_example"
511
android:icon="@mipmap/ic_launcher">
@@ -9,7 +15,8 @@
915
android:theme="@style/LaunchTheme"
1016
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
1117
android:hardwareAccelerated="true"
12-
android:windowSoftInputMode="adjustResize">
18+
android:windowSoftInputMode="adjustResize"
19+
android:exported="true">
1320
<!-- Specifies an Android theme to apply to this Activity as soon as
1421
the Android process has started. This theme is visible to the user
1522
while the Flutter UI initializes. After that, this theme continues
@@ -18,15 +25,6 @@
1825
android:name="io.flutter.embedding.android.NormalTheme"
1926
android:resource="@style/NormalTheme"
2027
/>
21-
<!-- Displays an Android View that continues showing the launch screen
22-
Drawable until Flutter paints its first frame, then this splash
23-
screen fades out. A splash screen is useful to avoid any visual
24-
gap between the end of Android's launch screen and the painting of
25-
Flutter's first frame. -->
26-
<meta-data
27-
android:name="io.flutter.embedding.android.SplashScreenDrawable"
28-
android:resource="@drawable/launch_background"
29-
/>
3028
<intent-filter>
3129
<action android:name="android.intent.action.MAIN"/>
3230
<category android:name="android.intent.category.LAUNCHER"/>

example/android/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
buildscript {
2-
ext.kotlin_version = '1.3.50'
2+
ext.kotlin_version = '1.5.20'
33
repositories {
44
google()
55
jcenter()
66
}
77

88
dependencies {
9-
classpath 'com.android.tools.build:gradle:4.1.0'
9+
classpath 'com.android.tools.build:gradle:7.4.1'
1010
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1111
}
1212
}
@@ -24,6 +24,6 @@ subprojects {
2424
project.evaluationDependsOn(':app')
2525
}
2626

27-
task clean(type: Delete) {
28-
delete rootProject.buildDir
27+
tasks.register("clean", Delete) {
28+
delete rootProject.layout.buildDirectory
2929
}

example/android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip

example/ios/Flutter/AppFrameworkInfo.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
<key>CFBundleVersion</key>
2222
<string>1.0</string>
2323
<key>MinimumOSVersion</key>
24-
<string>8.0</string>
24+
<string>11.0</string>
2525
</dict>
2626
</plist>

0 commit comments

Comments
 (0)