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

Suggestion: color options to be instances of `Color` rather than `int` #3

Closed jacobimpson closed 5 years ago

jacobimpson commented 5 years ago

Great package! I would however suggest that perhaps instead of using ints for color config, you use Colour instances directly. This would bring it inline with Flutter's inbuilt widgets. Eg.

Flutter's app bar..

AppBar(
 backgroundColor: Colors.white
 [....]
)

Changing to using colors like this will more easily allow for colors to be pulled out of the App's theme object. I would be happy to make this change if it's a direction that you're happy with.

duytq94 commented 5 years ago

Hi @jacobimpson OK, that's a good idea, I'll update it. Thanks.

duytq94 commented 5 years ago

Updated.

kalkotekedar commented 5 years ago

I can't use Colors.white for text style. I have to use the colour in the Color(0xFFF44336) format only.

duytq94 commented 5 years ago

@kalkotekedar Did you install the latest version? If you did it. You can check out my example, I use Colors.white and still work. Where exactly you can't use Colors.white? Actually Colors.white is the same type Color(0xFFFFFFFF) (instances of Color) so I don't understand how you can't use it. Please post more detail about the error.

kalkotekedar commented 5 years ago

styleTitle: TextStyle( color: PrimaryColor, fontSize: 30.0, fontWeight: FontWeight.bold, fontFamily: UIData.quickFont), Here if I enter the constant color like thw following is not working const PrimaryColor = const Color(0xF44336);

duytq94 commented 5 years ago

image I checked it again and nothing wrong, if you use exactly 0xF44336 maybe you miss FF prefix.

kalkotekedar commented 5 years ago

Do I need to add the FF prefix??

duytq94 commented 5 years ago

Why you don't need? First 2-prefix is opacity, you don't use mean your opacity is 100% and of course, nothing show because it's transparent.

kalkotekedar commented 5 years ago

Ok, Thank You !!!