Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resize windows issue #11

Open
hiimBugCreator opened this issue Jan 23, 2024 · 2 comments
Open

Resize windows issue #11

hiimBugCreator opened this issue Jan 23, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@hiimBugCreator
Copy link

Hi,
As your example:
image
While I running the web version and I resize the browser's windows, the blue sky is responsive (that's good) but the clouds and the sun just move to the old position.

@AbdulrhmanSayedAli AbdulrhmanSayedAli added the bug Something isn't working label Jan 23, 2024
@AbdulrhmanSayedAli
Copy link
Owner

AbdulrhmanSayedAli commented Jan 23, 2024

Hi,
thank you for reporting this bug I will fix it ASAP.

here is a work around until I publish a fix for this issue:

add a key to the vitality custom constructor to make it render whenever the width or height changes.
key: Key("${size.width}-${size.height}")

your build function should be like this now:

@override
  Widget build(BuildContext context) {
    Size size = MediaQuery.of(context).size;
    return Vitality.custom(
        key: Key("${size.width}-${size.height}"),
        background: Colors.blue,
        shapes: [
          Shape(
            pos: const Offset(30, 30),
            dx: 0.3,
            dy: 0,
            size: 160,
            color: Colors.yellow,
            whenOutOfScreenMode: WhenOutOfScreenMode.Reflect,
            behaviour: ItemBehaviour(shape: ShapeType.Icon, icon: Icons.sunny),
          ),
          ...getClouds(size),
          ...getGroundShapes(size),
        ]);
  }

I will notify you once I publish the fix.

@hiimBugCreator
Copy link
Author

ok, tks. That worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants