Giter Club home page Giter Club logo

Comments (7)

boyd-boyd avatar boyd-boyd commented on July 18, 2024 2

can you tell me one more thing:
i have to register port before i start my foreground service, so I'm initializing my foreground service in my main app, to send data to overlay i had to register the receiver port in overlay class (am i right?)

i have one more question that is when i kill my app from the app list and then do anything which causes the condition to show overlay from foreground service the overlay is shown but the code inside the overlay class never runs which means the old overlay is shown so it doesn't matter if i send the data through port to the overlay.

for example :
depending upon the data shared to overlay through FlutterOverlayWindow.sharedata() function, different screen is shown and if no data is shared an error screen is shown . so if i run the app and show the overlay after sharing data the overlay is shown with specified screen but now if i kill the app and show overlay the previous overlay is shown instead of error overlay as no data is shared.

which conclude that if the app is killed and overlay is invoked through the foreground service it displays the old overlay , and the overlay class code is not executed.

@pragma("vm:entry-point ")
void overlayMain() {
  runApp(ChangeNotifierProvider(
    create: (BuildContext context) {
      return TimerOverlayNotifier();
    },
    child: MaterialApp(
        color: Colors.transparent,
        theme:
            ThemeData.from(colorScheme: lightColorScheme, useMaterial3: true),
        darkTheme: ThemeData.from(
          colorScheme: darkColorScheme,
          useMaterial3: true,
        ),
        themeMode: ThemeMode.system,
        debugShowCheckedModeBanner: false,
        home: const MyOverlayWindow()),//the code inside this never executed if the app is killed
  ));
}

is there any workaround to this.

from flutter_overlay_window.

X-SLAYER avatar X-SLAYER commented on July 18, 2024

check the example on how i share the data between two isolates

from flutter_overlay_window.

rjsdnql123 avatar rjsdnql123 commented on July 18, 2024

@X-SLAYER where????? : ( 😢

from flutter_overlay_window.

X-SLAYER avatar X-SLAYER commented on July 18, 2024

Example folder

from flutter_overlay_window.

rjsdnql123 avatar rjsdnql123 commented on July 18, 2024

Thanks : )

but

@X-SLAYER If you go to the background, shareData returns null

HELP ME ㅠ^ㅠ

from flutter_overlay_window.

rjsdnql123 avatar rjsdnql123 commented on July 18, 2024

@X-SLAYER help me please ㅠ^ㅠ
ㅠ^ㅠ
ㅠ^ㅠ

from flutter_overlay_window.

X-SLAYER avatar X-SLAYER commented on July 18, 2024

yes use the ReceivePort instead of shareData like the example

from flutter_overlay_window.

Related Issues (20)

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.