Skip to content

Commit 6169311

Browse files
committed
compose [nfc]: Put {_Stream,FixedDestination}ComposeBoxBody near base class
1 parent d124755 commit 6169311

File tree

1 file changed

+52
-52
lines changed

1 file changed

+52
-52
lines changed

lib/widgets/compose_box.dart

+52-52
Original file line numberDiff line numberDiff line change
@@ -1097,37 +1097,6 @@ abstract class _ComposeBoxBody extends StatelessWidget {
10971097
}
10981098
}
10991099

1100-
sealed class ComposeBoxController {
1101-
ComposeContentController get content => _content;
1102-
final _content = ComposeContentController();
1103-
1104-
FocusNode get contentFocusNode => _contentFocusNode;
1105-
final _contentFocusNode = FocusNode();
1106-
1107-
@mustCallSuper
1108-
void dispose() {
1109-
_content.dispose();
1110-
_contentFocusNode.dispose();
1111-
}
1112-
}
1113-
1114-
class StreamComposeBoxController extends ComposeBoxController {
1115-
ComposeTopicController get topic => _topic;
1116-
final _topic = ComposeTopicController();
1117-
1118-
FocusNode get topicFocusNode => _topicFocusNode;
1119-
final _topicFocusNode = FocusNode();
1120-
1121-
@override
1122-
void dispose() {
1123-
_topic.dispose();
1124-
_topicFocusNode.dispose();
1125-
super.dispose();
1126-
}
1127-
}
1128-
1129-
class FixedDestinationComposeBoxController extends ComposeBoxController {}
1130-
11311100
/// A compose box for use in a channel narrow.
11321101
///
11331102
/// This offers a text input for the topic to send to,
@@ -1163,27 +1132,6 @@ class _StreamComposeBoxBody extends _ComposeBoxBody {
11631132
);
11641133
}
11651134

1166-
class _ErrorBanner extends StatelessWidget {
1167-
const _ErrorBanner({required this.label});
1168-
1169-
final String label;
1170-
1171-
@override
1172-
Widget build(BuildContext context) {
1173-
final designVariables = DesignVariables.of(context);
1174-
return Container(
1175-
padding: const EdgeInsets.all(8),
1176-
decoration: BoxDecoration(
1177-
color: designVariables.errorBannerBackground,
1178-
border: Border.all(color: designVariables.errorBannerBorder),
1179-
borderRadius: BorderRadius.circular(5)),
1180-
child: Text(label,
1181-
style: TextStyle(fontSize: 18, color: designVariables.errorBannerLabel),
1182-
),
1183-
);
1184-
}
1185-
}
1186-
11871135
class _FixedDestinationComposeBoxBody extends _ComposeBoxBody {
11881136
_FixedDestinationComposeBoxBody({required this.narrow, required this.controller});
11891137

@@ -1208,6 +1156,58 @@ class _FixedDestinationComposeBoxBody extends _ComposeBoxBody {
12081156
);
12091157
}
12101158

1159+
sealed class ComposeBoxController {
1160+
ComposeContentController get content => _content;
1161+
final _content = ComposeContentController();
1162+
1163+
FocusNode get contentFocusNode => _contentFocusNode;
1164+
final _contentFocusNode = FocusNode();
1165+
1166+
@mustCallSuper
1167+
void dispose() {
1168+
_content.dispose();
1169+
_contentFocusNode.dispose();
1170+
}
1171+
}
1172+
1173+
class StreamComposeBoxController extends ComposeBoxController {
1174+
ComposeTopicController get topic => _topic;
1175+
final _topic = ComposeTopicController();
1176+
1177+
FocusNode get topicFocusNode => _topicFocusNode;
1178+
final _topicFocusNode = FocusNode();
1179+
1180+
@override
1181+
void dispose() {
1182+
_topic.dispose();
1183+
_topicFocusNode.dispose();
1184+
super.dispose();
1185+
}
1186+
}
1187+
1188+
class FixedDestinationComposeBoxController extends ComposeBoxController {}
1189+
1190+
class _ErrorBanner extends StatelessWidget {
1191+
const _ErrorBanner({required this.label});
1192+
1193+
final String label;
1194+
1195+
@override
1196+
Widget build(BuildContext context) {
1197+
final designVariables = DesignVariables.of(context);
1198+
return Container(
1199+
padding: const EdgeInsets.all(8),
1200+
decoration: BoxDecoration(
1201+
color: designVariables.errorBannerBackground,
1202+
border: Border.all(color: designVariables.errorBannerBorder),
1203+
borderRadius: BorderRadius.circular(5)),
1204+
child: Text(label,
1205+
style: TextStyle(fontSize: 18, color: designVariables.errorBannerLabel),
1206+
),
1207+
);
1208+
}
1209+
}
1210+
12111211
class ComposeBox extends StatefulWidget {
12121212
ComposeBox({super.key, required this.narrow})
12131213
: assert(ComposeBox.hasComposeBox(narrow));

0 commit comments

Comments
 (0)