chore: merge latest dev

This commit is contained in:
groovinchip
2021-08-02 13:15:28 -04:00
176 changed files with 7089 additions and 489 deletions
@@ -358,9 +358,9 @@ class MessageInputState extends State<MessageInput> {
color: _streamChatTheme.colorTheme.disabled,
),
),
const Text(
'Reply to Message',
style: TextStyle(fontWeight: FontWeight.bold),
Text(
context.translations.replyToMessageLabel,
style: const TextStyle(fontWeight: FontWeight.bold),
),
IconButton(
visualDensity: VisualDensity.compact,
@@ -462,7 +462,7 @@ class MessageInputState extends State<MessageInput> {
Padding(
padding: const EdgeInsets.symmetric(horizontal: 12),
child: Text(
'Also send as direct message',
context.translations.alsoSendAsDirectMessageLabel,
style: _streamChatTheme.textTheme.footnote.copyWith(
color: _streamChatTheme.colorTheme.textHighEmphasis
.withOpacity(0.5),
@@ -587,7 +587,7 @@ class MessageInputState extends State<MessageInput> {
style: _messageInputTheme.inputTextStyle,
autofocus: widget.autofocus,
textAlignVertical: TextAlignVertical.center,
decoration: _getInputDecoration(),
decoration: _getInputDecoration(context),
textCapitalization: TextCapitalization.sentences,
),
)
@@ -599,11 +599,11 @@ class MessageInputState extends State<MessageInput> {
);
}
InputDecoration _getInputDecoration() {
InputDecoration _getInputDecoration(BuildContext context) {
final passedDecoration = _messageInputTheme.inputDecoration;
return InputDecoration(
isDense: true,
hintText: _getHint(),
hintText: _getHint(context),
hintStyle: _messageInputTheme.inputTextStyle!.copyWith(
color: _streamChatTheme.colorTheme.textLowEmphasis,
),
@@ -752,14 +752,14 @@ class MessageInputState extends State<MessageInput> {
);
}
String _getHint() {
String _getHint(BuildContext context) {
if (_commandEnabled && _chosenCommand!.name == 'giphy') {
return 'Search GIFs';
return context.translations.searchGifLabel;
}
if (_attachments.isNotEmpty) {
return 'Add a comment or send';
return context.translations.addACommentOrSendLabel;
}
return 'Write a message';
return context.translations.writeAMessageLabel;
}
void _checkEmoji(String s, BuildContext context) {
@@ -882,7 +882,7 @@ class MessageInputState extends State<MessageInput> {
),
),
Text(
'Instant Commands',
context.translations.instantCommandsLabel,
style: TextStyle(
color: _streamChatTheme.colorTheme.textHighEmphasis
.withOpacity(.5),
@@ -1145,8 +1145,9 @@ class MessageInputState extends State<MessageInput> {
if (mediaInfo.filesize! > widget.maxAttachmentSize) {
_showErrorAlert(
// ignore: lines_longer_than_80_chars
'The file is too large to upload. The file size limit is 20MB. We tried compressing it, but it was not enough.',
context.translations.fileTooLargeAfterCompressionError(
widget.maxAttachmentSize / (1024 * 1024),
),
);
return;
}
@@ -1157,9 +1158,9 @@ class MessageInputState extends State<MessageInput> {
path: mediaInfo.path,
);
} else {
_showErrorAlert(
'The file is too large to upload. The file size limit is 20MB.',
);
_showErrorAlert(context.translations.fileTooLargeError(
widget.maxAttachmentSize / (1024 * 1024),
));
return;
}
}
@@ -1427,7 +1428,9 @@ class MessageInputState extends State<MessageInput> {
),
Flexible(
child: Text(
'Emoji matching "$query"',
context.translations.emojiMatchingQueryText(
query,
),
style: TextStyle(
color: _streamChatTheme
.colorTheme.textHighEmphasis
@@ -1777,17 +1780,17 @@ class MessageInputState extends State<MessageInput> {
builder: (_) => Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
const ListTile(
ListTile(
title: Text(
'Add a file',
style: TextStyle(
context.translations.addAFileLabel,
style: const TextStyle(
fontWeight: FontWeight.bold,
),
),
),
ListTile(
leading: const Icon(Icons.image),
title: const Text('Upload a photo'),
title: Text(context.translations.uploadAPhotoLabel),
onTap: () {
pickFile(DefaultAttachmentTypes.image);
Navigator.pop(context);
@@ -1795,7 +1798,7 @@ class MessageInputState extends State<MessageInput> {
),
ListTile(
leading: const Icon(Icons.video_library),
title: const Text('Upload a video'),
title: Text(context.translations.uploadAVideoLabel),
onTap: () {
pickFile(DefaultAttachmentTypes.video);
Navigator.pop(context);
@@ -1804,7 +1807,7 @@ class MessageInputState extends State<MessageInput> {
if (!kIsWeb)
ListTile(
leading: const Icon(Icons.camera_alt),
title: const Text('Photo from camera'),
title: Text(context.translations.photoFromCameraLabel),
onTap: () {
pickFile(DefaultAttachmentTypes.image, true);
Navigator.pop(context);
@@ -1813,7 +1816,7 @@ class MessageInputState extends State<MessageInput> {
if (!kIsWeb)
ListTile(
leading: const Icon(Icons.videocam),
title: const Text('Video from camera'),
title: Text(context.translations.videoFromCameraLabel),
onTap: () {
pickFile(DefaultAttachmentTypes.video, true);
Navigator.pop(context);
@@ -1821,7 +1824,7 @@ class MessageInputState extends State<MessageInput> {
),
ListTile(
leading: const Icon(Icons.insert_drive_file),
title: const Text('Upload a file'),
title: Text(context.translations.uploadAFileLabel),
onTap: () {
pickFile(DefaultAttachmentTypes.file);
Navigator.pop(context);
@@ -1924,8 +1927,9 @@ class MessageInputState extends State<MessageInput> {
if (mediaInfo.filesize! > widget.maxAttachmentSize) {
_showErrorAlert(
// ignore: lines_longer_than_80_chars
'The file is too large to upload. The file size limit is 20MB. We tried compressing it, but it was not enough.',
context.translations.fileTooLargeAfterCompressionError(
widget.maxAttachmentSize / (1024 * 1024),
),
);
return;
}
@@ -1936,9 +1940,9 @@ class MessageInputState extends State<MessageInput> {
path: mediaInfo.path,
);
} else {
_showErrorAlert(
'The file is too large to upload. The file size limit is 20MB.',
);
_showErrorAlert(context.translations.fileTooLargeError(
widget.maxAttachmentSize / (1024 * 1024),
));
return;
}
}
@@ -2118,7 +2122,7 @@ class MessageInputState extends State<MessageInput> {
height: 26,
),
Text(
'Something went wrong',
context.translations.somethingWentWrongError,
style: _streamChatTheme.textTheme.headlineBold,
),
const SizedBox(
@@ -2147,7 +2151,7 @@ class MessageInputState extends State<MessageInput> {
Navigator.of(context).pop();
},
child: Text(
'OK',
context.translations.okLabel,
style: _streamChatTheme.textTheme.bodyBold.copyWith(
color: _streamChatTheme.colorTheme.accentPrimary),
),
@@ -2259,10 +2263,10 @@ class _PickerWidget extends StatefulWidget {
final StreamChatThemeData streamChatTheme;
@override
__PickerWidgetState createState() => __PickerWidgetState();
_PickerWidgetState createState() => _PickerWidgetState();
}
class __PickerWidgetState extends State<_PickerWidget> {
class _PickerWidgetState extends State<_PickerWidget> {
Future<bool>? requestPermission;
@override
@@ -2294,7 +2298,7 @@ class __PickerWidgetState extends State<_PickerWidget> {
color: widget.streamChatTheme.colorTheme.inputBg,
alignment: Alignment.center,
child: Text(
'Add more files',
context.translations.addMoreFilesLabel,
style: TextStyle(
color: widget.streamChatTheme.colorTheme.accentPrimary,
fontWeight: FontWeight.bold,
@@ -2326,8 +2330,7 @@ class __PickerWidgetState extends State<_PickerWidget> {
color: widget.streamChatTheme.colorTheme.disabled,
),
Text(
// ignore: lines_longer_than_80_chars
'Please enable access to your photos \nand videos so you can share them with friends.',
context.translations.enablePhotoAndVideoAccessMessage,
style: widget.streamChatTheme.textTheme.body.copyWith(
color:
widget.streamChatTheme.colorTheme.textLowEmphasis),
@@ -2336,7 +2339,7 @@ class __PickerWidgetState extends State<_PickerWidget> {
const SizedBox(height: 6),
Center(
child: Text(
'Allow access to your gallery',
context.translations.allowGalleryAccessMessage,
style: widget.streamChatTheme.textTheme.bodyBold.copyWith(
color: widget.streamChatTheme.colorTheme.accentPrimary,
),