-
-
Notifications
You must be signed in to change notification settings - Fork 287
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Text on the scancard should not be selectable (#1434)
* fix: Text on the scanner should not be selectable * converted to if statement * changed selectable extension * added style
- Loading branch information
1 parent
cb894fa
commit fcea379
Showing
4 changed files
with
24 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 14 additions & 9 deletions
23
packages/smooth_app/lib/helpers/extension_on_text_helper.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,19 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
extension Selectable on Text { | ||
Widget selectable() { | ||
return SelectableText( | ||
data!, | ||
style: style, | ||
toolbarOptions: const ToolbarOptions( | ||
copy: true, | ||
selectAll: true, | ||
), | ||
); | ||
Widget selectable({bool isSelectable = true}) { | ||
return isSelectable | ||
? SelectableText( | ||
data!, | ||
style: style, | ||
toolbarOptions: const ToolbarOptions( | ||
copy: true, | ||
selectAll: true, | ||
), | ||
) | ||
: Text( | ||
data!, | ||
style: style, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters