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

[New Feature] Only show overlay over a portion of the screen (like only over ElevatedButton/Form) #27

Closed
mrishabh72 opened this issue Jan 4, 2022 · 2 comments

Comments

@mrishabh72
Copy link

I am trying to show overlay only on one widget rather than the whole screen. I tried seperating that widget out, into a new widget but found no luck. Is my request possible to achieve?

I tried this, but still overlay occupies whole screen:
`class TapOnceButton extends StatelessWidget {
final Widget child;
final VoidFutureCallBack onPressed;

const TapOnceButton({Key? key, required this.child, required this.onPressed})
: super(key: key);
@OverRide
Widget build(BuildContext context) => LoaderOverlay(
child: ElevatedButton(
child: this.child,
onPressed: () async {
context.loaderOverlay.show();
await this.onPressed();
context.loaderOverlay.hide();
}));
}
`

@rodrigobastosv
Copy link
Owner

Hi @mrishabh72 , first of all, thanks a lot for using this package.

I'm currently a little busy, but I'll definitely take a look at your request. It seems to be a use case that makes sense.

Please give me a few days that I try to see this for you.

Thanks!

@rodrigobastosv
Copy link
Owner

@mrishabh72, sorry for the late reply.

I implemented your feature request. It should be available in version 2.0.5 already on pub.dev.

It was added 3 new properties to the LoaderOverlay:

  • overlayWholeScreen: should be false in your case, to prevent the full screen "mode"
  • overlayHeight: the desired height of the overlay
  • overlayWidth: the desired width of the overlay

I also added an example called PartScreenOverlay on the example project to demonstrate this use. It shows a case of an overlay on an ElevatedButton.

Thanks a lor for using this package.

Will close this issue for now, but feel free to reopen if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants