Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[flutter_reactive_ble] Add flutter_reactive_ble_tizen package #542

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
- packages/firebase_core/**/*
"p: flutter_app_badger":
- packages/flutter_app_badger/**/*
"p: flutter_reactive_ble":
- packages/flutter_reactive_ble/**/*
"p: flutter_secure_storage":
- packages/flutter_secure_storage/**/*
"p: flutter_tts":
Expand Down
1 change: 1 addition & 0 deletions .github/recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ plugins:
wakelock: ["wearable-5.5"]

# No tests.
flutter_reactive_ble: []
google_sign_in: []
image_picker: []
firebase_core: []
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ The _"non-endorsed"_ status means that the plugin is not endorsed by the origina
| [**device_info_plus_tizen**](packages/device_info_plus) | [device_info_plus](https://pub.dev/packages/device_info_plus) (1st-party) | [![pub package](https://img.shields.io/pub/v/device_info_plus_tizen.svg)](https://pub.dev/packages/device_info_plus_tizen) | No |
| [**firebase_core_tizen**](packages/firebase_core) | [firebase_core](https://pub.dev/packages/firebase_core) | [![pub package](https://img.shields.io/pub/v/firebase_core_tizen.svg)](https://pub.dev/packages/firebase_core_tizen) | No |
| [**flutter_app_badger_tizen**](packages/flutter_app_badger) | [flutter_app_badger](https://pub.dev/packages/flutter_app_badger) (3rd-party) | [![pub package](https://img.shields.io/pub/v/flutter_app_badger_tizen.svg)](https://pub.dev/packages/flutter_app_badger_tizen) | No |
| [**flutter_reactive_ble_tizen**](packages/flutter_reactive_ble) | [flutter_reactive_ble](https://pub.dev/packages/flutter_reactive_ble) (3rd-party) | [![pub package](https://img.shields.io/pub/v/flutter_reactive_ble_tizen.svg)](https://pub.dev/packages/flutter_reactive_ble_tizen) | No |
| [**flutter_secure_storage_tizen**](packages/flutter_secure_storage) | [flutter_secure_storage](https://pub.dev/packages/flutter_secure_storage) (3rd-party) | [![pub package](https://img.shields.io/pub/v/flutter_secure_storage_tizen.svg)](https://pub.dev/packages/flutter_secure_storage_tizen) | No |
| [**flutter_tts_tizen**](packages/flutter_tts) | [flutter_tts](https://pub.dev/packages/flutter_tts) (3rd-party) | [![pub package](https://img.shields.io/pub/v/flutter_tts_tizen.svg)](https://pub.dev/packages/flutter_tts_tizen) | No |
| [**flutter_webrtc_tizen**](packages/flutter_webrtc) | [flutter_webrtc](https://pub.dev/packages/flutter_webrtc) (3rd-party) | [![pub package](https://img.shields.io/pub/v/flutter_webrtc_tizen.svg)](https://pub.dev/packages/flutter_webrtc_tizen) | No |
Expand Down Expand Up @@ -63,6 +64,7 @@ The _"non-endorsed"_ status means that the plugin is not endorsed by the origina
| [**device_info_plus_tizen**](packages/device_info_plus) | 4.0 | ✔️ | ✔️ | ✔️ | ✔️ |
| [**firebase_core**](packages/firebase_core) | 4.0 | ✔️ | ✔️ | ✔️ | ✔️ |
| [**flutter_app_badger_tizen**](packages/flutter_app_badger) | 4.0 | ✔️ | ✔️ | ❌ | ❌ | API not supported |
| [**flutter_reactive_ble_tizen**](packages/flutter_reactive_ble) | 4.0 | ✔️ | ❌ | ✔️ | ❌ | API not supported on emulator |
| [**flutter_secure_storage_tizen**](packages/flutter_secure_storage) | 4.0 | ✔️ | ✔️ | ✔️ | ✔️ |
| [**flutter_tts_tizen**](packages/flutter_tts) | 4.0 | ✔️ | ✔️ | ✔️ | ✔️ |
| [**flutter_webrtc_tizen**](packages/flutter_webrtc) | 6.0 | ❌ | ❌ | ✔️ | ❌ | No camera |
Expand Down
28 changes: 28 additions & 0 deletions packages/flutter_reactive_ble/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
migrate_working_dir/

# IntelliJ related
*.iml
*.ipr
*.iws
.idea/

# VS Code related
.vscode/

# Flutter/Dart/Pub related
# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock.
/pubspec.lock
**/doc/api/
.dart_tool/
.packages
build/
3 changes: 3 additions & 0 deletions packages/flutter_reactive_ble/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 0.1.0

* Initial release.
26 changes: 26 additions & 0 deletions packages/flutter_reactive_ble/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Copyright (c) 2023 Samsung Electronics Co., Ltd. All rights reserved.
Copyright (c) 2019 Signify Holding. All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the names of the copyright holders nor the names of the
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
41 changes: 41 additions & 0 deletions packages/flutter_reactive_ble/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# flutter_reactive_ble_tizen

[![pub package](https://img.shields.io/pub/v/flutter_reactive_ble_tizen.svg)](https://pub.dev/packages/flutter_reactive_ble_tizen)

The Tizen implementation of [`flutter_reactive_ble`](https://pub.dev/packages/flutter_reactive_ble).

## Usage

This package is not an _endorsed_ implementation of `flutter_reactive_ble`. Therefore, you have to include `flutter_reactive_ble_tizen` alongside `flutter_reactive_ble` as dependencies in your `pubspec.yaml` file.

```yaml
dependencies:
flutter_reactive_ble: ^5.0.3
flutter_reactive_ble_tizen: ^0.1.0
```

Then you can import `flutter_reactive_ble` in your Dart code:

```dart
import 'package:flutter_reactive_ble/flutter_reactive_ble.dart';
```

For detailed usage, see https://pub.dev/packages/flutter_reactive_ble#usage.

## Required privileges

The bluetooth privilege must be added to your `tizen-manifest.xml` file to use this plugin.

```xml
<privileges>
<privilege>http://tizen.org/privilege/bluetooth</privilege>
</privileges>
```

## Known issues

- The following parameters are not supported and will be ignored on Tizen.
- `connectionTimeout` of `FlutterReactiveBle.connectToDevice()` and `FlutterReactiveBle.connectToAdvertisingDevice()`
- `scanMode` of `FlutterReactiveBle.scanForDevices()`
- The plugin sometimes doesn't respond to characteristic read or notify/indicate requests, requiring the user to press the same button twice in the example app. This looks like a bug in the frontend package.
- The plugin often fails to retrieve the names of discovered devices on Tizen more frequently than on other platforms.
161 changes: 161 additions & 0 deletions packages/flutter_reactive_ble/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
include: package:flutter_lints/flutter.yaml

analyzer:
strong-mode:
implicit-casts: false
implicit-dynamic: false
exclude:
- "bin/cache/**"
- "**/*.freezed.dart"
- "**/*.g.dart"
- "**/*.mocks.dart"
- "**/generated/**"

linter:
rules:
# Errors
- avoid_empty_else
- avoid_relative_lib_imports
- avoid_returning_null_for_future
- avoid_slow_async_io
- avoid_types_as_parameter_names
- cancel_subscriptions
- close_sinks
# - comment_references -- DISABLED: collision with mockito generation
- control_flow_in_finally
# - diagnostic_describe_all_properties -- DISABLED: experimental feature
- empty_statements
- hash_and_equals
- iterable_contains_unrelated_type
- list_remove_unrelated_type
- literal_only_boolean_expressions
- no_adjacent_strings_in_list
- no_duplicate_case_values
- prefer_void_to_null
- test_types_in_equals
- throw_in_finally
- unnecessary_statements
- unrelated_type_equality_checks
- valid_regexps
# Style checks
- always_declare_return_types
# - always_put_control_body_on_new_line -- DISABLED: DARTFMT INCOMPATIBLE
- always_put_required_named_parameters_first
- always_require_non_null_named_parameters
# - always_specify_types -- DISABLED: LEADS TO FLUFFY CODE
- annotate_overrides
# - avoid_annotating_with_dynamic -- DISABLED: Gives false positives for function arguments where it is needed
# - avoid_as
- avoid_bool_literals_in_conditional_expressions
- avoid_catches_without_on_clauses
- avoid_catching_errors
- avoid_classes_with_only_static_members
- avoid_double_and_int_checks
- avoid_field_initializers_in_const_classes
# - avoid_function_literals_in_foreach_calls -- DISABLED: forEach is often clearer than for-loop
- avoid_implementing_value_types
- avoid_init_to_null
- avoid_js_rounded_ints
- avoid_null_checks_in_equality_operators
- avoid_positional_boolean_parameters
- avoid_private_typedef_functions
- avoid_renaming_method_parameters
- avoid_return_types_on_setters
- avoid_returning_null
- avoid_returning_null_for_void
- avoid_returning_this
# - avoid_setters_without_getters -- DISABLED: Sometimes it makes sense to have write-only member
# - avoid_shadowing_type_parameters -- TODO: Enable new option
- avoid_single_cascade_in_expression_statements
# - avoid_types_on_closure_parameters -- DISABLED: INCOMPATIBLE WITH IMPLICIT TYPE CASTS DISABLED
- avoid_unused_constructor_parameters
- avoid_void_async
- await_only_futures
- camel_case_types
- cascade_invocations
- constant_identifier_names
# - curly_braces_in_flow_control_structures -- DISABLED: WE DO NOT WANT THIS
- directives_ordering
- empty_catches
- empty_constructor_bodies
- file_names
# - flutter_style_todos -- DISABLED: TOO MUCH?
- implementation_imports
- join_return_with_assignment
- library_names
- library_prefixes
# - lines_longer_than_80_chars -- DISABLED: WE DO NOT WANT THIS
- non_constant_identifier_names
- null_closures
- omit_local_variable_types
# - one_member_abstracts -- DISABLED: OBSTRUCTS OO DESIGN
- only_throw_errors
- overridden_fields
- package_api_docs
- package_prefixed_library_names
- parameter_assignments
- prefer_adjacent_string_concatenation
- prefer_asserts_in_initializer_lists
# - prefer_asserts_with_message -- DISABLED: BOOLEAN CONDITIONS ARE GOOD ENOUGH
- prefer_collection_literals
- prefer_conditional_assignment
- prefer_const_constructors
- prefer_const_constructors_in_immutables
- prefer_const_declarations
- prefer_const_literals_to_create_immutables
- prefer_constructors_over_static_methods
- prefer_contains
# - prefer_double_quotes -- DISABLED: This rule is to be supported in a future Dart release
- prefer_equal_for_default_values
- prefer_expression_function_bodies
- prefer_final_fields
- prefer_final_in_for_each
- prefer_final_locals
- prefer_for_elements_to_map_fromIterable
- prefer_foreach
- prefer_function_declarations_over_variables
- prefer_generic_function_type_aliases
- prefer_if_elements_to_conditional_expressions
- prefer_initializing_formals
- prefer_inlined_adds
# - prefer_int_literals -- DISABLED: ADDED VALUE IS UNCLEAR
- prefer_interpolation_to_compose_strings
- prefer_is_empty
- prefer_is_not_empty
- prefer_iterable_whereType
- prefer_mixin
- prefer_null_aware_operators
# - prefer_single_quotes -- DISABLED: ADDED VALUE IS UNCLEAR
- prefer_spread_collections
- prefer_typing_uninitialized_variables
# - provide_deprecation_messages -- DISABLED: This rule is to be supported in a future Dart release
# - public_member_api_docs
- recursive_getters
- slash_for_doc_comments
# - sort_child_properties_last -- This rule is to be supported in a future Dart release
# - sort_constructors_first -- DISABLED: ADDED VALUE IS UNCLEAR
# - sort_unnamed_constructors_first -- DISABLED: ADDED VALUE IS UNCLEAR
# - type_annotate_public_apis -- DISABLED: ADDED VALUE IS UNCLEAR
- type_init_formals
- unawaited_futures
- unnecessary_await_in_return
- unnecessary_brace_in_string_interps
- unnecessary_const
- unnecessary_getters_setters
- unnecessary_lambdas
- unnecessary_new
- unnecessary_null_aware_assignments
- unnecessary_null_in_if_null_operators
- unnecessary_overrides
- unnecessary_parenthesis
- unnecessary_this
- use_full_hex_values_for_flutter_colors
- use_function_type_syntax_for_parameters
- use_rethrow_when_possible
- use_setters_to_change_properties
- use_string_buffers
- use_to_and_as_if_applicable
- void_checks
# Pub Rules
- package_names
- sort_pub_dependencies
42 changes: 42 additions & 0 deletions packages/flutter_reactive_ble/example/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
migrate_working_dir/

# IntelliJ related
*.iml
*.ipr
*.iws
.idea/

# VS Code related
.vscode/

# Flutter/Dart/Pub related
**/doc/api/
**/ios/Flutter/.last_build_id
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.packages
.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
7 changes: 7 additions & 0 deletions packages/flutter_reactive_ble/example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# flutter_reactive_ble_tizen_example

Demonstrates how to use the flutter_reactive_ble_tizen plugin.

## Getting Started

To run this app on your Tizen device, use [flutter-tizen](https://github.com/flutter-tizen/flutter-tizen).
Loading