Skip to content

Commit

Permalink
Merge branch 'master' into update-device-info-plus-2
Browse files Browse the repository at this point in the history
  • Loading branch information
swift-kim authored Nov 17, 2023
2 parents bb2a6cd + bc4d708 commit 9a62e5d
Show file tree
Hide file tree
Showing 183 changed files with 13,771 additions and 523 deletions.
2 changes: 2 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@
- packages/url_launcher/**/*
"p: video_player":
- packages/video_player/**/*
"p: video_player_avplay":
- packages/video_player_avplay/**/*
"p: video_player_videohole":
- packages/video_player_videohole/**/*
"p: wakelock":
Expand Down
1 change: 1 addition & 0 deletions .github/recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ plugins:
geolocator: []
in_app_purchase: []
network_info_plus: []
video_player_avplay: []
video_player_videohole: []

# Only testable with the drive command: https://github.com/flutter-tizen/plugins/issues/272
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ The _"non-endorsed"_ status means that the plugin is not endorsed by the origina
| [**tizen_package_manager**](packages/tizen_package_manager) | (Tizen-only) | [![pub package](https://img.shields.io/pub/v/tizen_package_manager.svg)](https://pub.dev/packages/tizen_package_manager) | N/A |
| [**tizen_rpc_port**](packages/tizen_rpc_port) | (Tizen-only) | [![pub package](https://img.shields.io/pub/v/tizen_rpc_port.svg)](https://pub.dev/packages/tizen_rpc_port) | N/A |
| [**url_launcher_tizen**](packages/url_launcher) | [url_launcher](https://pub.dev/packages/url_launcher) (1st-party) | [![pub package](https://img.shields.io/pub/v/url_launcher_tizen.svg)](https://pub.dev/packages/url_launcher_tizen) | No |
| [**video_player_avplay**](packages/video_player_avplay) | (Tizen-only) | [![pub package](https://img.shields.io/pub/v/video_player_avplay.svg)](https://pub.dev/packages/video_player_avplay) | N/A |
| [**video_player_tizen**](packages/video_player) | [video_player](https://pub.dev/packages/video_player) (1st-party) | [![pub package](https://img.shields.io/pub/v/video_player_tizen.svg)](https://pub.dev/packages/video_player_tizen) | No |
| [**video_player_videohole**](packages/video_player_videohole) | (Tizen-only) | [![pub package](https://img.shields.io/pub/v/video_player_videohole.svg)](https://pub.dev/packages/video_player_videohole) | N/A |
| [**wakelock_tizen**](packages/wakelock) | [wakelock](https://pub.dev/packages/wakelock) (3rd-party) | [![pub package](https://img.shields.io/pub/v/wakelock_tizen.svg)](https://pub.dev/packages/wakelock_tizen) | No |
Expand Down Expand Up @@ -91,6 +92,7 @@ The _"non-endorsed"_ status means that the plugin is not endorsed by the origina
| [**tizen_package_manager**](packages/tizen_package_manager) | ✔️ | ✔️ | ✔️ | ✔️ |
| [**tizen_rpc_port**](packages/tizen_rpc_port) | ✔️ | ✔️ | ✔️ | ✔️ |
| [**url_launcher_tizen**](packages/url_launcher) | ✔️ || ✔️ || No browser app |
| [**video_player_avplay**](packages/video_player_avplay) ||| ✔️ | ⚠️ | See README for details |
| [**video_player_tizen**](packages/video_player) | ✔️ | ✔️ | ✔️ || TV emulator issue |
| [**video_player_videohole**](packages/video_player_videohole) ||| ✔️ | ⚠️ | See README for details |
| [**wakelock_tizen**](packages/wakelock) | ✔️ | ✔️ ||| Cannot override system settings |
Expand Down
6 changes: 6 additions & 0 deletions packages/connectivity_plus/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 1.1.4

* Update connectivity_plus to 4.0.1.
* Update connectivity_plus_platform_interface to 1.2.4.
* Update the example app.

## 1.1.3

* Remove unnecessary `StreamHandlerError` implementation.
Expand Down
4 changes: 2 additions & 2 deletions packages/connectivity_plus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ This package is not an _endorsed_ implementation of `connectivity_plus`. Therefo

```yaml
dependencies:
connectivity_plus: ^2.3.0
connectivity_plus_tizen: ^1.1.3
connectivity_plus: ^4.0.1
connectivity_plus_tizen: ^1.1.4
```
Then you can import `connectivity_plus` in your Dart code:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();

group('Connectivity test driver', () {
late Connectivity _connectivity;
late Connectivity connectivity;

setUpAll(() async {
_connectivity = Connectivity();
connectivity = Connectivity();
});

testWidgets('test connectivity result', (WidgetTester tester) async {
final result = await _connectivity.checkConnectivity();
final result = await connectivity.checkConnectivity();
expect(result, isNotNull);
});
});
Expand Down
6 changes: 4 additions & 2 deletions packages/connectivity_plus/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ class MyApp extends StatelessWidget {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
useMaterial3: true,
colorSchemeSeed: const Color(0x9f4376f8),
),
home: const MyHomePage(title: 'Flutter Demo Home Page'),
);
Expand All @@ -37,7 +38,7 @@ class MyHomePage extends StatefulWidget {
final String title;

@override
_MyHomePageState createState() => _MyHomePageState();
State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
Expand Down Expand Up @@ -92,6 +93,7 @@ class _MyHomePageState extends State<MyHomePage> {
return Scaffold(
appBar: AppBar(
title: const Text('Connectivity example app'),
elevation: 4,
),
body: Center(
child: Text('Connection Status: ${_connectionStatus.toString()}')),
Expand Down
4 changes: 2 additions & 2 deletions packages/connectivity_plus/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ environment:
flutter: ">=3.3.0"

dependencies:
connectivity_plus: ^2.3.0
connectivity_plus: ^4.0.1
connectivity_plus_tizen:
path: ../
flutter:
Expand All @@ -22,7 +22,7 @@ dev_dependencies:
sdk: flutter
integration_test_tizen:
path: ../../integration_test/
flutter_lints: ^1.0.4
flutter_lints: ^2.0.1

flutter:
uses-material-design: true
6 changes: 3 additions & 3 deletions packages/connectivity_plus/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: connectivity_plus_tizen
description: Tizen implementation of the connectivity_plus plugin.
homepage: https://github.com/flutter-tizen/plugins
repository: https://github.com/flutter-tizen/plugins/tree/master/packages/connectivity_plus
version: 1.1.3
version: 1.1.4

environment:
sdk: ">=2.18.0 <4.0.0"
Expand All @@ -16,9 +16,9 @@ flutter:
fileName: connectivity_plus_tizen_plugin.h

dependencies:
connectivity_plus_platform_interface: ^1.2.0
connectivity_plus_platform_interface: ^1.2.4
flutter:
sdk: flutter

dev_dependencies:
flutter_lints: ^1.0.4
flutter_lints: ^2.0.1
6 changes: 6 additions & 0 deletions packages/sensors_plus/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 1.1.3

* Update sensors_plus to 3.0.2.
* Update sensors_plus_platform_interface to 1.1.3.
* Update the example app.

## 1.1.2

* Remove unnecessary `StreamHandlerError` implementation.
Expand Down
4 changes: 2 additions & 2 deletions packages/sensors_plus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ This package is not an _endorsed_ implementation of 'sensors_plus'. Therefore, y

```yaml
dependencies:
sensors_plus: ^1.2.1
sensors_plus_tizen: ^1.1.2
sensors_plus: ^3.0.2
sensors_plus_tizen: ^1.1.3
```
Then you can import `sensors_plus` in your Dart code:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import 'package:integration_test/integration_test.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();

testWidgets('Can subscript to accelerometerEvents and get non-null events',
testWidgets('Can subscribe to accelerometerEvents and get non-null events',
(WidgetTester tester) async {
final completer = Completer<AccelerometerEvent>();
late StreamSubscription<AccelerometerEvent> subscription;
Expand Down
94 changes: 77 additions & 17 deletions packages/sensors_plus/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,22 @@
// ignore_for_file: public_member_api_docs

import 'dart:async';

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:sensors_plus/sensors_plus.dart';

import 'snake.dart';

void main() {
WidgetsFlutterBinding.ensureInitialized();
SystemChrome.setPreferredOrientations(
[
DeviceOrientation.portraitUp,
DeviceOrientation.portraitDown,
],
);

runApp(const MyApp());
}

Expand All @@ -22,7 +32,8 @@ class MyApp extends StatelessWidget {
return MaterialApp(
title: 'Sensors Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
useMaterial3: true,
colorSchemeSeed: const Color(0x9f4376f8),
),
home: const MyHomePage(title: 'Flutter Demo Home Page'),
);
Expand All @@ -35,35 +46,36 @@ class MyHomePage extends StatefulWidget {
final String? title;

@override
_MyHomePageState createState() => _MyHomePageState();
State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
static const int _snakeRows = 20;
static const int _snakeColumns = 20;
static const double _snakeCellSize = 10.0;

List<double>? _accelerometerValues;
List<double>? _userAccelerometerValues;
List<double>? _accelerometerValues;
List<double>? _gyroscopeValues;
List<double>? _magnetometerValues;
final _streamSubscriptions = <StreamSubscription<dynamic>>[];

@override
Widget build(BuildContext context) {
final userAccelerometer = _userAccelerometerValues
?.map((double v) => v.toStringAsFixed(1))
.toList();
final accelerometer =
_accelerometerValues?.map((double v) => v.toStringAsFixed(1)).toList();
final gyroscope =
_gyroscopeValues?.map((double v) => v.toStringAsFixed(1)).toList();
final userAccelerometer = _userAccelerometerValues
?.map((double v) => v.toStringAsFixed(1))
.toList();
final magnetometer =
_magnetometerValues?.map((double v) => v.toStringAsFixed(1)).toList();

return Scaffold(
appBar: AppBar(
title: const Text('Sensor Example'),
title: const Text('Sensors Plus Example'),
elevation: 4,
),
body: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
Expand All @@ -89,7 +101,7 @@ class _MyHomePageState extends State<MyHomePage> {
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Text('Accelerometer: $accelerometer'),
Text('UserAccelerometer: $userAccelerometer'),
],
),
),
Expand All @@ -98,7 +110,7 @@ class _MyHomePageState extends State<MyHomePage> {
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Text('UserAccelerometer: $userAccelerometer'),
Text('Accelerometer: $accelerometer'),
],
),
),
Expand Down Expand Up @@ -136,13 +148,46 @@ class _MyHomePageState extends State<MyHomePage> {
@override
void initState() {
super.initState();
_streamSubscriptions.add(
userAccelerometerEvents.listen(
(UserAccelerometerEvent event) {
setState(() {
_userAccelerometerValues = <double>[event.x, event.y, event.z];
});
},
onError: (e) {
showDialog(
context: context,
builder: (context) {
return const AlertDialog(
title: Text("Sensor Not Found"),
content: Text(
"It seems that your device doesn't support Accelerometer Sensor"),
);
});
},
cancelOnError: true,
),
);
_streamSubscriptions.add(
accelerometerEvents.listen(
(AccelerometerEvent event) {
setState(() {
_accelerometerValues = <double>[event.x, event.y, event.z];
});
},
onError: (e) {
showDialog(
context: context,
builder: (context) {
return const AlertDialog(
title: Text("Sensor Not Found"),
content: Text(
"It seems that your device doesn't support Gyroscope Sensor"),
);
});
},
cancelOnError: true,
),
);
_streamSubscriptions.add(
Expand All @@ -152,15 +197,18 @@ class _MyHomePageState extends State<MyHomePage> {
_gyroscopeValues = <double>[event.x, event.y, event.z];
});
},
),
);
_streamSubscriptions.add(
userAccelerometerEvents.listen(
(UserAccelerometerEvent event) {
setState(() {
_userAccelerometerValues = <double>[event.x, event.y, event.z];
});
onError: (e) {
showDialog(
context: context,
builder: (context) {
return const AlertDialog(
title: Text("Sensor Not Found"),
content: Text(
"It seems that your device doesn't support User Accelerometer Sensor"),
);
});
},
cancelOnError: true,
),
);
_streamSubscriptions.add(
Expand All @@ -170,6 +218,18 @@ class _MyHomePageState extends State<MyHomePage> {
_magnetometerValues = <double>[event.x, event.y, event.z];
});
},
onError: (e) {
showDialog(
context: context,
builder: (context) {
return const AlertDialog(
title: Text("Sensor Not Found"),
content: Text(
"It seems that your device doesn't support Magnetometer Sensor"),
);
});
},
cancelOnError: true,
),
);
}
Expand Down
6 changes: 4 additions & 2 deletions packages/sensors_plus/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,20 @@ environment:
dependencies:
flutter:
sdk: flutter
sensors_plus: ^1.2.1
sensors_plus: ^3.0.2
sensors_plus_tizen:
path: ../

dev_dependencies:
flutter_driver:
sdk: flutter
flutter_test:
sdk: flutter
integration_test:
sdk: flutter
integration_test_tizen:
path: ../../integration_test/
flutter_lints: ^1.0.4
flutter_lints: ^2.0.1

flutter:
uses-material-design: true
6 changes: 3 additions & 3 deletions packages/sensors_plus/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: sensors_plus_tizen
description: Tizen implementation of the sensors plugin.
homepage: https://github.com/flutter-tizen/plugins
repository: https://github.com/flutter-tizen/plugins/tree/master/packages/sensors_plus
version: 1.1.2
version: 1.1.3

environment:
sdk: ">=2.18.0 <4.0.0"
Expand All @@ -18,7 +18,7 @@ flutter:
dependencies:
flutter:
sdk: flutter
sensors_plus_platform_interface: ^1.1.0
sensors_plus_platform_interface: ^1.1.3

dev_dependencies:
flutter_lints: ^1.0.4
flutter_lints: ^2.0.1
Loading

0 comments on commit 9a62e5d

Please sign in to comment.