From 35b47679c0891dc958e08d72f35742a18db9fa01 Mon Sep 17 00:00:00 2001 From: dab246 Date: Mon, 18 Jul 2022 13:45:21 +0700 Subject: [PATCH] TF-61 Add RichTextStyleType object --- .../model/rich_text_style_type.dart | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 lib/features/composer/presentation/model/rich_text_style_type.dart diff --git a/lib/features/composer/presentation/model/rich_text_style_type.dart b/lib/features/composer/presentation/model/rich_text_style_type.dart new file mode 100644 index 000000000..694ee210e --- /dev/null +++ b/lib/features/composer/presentation/model/rich_text_style_type.dart @@ -0,0 +1,34 @@ + +import 'package:core/presentation/resources/image_paths.dart'; + +enum RichTextStyleType { + bold, + italic, + underline; + + String get commandAction { + switch (this) { + case bold: + return 'bold'; + case italic: + return 'italic'; + case underline: + return 'underline'; + default: + return ''; + } + } + + String getIcon(ImagePaths imagePaths) { + switch (this) { + case bold: + return imagePaths.icStyleBold; + case italic: + return imagePaths.icStyleItalic; + case underline: + return imagePaths.icStyleUnderline; + default: + return ''; + } + } +} \ No newline at end of file