flutter-tizen / plugins

Flutter plugins for Tizen
67 stars 47 forks source link

[wearable_rotary] Ability to detect if supported #779

Closed projectitis closed 1 day ago

projectitis commented 3 days ago

Hi there,

Dart is an amazing cross-platform development tool. However, wearable_rotary is only supported on very specific devices. In other cases (mobile, PC etc) I would use the mouse wheel or touch gestures etc as an alternative.

This may be availalbe already (and I am missing something), but I'd like the ability to check if a rotary input is supported, and conditionally start listening in that case. For example RotaryScroll.isSupported.

At the moment on unsupported platforms the following exception is thrown:

MissingPluginException(No implementation found for method listen on channel flutter.wearable_rotary.channel)

Thanks!

JSUYA commented 3 days ago

Hi projectitis. Thank you for your interest.

MissingPluginException(No implementation found for method listen on channel flutter.wearable_rotary.channel)

This exception occurs because there is no platform implementation for that plugin. Supported platforms are already described. In this case, you can use Platform.isWindow(or Platform.isIOS) or use isTizen of flutter-tizen before using the API (before creating RotaryScrollController()).

please refer to https://github.com/flutter-tizen/flutter-tizen/wiki/Limitations#apis

projectitis commented 3 days ago

Hi JSUYA (there is a familiar name from ThorVG 😀 ). Thanks for your reply.

If I use isTizen is it possible that some devices may still have a missing implementation? Or do all Tizen devices support the rotary input?

JSUYA commented 2 days ago

HI :)

Is the tizen device you are talking about a watch device? The wearable_rotary plugin was developed using the efl extension and supports watch devices using tizen os. it does not support other devices (TV, IoT (rpi)). Unfortunately, this plugin was originally developed to support the watch's rotary controller(?).

In my opinion, unless you are controlling the watch's rotary wheel, this plugin is not appropriate. If you want a wheel event, there is also this. I'm sorry I couldn't help you.

swift-kim commented 2 days ago

@JSUYA I think the original poster is talking about watch devices that do not have the rotary input. The app will not even build when targeting other profiles than wearable.

Tip: An alternative to isTizen is Platform.isLinux (should return true on Tizen) if you don't want the additional package dependency.

projectitis commented 2 days ago

Thank you for the discussion :)

My intention is to develop a cross-platform/multi-device application that can use the rotary controller if the device has one, and an alternative if it does not.

A benefit of flutter/dart is that you should be able to do this from the same code base.

But because there is no "isSupported" method, I cannot conditionally activate the rotary controller based on whether or not one is available. I can only "guess" based on factors like isTizen, isLinux and small screen size.

Currently when I build for other devices it compiles ok, and it runs ok, but it does throw the unimplemented exception.

So really, this is a feature request for an "isSupported" method :)

JSUYA commented 2 days ago

:) Flutter-tizen support for watch is supported from Tizen 5.5. The target is probably Galaxy Watch3. And this device has a bezel and supports rotary events. I think most Tizen watches that support 4.0 also have a software bezel even without a hardware bezel, and this works with rotary events. That's why I don't think there are any cases where rotary events don't work on Tizen wearable. https://developer.samsung.com/galaxy-watch-tizen/studio/tutorial/compatibility.html

In my opinion, there is no Tizen watch that can apply Flutter-tizen and doesn't have a rotary controller. So I think isTizen or isLinux is enough.

if (isTizen ) {
 // rotary event.
} else if (isAndroid) {
  // Use wear package(https://pub.dev/packages/wear)
} else {
 // alternative
}

(It's a shame it's not a single code,)

Even if there is such a case, there is no API in Tizen's C API that can find out whether supported a rotary event. We need an workaround for this case, so if you tell us a specific case, we can review it again.

+) I found this notice while looking for a case. Please check it. It is said that the watch app on Tizen base is no longer register in the galaxy store. https://developer.samsung.com/galaxy-watch-tizen/notice.html

projectitis commented 2 days ago

Thank you JSUYA.

I guess I should have been clear that I am not targeting Tizen devices specifically. I am targeting all devices, and the Tizen rotary input package happens to fit my requirement (apart from not having isSupported).

Thank you for all the feedback. Feel free to close this issue.

swift-kim commented 2 days ago

I understand you concern. The fact that all Tizen watches support rotary input does not mean that it is always enabled (because the feature can be disabled). The problem is even more complicated when it comes to Wear OS based devices. The feature may or may not be supported depending on the hardware.

What we need is a platform API to know if the feature is supported or enabled by the current device. I don't know if there is such an API on Tizen and Wear OS to the best of my knowledge. If such an API exists, we are welcome to add the API you mentioned (isSupported) to our plugin.

JSUYA commented 1 day ago

As swift-kim said, it's difficult to implement this requirement at the moment, as we need to know the support at the platform API level. I will close this issue, but if you have any further comments, please let us know. Once again, thank you for your interest.