Skip to content

Commit

Permalink
[multi-packages] Fix various lint issues (flutter-tizen#212)
Browse files Browse the repository at this point in the history
* [multi-packages] Fix various lint issues

* contribute to flutter-tizen#207

Signed-off-by: Boram Bae <[email protected]>

* [video_player] Add test to dev_dependencies

* sort dependencies

Signed-off-by: Boram Bae <[email protected]>
  • Loading branch information
bbrto21 authored Sep 13, 2021
1 parent 698b14f commit f691594
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 32 deletions.
6 changes: 3 additions & 3 deletions packages/messageport/lib/src/messageport_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ class TizenMessagePortManager {
args['remoteAppId'] = remoteAppId;
args['portName'] = portName;
args['trusted'] = trusted;
final bool status =
await _channel.invokeMethod<bool>('checkForRemote', args) as bool;
return status;
final bool? status =
await _channel.invokeMethod<bool>('checkForRemote', args);
return status ?? false;
}

Future<void> send(RemotePort remotePort, dynamic message) async {
Expand Down
17 changes: 8 additions & 9 deletions packages/path_provider/lib/src/app_common.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import 'dart:ffi';

import 'package:ffi/ffi.dart';

typedef _app_common_get_data_path = Pointer<Utf8> Function();
typedef _app_common_get_cache_path = Pointer<Utf8> Function();
typedef _app_common_get_external_data_path = Pointer<Utf8> Function();
typedef _app_common_get_external_cache_path = Pointer<Utf8> Function();
typedef _AppCommonGetDataPath = Pointer<Utf8> Function();
typedef _AppCommonGetCachePath = Pointer<Utf8> Function();
typedef _AppCommonGetExternalDataPath = Pointer<Utf8> Function();
typedef _AppCommonGetExternalCachePath = Pointer<Utf8> Function();

AppCommon? _appCommonInstance;
AppCommon get appCommon => _appCommonInstance ??= AppCommon();
Expand All @@ -24,18 +24,17 @@ class AppCommon {
final DynamicLibrary libAppCommon =
DynamicLibrary.open('libcapi-appfw-app-common.so.0');
_getDataPath = libAppCommon
.lookup<NativeFunction<_app_common_get_data_path>>('app_get_data_path')
.lookup<NativeFunction<_AppCommonGetDataPath>>('app_get_data_path')
.asFunction();
_getCachePath = libAppCommon
.lookup<NativeFunction<_app_common_get_cache_path>>(
'app_get_cache_path')
.lookup<NativeFunction<_AppCommonGetCachePath>>('app_get_cache_path')
.asFunction();
_getExternalDataPath = libAppCommon
.lookup<NativeFunction<_app_common_get_external_data_path>>(
.lookup<NativeFunction<_AppCommonGetExternalDataPath>>(
'app_get_external_data_path')
.asFunction();
_getExternalCachePath = libAppCommon
.lookup<NativeFunction<_app_common_get_external_cache_path>>(
.lookup<NativeFunction<_AppCommonGetExternalCachePath>>(
'app_get_external_cache_path')
.asFunction();
}
Expand Down
14 changes: 7 additions & 7 deletions packages/path_provider/lib/src/storage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import 'dart:ffi';
import 'package:ffi/ffi.dart';
import 'package:flutter/services.dart';

typedef _storage_get_directory = Int32 Function(
typedef _StorageGetDirectory = Int32 Function(
Int32, Int32, Pointer<Pointer<Utf8>>);
typedef _storage_callback = Int32 Function(
typedef _StorageCallback = Int32 Function(
Int32, Int32, Int32, Pointer<Utf8>, Pointer<Void>);
typedef _storage_foreach_device_supported = Int32 Function(
Pointer<NativeFunction<_storage_callback>>, Pointer<Void>);
typedef _StorageForeachDeviceSupported = Int32 Function(
Pointer<NativeFunction<_StorageCallback>>, Pointer<Void>);

/// Corresponds to `storage_directory_e`.
enum StorageDirectoryType {
Expand All @@ -40,11 +40,11 @@ class Storage {
Storage() {
final DynamicLibrary libStorage = DynamicLibrary.open('libstorage.so.0.1');
_storageGetDirectory = libStorage
.lookup<NativeFunction<_storage_get_directory>>('storage_get_directory')
.lookup<NativeFunction<_StorageGetDirectory>>('storage_get_directory')
.asFunction();

_storageForeachDeviceSupported = libStorage
.lookup<NativeFunction<_storage_foreach_device_supported>>(
.lookup<NativeFunction<_StorageForeachDeviceSupported>>(
'storage_foreach_device_supported')
.asFunction();

Expand All @@ -63,7 +63,7 @@ class Storage {
}

late int Function(int, int, Pointer<Pointer<Utf8>>) _storageGetDirectory;
late int Function(Pointer<NativeFunction<_storage_callback>>, Pointer<Void>)
late int Function(Pointer<NativeFunction<_StorageCallback>>, Pointer<Void>)
_storageForeachDeviceSupported;

/// The unique storage device id.
Expand Down
2 changes: 1 addition & 1 deletion packages/share_plus/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class DemoAppState extends State<DemoApp> {
title: Text('Add image'),
onTap: () async {
final imagePicker = ImagePicker();
final pickedFile = await imagePicker.getImage(
final pickedFile = await imagePicker.pickImage(
source: ImageSource.gallery,
);
if (pickedFile != null) {
Expand Down
4 changes: 2 additions & 2 deletions packages/shared_preferences/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ flutter:
fileName: shared_preferences_tizen.dart

dependencies:
ffi: ^1.0.0
ffi: ^1.1.2
flutter:
sdk: flutter
shared_preferences_platform_interface: ^2.0.0
Expand All @@ -20,5 +20,5 @@ dev_dependencies:
pedantic: ^1.10.0

environment:
sdk: '>=2.12.0 <3.0.0'
sdk: ">=2.12.0 <3.0.0"
flutter: ">=2.0.0"
9 changes: 5 additions & 4 deletions packages/video_player/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,24 @@ dependencies:
path: ../

dev_dependencies:
flutter_test:
sdk: flutter
flutter_driver:
sdk: flutter
flutter_test:
sdk: flutter
integration_test:
sdk: flutter
integration_test_tizen:
path: ../../integration_test/
pedantic: ^1.10.0
test: any

flutter:
uses-material-design: true
assets:
- assets/flutter-mark-square-64.png
- assets/Butterfly-209.mp4
- assets/bumble_bee_captions.srt
uses-material-design: true

environment:
sdk: ">=2.12.0 <3.0.0"
flutter: ">=2.0.0"
sdk: ">=2.12.0 <3.0.0"
4 changes: 2 additions & 2 deletions packages/video_player/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ flutter:
fileName: video_player_tizen_plugin.h

dependencies:
video_player_platform_interface: ^4.1.0
flutter:
sdk: flutter
video_player_platform_interface: ^4.1.0

dev_dependencies:
pedantic: ^1.10.0

environment:
sdk: ">=2.12.0<3.0.0"
flutter: ">=2.0.0"
sdk: ">=2.12.0<3.0.0"
4 changes: 2 additions & 2 deletions packages/wakelock/example/integration_test/wakelock_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ void main() {
});

testWidgets('enable wakelock', (WidgetTester tester) async {
Wakelock.enable();
await Wakelock.enable();
expect(await Wakelock.enabled, true);
});

testWidgets('disable wakelock', (WidgetTester tester) async {
Wakelock.disable();
await Wakelock.disable();
expect(await Wakelock.enabled, false);
});
}
1 change: 0 additions & 1 deletion packages/webview_flutter/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import 'dart:async';
import 'dart:convert';
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:webview_flutter/webview_flutter.dart';

Expand Down
4 changes: 3 additions & 1 deletion packages/webview_flutter/lib/src/platform_view_tizen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -363,8 +363,10 @@ class TizenViewController extends PlatformViewController {

@override
Future<void> dispose() async {
if (_state == _TizenViewState.creating || _state == _TizenViewState.created)
if (_state == _TizenViewState.creating ||
_state == _TizenViewState.created) {
await _sendDisposeMessage();
}
_platformViewCreatedCallbacks.clear();
_state = _TizenViewState.disposed;
PlatformViewsServiceTizen._instance._focusCallbacks.remove(viewId);
Expand Down

0 comments on commit f691594

Please sign in to comment.