Skip to content

Commit f46187a

Browse files
gnpricechrisbobbe
authored andcommitted
compose [nfc]: Simplify controller getters to final fields
A private final field exposed by a public getter is equivalent to a public final field: either means that any library can get, and no library can set.
1 parent e1fc763 commit f46187a

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

lib/widgets/compose_box.dart

+8-14
Original file line numberDiff line numberDiff line change
@@ -1178,30 +1178,24 @@ class _FixedDestinationComposeBoxBody extends _ComposeBoxBody {
11781178
}
11791179

11801180
sealed class ComposeBoxController {
1181-
ComposeContentController get content => _content;
1182-
final _content = ComposeContentController();
1183-
1184-
FocusNode get contentFocusNode => _contentFocusNode;
1185-
final _contentFocusNode = FocusNode();
1181+
final content = ComposeContentController();
1182+
final contentFocusNode = FocusNode();
11861183

11871184
@mustCallSuper
11881185
void dispose() {
1189-
_content.dispose();
1190-
_contentFocusNode.dispose();
1186+
content.dispose();
1187+
contentFocusNode.dispose();
11911188
}
11921189
}
11931190

11941191
class StreamComposeBoxController extends ComposeBoxController {
1195-
ComposeTopicController get topic => _topic;
1196-
final _topic = ComposeTopicController();
1197-
1198-
FocusNode get topicFocusNode => _topicFocusNode;
1199-
final _topicFocusNode = FocusNode();
1192+
final topic = ComposeTopicController();
1193+
final topicFocusNode = FocusNode();
12001194

12011195
@override
12021196
void dispose() {
1203-
_topic.dispose();
1204-
_topicFocusNode.dispose();
1197+
topic.dispose();
1198+
topicFocusNode.dispose();
12051199
super.dispose();
12061200
}
12071201
}

0 commit comments

Comments
 (0)