Skip to content
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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

VanHoangTran
Copy link
Collaborator

No description provided.

@VanHoangTran VanHoangTran requested a review from a team as a code owner January 30, 2025 16:18
@VanHoangTran VanHoangTran reopened this Jan 31, 2025
Copy link
Contributor

@smallTrogdor smallTrogdor left a 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 '
Copy link
Contributor

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.',
Copy link
Contributor

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
Copy link
Contributor

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 {
Copy link
Contributor

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
Copy link
Contributor

@smallTrogdor smallTrogdor Feb 3, 2025

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);
Copy link
Contributor

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
Copy link
Contributor

@smallTrogdor smallTrogdor Feb 3, 2025

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice 👍

Copy link
Contributor

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 💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature request]: Enhance SBBTextStyles for easier use of other text styles
2 participants