-
Notifications
You must be signed in to change notification settings - Fork 8
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
276 feature request enhance sbbtextstyles for easier use of other text styles #279
base: main
Are you sure you want to change the base?
276 feature request enhance sbbtextstyles for easier use of other text styles #279
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some small comments, biggest one is the consideration of adding SBBFontFamilies
(as package private) instead of adding this also to the SBBTextStyles class ..
One more thing: Please update the CHANGELOG accordingly. 😄 good work 🥇
/// Use [sbbFont] instead. | ||
@Deprecated('Use sbbFont instead') | ||
@Deprecated( | ||
'Use of sbbWebFont was deprecated and replaced by sbbFont for a clearer and more consistent naming convention ' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing punctuation ... naming convention . ...
@Deprecated('Use sbbFont instead') | ||
@Deprecated( | ||
'Use of sbbWebFont was deprecated and replaced by sbbFont for a clearer and more consistent naming convention ' | ||
'This feature was deprecated after v2.2.0.', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯
/// When in need of a more custom text style, consider using the extension methods defined in [TextStylesExtensions]. | ||
/// The intended way to use this is to start with [sbbTextStyle] and use the corresponding methods to achieve the | ||
/// desired [TextStyle]: | ||
/// ```dart |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very nice 👀
); | ||
} | ||
|
||
extension TextStylesExtensions on TextStyle { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good stuff 💯
class SBBTextStyles { | ||
SBBTextStyles._(); | ||
|
||
// Font families |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would create a separate class for these.
e.g. SBBFontFamilies
It seems a bit weird, that you call SBBTextStyles.sbbFontUltraLight for getting a FontFamily
// Font families | ||
|
||
/// Returns an ultra light ([fontFamily]) copy of this text style | ||
TextStyle get ultraLightStyle => copyWith(fontFamily: SBBTextStyles.sbbFontUltraLight); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This confused me a bit with the
fontFamily: SBBTextStyles. ...
Would do SBBFontFamilies (and maybe even private to the lib and not expose this one ? )
static const String sbbFontCondensedBold = 'packages/sbb_design_system_mobile/SBBWebCondensedBold'; | ||
static const String sbbFontCondensedHeavy = 'packages/sbb_design_system_mobile/SBBWebCondensedHeavy'; | ||
|
||
// Font sizes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe also for these a separate class 🤔 but I guess that breaks backwards compatibility ...
@@ -41,21 +41,27 @@ flutter: | |||
- lib/assets/illustrations/dark/ | |||
- lib/assets/illustrations/light/ | |||
fonts: | |||
- family: SBBWeb |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice for adding those tests 💯
No description provided.