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

fix: Text on the scanner should not be selectable #1434

Merged
merged 4 commits into from
Apr 1, 2022
Merged

fix: Text on the scanner should not be selectable #1434

merged 4 commits into from
Apr 1, 2022

Conversation

bhattabhi013
Copy link
Contributor

@bhattabhi013 bhattabhi013 commented Mar 31, 2022

What

Text on the scanner should not be selectable

Screenshot

Record_2022-03-31-23-45-21_cc729dbb1ea2c751a543590b5da9708c.mp4

Fixes bug(s)

Part of

@bhattabhi013 bhattabhi013 requested a review from a team as a code owner March 31, 2022 18:17
@teolemon teolemon linked an issue Mar 31, 2022 that may be closed by this pull request
Copy link
Member

@M123-dev M123-dev left a comment

Choose a reason for hiding this comment

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

Heyyy, some minor comments:

What about instead of using a conditional Text() or Text().selectable() everywhere just updating the Selectable Text extension for allowing to pass a bool if selectable or not and then deciding there wether to return Text or SelectableText

extension Selectable on Text {
  Widget selectable({bool isSelectable = false}) {
    return isSelectable
        ? SelectableText( ... )
        : Text( ... )

Also noticed the quantity text in the product title card is still always selectable

packages/smooth_app/lib/pages/product/summary_card.dart Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

Codecov Report

❗ No coverage uploaded for pull request base (develop@35457d3). Click here to learn what that means.
The diff coverage is n/a.

@@            Coverage Diff            @@
##             develop   #1434   +/-   ##
=========================================
  Coverage           ?   9.15%           
=========================================
  Files              ?     158           
  Lines              ?    6380           
  Branches           ?       0           
=========================================
  Hits               ?     584           
  Misses             ?    5796           
  Partials           ?       0           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 35457d3...51d33bf. Read the comment docs.

@bhattabhi013
Copy link
Contributor Author

Thanks for the review and for providing a better approach to the solution. I've made the changes in the selectable extension.

@bhattabhi013 bhattabhi013 requested a review from M123-dev April 1, 2022 10:29
selectAll: true,
),
)
: Text(data!);
Copy link
Member

Choose a reason for hiding this comment

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

The style is missing here

Copy link
Member

@M123-dev M123-dev left a comment

Choose a reason for hiding this comment

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

Looks good, thanks @bhattabhi013

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

Successfully merging this pull request may close these issues.

Text on the scanner should not be selectable
4 participants