Skip to content

Commit 82dbde1

Browse files
button: Add video chat button in compose box
1 parent 07c3a70 commit 82dbde1

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

lib/widgets/compose_box.dart

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1031,6 +1031,32 @@ Future<void> _uploadFiles({
10311031
}
10321032
}
10331033

1034+
class _AttachVideoChatUrlButton extends StatelessWidget {
1035+
const _AttachVideoChatUrlButton({
1036+
required this.controller,
1037+
required this.enabled,
1038+
});
1039+
1040+
final ComposeBoxController controller;
1041+
final bool enabled;
1042+
1043+
void _handlePress(BuildContext context) {
1044+
}
1045+
1046+
@override
1047+
Widget build(BuildContext context) {
1048+
final designVariables = DesignVariables.of(context);
1049+
final zulipLocalizations = ZulipLocalizations.of(context);
1050+
1051+
return SizedBox(
1052+
width: _composeButtonSize,
1053+
child: IconButton(
1054+
icon: Icon(ZulipIcons.video, color: designVariables.foreground.withFadedAlpha(0.5)),
1055+
tooltip: zulipLocalizations.composeBoxAttachFromVideoCallTooltip,
1056+
onPressed: enabled ? () => _handlePress(context) : null));
1057+
}
1058+
}
1059+
10341060
abstract class _AttachUploadsButton extends StatelessWidget {
10351061
const _AttachUploadsButton({required this.controller, required this.enabled});
10361062

@@ -1469,6 +1495,7 @@ abstract class _ComposeBoxBody extends StatelessWidget {
14691495
_AttachFileButton(controller: controller, enabled: composeButtonsEnabled),
14701496
_AttachMediaButton(controller: controller, enabled: composeButtonsEnabled),
14711497
_AttachFromCameraButton(controller: controller, enabled: composeButtonsEnabled),
1498+
_AttachVideoChatUrlButton(controller: controller, enabled: composeButtonsEnabled),
14721499
];
14731500

14741501
final topicInput = buildTopicInput();

test/widgets/compose_box_test.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1314,6 +1314,7 @@ void main() {
13141314
check(attachButtonFinder(ZulipIcons.attach_file).evaluate().length).equals(areShown ? 1 : 0);
13151315
check(attachButtonFinder(ZulipIcons.image).evaluate().length).equals(areShown ? 1 : 0);
13161316
check(attachButtonFinder(ZulipIcons.camera).evaluate().length).equals(areShown ? 1 : 0);
1317+
check(attachButtonFinder(ZulipIcons.video).evaluate().length).equals(areShown ? 1 : 0);
13171318
}
13181319

13191320
void checkBannerWithLabel(String label, {required bool isShown}) {

0 commit comments

Comments
 (0)