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

Add TextStyle properties: overflow, word_spacing, baseline #3435

Merged
merged 1 commit into from
Jun 10, 2024
Merged

Conversation

ndonkoHenri
Copy link
Contributor

@ndonkoHenri ndonkoHenri commented Jun 8, 2024

Closes #3231

Summary by Sourcery

This pull request introduces new properties overflow, word_spacing, and baseline to the TextStyle class, enhancing text styling capabilities. Additionally, utility functions for parsing text properties have been refactored to support default values.

  • New Features:
    • Added overflow, word_spacing, and baseline properties to TextStyle in both Dart and Python implementations.
  • Enhancements:
    • Refactored utility functions to accept default values for text properties like TextAlign, TextOverflow, TextCapitalization, and TextBaseline.

@ndonkoHenri ndonkoHenri requested a review from FeodorFitsner June 8, 2024 02:34
Copy link
Contributor

sourcery-ai bot commented Jun 8, 2024

Reviewer's Guide by Sourcery

This pull request adds new properties (overflow, word_spacing, baseline) to the TextStyle class in the Flet library. The changes include modifications to the text parsing utilities in Dart and updates to the Python SDK to support these new properties.

File-Level Changes

Files Changes
sdk/python/packages/flet-core/src/flet_core/text_style.py
sdk/python/packages/flet-core/src/flet_core/text.py
Refactored enums and extended TextStyle class to support new properties.

Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @ndonkoHenri - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟡 General issues: 4 issues found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

packages/flet/lib/src/utils/text.dart Show resolved Hide resolved
packages/flet/lib/src/utils/text.dart Show resolved Hide resolved
letterSpacing: json['letter_spacing'] != null
? parseDouble(json['letter_spacing'])
: null);
fontSize: parseDouble(json["size"]),
Copy link
Contributor

Choose a reason for hiding this comment

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

issue (bug_risk): Check for null values in JSON parsing.

Ensure that parseDouble and other parsing functions handle null values gracefully to avoid potential runtime errors.

@FeodorFitsner FeodorFitsner merged commit 1adcf9f into main Jun 10, 2024
3 checks passed
@FeodorFitsner FeodorFitsner deleted the text branch June 10, 2024 17:46
zrr1999 pushed a commit to zrr1999/flet that referenced this pull request Jul 17, 2024
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.

Text overflow options for dropdown options
2 participants