From c6157b32d639013f2403efa19b49cca73c458d41 Mon Sep 17 00:00:00 2001 From: Marcelo Amaro Date: Thu, 19 Sep 2024 15:56:53 -0300 Subject: [PATCH] feat: add selectable texts security --- CHANGELOG.md | 4 ++++ lib/blip_ds.dart | 1 + lib/src/services/ds_security.service.dart | 3 +++ lib/src/widgets/texts/ds_text.widget.dart | 5 ++++- pubspec.yaml | 2 +- sample/pubspec.lock | 2 +- 6 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 lib/src/services/ds_security.service.dart diff --git a/CHANGELOG.md b/CHANGELOG.md index 3823e506..252c9b69 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.2.4 + +- [DSSecurityService] Add service to manage security features. +- ## 0.2.3 - [DSPhoneInput] Add support to select current country code. diff --git a/lib/blip_ds.dart b/lib/blip_ds.dart index c7f25ac5..f819e972 100644 --- a/lib/blip_ds.dart +++ b/lib/blip_ds.dart @@ -62,6 +62,7 @@ export 'src/services/ds_dialog.service.dart' show DSDialogService; export 'src/services/ds_file.service.dart' show DSFileService; export 'src/services/ds_localization.service.dart' show DSLocalizationService; export 'src/services/ds_media_format.service.dart' show DSMediaFormatService; +export 'src/services/ds_security.service.dart' show DSSecurityService; export 'src/services/ds_toast.service.dart' show DSToastService; export 'src/themes/colors/ds_colors.theme.dart' show DSColors; export 'src/themes/colors/ds_dark_colors.theme.dart' show DSDarkColors; diff --git a/lib/src/services/ds_security.service.dart b/lib/src/services/ds_security.service.dart new file mode 100644 index 00000000..a43f87d7 --- /dev/null +++ b/lib/src/services/ds_security.service.dart @@ -0,0 +1,3 @@ +abstract class DSSecurityService { + static bool isSelectableTextsEnabled = true; +} diff --git a/lib/src/widgets/texts/ds_text.widget.dart b/lib/src/widgets/texts/ds_text.widget.dart index 29f0451a..c33e468d 100644 --- a/lib/src/widgets/texts/ds_text.widget.dart +++ b/lib/src/widgets/texts/ds_text.widget.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; +import '../../services/ds_security.service.dart'; import '../../themes/colors/ds_colors.theme.dart'; import '../../themes/texts/utils/ds_font_weights.theme.dart'; import '../../utils/ds_linkify.util.dart'; @@ -58,7 +59,9 @@ class DSText extends StatelessWidget { @override Widget build(BuildContext context) => - isSelectable ? _buildSelectableText() : _buildText(); + DSSecurityService.isSelectableTextsEnabled && isSelectable + ? _buildSelectableText() + : _buildText(); InlineSpan get _formattedText { List? formattedText; diff --git a/pubspec.yaml b/pubspec.yaml index 6d433e07..99293b85 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: blip_ds description: Blip Design System for Flutter. -version: 0.2.3 +version: 0.2.4 homepage: https://github.com/takenet/blip-ds-flutter#readme repository: https://github.com/takenet/blip-ds-flutter diff --git a/sample/pubspec.lock b/sample/pubspec.lock index 27776096..6957204e 100644 --- a/sample/pubspec.lock +++ b/sample/pubspec.lock @@ -31,7 +31,7 @@ packages: path: ".." relative: true source: path - version: "0.2.0" + version: "0.2.4" boolean_selector: dependency: transitive description: