@@ -284,7 +284,6 @@ class _ContentInput extends StatelessWidget {
284
284
@override
285
285
Widget build (BuildContext context) {
286
286
ColorScheme colorScheme = Theme .of (context).colorScheme;
287
-
288
287
return InputDecorator (
289
288
decoration: const InputDecoration (),
290
289
child: ConstrainedBox (
@@ -505,7 +504,10 @@ Future<void> _uploadFiles({
505
504
}
506
505
507
506
abstract class _AttachUploadsButton extends StatelessWidget {
508
- const _AttachUploadsButton ({required this .contentController, required this .contentFocusNode});
507
+ const _AttachUploadsButton ({
508
+ required this .contentController,
509
+ required this .contentFocusNode,
510
+ });
509
511
510
512
final ComposeContentController contentController;
511
513
final FocusNode contentFocusNode;
@@ -606,7 +608,10 @@ Future<Iterable<_File>> _getFilePickerFiles(BuildContext context, FileType type)
606
608
}
607
609
608
610
class _AttachFileButton extends _AttachUploadsButton {
609
- const _AttachFileButton ({required super .contentController, required super .contentFocusNode});
611
+ const _AttachFileButton ({
612
+ required super .contentController,
613
+ required super .contentFocusNode,
614
+ });
610
615
611
616
@override
612
617
IconData get icon => Icons .attach_file;
@@ -622,7 +627,10 @@ class _AttachFileButton extends _AttachUploadsButton {
622
627
}
623
628
624
629
class _AttachMediaButton extends _AttachUploadsButton {
625
- const _AttachMediaButton ({required super .contentController, required super .contentFocusNode});
630
+ const _AttachMediaButton ({
631
+ required super .contentController,
632
+ required super .contentFocusNode,
633
+ });
626
634
627
635
@override
628
636
IconData get icon => Icons .image;
@@ -639,7 +647,10 @@ class _AttachMediaButton extends _AttachUploadsButton {
639
647
}
640
648
641
649
class _AttachFromCameraButton extends _AttachUploadsButton {
642
- const _AttachFromCameraButton ({required super .contentController, required super .contentFocusNode});
650
+ const _AttachFromCameraButton ({
651
+ required super .contentController,
652
+ required super .contentFocusNode,
653
+ });
643
654
644
655
@override
645
656
IconData get icon => Icons .camera_alt;
@@ -850,11 +861,13 @@ class _ComposeBoxLayout extends StatelessWidget {
850
861
required this .sendButton,
851
862
required this .contentController,
852
863
required this .contentFocusNode,
864
+ this .placeholder,
853
865
});
854
866
855
867
final Widget ? topicInput;
856
868
final Widget contentInput;
857
869
final Widget sendButton;
870
+ final Widget ? placeholder;
858
871
final ComposeContentController contentController;
859
872
final FocusNode contentFocusNode;
860
873
@@ -883,7 +896,7 @@ class _ComposeBoxLayout extends StatelessWidget {
883
896
minimum: const EdgeInsets .fromLTRB (8 , 0 , 8 , 8 ),
884
897
child: Padding (
885
898
padding: const EdgeInsets .only (top: 8.0 ),
886
- child: Column (children: [
899
+ child: placeholder ?? Column (children: [
887
900
Row (crossAxisAlignment: CrossAxisAlignment .end, children: [
888
901
Expanded (
889
902
child: Theme (
@@ -900,9 +913,18 @@ class _ComposeBoxLayout extends StatelessWidget {
900
913
data: themeData.copyWith (
901
914
iconTheme: themeData.iconTheme.copyWith (color: colorScheme.onSurfaceVariant)),
902
915
child: Row (children: [
903
- _AttachFileButton (contentController: contentController, contentFocusNode: contentFocusNode),
904
- _AttachMediaButton (contentController: contentController, contentFocusNode: contentFocusNode),
905
- _AttachFromCameraButton (contentController: contentController, contentFocusNode: contentFocusNode),
916
+ _AttachFileButton (
917
+ contentController: contentController,
918
+ contentFocusNode: contentFocusNode,
919
+ ),
920
+ _AttachMediaButton (
921
+ contentController: contentController,
922
+ contentFocusNode: contentFocusNode,
923
+ ),
924
+ _AttachFromCameraButton (
925
+ contentController: contentController,
926
+ contentFocusNode: contentFocusNode,
927
+ ),
906
928
])),
907
929
])))); }
908
930
}
@@ -982,6 +1004,29 @@ class _FixedDestinationComposeBox extends StatefulWidget {
982
1004
State <_FixedDestinationComposeBox > createState () => _FixedDestinationComposeBoxState ();
983
1005
}
984
1006
1007
+ class _ErrorBanner extends StatelessWidget {
1008
+ const _ErrorBanner ({required this .label});
1009
+
1010
+ final String label;
1011
+
1012
+ @override
1013
+ Widget build (BuildContext context) {
1014
+ return Container (
1015
+ padding: const EdgeInsets .all (8 ),
1016
+ decoration: BoxDecoration (
1017
+ color: const Color .fromRGBO (238 , 222 , 221 , 1 ),
1018
+ border: Border .all (color: const Color .fromRGBO (132 , 41 , 36 , 0.4 )),
1019
+ borderRadius: BorderRadius .circular (5 )),
1020
+ child: Text (label,
1021
+ maxLines: 2 ,
1022
+ overflow: TextOverflow .ellipsis,
1023
+ style: const TextStyle (fontSize: 18 ,
1024
+ color: Color .fromRGBO (133 , 42 , 35 , 1 )),
1025
+ ),
1026
+ );
1027
+ }
1028
+ }
1029
+
985
1030
class _FixedDestinationComposeBoxState extends State <_FixedDestinationComposeBox > implements ComposeBoxController <_FixedDestinationComposeBox > {
986
1031
@override ComposeTopicController ? get topicController => null ;
987
1032
@@ -998,6 +1043,19 @@ class _FixedDestinationComposeBoxState extends State<_FixedDestinationComposeBox
998
1043
super .dispose ();
999
1044
}
1000
1045
1046
+ Widget ? _placeholder (BuildContext context) {
1047
+ if (widget.narrow case DmNarrow (: final otherRecipientIds)) {
1048
+ final store = PerAccountStoreWidget .of (context);
1049
+ final showPlaceholder = otherRecipientIds.any ((id) =>
1050
+ ! (store.users[id]? .isActive ?? true ));
1051
+ if (showPlaceholder) {
1052
+ return _ErrorBanner (label: ZulipLocalizations .of (context)
1053
+ .errorBannerDeactivatedDmLabel);
1054
+ }
1055
+ }
1056
+ return null ;
1057
+ }
1058
+
1001
1059
@override
1002
1060
Widget build (BuildContext context) {
1003
1061
return _ComposeBoxLayout (
@@ -1013,7 +1071,8 @@ class _FixedDestinationComposeBoxState extends State<_FixedDestinationComposeBox
1013
1071
topicController: null ,
1014
1072
contentController: _contentController,
1015
1073
getDestination: () => widget.narrow.destination,
1016
- ));
1074
+ ),
1075
+ placeholder: _placeholder (context));
1017
1076
}
1018
1077
}
1019
1078
0 commit comments