Skip to content

Commit

Permalink
Merge pull request #2 from emdgroup/chore_advanced_workflow
Browse files Browse the repository at this point in the history
chore: example for custom workflow
  • Loading branch information
KochC authored Nov 18, 2024
2 parents f7548d9 + 20b4995 commit 9014070
Show file tree
Hide file tree
Showing 141 changed files with 2,676 additions and 21 deletions.
20 changes: 10 additions & 10 deletions .flutter-plugins
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# This is a generated file; do not edit or check into version control.
haptic_feedback=/Users/runner/.pub-cache/hosted/pub.dev/haptic_feedback-0.4.2/
path_provider_linux=/Users/runner/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/
path_provider_windows=/Users/runner/.pub-cache/hosted/pub.dev/path_provider_windows-2.3.0/
sensors_plus=/Users/runner/.pub-cache/hosted/pub.dev/sensors_plus-5.0.1/
shared_preferences=/Users/runner/.pub-cache/hosted/pub.dev/shared_preferences-2.3.3/
shared_preferences_android=/Users/runner/.pub-cache/hosted/pub.dev/shared_preferences_android-2.3.3/
shared_preferences_foundation=/Users/runner/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.5.3/
shared_preferences_linux=/Users/runner/.pub-cache/hosted/pub.dev/shared_preferences_linux-2.4.1/
shared_preferences_web=/Users/runner/.pub-cache/hosted/pub.dev/shared_preferences_web-2.4.2/
shared_preferences_windows=/Users/runner/.pub-cache/hosted/pub.dev/shared_preferences_windows-2.4.1/
haptic_feedback=/Users/joshuawellbrock/.pub-cache/hosted/pub.dev/haptic_feedback-0.4.2/
path_provider_linux=/Users/joshuawellbrock/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/
path_provider_windows=/Users/joshuawellbrock/.pub-cache/hosted/pub.dev/path_provider_windows-2.3.0/
sensors_plus=/Users/joshuawellbrock/.pub-cache/hosted/pub.dev/sensors_plus-5.0.1/
shared_preferences=/Users/joshuawellbrock/.pub-cache/hosted/pub.dev/shared_preferences-2.3.3/
shared_preferences_android=/Users/joshuawellbrock/.pub-cache/hosted/pub.dev/shared_preferences_android-2.3.3/
shared_preferences_foundation=/Users/joshuawellbrock/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.5.3/
shared_preferences_linux=/Users/joshuawellbrock/.pub-cache/hosted/pub.dev/shared_preferences_linux-2.4.1/
shared_preferences_web=/Users/joshuawellbrock/.pub-cache/hosted/pub.dev/shared_preferences_web-2.4.2/
shared_preferences_windows=/Users/joshuawellbrock/.pub-cache/hosted/pub.dev/shared_preferences_windows-2.4.1/
2 changes: 1 addition & 1 deletion .flutter-plugins-dependencies
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"haptic_feedback","path":"/Users/runner/.pub-cache/hosted/pub.dev/haptic_feedback-0.4.2/","native_build":true,"dependencies":[]},{"name":"sensors_plus","path":"/Users/runner/.pub-cache/hosted/pub.dev/sensors_plus-5.0.1/","native_build":true,"dependencies":[]},{"name":"shared_preferences_foundation","path":"/Users/runner/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.5.3/","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"android":[{"name":"haptic_feedback","path":"/Users/runner/.pub-cache/hosted/pub.dev/haptic_feedback-0.4.2/","native_build":true,"dependencies":[]},{"name":"sensors_plus","path":"/Users/runner/.pub-cache/hosted/pub.dev/sensors_plus-5.0.1/","native_build":true,"dependencies":[]},{"name":"shared_preferences_android","path":"/Users/runner/.pub-cache/hosted/pub.dev/shared_preferences_android-2.3.3/","native_build":true,"dependencies":[]}],"macos":[{"name":"shared_preferences_foundation","path":"/Users/runner/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.5.3/","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/Users/runner/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/","native_build":false,"dependencies":[]},{"name":"shared_preferences_linux","path":"/Users/runner/.pub-cache/hosted/pub.dev/shared_preferences_linux-2.4.1/","native_build":false,"dependencies":["path_provider_linux"]}],"windows":[{"name":"path_provider_windows","path":"/Users/runner/.pub-cache/hosted/pub.dev/path_provider_windows-2.3.0/","native_build":false,"dependencies":[]},{"name":"shared_preferences_windows","path":"/Users/runner/.pub-cache/hosted/pub.dev/shared_preferences_windows-2.4.1/","native_build":false,"dependencies":["path_provider_windows"]}],"web":[{"name":"sensors_plus","path":"/Users/runner/.pub-cache/hosted/pub.dev/sensors_plus-5.0.1/","dependencies":[]},{"name":"shared_preferences_web","path":"/Users/runner/.pub-cache/hosted/pub.dev/shared_preferences_web-2.4.2/","dependencies":[]}]},"dependencyGraph":[{"name":"haptic_feedback","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"sensors_plus","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_android","shared_preferences_foundation","shared_preferences_linux","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_android","dependencies":[]},{"name":"shared_preferences_foundation","dependencies":[]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]}],"date_created":"2024-11-18 10:29:06.385178","version":"3.24.3","swift_package_manager_enabled":false}
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"haptic_feedback","path":"/Users/joshuawellbrock/.pub-cache/hosted/pub.dev/haptic_feedback-0.4.2/","native_build":true,"dependencies":[]},{"name":"sensors_plus","path":"/Users/joshuawellbrock/.pub-cache/hosted/pub.dev/sensors_plus-5.0.1/","native_build":true,"dependencies":[]},{"name":"shared_preferences_foundation","path":"/Users/joshuawellbrock/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.5.3/","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"android":[{"name":"haptic_feedback","path":"/Users/joshuawellbrock/.pub-cache/hosted/pub.dev/haptic_feedback-0.4.2/","native_build":true,"dependencies":[]},{"name":"sensors_plus","path":"/Users/joshuawellbrock/.pub-cache/hosted/pub.dev/sensors_plus-5.0.1/","native_build":true,"dependencies":[]},{"name":"shared_preferences_android","path":"/Users/joshuawellbrock/.pub-cache/hosted/pub.dev/shared_preferences_android-2.3.3/","native_build":true,"dependencies":[]}],"macos":[{"name":"shared_preferences_foundation","path":"/Users/joshuawellbrock/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.5.3/","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/Users/joshuawellbrock/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/","native_build":false,"dependencies":[]},{"name":"shared_preferences_linux","path":"/Users/joshuawellbrock/.pub-cache/hosted/pub.dev/shared_preferences_linux-2.4.1/","native_build":false,"dependencies":["path_provider_linux"]}],"windows":[{"name":"path_provider_windows","path":"/Users/joshuawellbrock/.pub-cache/hosted/pub.dev/path_provider_windows-2.3.0/","native_build":false,"dependencies":[]},{"name":"shared_preferences_windows","path":"/Users/joshuawellbrock/.pub-cache/hosted/pub.dev/shared_preferences_windows-2.4.1/","native_build":false,"dependencies":["path_provider_windows"]}],"web":[{"name":"sensors_plus","path":"/Users/joshuawellbrock/.pub-cache/hosted/pub.dev/sensors_plus-5.0.1/","dependencies":[]},{"name":"shared_preferences_web","path":"/Users/joshuawellbrock/.pub-cache/hosted/pub.dev/shared_preferences_web-2.4.2/","dependencies":[]}]},"dependencyGraph":[{"name":"haptic_feedback","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"sensors_plus","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_android","shared_preferences_foundation","shared_preferences_linux","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_android","dependencies":[]},{"name":"shared_preferences_foundation","dependencies":[]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]}],"date_created":"2024-11-18 13:28:10.718146","version":"3.24.3","swift_package_manager_enabled":false}
34 changes: 31 additions & 3 deletions .github/workflows/pr_dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,46 @@ jobs:
- name: Prepare Flutter
uses: emdgroup/mtrust-urp/.github/actions/prepare-flutter@main
with:
directory: example
directory: example/example

