talamaska / onboarding_overlay

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to change the width of the widget rendered in the stepBuilder

cjouannet opened this issue · comments

Hello,

thanks to the version 3.0.0 of your package, we can now return a custom widget in the stepBuilder to render pretty much everything we want.
This is a great feature, however i noticed that the rendered widget takes the full width of the device and I can't change or constraints the width.

I tried returning, in the stepBuilder, a SizedBox with a width of half the one given by the OnboardingStepRenderInfo but it doesn't change the end result.

stepBuilder: (
    BuildContext context,
    OnboardingStepRenderInfo renderInfo,
) {
    return SizedBox(
        width: renderInfo.size.width / 2,
        child: Material(
            child: ...,
        ),
    );
},

I also tried to add some padding at the top of the widget in the stepBuilder method, but only worked by removing the labelBoxDecoration, and with that loosing the arrow, which isn't really what i want.

stepBuilder: (
    BuildContext context,
    OnboardingStepRenderInfo renderInfo,
) {
    return Padding(
        padding: const EdgeInsets.symmetric(horizontal: 20),
        child: Material(
            child: ...,
        ),
    );
},

So my question is, is there a way to adjust the width of the widget returned in the stepBuilder? Or does it not exist yet?

I haven't tested that use-case. Will see what I can do and will be back with to you, maybe next week.

fixed in 3.1.0-pre.2
please test