@@ -272,6 +272,21 @@ class ComposeContentController extends ComposeController<ContentValidationError>
272
272
}
273
273
}
274
274
275
+ class _TopBar extends StatelessWidget {
276
+ const _TopBar ({required this .showProgressIndicator});
277
+
278
+ final bool showProgressIndicator;
279
+
280
+ @override
281
+ Widget build (BuildContext context) {
282
+ // TODO: Figure out a way so that this does not shift the message list
283
+ // when it gains more height.
284
+ return Column (children: [
285
+ if (showProgressIndicator) _progressIndicator (context),
286
+ ]);
287
+ }
288
+ }
289
+
275
290
class _ContentInput extends StatefulWidget {
276
291
const _ContentInput ({
277
292
required this .enabled,
@@ -1072,6 +1087,14 @@ class _SendButtonState extends State<_SendButton> {
1072
1087
}
1073
1088
}
1074
1089
1090
+ Widget _progressIndicator (BuildContext context) {
1091
+ final designVariables = DesignVariables .of (context);
1092
+ return LinearProgressIndicator (
1093
+ minHeight: 2.0 ,
1094
+ backgroundColor: designVariables.foreground.withFadedAlpha (0.2 ),
1095
+ color: designVariables.foreground.withFadedAlpha (0.5 ));
1096
+ }
1097
+
1075
1098
class _ComposeBoxContainer extends StatelessWidget {
1076
1099
const _ComposeBoxContainer ({required this .children});
1077
1100
@@ -1094,12 +1117,14 @@ class _ComposeBoxContainer extends StatelessWidget {
1094
1117
1095
1118
class _ComposeBoxLayout extends StatelessWidget {
1096
1119
const _ComposeBoxLayout ({
1120
+ required this .topBar,
1097
1121
required this .topicInput,
1098
1122
required this .contentInput,
1099
1123
required this .composeButtonBar,
1100
1124
required this .sendButton,
1101
1125
});
1102
1126
1127
+ final Widget topBar;
1103
1128
final Widget ? topicInput;
1104
1129
final Widget contentInput;
1105
1130
final Widget composeButtonBar;
@@ -1133,6 +1158,7 @@ class _ComposeBoxLayout extends StatelessWidget {
1133
1158
data: iconButtonThemeData,
1134
1159
child: _ComposeBoxContainer (
1135
1160
children: [
1161
+ topBar,
1136
1162
SafeArea (
1137
1163
minimum: const EdgeInsets .symmetric (horizontal: 8 ),
1138
1164
child: Column (children: [
@@ -1208,6 +1234,7 @@ class _StreamComposeBoxState extends State<_StreamComposeBox> implements Compose
1208
1234
valueListenable: _enabled,
1209
1235
builder: (context, enabled, child) {
1210
1236
return _ComposeBoxLayout (
1237
+ topBar: _TopBar (showProgressIndicator: ! enabled),
1211
1238
topicInput: _TopicInput (
1212
1239
enabled: enabled,
1213
1240
streamId: widget.narrow.streamId,
@@ -1293,6 +1320,7 @@ class _FixedDestinationComposeBoxState extends State<_FixedDestinationComposeBox
1293
1320
valueListenable: _enabled,
1294
1321
builder: (context, enabled, child) {
1295
1322
return _ComposeBoxLayout (
1323
+ topBar: _TopBar (showProgressIndicator: ! enabled),
1296
1324
topicInput: null ,
1297
1325
contentInput: _FixedDestinationContentInput (
1298
1326
enabled: enabled,
0 commit comments