- name: Run static analysis
run: |
cd example
cd example/example
flutter analyze --no-fatal-warnings
shell: bash

- name: Check licenses
uses: emdgroup/mtrust-urp/.github/actions/check-dart-licenses@main
with:
directory: example
directory: example/example

build_advanced_example:
name: Build Advanced Example
needs: validate_pr
runs-on: macos-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Dart
uses: dart-lang/setup-dart@v1

- name: Prepare Flutter
uses: emdgroup/mtrust-urp/.github/actions/prepare-flutter@main
with:
directory: example/example_advanced

- name: Run static analysis
run: |
cd example/example_advanced
flutter analyze --no-fatal-warnings
shell: bash

- name: Check licenses
uses: emdgroup/mtrust-urp/.github/actions/check-dart-licenses@main
with:
directory: example/example_advanced

build_library:
name: Build Library
Expand Down
34 changes: 31 additions & 3 deletions .github/workflows/pr_main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,46 @@ jobs:
- name: Prepare Flutter
uses: emdgroup/mtrust-urp/.github/actions/prepare-flutter@main
with:
directory: example
directory: example/example

- name: Run static analysis
run: |
cd example
cd example/example
flutter analyze --no-fatal-warnings
shell: bash

- name: Check licenses
uses: emdgroup/mtrust-urp/.github/actions/check-dart-licenses@main
with:
directory: example
directory: example/example

