Coder Social home page Coder Social logo

floating's Introduction

floating's People

Contributors

deckerst avatar wrbl606 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

floating's Issues

Resume current state error

I have a video player, i want to continue the video when i minimize the app, but the state is changed when minimize and the videoPlayer() widget is rebuild and the video is restart, how can i fix it?

PiPSwitcher(
      childWhenEnabled: videoPlayer(),
      childWhenDisabled: Scaffold(body: Column(
      children: [
            videoPlayer(),
            videoList(),
      ],
    ),
);

How to turn off PIP?

This library is great, but I have a problem.

When I use floating.enable, every time I switch the app or minimize the app, there will be a picture in picture. Is there any way to turn off the picture in picture function? I only found the enable method, not the disable method.

How to avoid re-rendering of widgets when it switches to PiP mode and vice-versa?

image
Actually the code you see here is rendering a map.
image
This Widget HereMap() and its functional argument _onMapCreated is very computational expensive, when I switches to PiP mode then childWhenEnabled is called and its re-rending the entire widget (A lot of computations). Can we somehow make it static or something? Just wanna avoid the re-rendering part, Pls help!!!

IllegalStateException when trying to enter PiP mode from SplitScreen

I am running Flutter version 3.7.11 and the newest version of the floating package. Moreover, I use the following code to enter Pip Mode:

@override
  void didChangeAppLifecycleState(AppLifecycleState lifecycleState) {
    if (_pipIsSupported) { // only true if '!kIsWeb && Platform.isAndroid'
      if (lifecycleState == AppLifecycleState.inactive) {
        // Only enable PiP if the timer is currently running
        if (state.mode != ModeRegister.IDLE) {
          _floating.enable();
        }
      }
    }
  }

However, I run into issues in the following two situation:

  1. On a phone (Pixel 6 Emulator on API level 33):
  • Open the app
  • Enter App Overview
  • Click on the App icon and then on 'Split top'
  1. On a tablet (10.1 WXGA Emulator on API lebel 33):
  • Open the app in split screen mode
  • Use the central divider to put the other app into fullscreen

In both of these cases I get the following exception:

E/flutter ( 6443): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(error, Activity must be resumed to enter picture-in-picture, null, java.lang.IllegalStateException: Activity must be resumed to enter picture-in-picture
E/flutter ( 6443):      at android.app.Activity.enterPictureInPictureMode(Activity.java:2901)
E/flutter ( 6443):      at eu.wroblewscy.marcin.floating.floating.FloatingPlugin.onMethodCall(FloatingPlugin.kt:61)
E/flutter ( 6443):      at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:258)
E/flutter ( 6443):      at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295)
E/flutter ( 6443):      at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:322)
E/flutter ( 6443):      at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12)
E/flutter ( 6443):      at android.os.Handler.handleCallback(Handler.java:942)
E/flutter ( 6443):      at android.os.Handler.dispatchMessage(Handler.java:99)
E/flutter ( 6443):      at android.os.Looper.loopOnce(Looper.java:201)
E/flutter ( 6443):      at android.os.Looper.loop(Looper.java:288)
E/flutter ( 6443):      at android.app.ActivityThread.main(ActivityThread.java:7872)
E/flutter ( 6443):      at java.lang.reflect.Method.invoke(Native Method)
E/flutter ( 6443):      at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
E/flutter ( 6443):      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
E/flutter ( 6443): )
E/flutter ( 6443): #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:653:7)
E/flutter ( 6443): #1      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:315:18)
E/flutter ( 6443): <asynchronous suspension>
E/flutter ( 6443): #2      Floating.enable (package:floating/src/floating.dart:83:39)
E/flutter ( 6443): <asynchronous suspension>
E/flutter ( 6443):

Any chance that this can be fixed?

[Proposal] for Event Listener Feature

Just wanted to drop a quick note to say thank you for creating this amazing package.
I was wondering if there's any chance you could add an event listener to the package?
like onPipDisabled onPipEnabled
I think it would be super helpful.

Thanks again for all your hard work on this, it's greatly appreciated!

dispose doesn't work

Hello, I use floating in a specific page. When the page dispose, I execute floating.dispose() too. But
I will find the floating window doesn't closed, it still show on my phone.
Is there any advice?
Thank you very much.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.