Skip to content

Commit da4c789

Browse files
committed
Remove the extension on TextDirection
Dart 2.15 added support for accessing the String value of an enum which makes the extension unnecessary.
1 parent baeb0f7 commit da4c789

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

lib/src/chatoptions.dart

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,6 @@ enum TextDirection {
1111
ltr,
1212
}
1313

14-
extension TextDirectionString on TextDirection {
15-
/// Converts this enum's values to String.
16-
String getValue() {
17-
switch (this) {
18-
case TextDirection.rtl:
19-
return 'rtl';
20-
case TextDirection.ltr:
21-
return 'ltr';
22-
}
23-
}
24-
}
2514

2615
/// Settings that affect the behavior of the message field
2716
class MessageFieldOptions {
@@ -199,7 +188,7 @@ class ChatBoxOptions {
199188
final result = <String, dynamic>{};
200189

201190
if (dir != null) {
202-
result['dir'] = dir!.getValue();
191+
result['dir'] = dir!.name;
203192
}
204193

205194
if (messageField != null) {

0 commit comments

Comments
 (0)