SimformSolutionsPvtLtd / flutter_showcaseview

Flutter plugin that allows you to showcase your features on flutter application. 👌🔝🎉
https://pub.dev/packages/showcaseview
MIT License
1.52k stars 442 forks source link

Android TV support #391

Closed cool2apps closed 1 year ago

cool2apps commented 1 year ago

Is your feature request related to a problem? Please describe. When I use this plugin with an Android TV app, it is not possible to close showcase box by pressing any Android TV remote keys. I need to click with a mouse, which may not be easy with Android TV interface.

Describe the solution you'd like There could be an option to close showcase box by pressing any key.

Describe alternatives you've considered None.

Additional context

jaiminrana05 commented 1 year ago

Hi @cool2apps , According to my understanding you are not able to view the next showCase by pressing any key of Android TV remote . So, you can Set autoPlay: true parameter of ShowCaseWidget to true or you add a RawKeyboard Listener for listing the Android TV remote keys press events.

@override
  void initState() {
    super.initState();
    startShowCase();
    RawKeyboard.instance.addListener(_handleKeyEvent);
  }

  void _handleKeyEvent(RawKeyEvent value) {
    if (value is RawKeyDownEvent &&
        value.physicalKey == PhysicalKeyboardKey.arrowLeft) {
      ShowCaseWidget.of(context).next();
    }
  }
cool2apps commented 1 year ago

ShowCaseWidget.of(context).next();

Adding this to RawKeyboard listener solved the problem. Thanks for help.