build_advanced_example:
name: Build Advanced Example
needs: validate_pr
runs-on: macos-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Dart
uses: dart-lang/setup-dart@v1

- name: Prepare Flutter
uses: emdgroup/mtrust-urp/.github/actions/prepare-flutter@main
with:
directory: example/example_advanced

- name: Run static analysis
run: |
cd example/example_advanced
flutter analyze --no-fatal-warnings
shell: bash

- name: Check licenses
uses: emdgroup/mtrust-urp/.github/actions/check-dart-licenses@main
with:
directory: example/example_advanced

build_library:
name: Build Library
Expand Down
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,18 @@ To display the IMP Sheet, utilize the `ImpSheet` widget. It requires a connectio
```

## Use ImpReader to build custom workflows

To build custom workflows, utilize the `ImpReader` class. It requires a connection strategy to handle the connection between the device and the reader.

```dart
final reader = ImpReader(
connectionStrategy: _connectionStrategy,
);
```

With the `ImpReader` you can access all methods required to build workflows that meet your specific requirements. Please refer to the `example_advanced` for an example on how to build custom workflows.

## Configuration Options
- **Connection Strategies:** While BLE is the default, IMP-Kit supports various connection strategies. Ensure you include and configure the appropriate strategy package as needed.

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion example/pubspec.lock → example/example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ packages:
mtrust_imp_kit:
dependency: "direct main"
description:
path: ".."
path: "../.."
relative: true
source: path
version: "1.0.0-1"
Expand Down
4 changes: 2 additions & 2 deletions example/pubspec.yaml → example/example/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: example
description: "A new Flutter project."
description: "Example showcasing the use of ImpSheet (predefined workflow)."
publish_to: "none"
version: 0.1.0

Expand All @@ -10,7 +10,7 @@ dependencies:
flutter:
sdk: flutter
mtrust_imp_kit:
path: ../
path: ../../
mtrust_urp_ble_strategy: ^8.0.1
liquid_flutter: ^15.3.2

Expand Down
43 changes: 43 additions & 0 deletions example/example_advanced/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
migrate_working_dir/

# 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
.pub-cache/
.pub/
/build/

# Symbolication related
app.*.symbols

# Obfuscation related
app.*.map.json

# Android Studio will place build artifacts here
/android/app/debug
/android/app/profile
/android/app/release
36 changes: 36 additions & 0 deletions example/example_advanced/.metadata
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# 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: "abb292a07e20d696c4568099f918f6c5f330e6b0"
channel: "stable"

project_type: app

# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: abb292a07e20d696c4568099f918f6c5f330e6b0
base_revision: abb292a07e20d696c4568099f918f6c5f330e6b0
- platform: android
create_revision: abb292a07e20d696c4568099f918f6c5f330e6b0
base_revision: abb292a07e20d696c4568099f918f6c5f330e6b0
- platform: ios
create_revision: abb292a07e20d696c4568099f918f6c5f330e6b0
base_revision: abb292a07e20d696c4568099f918f6c5f330e6b0
- platform: web
create_revision: abb292a07e20d696c4568099f918f6c5f330e6b0
base_revision: abb292a07e20d696c4568099f918f6c5f330e6b0

# User provided section

# List of Local paths (relative to this file) that should be
# ignored by the migrate tool.
#
# Files that are not part of the templates will be ignored by default.
unmanaged_files:
- 'lib/main.dart'
- 'ios/Runner.xcodeproj/project.pbxproj'
3 changes: 3 additions & 0 deletions example/example_advanced/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# example

A new Flutter project.
1 change: 1 addition & 0 deletions example/example_advanced/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include: package:flutter_lints/flutter.yaml
13 changes: 13 additions & 0 deletions example/example_advanced/android/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
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
**/*.keystore
**/*.jks
67 changes: 67 additions & 0 deletions example/example_advanced/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
plugins {
id "com.android.application"
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
}

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}

android {
namespace "com.example.example"
compileSdk flutter.compileSdkVersion
ndkVersion flutter.ndkVersion

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = '1.8'
}

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.example"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdkVersion flutter.minSdkVersion
targetSdkVersion flutter.targetSdkVersion
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 {}
1 change: 1 addition & 0 deletions example/example_advanced/android/app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-keep class com.lib.flutter_blue_plus.* { *; }
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- The INTERNET permission is required for development. Specifically,
the Flutter tool 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>
Loading

0 comments on commit 9014070

Please sign in to comment.