duytq94 / flutter-intro-slider

Simple and configurable app introduction slider for Flutter
https://pub.dartlang.org/packages/intro_slider
MIT License
677 stars 141 forks source link

Remove code duplication #16

Closed PabloPL closed 5 years ago

PabloPL commented 5 years ago

This two commits simplifies code by removing some code duplication. Previously code for building buttons was duplicated (only difference was that we used either new created Text widget or one provided by user). Also by initializing unset fields with default values(setupButtonDefaultValues method), we can get rid of null checks when doing widgets. Also code for creation of buttons is moved to separate methods, to make whole widget building code smaller and it more readable.

I plan to add "previous" button support (in next PR) and separate next/done button styles/etc (they're using the same values).

Thanks for nice library!