duytq94 / flutter-intro-slider

Simple and configurable app introduction slider for Flutter

Home Page:https://pub.dartlang.org/packages/intro_slider

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

renderDoneBtn and other should't be default TextButton

Fintasys opened this issue · comments

Hey !
Thanks for your hard work on this awesome library !

I've noticed that all buttons, even if you define your own widget, are default TextButtons. I think that's rather confusing and should be only the case if only nameNextBtn is set. Building the widget just as given would give us the chance to adjust the button for next and others like I'm trying to do.

Let me know what do you think.
Thank you!

Hi,
You're right, I haven't think about it when I starting, rendering entire your custom button is more flexible than wrapping it by TextButton.
I will update it later, if you could make a PR, I appreciate it

@duytq94 Thank you very much ! At the moment I can't find time for that, but I gonna keep it in mind and check again once I have more time 🙇

I just updated (still using TextButton) but with more flexibility and clearly at here https://github.com/duytq94/flutter-intro-slider/releases/tag/3.0.0
The reason I'm still using TextButton for wrapping because:

  • You can pass a child widget and ButtonStyle to TextButton, which I think you can custom almost all cases
  • Render entire your custom widget without wrapping by TextButton, you hard to handle onPress action (eg: how to check slide is animating to prevent jump to next tab like photo below?)
    Screen Shot 2021-06-19 at 1 08 58 AM

@duytq94 Thanks for looking into this issue and this improvement which is already very helpful !

To answer your question, something like this would be possible I guess

GestureDetector(
    onTap: () {
        // Logic 
    },
    child: AbsorbPointer(
        child: renderCustomWidget,
    )
)

any onTap in custom Widget would ignored and only gestureDetector's onTap would be called.
But problem is that also any effect on the custom Widget, like ripple won't be triggered. But I guess your solution so far is not bad and might be the better option.

OK, I'll close this issue since the latest improvement has given users to custom almost cases, thanks.