add remaining translation strings
Signed-off-by: xsahil03x <[email protected]>
This commit is contained in:
+2
-1
@@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:stream_chat_flutter/src/upload_progress_indicator.dart';
|
||||
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||
import 'package:stream_chat_flutter/src/extension.dart';
|
||||
|
||||
/// Widget to build in progress
|
||||
typedef InProgressBuilder = Widget Function(BuildContext, int, int);
|
||||
@@ -226,7 +227,7 @@ class _FailedState extends StatelessWidget {
|
||||
horizontal: 12,
|
||||
),
|
||||
child: Text(
|
||||
'UPLOAD ERROR',
|
||||
context.translations.uploadErrorLabel,
|
||||
style: theme.textTheme.footnote.copyWith(
|
||||
color: theme.colorTheme.white,
|
||||
),
|
||||
|
||||
@@ -7,9 +7,9 @@ import 'package:stream_chat_flutter/src/upload_progress_indicator.dart';
|
||||
import 'package:stream_chat_flutter/src/utils.dart';
|
||||
import 'package:stream_chat_flutter/src/video_thumbnail_image.dart';
|
||||
import 'package:stream_chat_flutter_core/stream_chat_flutter_core.dart';
|
||||
import 'package:stream_chat_flutter/src/extension.dart';
|
||||
|
||||
// ignore: always_use_package_imports
|
||||
import 'attachment_widget.dart';
|
||||
import 'package:stream_chat_flutter/src/attachment/attachment_widget.dart';
|
||||
|
||||
/// Widget for displaying file attachments
|
||||
class FileAttachment extends AttachmentWidget {
|
||||
@@ -285,7 +285,10 @@ class FileAttachment extends AttachmentWidget {
|
||||
progressIndicatorColor: theme.colorTheme.accentBlue,
|
||||
),
|
||||
success: () => Text(fileSize(size), style: textStyle),
|
||||
failed: (_) => Text('UPLOAD ERROR', style: textStyle),
|
||||
failed: (_) => Text(
|
||||
context.translations.uploadErrorLabel,
|
||||
style: textStyle,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import 'package:shimmer/shimmer.dart';
|
||||
import 'package:stream_chat_flutter/src/attachment/attachment_widget.dart';
|
||||
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||
import 'package:stream_chat_flutter_core/stream_chat_flutter_core.dart';
|
||||
import 'package:stream_chat_flutter/src/extension.dart';
|
||||
|
||||
/// Widget for showing a GIF attachment
|
||||
class GiphyAttachment extends AttachmentWidget {
|
||||
@@ -71,9 +72,9 @@ class GiphyAttachment extends AttachmentWidget {
|
||||
children: [
|
||||
StreamSvgIcon.giphyIcon(),
|
||||
const SizedBox(width: 8),
|
||||
const Text(
|
||||
'Giphy',
|
||||
style: TextStyle(fontWeight: FontWeight.bold),
|
||||
Text(
|
||||
context.translations.giphyLabel,
|
||||
style: const TextStyle(fontWeight: FontWeight.bold),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
if (attachment.title != null)
|
||||
@@ -134,7 +135,7 @@ class GiphyAttachment extends AttachmentWidget {
|
||||
});
|
||||
},
|
||||
child: Text(
|
||||
'Cancel',
|
||||
context.translations.cancelLabel.toLowerCase(),
|
||||
style: StreamChatTheme.of(context)
|
||||
.textTheme
|
||||
.bodyBold
|
||||
@@ -166,7 +167,7 @@ class GiphyAttachment extends AttachmentWidget {
|
||||
});
|
||||
},
|
||||
child: Text(
|
||||
'Shuffle',
|
||||
context.translations.shuffleLabel,
|
||||
style: StreamChatTheme.of(context)
|
||||
.textTheme
|
||||
.bodyBold
|
||||
@@ -199,7 +200,7 @@ class GiphyAttachment extends AttachmentWidget {
|
||||
});
|
||||
},
|
||||
child: Text(
|
||||
'Send',
|
||||
context.translations.sendLabel,
|
||||
style: TextStyle(
|
||||
color: StreamChatTheme.of(context)
|
||||
.colorTheme
|
||||
@@ -234,7 +235,7 @@ class GiphyAttachment extends AttachmentWidget {
|
||||
width: 8,
|
||||
),
|
||||
Text(
|
||||
'Only visible to you',
|
||||
context.translations.onlyVisibleToYouText,
|
||||
style: StreamChatTheme.of(context)
|
||||
.textTheme
|
||||
.footnote
|
||||
@@ -339,7 +340,7 @@ class GiphyAttachment extends AttachmentWidget {
|
||||
size: 16,
|
||||
),
|
||||
Text(
|
||||
'GIPHY',
|
||||
context.translations.giphyLabel.toUpperCase(),
|
||||
style: TextStyle(
|
||||
color: StreamChatTheme.of(context).colorTheme.white,
|
||||
fontWeight: FontWeight.bold,
|
||||
|
||||
@@ -48,7 +48,7 @@ class AttachmentActionsModal extends StatelessWidget {
|
||||
child: _buildPage(context),
|
||||
);
|
||||
|
||||
Widget _buildPage(context) {
|
||||
Widget _buildPage(BuildContext context) {
|
||||
final theme = StreamChatTheme.of(context);
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
@@ -69,7 +69,7 @@ class AttachmentActionsModal extends StatelessWidget {
|
||||
children: [
|
||||
_buildButton(
|
||||
context,
|
||||
'Reply',
|
||||
context.translations.replyLabel,
|
||||
StreamSvgIcon.iconCurveLineLeftUp(
|
||||
size: 24,
|
||||
color: theme.colorTheme.grey,
|
||||
@@ -80,7 +80,7 @@ class AttachmentActionsModal extends StatelessWidget {
|
||||
),
|
||||
_buildButton(
|
||||
context,
|
||||
'Show in Chat',
|
||||
context.translations.showInChatLabel,
|
||||
StreamSvgIcon.eye(
|
||||
size: 24,
|
||||
color: theme.colorTheme.black,
|
||||
@@ -89,8 +89,9 @@ class AttachmentActionsModal extends StatelessWidget {
|
||||
),
|
||||
_buildButton(
|
||||
context,
|
||||
// ignore: lines_longer_than_80_chars
|
||||
'Save ${message.attachments[currentIndex].type == 'video' ? 'Video' : 'Image'}',
|
||||
message.attachments[currentIndex].type == 'video'
|
||||
? context.translations.saveVideoLabel
|
||||
: context.translations.saveImageLabel,
|
||||
StreamSvgIcon.iconSave(
|
||||
size: 24,
|
||||
color: theme.colorTheme.grey,
|
||||
@@ -141,7 +142,7 @@ class AttachmentActionsModal extends StatelessWidget {
|
||||
if (StreamChat.of(context).user?.id == message.user?.id)
|
||||
_buildButton(
|
||||
context,
|
||||
'Delete',
|
||||
context.translations.deleteLabel,
|
||||
StreamSvgIcon.delete(
|
||||
size: 24,
|
||||
color: theme.colorTheme.accentRed,
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:stream_chat_flutter/src/channel_info.dart';
|
||||
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||
import 'package:stream_chat_flutter/src/extension.dart';
|
||||
|
||||
/// Bottom Sheet with options
|
||||
class ChannelBottomSheet extends StatefulWidget {
|
||||
@@ -149,7 +150,7 @@ class _ChannelBottomSheetState extends State<ChannelBottomSheet> {
|
||||
color: _streamChatThemeData.colorTheme.grey,
|
||||
),
|
||||
),
|
||||
title: 'View Info',
|
||||
title: context.translations.viewInfoLabel,
|
||||
onTap: widget.onViewInfoTap,
|
||||
),
|
||||
if (!channel.isDistinct)
|
||||
@@ -160,7 +161,7 @@ class _ChannelBottomSheetState extends State<ChannelBottomSheet> {
|
||||
color: _streamChatThemeData.colorTheme.grey,
|
||||
),
|
||||
),
|
||||
title: 'Leave Group',
|
||||
title: context.translations.leaveGroupLabel,
|
||||
onTap: () async {
|
||||
setState(() {
|
||||
_showActions = false;
|
||||
@@ -179,7 +180,7 @@ class _ChannelBottomSheetState extends State<ChannelBottomSheet> {
|
||||
color: _streamChatThemeData.colorTheme.accentRed,
|
||||
),
|
||||
),
|
||||
title: 'Delete Conversation',
|
||||
title: context.translations.deleteConversationLabel,
|
||||
titleColor: _streamChatThemeData.colorTheme.accentRed,
|
||||
onTap: () async {
|
||||
setState(() {
|
||||
@@ -198,7 +199,7 @@ class _ChannelBottomSheetState extends State<ChannelBottomSheet> {
|
||||
color: _streamChatThemeData.colorTheme.grey,
|
||||
),
|
||||
),
|
||||
title: 'Cancel',
|
||||
title: context.translations.cancelLabel,
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
@@ -219,10 +220,10 @@ class _ChannelBottomSheetState extends State<ChannelBottomSheet> {
|
||||
Future<void> _showDeleteDialog() async {
|
||||
final res = await showConfirmationDialog(
|
||||
context,
|
||||
title: 'Delete Conversation',
|
||||
okText: 'DELETE',
|
||||
question: 'Are you sure you want to delete this conversation?',
|
||||
cancelText: 'CANCEL',
|
||||
title: context.translations.deleteConversationLabel,
|
||||
okText: context.translations.deleteLabel,
|
||||
question: context.translations.deleteConversationQuestion,
|
||||
cancelText: context.translations.cancelLabel,
|
||||
icon: StreamSvgIcon.delete(
|
||||
color: _streamChatThemeData.colorTheme.accentRed,
|
||||
),
|
||||
@@ -237,10 +238,10 @@ class _ChannelBottomSheetState extends State<ChannelBottomSheet> {
|
||||
Future<void> _showLeaveDialog() async {
|
||||
final res = await showConfirmationDialog(
|
||||
context,
|
||||
title: 'Leave conversation',
|
||||
okText: 'LEAVE',
|
||||
question: 'Are you sure you want to leave this conversation?',
|
||||
cancelText: 'CANCEL',
|
||||
title: context.translations.leaveConversationLabel,
|
||||
okText: context.translations.leaveLabel,
|
||||
question: context.translations.leaveConversationQuestion,
|
||||
cancelText: context.translations.cancelLabel,
|
||||
icon: StreamSvgIcon.userRemove(
|
||||
color: _streamChatThemeData.colorTheme.accentRed,
|
||||
),
|
||||
|
||||
@@ -6,6 +6,7 @@ import 'package:stream_chat_flutter/src/info_tile.dart';
|
||||
import 'package:stream_chat_flutter/src/stream_chat_theme.dart';
|
||||
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||
import 'package:stream_chat_flutter_core/stream_chat_flutter_core.dart';
|
||||
import 'package:stream_chat_flutter/src/extension.dart';
|
||||
|
||||
/// 
|
||||
/// 
|
||||
@@ -121,14 +122,14 @@ class ChannelHeader extends StatelessWidget implements PreferredSizeWidget {
|
||||
|
||||
switch (status) {
|
||||
case ConnectionStatus.connected:
|
||||
statusString = 'Connected';
|
||||
statusString = context.translations.connectedLabel;
|
||||
showStatus = false;
|
||||
break;
|
||||
case ConnectionStatus.connecting:
|
||||
statusString = 'Reconnecting...';
|
||||
statusString = context.translations.reconnectingLabel;
|
||||
break;
|
||||
case ConnectionStatus.disconnected:
|
||||
statusString = 'Disconnected';
|
||||
statusString = context.translations.disconnectedLabel;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ import 'package:collection/collection.dart' show IterableExtension;
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:jiffy/jiffy.dart';
|
||||
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||
import 'package:stream_chat_flutter/src/extension.dart';
|
||||
|
||||
/// Widget which shows channel info
|
||||
class ChannelInfo extends StatelessWidget {
|
||||
@@ -55,10 +56,13 @@ class ChannelInfo extends StatelessWidget {
|
||||
) {
|
||||
Widget? alternativeWidget;
|
||||
|
||||
if (channel.memberCount != null && channel.memberCount! > 2) {
|
||||
var text = '${channel.memberCount} Members';
|
||||
final memberCount = channel.memberCount;
|
||||
if (memberCount != null && memberCount > 2) {
|
||||
var text = context.translations.membersCountText(memberCount);
|
||||
final watcherCount = channel.state?.watcherCount ?? 0;
|
||||
if (watcherCount > 0) text += ' $watcherCount Online';
|
||||
if (watcherCount > 0) {
|
||||
text += ' ${context.translations.watchersCountText(watcherCount)}';
|
||||
}
|
||||
alternativeWidget = Text(
|
||||
text,
|
||||
style: StreamChatTheme.of(context)
|
||||
@@ -75,12 +79,13 @@ class ChannelInfo extends StatelessWidget {
|
||||
if (otherMember != null) {
|
||||
if (otherMember.user?.online == true) {
|
||||
alternativeWidget = Text(
|
||||
'Online',
|
||||
context.translations.userOnlineText,
|
||||
style: textStyle,
|
||||
);
|
||||
} else {
|
||||
alternativeWidget = Text(
|
||||
'Last seen ${Jiffy(otherMember.user?.lastActive).fromNow()}',
|
||||
context.translations.userLastOnlineText +
|
||||
Jiffy(otherMember.user?.lastActive).fromNow(),
|
||||
style: textStyle,
|
||||
);
|
||||
}
|
||||
@@ -111,7 +116,7 @@ class ChannelInfo extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Text(
|
||||
'Searching for Network',
|
||||
context.translations.searchingForNetworkLabel,
|
||||
style: textStyle,
|
||||
),
|
||||
],
|
||||
@@ -125,7 +130,7 @@ class ChannelInfo extends StatelessWidget {
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
'Offline...',
|
||||
context.translations.offlineLabel,
|
||||
style: textStyle,
|
||||
),
|
||||
TextButton(
|
||||
@@ -141,7 +146,7 @@ class ChannelInfo extends StatelessWidget {
|
||||
..closeConnection()
|
||||
..openConnection(),
|
||||
child: Text(
|
||||
'Try Again',
|
||||
context.translations.tryAgainLabel,
|
||||
style: textStyle?.copyWith(
|
||||
color: StreamChatTheme.of(context).colorTheme.accentBlue,
|
||||
),
|
||||
|
||||
@@ -5,6 +5,7 @@ import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:stream_chat_flutter/src/stream_neumorphic_button.dart';
|
||||
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||
import 'package:stream_chat_flutter_core/stream_chat_flutter_core.dart';
|
||||
import 'package:stream_chat_flutter/src/extension.dart';
|
||||
|
||||
/// Widget builder for title
|
||||
typedef TitleBuilder = Widget Function(
|
||||
@@ -103,21 +104,20 @@ class ChannelListHeader extends StatelessWidget implements PreferredSizeWidget {
|
||||
|
||||
switch (status) {
|
||||
case ConnectionStatus.connected:
|
||||
statusString = 'Connected';
|
||||
statusString = context.translations.connectedLabel;
|
||||
showStatus = false;
|
||||
break;
|
||||
case ConnectionStatus.connecting:
|
||||
statusString = 'Reconnecting...';
|
||||
statusString = context.translations.reconnectingLabel;
|
||||
break;
|
||||
case ConnectionStatus.disconnected:
|
||||
statusString = 'Disconnected';
|
||||
statusString = context.translations.disconnectedLabel;
|
||||
break;
|
||||
}
|
||||
|
||||
final chatThemeData = StreamChatTheme.of(context);
|
||||
return InfoTile(
|
||||
// ignore: avoid_bool_literals_in_conditional_expressions
|
||||
showMessage: showConnectionStateTile ? showStatus : false,
|
||||
showMessage: showConnectionStateTile && showStatus,
|
||||
message: statusString,
|
||||
child: AppBar(
|
||||
textTheme: Theme.of(context).textTheme,
|
||||
@@ -207,7 +207,7 @@ class ChannelListHeader extends StatelessWidget implements PreferredSizeWidget {
|
||||
Widget _buildConnectedTitleState(BuildContext context) {
|
||||
final chatThemeData = StreamChatTheme.of(context);
|
||||
return Text(
|
||||
'Stream Chat',
|
||||
context.translations.streamChatLabel,
|
||||
style: chatThemeData.textTheme.headlineBold.copyWith(
|
||||
color: chatThemeData.colorTheme.black,
|
||||
),
|
||||
@@ -226,7 +226,7 @@ class ChannelListHeader extends StatelessWidget implements PreferredSizeWidget {
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Text(
|
||||
'Searching for Network',
|
||||
context.translations.searchingForNetworkLabel,
|
||||
style: StreamChatTheme.of(context)
|
||||
.channelListHeaderTheme
|
||||
.title
|
||||
@@ -247,7 +247,7 @@ class ChannelListHeader extends StatelessWidget implements PreferredSizeWidget {
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
'Offline...',
|
||||
context.translations.offlineLabel,
|
||||
style: chatThemeData.channelListHeaderTheme.title?.copyWith(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
@@ -258,7 +258,7 @@ class ChannelListHeader extends StatelessWidget implements PreferredSizeWidget {
|
||||
..closeConnection()
|
||||
..openConnection(),
|
||||
child: Text(
|
||||
'Try Again',
|
||||
context.translations.tryAgainLabel,
|
||||
style: chatThemeData.channelListHeaderTheme.title?.copyWith(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
|
||||
@@ -7,6 +7,7 @@ import 'package:stream_chat_flutter/src/channel_bottom_sheet.dart';
|
||||
import 'package:stream_chat_flutter/src/stream_svg_icon.dart';
|
||||
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||
import 'package:stream_chat_flutter_core/stream_chat_flutter_core.dart';
|
||||
import 'package:stream_chat_flutter/src/extension.dart';
|
||||
|
||||
/// Callback called when tapping on a channel
|
||||
typedef ChannelTapCallback = void Function(Channel, Widget?);
|
||||
@@ -202,6 +203,7 @@ class _ChannelListViewState extends State<ChannelListView> {
|
||||
final _slideController = SlidableController();
|
||||
|
||||
late final _defaultController = ChannelListController();
|
||||
|
||||
ChannelListController get _channelListController =>
|
||||
widget.channelListController ?? _defaultController;
|
||||
|
||||
@@ -296,7 +298,7 @@ class _ChannelListViewState extends State<ChannelListView> {
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8),
|
||||
child: Text(
|
||||
'Let’s start chatting!',
|
||||
context.translations.letsStartChattingLabel,
|
||||
style: chatThemeData.textTheme.headline,
|
||||
),
|
||||
),
|
||||
@@ -306,7 +308,7 @@ class _ChannelListViewState extends State<ChannelListView> {
|
||||
horizontal: 52,
|
||||
),
|
||||
child: Text(
|
||||
'How about sending your first message to a friend?',
|
||||
context.translations.sendingFirstMessageLabel,
|
||||
textAlign: TextAlign.center,
|
||||
style: chatThemeData.textTheme.body.copyWith(
|
||||
color: chatThemeData.colorTheme.grey,
|
||||
@@ -325,7 +327,7 @@ class _ChannelListViewState extends State<ChannelListView> {
|
||||
child: TextButton(
|
||||
onPressed: widget.onStartChatPressed,
|
||||
child: Text(
|
||||
'Start a chat',
|
||||
context.translations.startAChatLabel,
|
||||
style: chatThemeData.textTheme.bodyBold.copyWith(
|
||||
color: chatThemeData.colorTheme.accentBlue,
|
||||
),
|
||||
@@ -461,9 +463,9 @@ class _ChannelListViewState extends State<ChannelListView> {
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Text.rich(
|
||||
const TextSpan(
|
||||
TextSpan(
|
||||
children: [
|
||||
WidgetSpan(
|
||||
const WidgetSpan(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
right: 2,
|
||||
@@ -471,14 +473,14 @@ class _ChannelListViewState extends State<ChannelListView> {
|
||||
child: Icon(Icons.error_outline),
|
||||
),
|
||||
),
|
||||
TextSpan(text: 'Error loading channels'),
|
||||
TextSpan(text: context.translations.loadingChannelsError),
|
||||
],
|
||||
),
|
||||
style: Theme.of(context).textTheme.headline6,
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () => _channelListController.loadData!(),
|
||||
child: const Text('Retry'),
|
||||
child: Text(context.translations.retryLabel),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -558,12 +560,12 @@ class _ChannelListViewState extends State<ChannelListView> {
|
||||
: () async {
|
||||
final res = await showConfirmationDialog(
|
||||
context,
|
||||
title: 'Delete Conversation',
|
||||
okText: 'DELETE',
|
||||
question:
|
||||
// ignore: lines_longer_than_80_chars
|
||||
'Are you sure you want to delete this conversation?',
|
||||
cancelText: 'CANCEL',
|
||||
title:
|
||||
context.translations.deleteConversationLabel,
|
||||
question: context
|
||||
.translations.deleteConversationQuestion,
|
||||
okText: context.translations.deleteLabel,
|
||||
cancelText: context.translations.cancelLabel,
|
||||
icon: StreamSvgIcon.delete(
|
||||
color: chatThemeData.colorTheme.accentRed,
|
||||
),
|
||||
@@ -666,10 +668,10 @@ class _ChannelListViewState extends State<ChannelListView> {
|
||||
.colorTheme
|
||||
.accentRed
|
||||
.withOpacity(.2),
|
||||
child: const Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 16),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 16),
|
||||
child: Center(
|
||||
child: Text('Error loading channels'),
|
||||
child: Text(context.translations.loadingChannelsError),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter/rendering.dart';
|
||||
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||
import 'package:stream_chat_flutter_core/stream_chat_flutter_core.dart';
|
||||
import 'package:stream_chat_flutter/src/extension.dart';
|
||||
|
||||
/// It shows the current [Channel] name using a [Text] widget.
|
||||
///
|
||||
@@ -44,8 +45,10 @@ class ChannelName extends StatelessWidget {
|
||||
) =>
|
||||
LayoutBuilder(
|
||||
builder: (context, constraints) {
|
||||
var title = 'No title';
|
||||
if (extraData['name'] == null) {
|
||||
var title = context.translations.noTitleText;
|
||||
if (extraData['name'] != null) {
|
||||
title = extraData['name'];
|
||||
} else {
|
||||
final otherMembers =
|
||||
members?.where((member) => member.userId != client.user!.id);
|
||||
if (otherMembers?.length == 1) {
|
||||
@@ -71,8 +74,6 @@ class ChannelName extends StatelessWidget {
|
||||
title = '${currentMembers.map((e) => e.user?.name).join(', ')} '
|
||||
'${exceedingMembers > 0 ? '+ $exceedingMembers' : ''}';
|
||||
}
|
||||
} else {
|
||||
title = extraData['name'];
|
||||
}
|
||||
|
||||
return Text(
|
||||
|
||||
@@ -6,6 +6,7 @@ import 'package:jiffy/jiffy.dart';
|
||||
import 'package:stream_chat_flutter/src/stream_svg_icon.dart';
|
||||
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||
import 'package:stream_chat_flutter_core/stream_chat_flutter_core.dart';
|
||||
import 'package:stream_chat_flutter/src/extension.dart';
|
||||
|
||||
/// 
|
||||
/// 
|
||||
@@ -183,7 +184,7 @@ class ChannelPreview extends StatelessWidget {
|
||||
startOfDay
|
||||
.subtract(const Duration(days: 1))
|
||||
.millisecondsSinceEpoch) {
|
||||
stringDate = 'Yesterday';
|
||||
stringDate = context.translations.yesterdayLabel;
|
||||
} else if (startOfDay.difference(lastMessageAt).inDays < 7) {
|
||||
stringDate = Jiffy(lastMessageAt.toLocal()).EEEE;
|
||||
} else {
|
||||
@@ -208,7 +209,7 @@ class ChannelPreview extends StatelessWidget {
|
||||
size: 16,
|
||||
),
|
||||
Text(
|
||||
' Channel is muted',
|
||||
context.translations.channelIsMutedText,
|
||||
style: chatThemeData.channelPreviewTheme.subtitle,
|
||||
),
|
||||
],
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:jiffy/jiffy.dart';
|
||||
import 'package:stream_chat_flutter/src/stream_chat_theme.dart';
|
||||
import 'package:stream_chat_flutter/src/extension.dart';
|
||||
|
||||
/// It shows a date divider depending on the date difference
|
||||
class DateDivider extends StatelessWidget {
|
||||
@@ -24,10 +25,10 @@ class DateDivider extends StatelessWidget {
|
||||
|
||||
String dayInfo;
|
||||
if (Jiffy(createdAt).isSame(now, Units.DAY)) {
|
||||
dayInfo = 'Today';
|
||||
dayInfo = context.translations.todayLabel;
|
||||
} else if (Jiffy(createdAt)
|
||||
.isSame(now.subtract(const Duration(days: 1)), Units.DAY)) {
|
||||
dayInfo = 'Yesterday';
|
||||
dayInfo = context.translations.yesterdayLabel;
|
||||
} else if (Jiffy(createdAt).isAfter(
|
||||
now.subtract(const Duration(days: 7)),
|
||||
Units.DAY,
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:stream_chat_flutter/src/stream_chat_theme.dart';
|
||||
import 'package:stream_chat_flutter/src/extension.dart';
|
||||
|
||||
/// Widget to display deleted message
|
||||
class DeletedMessage extends StatelessWidget {
|
||||
@@ -49,7 +50,7 @@ class DeletedMessage extends StatelessWidget {
|
||||
horizontal: 16,
|
||||
),
|
||||
child: Text(
|
||||
'Message deleted',
|
||||
context.translations.messageDeletedLabel,
|
||||
style: messageTheme.messageText?.copyWith(
|
||||
fontStyle: FontStyle.italic,
|
||||
color: messageTheme.createdAt?.color,
|
||||
|
||||
@@ -2,6 +2,7 @@ import 'package:characters/characters.dart';
|
||||
import 'package:file_picker/file_picker.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:stream_chat_flutter/src/emoji/emoji.dart';
|
||||
import 'package:stream_chat_flutter/src/localization/translations.dart';
|
||||
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||
|
||||
final _emojiChars = Emoji.chars();
|
||||
@@ -104,7 +105,8 @@ extension BuildContextX on BuildContext {
|
||||
double get textScaleFactor =>
|
||||
MediaQuery.maybeOf(this)?.textScaleFactor ?? 1.0;
|
||||
|
||||
StreamChatLocalizations? get translations => StreamChatLocalizations.of(this);
|
||||
Translations get translations =>
|
||||
StreamChatLocalizations.of(this) ?? DefaultTranslations.instance;
|
||||
}
|
||||
|
||||
/// Extension on [BorderRadius]
|
||||
|
||||
@@ -10,6 +10,7 @@ import 'package:stream_chat_flutter/src/image_footer.dart';
|
||||
import 'package:stream_chat_flutter/src/image_header.dart';
|
||||
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||
import 'package:video_player/video_player.dart';
|
||||
import 'package:stream_chat_flutter/src/extension.dart';
|
||||
|
||||
/// Return action for coming back from pages
|
||||
enum ReturnActionType {
|
||||
@@ -182,9 +183,11 @@ class _FullScreenMediaState extends State<FullScreenMedia>
|
||||
children: [
|
||||
ImageHeader(
|
||||
userName: widget.userName,
|
||||
sentAt:
|
||||
// ignore: lines_longer_than_80_chars
|
||||
'Sent ${getDay(widget.message.createdAt.toLocal())} at ${Jiffy(widget.message.createdAt.toLocal()).format('HH:mm')}',
|
||||
// TODO: Fix this
|
||||
sentAt: context.translations.sentAtText(
|
||||
date: widget.message.createdAt,
|
||||
time: widget.message.createdAt,
|
||||
),
|
||||
onBackPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
|
||||
@@ -11,6 +11,7 @@ import 'package:stream_chat_flutter/src/stream_chat_theme.dart';
|
||||
import 'package:stream_chat_flutter/src/video_thumbnail_image.dart';
|
||||
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||
import 'package:stream_chat_flutter_core/stream_chat_flutter_core.dart';
|
||||
import 'package:stream_chat_flutter/src/extension.dart';
|
||||
|
||||
/// Footer widget for media display
|
||||
class ImageFooter extends StatefulWidget implements PreferredSizeWidget {
|
||||
@@ -190,7 +191,7 @@ class _ImageFooterState extends State<ImageFooter> {
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Text(
|
||||
'Photos',
|
||||
context.translations.photosLabel,
|
||||
style: chatThemeData.textTheme.headlineBold,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
||||
import 'package:stream_chat_flutter/src/localization/translations.dart'
|
||||
show Translations;
|
||||
|
||||
/// Defines the localized resource values used by the StreamChatFlutter widgets.
|
||||
///
|
||||
/// See also:
|
||||
///
|
||||
/// * [GlobalStreamChatLocalizations], which provides material localizations
|
||||
/// for many languages.
|
||||
abstract class StreamChatLocalizations implements Translations {
|
||||
/// The `StreamChatLocalizations` from the closest [Localizations] instance
|
||||
/// that encloses the given context.
|
||||
///
|
||||
/// If no [StreamChatLocalizations] are available in the given `context`, this
|
||||
/// method returns null.
|
||||
///
|
||||
/// This method is just a convenient shorthand for:
|
||||
/// `Localizations.of<StreamChatLocalizations>(
|
||||
/// context,
|
||||
/// StreamChatLocalizations
|
||||
/// )`.
|
||||
///
|
||||
/// References to the localized resources defined by this class are typically
|
||||
/// written in terms of this method. For example:
|
||||
///
|
||||
/// ```dart
|
||||
/// tooltip: StreamChatLocalizations.of(context).streamChatLabel,
|
||||
/// ```
|
||||
static StreamChatLocalizations? of(BuildContext context) =>
|
||||
Localizations.of<StreamChatLocalizations>(
|
||||
context,
|
||||
StreamChatLocalizations,
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,517 @@
|
||||
import 'package:stream_chat_flutter_core/stream_chat_flutter_core.dart'
|
||||
show User;
|
||||
|
||||
abstract class Translations {
|
||||
String get launchUrlError;
|
||||
|
||||
String get loadingUsersError;
|
||||
|
||||
String get retryLabel;
|
||||
|
||||
String get noUsersLabel;
|
||||
|
||||
String get userOnlineText;
|
||||
|
||||
String get userLastOnlineText;
|
||||
|
||||
String userTypingText(Iterable<User> users);
|
||||
|
||||
String get threadReplyLabel;
|
||||
|
||||
String get onlyVisibleToYouText;
|
||||
|
||||
String threadReplyCountText(int count);
|
||||
|
||||
String attachmentsUploadProgressText({
|
||||
required int remaining,
|
||||
required int total,
|
||||
});
|
||||
|
||||
String pinnedByUserText({
|
||||
required User pinnedBy,
|
||||
required User currentUser,
|
||||
});
|
||||
|
||||
String get emptyMessagesText;
|
||||
|
||||
String get genericErrorText;
|
||||
|
||||
String get loadingMessagesError;
|
||||
|
||||
String resultCountText(int count);
|
||||
|
||||
String get messageDeletedText;
|
||||
|
||||
String get messageDeletedLabel;
|
||||
|
||||
String get messageReactionsText;
|
||||
|
||||
String get emptyChatMessagesText;
|
||||
|
||||
String threadSeparatorText(int replyCount);
|
||||
|
||||
String get connectedLabel;
|
||||
|
||||
String get disconnectedLabel;
|
||||
|
||||
String get reconnectingLabel;
|
||||
|
||||
String get alsoSendAsDirectMessageLabel;
|
||||
|
||||
String get searchGifLabel;
|
||||
|
||||
String get addACommentOrSendLabel;
|
||||
|
||||
String get writeAMessageLabel;
|
||||
|
||||
String get instantCommandsLabel;
|
||||
|
||||
String get fileTooLargeAfterCompressionError;
|
||||
|
||||
String get fileTooLargeError;
|
||||
|
||||
String emojiMatchingQueryText(String query);
|
||||
|
||||
String get addAFileLabel;
|
||||
|
||||
String get uploadAPhotoLabel;
|
||||
|
||||
String get uploadAVideoLabel;
|
||||
|
||||
String get photoFromCameraLabel;
|
||||
|
||||
String get videoFromCameraLabel;
|
||||
|
||||
String get uploadAFileLabel;
|
||||
|
||||
String get somethingWentWrongLabel;
|
||||
|
||||
String get okLabel;
|
||||
|
||||
String get addMoreFilesLabel;
|
||||
|
||||
String get enablePhotoAndVideoAccessMessage;
|
||||
|
||||
String get allowGalleryAccessMessage;
|
||||
|
||||
String get flagMessageLabel;
|
||||
|
||||
String get flagMessageQuestion;
|
||||
|
||||
String get flagLabel;
|
||||
|
||||
String get cancelLabel;
|
||||
|
||||
String get flagMessageSuccessfulLabel;
|
||||
|
||||
String get flagMessageSuccessfulText;
|
||||
|
||||
String get deleteMessageLabel;
|
||||
|
||||
String get deleteMessageQuestion;
|
||||
|
||||
String get deleteLabel;
|
||||
|
||||
String get operationCouldNotBeCompletedText;
|
||||
|
||||
String get replyLabel;
|
||||
|
||||
String togglePinUnpinText({required bool pinned});
|
||||
|
||||
String toggleDeleteRetryDeleteMessageText({required bool isDeleteFailed});
|
||||
|
||||
String get copyMessageLabel;
|
||||
|
||||
String get editMessageLabel;
|
||||
|
||||
String toggleResendOrResendEditedMessage({required bool isUpdateFailed});
|
||||
|
||||
String get photosLabel;
|
||||
|
||||
String sentAtText({required DateTime date, required DateTime time});
|
||||
|
||||
String get todayLabel;
|
||||
|
||||
String get yesterdayLabel;
|
||||
|
||||
String get channelIsMutedText;
|
||||
|
||||
String get noTitleText;
|
||||
|
||||
String get letsStartChattingLabel;
|
||||
|
||||
String get sendingFirstMessageLabel;
|
||||
|
||||
String get startAChatLabel;
|
||||
|
||||
String get loadingChannelsError;
|
||||
|
||||
// title: 'Delete Conversation',
|
||||
// okText: 'DELETE',
|
||||
// question:
|
||||
// 'Are you sure you want to delete this conversation?',
|
||||
|
||||
String get deleteConversationLabel;
|
||||
|
||||
String get deleteConversationQuestion;
|
||||
|
||||
String get streamChatLabel;
|
||||
|
||||
String get searchingForNetworkLabel;
|
||||
|
||||
String get offlineLabel;
|
||||
|
||||
String get tryAgainLabel;
|
||||
|
||||
String membersCountText(int count);
|
||||
|
||||
String watchersCountText(int count);
|
||||
|
||||
String get viewInfoLabel;
|
||||
|
||||
String get leaveGroupLabel;
|
||||
|
||||
String get leaveLabel;
|
||||
|
||||
String get leaveConversationLabel;
|
||||
|
||||
String get leaveConversationQuestion;
|
||||
|
||||
String get showInChatLabel;
|
||||
|
||||
String get saveImageLabel;
|
||||
|
||||
String get saveVideoLabel;
|
||||
|
||||
String get uploadErrorLabel;
|
||||
|
||||
String get giphyLabel;
|
||||
|
||||
String get shuffleLabel;
|
||||
|
||||
String get sendLabel;
|
||||
}
|
||||
|
||||
class DefaultTranslations implements Translations {
|
||||
const DefaultTranslations._();
|
||||
|
||||
static const instance = DefaultTranslations._();
|
||||
|
||||
@override
|
||||
String get launchUrlError => 'Cannot launch the url';
|
||||
|
||||
@override
|
||||
String get loadingUsersError => 'Error loading users';
|
||||
|
||||
@override
|
||||
String get noUsersLabel => 'There are no users currently';
|
||||
|
||||
@override
|
||||
String get retryLabel => 'Retry';
|
||||
|
||||
@override
|
||||
String get userLastOnlineText => 'Last online';
|
||||
|
||||
@override
|
||||
String get userOnlineText => 'Online';
|
||||
|
||||
@override
|
||||
String userTypingText(Iterable<User> users) {
|
||||
if (users.isEmpty) return '';
|
||||
final first = users.first;
|
||||
if (users.length == 1) {
|
||||
return '${first.name} is typing';
|
||||
}
|
||||
return '${first.name} and ${users.length - 1} more are typing';
|
||||
}
|
||||
|
||||
@override
|
||||
String get threadReplyLabel => 'Thread Reply';
|
||||
|
||||
@override
|
||||
String get onlyVisibleToYouText => 'Only visible to you';
|
||||
|
||||
@override
|
||||
String threadReplyCountText(int count) => '$count Thread Replies';
|
||||
|
||||
@override
|
||||
String attachmentsUploadProgressText({
|
||||
required int remaining,
|
||||
required int total,
|
||||
}) =>
|
||||
'Uploading $remaining/$total ...';
|
||||
|
||||
@override
|
||||
String pinnedByUserText({
|
||||
required User pinnedBy,
|
||||
required User currentUser,
|
||||
}) {
|
||||
final pinnedByCurrentUser = currentUser.id == pinnedBy.id;
|
||||
if (pinnedByCurrentUser) return 'Pinned by You';
|
||||
return 'Pinned by ${pinnedBy.name}';
|
||||
}
|
||||
|
||||
@override
|
||||
String get emptyMessagesText => 'There are no messages currently';
|
||||
|
||||
@override
|
||||
String get genericErrorText => 'Something went wrong';
|
||||
|
||||
@override
|
||||
String get loadingMessagesError => 'Error loading messages';
|
||||
|
||||
@override
|
||||
String resultCountText(int count) => '$count results';
|
||||
|
||||
@override
|
||||
String get messageDeletedText => 'This message was deleted.';
|
||||
|
||||
@override
|
||||
String get messageDeletedLabel => 'Message deleted';
|
||||
|
||||
@override
|
||||
String get messageReactionsText => 'Message Reactions';
|
||||
|
||||
@override
|
||||
String get emptyChatMessagesText => 'No chats here yet...';
|
||||
|
||||
@override
|
||||
String threadSeparatorText(int replyCount) {
|
||||
if (replyCount == 1) return '1 Reply';
|
||||
return '$replyCount Replies';
|
||||
}
|
||||
|
||||
@override
|
||||
String get connectedLabel => 'Connected';
|
||||
|
||||
@override
|
||||
String get disconnectedLabel => 'Disconnected';
|
||||
|
||||
@override
|
||||
String get reconnectingLabel => 'Reconnecting...';
|
||||
|
||||
@override
|
||||
String get alsoSendAsDirectMessageLabel => 'Also send as direct message';
|
||||
|
||||
@override
|
||||
String get addACommentOrSendLabel => 'Add a comment or send';
|
||||
|
||||
@override
|
||||
String get searchGifLabel => 'Search GIFs';
|
||||
|
||||
@override
|
||||
String get writeAMessageLabel => 'Write a message';
|
||||
|
||||
@override
|
||||
String get instantCommandsLabel => 'Instant Commands';
|
||||
|
||||
@override
|
||||
String get fileTooLargeAfterCompressionError =>
|
||||
'The file is too large to upload. '
|
||||
'The file size limit is 20MB. '
|
||||
'We tried compressing it, but it was not enough.';
|
||||
|
||||
@override
|
||||
String get fileTooLargeError =>
|
||||
'The file is too large to upload. The file size limit is 20MB.';
|
||||
|
||||
@override
|
||||
String emojiMatchingQueryText(String query) => 'Emoji matching "$query"';
|
||||
|
||||
@override
|
||||
String get addAFileLabel => 'Add a file';
|
||||
|
||||
@override
|
||||
String get photoFromCameraLabel => 'Photo from camera';
|
||||
|
||||
@override
|
||||
String get uploadAFileLabel => 'Upload a file';
|
||||
|
||||
@override
|
||||
String get uploadAPhotoLabel => 'Upload a photo';
|
||||
|
||||
@override
|
||||
String get uploadAVideoLabel => 'Upload a video';
|
||||
|
||||
@override
|
||||
String get videoFromCameraLabel => 'Video from camera';
|
||||
|
||||
@override
|
||||
String get okLabel => 'OK';
|
||||
|
||||
@override
|
||||
String get somethingWentWrongLabel => 'Something went wrong';
|
||||
|
||||
@override
|
||||
String get addMoreFilesLabel => 'Add more files';
|
||||
|
||||
@override
|
||||
String get enablePhotoAndVideoAccessMessage =>
|
||||
'Please enable access to your photos'
|
||||
'\nand videos so you can share them with friends.';
|
||||
|
||||
@override
|
||||
String get allowGalleryAccessMessage => 'Allow access to your gallery';
|
||||
|
||||
@override
|
||||
String get flagMessageLabel => 'Flag Message';
|
||||
|
||||
@override
|
||||
String get flagMessageQuestion =>
|
||||
'Do you want to send a copy of this message to a'
|
||||
'\nmoderator for further investigation?';
|
||||
|
||||
@override
|
||||
String get flagLabel => 'FLAG';
|
||||
|
||||
@override
|
||||
String get cancelLabel => 'CANCEL';
|
||||
|
||||
@override
|
||||
String get flagMessageSuccessfulLabel => 'Message flagged';
|
||||
|
||||
@override
|
||||
String get flagMessageSuccessfulText =>
|
||||
'The message has been reported to a moderator.';
|
||||
|
||||
@override
|
||||
String get deleteLabel => 'DELETE';
|
||||
|
||||
@override
|
||||
String get deleteMessageLabel => 'Delete Message';
|
||||
|
||||
@override
|
||||
String get deleteMessageQuestion =>
|
||||
'Are you sure you want to permanently delete this\nmessage?';
|
||||
|
||||
@override
|
||||
String get operationCouldNotBeCompletedText =>
|
||||
'The operation couldn\'t be completed.';
|
||||
|
||||
@override
|
||||
String get replyLabel => 'Reply';
|
||||
|
||||
@override
|
||||
String togglePinUnpinText({required bool pinned}) {
|
||||
if (pinned) return 'Unpin from Conversation';
|
||||
return 'Pin to Conversation';
|
||||
}
|
||||
|
||||
@override
|
||||
String toggleDeleteRetryDeleteMessageText({required bool isDeleteFailed}) {
|
||||
if (isDeleteFailed) return 'Retry Deleting Message';
|
||||
return 'Delete Message';
|
||||
}
|
||||
|
||||
@override
|
||||
String get copyMessageLabel => 'Copy Message';
|
||||
|
||||
@override
|
||||
String get editMessageLabel => 'Edit Message';
|
||||
|
||||
@override
|
||||
String toggleResendOrResendEditedMessage({required bool isUpdateFailed}) {
|
||||
if (isUpdateFailed) return 'Resend Edited Message';
|
||||
return 'Resend';
|
||||
}
|
||||
|
||||
@override
|
||||
String get photosLabel => 'Photos';
|
||||
|
||||
@override
|
||||
String sentAtText({required DateTime date, required DateTime time}) =>
|
||||
'Sent $date at $time';
|
||||
|
||||
@override
|
||||
String get todayLabel => 'Today';
|
||||
|
||||
@override
|
||||
String get yesterdayLabel => 'Yesterday';
|
||||
|
||||
@override
|
||||
String get channelIsMutedText => ' Channel is muted';
|
||||
|
||||
@override
|
||||
String get noTitleText => 'No title';
|
||||
|
||||
@override
|
||||
String get letsStartChattingLabel => 'Let’s start chatting!';
|
||||
|
||||
@override
|
||||
String get sendingFirstMessageLabel =>
|
||||
'How about sending your first message to a friend?';
|
||||
|
||||
@override
|
||||
String get startAChatLabel => 'Start a chat';
|
||||
|
||||
@override
|
||||
String get loadingChannelsError => 'Error loading channels';
|
||||
|
||||
@override
|
||||
String get deleteConversationLabel => 'Delete Conversation';
|
||||
|
||||
@override
|
||||
String get deleteConversationQuestion =>
|
||||
'Are you sure you want to delete this conversation?';
|
||||
|
||||
@override
|
||||
String get streamChatLabel => 'Stream Chat';
|
||||
|
||||
@override
|
||||
String get searchingForNetworkLabel => 'Searching for Network';
|
||||
|
||||
@override
|
||||
String get offlineLabel => 'Offline...';
|
||||
|
||||
@override
|
||||
String get tryAgainLabel => 'Try Again';
|
||||
|
||||
@override
|
||||
String membersCountText(int count) {
|
||||
if (count == 1) return '1 Member';
|
||||
return '$count Members';
|
||||
}
|
||||
|
||||
@override
|
||||
String watchersCountText(int count) {
|
||||
if (count == 1) return '1 Online';
|
||||
return '$count Online';
|
||||
}
|
||||
|
||||
@override
|
||||
String get viewInfoLabel => 'View Info';
|
||||
|
||||
@override
|
||||
String get leaveGroupLabel => 'Leave Group';
|
||||
|
||||
@override
|
||||
String get leaveLabel => 'LEAVE';
|
||||
|
||||
@override
|
||||
String get leaveConversationLabel => 'Leave conversation';
|
||||
|
||||
@override
|
||||
String get leaveConversationQuestion =>
|
||||
'Are you sure you want to leave this conversation?';
|
||||
|
||||
@override
|
||||
String get showInChatLabel => 'Show in Chat';
|
||||
|
||||
@override
|
||||
String get saveImageLabel => 'Save Image';
|
||||
|
||||
@override
|
||||
String get saveVideoLabel => 'Save Video';
|
||||
|
||||
@override
|
||||
String get uploadErrorLabel => 'UPLOAD ERROR';
|
||||
|
||||
@override
|
||||
String get giphyLabel => 'Giphy';
|
||||
|
||||
@override
|
||||
String get shuffleLabel => 'Shuffle';
|
||||
|
||||
@override
|
||||
String get sendLabel => 'Send';
|
||||
}
|
||||
@@ -268,16 +268,14 @@ class _MessageActionsModalState extends State<MessageActionsModal> {
|
||||
final streamChatThemeData = StreamChatTheme.of(context);
|
||||
final answer = await showConfirmationDialog(
|
||||
context,
|
||||
title: 'Flag Message',
|
||||
title: context.translations.flagMessageLabel,
|
||||
icon: StreamSvgIcon.flag(
|
||||
color: streamChatThemeData.colorTheme.accentRed,
|
||||
size: 24,
|
||||
),
|
||||
question:
|
||||
// ignore: lines_longer_than_80_chars
|
||||
'Do you want to send a copy of this message to a\nmoderator for further investigation?',
|
||||
okText: 'FLAG',
|
||||
cancelText: 'CANCEL',
|
||||
question: context.translations.flagMessageQuestion,
|
||||
okText: context.translations.okLabel,
|
||||
cancelText: context.translations.cancelLabel,
|
||||
);
|
||||
|
||||
final theme = streamChatThemeData;
|
||||
@@ -290,9 +288,9 @@ class _MessageActionsModalState extends State<MessageActionsModal> {
|
||||
color: theme.colorTheme.accentRed,
|
||||
size: 24,
|
||||
),
|
||||
details: 'The message has been reported to a moderator.',
|
||||
title: 'Message flagged',
|
||||
okText: 'OK',
|
||||
details: context.translations.flagMessageSuccessfulText,
|
||||
title: context.translations.flagMessageSuccessfulLabel,
|
||||
okText: context.translations.okLabel,
|
||||
);
|
||||
} catch (err) {
|
||||
if (err is StreamChatNetworkError &&
|
||||
@@ -303,9 +301,9 @@ class _MessageActionsModalState extends State<MessageActionsModal> {
|
||||
color: theme.colorTheme.accentRed,
|
||||
size: 24,
|
||||
),
|
||||
details: 'The message has been reported to a moderator.',
|
||||
title: 'Message flagged',
|
||||
okText: 'OK',
|
||||
details: context.translations.flagMessageSuccessfulText,
|
||||
title: context.translations.flagMessageSuccessfulLabel,
|
||||
okText: context.translations.okLabel,
|
||||
);
|
||||
} else {
|
||||
_showErrorAlert();
|
||||
@@ -335,14 +333,14 @@ class _MessageActionsModalState extends State<MessageActionsModal> {
|
||||
});
|
||||
final answer = await showConfirmationDialog(
|
||||
context,
|
||||
title: 'Delete message',
|
||||
title: context.translations.deleteMessageLabel,
|
||||
icon: StreamSvgIcon.flag(
|
||||
color: StreamChatTheme.of(context).colorTheme.accentRed,
|
||||
size: 24,
|
||||
),
|
||||
question: 'Are you sure you want to permanently delete this\nmessage?',
|
||||
okText: 'DELETE',
|
||||
cancelText: 'CANCEL',
|
||||
question: context.translations.deleteMessageQuestion,
|
||||
okText: context.translations.deleteLabel,
|
||||
cancelText: context.translations.cancelLabel,
|
||||
);
|
||||
|
||||
if (answer == true) {
|
||||
@@ -366,9 +364,9 @@ class _MessageActionsModalState extends State<MessageActionsModal> {
|
||||
color: StreamChatTheme.of(context).colorTheme.accentRed,
|
||||
size: 24,
|
||||
),
|
||||
details: 'The operation couldn\'t be completed.',
|
||||
title: 'Something went wrong',
|
||||
okText: 'OK',
|
||||
details: context.translations.operationCouldNotBeCompletedText,
|
||||
title: context.translations.somethingWentWrongLabel,
|
||||
okText: context.translations.okLabel,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -390,7 +388,7 @@ class _MessageActionsModalState extends State<MessageActionsModal> {
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
Text(
|
||||
'Reply',
|
||||
context.translations.replyLabel,
|
||||
style: streamChatThemeData.textTheme.body,
|
||||
),
|
||||
],
|
||||
@@ -412,7 +410,7 @@ class _MessageActionsModalState extends State<MessageActionsModal> {
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
Text(
|
||||
'Flag Message',
|
||||
context.translations.flagMessageLabel,
|
||||
style: streamChatThemeData.textTheme.body,
|
||||
),
|
||||
],
|
||||
@@ -435,7 +433,9 @@ class _MessageActionsModalState extends State<MessageActionsModal> {
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
Text(
|
||||
'${widget.message.pinned ? 'Unpin from' : 'Pin to'} Conversation',
|
||||
context.translations.togglePinUnpinText(
|
||||
pinned: widget.message.pinned,
|
||||
),
|
||||
style: streamChatThemeData.textTheme.body,
|
||||
),
|
||||
],
|
||||
@@ -458,7 +458,9 @@ class _MessageActionsModalState extends State<MessageActionsModal> {
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
Text(
|
||||
isDeleteFailed ? 'Retry Deleting Message' : 'Delete Message',
|
||||
context.translations.toggleDeleteRetryDeleteMessageText(
|
||||
isDeleteFailed: isDeleteFailed,
|
||||
),
|
||||
style: StreamChatTheme.of(context)
|
||||
.textTheme
|
||||
.body
|
||||
@@ -487,7 +489,7 @@ class _MessageActionsModalState extends State<MessageActionsModal> {
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
Text(
|
||||
'Copy Message',
|
||||
context.translations.copyMessageLabel,
|
||||
style: streamChatThemeData.textTheme.body,
|
||||
),
|
||||
],
|
||||
@@ -512,7 +514,7 @@ class _MessageActionsModalState extends State<MessageActionsModal> {
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
Text(
|
||||
'Edit Message',
|
||||
context.translations.editMessageLabel,
|
||||
style: streamChatThemeData.textTheme.body,
|
||||
),
|
||||
],
|
||||
@@ -544,7 +546,9 @@ class _MessageActionsModalState extends State<MessageActionsModal> {
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
Text(
|
||||
isUpdateFailed ? 'Resend Edited Message' : 'Resend',
|
||||
context.translations.toggleResendOrResendEditedMessage(
|
||||
isUpdateFailed: isUpdateFailed,
|
||||
),
|
||||
style: streamChatThemeData.textTheme.body,
|
||||
),
|
||||
],
|
||||
@@ -588,8 +592,8 @@ class _MessageActionsModalState extends State<MessageActionsModal> {
|
||||
color: streamChatThemeData.colorTheme.greyGainsboro,
|
||||
),
|
||||
),
|
||||
const Text(
|
||||
'Edit Message',
|
||||
Text(
|
||||
context.translations.editMessageLabel,
|
||||
style: TextStyle(fontWeight: FontWeight.bold),
|
||||
),
|
||||
IconButton(
|
||||
@@ -636,7 +640,7 @@ class _MessageActionsModalState extends State<MessageActionsModal> {
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
Text(
|
||||
'Thread Reply',
|
||||
context.translations.threadReplyLabel,
|
||||
style: streamChatThemeData.textTheme.body,
|
||||
),
|
||||
],
|
||||
|
||||
@@ -24,6 +24,7 @@ import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||
import 'package:stream_chat_flutter_core/stream_chat_flutter_core.dart';
|
||||
import 'package:substring_highlight/substring_highlight.dart';
|
||||
import 'package:video_compress/video_compress.dart';
|
||||
import 'package:stream_chat_flutter/src/extension.dart';
|
||||
|
||||
/// Builder for attachment thumbnails
|
||||
typedef AttachmentThumbnailBuilder = Widget Function(
|
||||
@@ -229,16 +230,12 @@ class MessageInput extends StatefulWidget {
|
||||
/// Use this method to get the current [StreamChatState] instance
|
||||
static MessageInputState of(BuildContext context) {
|
||||
MessageInputState? messageInputState;
|
||||
|
||||
messageInputState = context.findAncestorStateOfType<MessageInputState>();
|
||||
|
||||
if (messageInputState == null) {
|
||||
throw Exception(
|
||||
// ignore: lines_longer_than_80_chars
|
||||
'You must have a MessageInput widget as ancestor of your widget tree');
|
||||
}
|
||||
|
||||
return messageInputState;
|
||||
assert(
|
||||
messageInputState != null,
|
||||
'You must have a MessageInput widget as ancestor of your widget tree',
|
||||
);
|
||||
return messageInputState!;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -440,7 +437,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.black.withOpacity(0.5),
|
||||
),
|
||||
@@ -564,7 +561,7 @@ class MessageInputState extends State<MessageInput> {
|
||||
style: _streamChatTheme.messageInputTheme.inputTextStyle,
|
||||
autofocus: widget.autofocus,
|
||||
textAlignVertical: TextAlignVertical.center,
|
||||
decoration: _getInputDecoration(),
|
||||
decoration: _getInputDecoration(context),
|
||||
textCapitalization: TextCapitalization.sentences,
|
||||
),
|
||||
)
|
||||
@@ -576,11 +573,11 @@ class MessageInputState extends State<MessageInput> {
|
||||
);
|
||||
}
|
||||
|
||||
InputDecoration _getInputDecoration() {
|
||||
InputDecoration _getInputDecoration(BuildContext context) {
|
||||
final passedDecoration = _streamChatTheme.messageInputTheme.inputDecoration;
|
||||
return InputDecoration(
|
||||
isDense: true,
|
||||
hintText: _getHint(),
|
||||
hintText: _getHint(context),
|
||||
hintStyle: _streamChatTheme.messageInputTheme.inputTextStyle!.copyWith(
|
||||
color: _streamChatTheme.colorTheme.grey,
|
||||
),
|
||||
@@ -729,14 +726,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) {
|
||||
@@ -859,7 +856,7 @@ class MessageInputState extends State<MessageInput> {
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'Instant Commands',
|
||||
context.translations.instantCommandsLabel,
|
||||
style: TextStyle(
|
||||
color:
|
||||
_streamChatTheme.colorTheme.black.withOpacity(.5),
|
||||
@@ -1114,8 +1111,7 @@ 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,
|
||||
);
|
||||
return;
|
||||
}
|
||||
@@ -1126,9 +1122,7 @@ 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);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -1396,7 +1390,9 @@ class MessageInputState extends State<MessageInput> {
|
||||
),
|
||||
Flexible(
|
||||
child: Text(
|
||||
'Emoji matching "$query"',
|
||||
context.translations.emojiMatchingQueryText(
|
||||
query,
|
||||
),
|
||||
style: TextStyle(
|
||||
color: _streamChatTheme.colorTheme.black
|
||||
.withOpacity(.5),
|
||||
@@ -1744,17 +1740,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);
|
||||
@@ -1762,7 +1758,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);
|
||||
@@ -1771,7 +1767,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);
|
||||
@@ -1780,7 +1776,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);
|
||||
@@ -1788,7 +1784,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);
|
||||
@@ -1888,8 +1884,7 @@ 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,
|
||||
);
|
||||
return;
|
||||
}
|
||||
@@ -1900,9 +1895,7 @@ 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);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -2079,7 +2072,7 @@ class MessageInputState extends State<MessageInput> {
|
||||
height: 26,
|
||||
),
|
||||
Text(
|
||||
'Something went wrong',
|
||||
context.translations.somethingWentWrongLabel,
|
||||
style: _streamChatTheme.textTheme.headlineBold,
|
||||
),
|
||||
const SizedBox(
|
||||
@@ -2107,7 +2100,7 @@ class MessageInputState extends State<MessageInput> {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
child: Text(
|
||||
'OK',
|
||||
context.translations.okLabel,
|
||||
style: _streamChatTheme.textTheme.bodyBold
|
||||
.copyWith(color: _streamChatTheme.colorTheme.accentBlue),
|
||||
),
|
||||
@@ -2253,7 +2246,7 @@ class __PickerWidgetState extends State<_PickerWidget> {
|
||||
color: widget.streamChatTheme.colorTheme.whiteSmoke,
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
'Add more files',
|
||||
context.translations.addMoreFilesLabel,
|
||||
style: TextStyle(
|
||||
color: widget.streamChatTheme.colorTheme.accentBlue,
|
||||
fontWeight: FontWeight.bold,
|
||||
@@ -2285,8 +2278,7 @@ class __PickerWidgetState extends State<_PickerWidget> {
|
||||
color: widget.streamChatTheme.colorTheme.greyGainsboro,
|
||||
),
|
||||
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.grey),
|
||||
textAlign: TextAlign.center,
|
||||
@@ -2294,7 +2286,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.accentBlue,
|
||||
),
|
||||
|
||||
@@ -17,6 +17,7 @@ import 'package:stream_chat_flutter/src/system_message.dart';
|
||||
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||
import 'package:stream_chat_flutter_core/stream_chat_flutter_core.dart';
|
||||
import 'package:visibility_detector/visibility_detector.dart';
|
||||
import 'package:stream_chat_flutter/src/extension.dart';
|
||||
|
||||
/// Widget builder for message
|
||||
/// [defaultMessageWidget] is the default [MessageWidget] configuration
|
||||
@@ -353,6 +354,7 @@ class _MessageListViewState extends State<MessageListView> {
|
||||
bool _inBetweenList = false;
|
||||
|
||||
late final _defaultController = MessageListController();
|
||||
|
||||
MessageListController get _messageListController =>
|
||||
widget.messageListController ?? _defaultController;
|
||||
|
||||
@@ -366,7 +368,7 @@ class _MessageListViewState extends State<MessageListView> {
|
||||
emptyBuilder: widget.emptyBuilder ??
|
||||
(context) => Center(
|
||||
child: Text(
|
||||
'No chats here yet...',
|
||||
context.translations.emptyChatMessagesText,
|
||||
style: _streamTheme.textTheme.footnote.copyWith(
|
||||
color: _streamTheme.colorTheme.black.withOpacity(.5)),
|
||||
),
|
||||
@@ -378,7 +380,7 @@ class _MessageListViewState extends State<MessageListView> {
|
||||
errorWidgetBuilder: widget.errorWidgetBuilder ??
|
||||
(BuildContext context, Object error) => Center(
|
||||
child: Text(
|
||||
'Something went wrong',
|
||||
context.translations.genericErrorText,
|
||||
style: _streamTheme.textTheme.footnote.copyWith(
|
||||
color: _streamTheme.colorTheme.black.withOpacity(.5)),
|
||||
),
|
||||
@@ -423,14 +425,14 @@ class _MessageListViewState extends State<MessageListView> {
|
||||
var showStatus = true;
|
||||
switch (status) {
|
||||
case ConnectionStatus.connected:
|
||||
statusString = 'Connected';
|
||||
statusString = context.translations.connectedLabel;
|
||||
showStatus = false;
|
||||
break;
|
||||
case ConnectionStatus.connecting:
|
||||
statusString = 'Reconnecting...';
|
||||
statusString = context.translations.reconnectingLabel;
|
||||
break;
|
||||
case ConnectionStatus.disconnected:
|
||||
statusString = 'Disconnected';
|
||||
statusString = context.translations.disconnectedLabel;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -619,7 +621,7 @@ class _MessageListViewState extends State<MessageListView> {
|
||||
return widget.threadSeparatorBuilder!.call(context);
|
||||
}
|
||||
|
||||
final replyCount = widget.parentMessage!.replyCount;
|
||||
final replyCount = widget.parentMessage!.replyCount!;
|
||||
return DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
gradient: _streamTheme.colorTheme.bgGradient,
|
||||
@@ -627,7 +629,7 @@ class _MessageListViewState extends State<MessageListView> {
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8),
|
||||
child: Text(
|
||||
'$replyCount ${replyCount == 1 ? 'Reply' : 'Replies'}',
|
||||
context.translations.threadSeparatorText(replyCount),
|
||||
textAlign: TextAlign.center,
|
||||
style: _streamTheme.channelTheme.channelHeaderTheme.subtitle,
|
||||
),
|
||||
@@ -1253,8 +1255,8 @@ class _LoadingIndicator extends StatelessWidget {
|
||||
initialData: false,
|
||||
errorBuilder: (context, error) => Container(
|
||||
color: streamTheme.colorTheme.accentRed.withOpacity(.2),
|
||||
child: const Center(
|
||||
child: Text('Error loading messages'),
|
||||
child: Center(
|
||||
child: Text(context.translations.loadingMessagesError),
|
||||
),
|
||||
),
|
||||
builder: (context, data) {
|
||||
|
||||
@@ -7,6 +7,7 @@ import 'package:stream_chat_flutter/src/stream_chat.dart';
|
||||
import 'package:stream_chat_flutter/src/user_avatar.dart';
|
||||
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||
import 'package:stream_chat_flutter_core/stream_chat_flutter_core.dart';
|
||||
import 'package:stream_chat_flutter/src/extension.dart';
|
||||
|
||||
/// Modal widget for displaying message reactions
|
||||
class MessageReactionsModal extends StatelessWidget {
|
||||
@@ -154,7 +155,7 @@ class MessageReactionsModal extends StatelessWidget {
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
'Message Reactions',
|
||||
context.translations.messageReactionsText,
|
||||
style: chatThemeData.textTheme.headlineBold,
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
|
||||
@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:jiffy/jiffy.dart';
|
||||
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||
import 'package:stream_chat_flutter_core/stream_chat_flutter_core.dart';
|
||||
import 'package:stream_chat_flutter/src/extension.dart';
|
||||
|
||||
/// It shows the current [Message] preview.
|
||||
///
|
||||
@@ -98,7 +99,7 @@ class MessageSearchItem extends StatelessWidget {
|
||||
Widget _buildSubtitle(BuildContext context, Message message) {
|
||||
var text = message.text;
|
||||
if (message.isDeleted) {
|
||||
text = 'This message was deleted.';
|
||||
text = context.translations.messageDeletedText;
|
||||
} else if (message.attachments.isNotEmpty) {
|
||||
final parts = <String>[
|
||||
...message.attachments.map((e) {
|
||||
|
||||
@@ -3,6 +3,7 @@ import 'package:stream_chat_flutter/src/info_tile.dart';
|
||||
import 'package:stream_chat_flutter/src/message_search_item.dart';
|
||||
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||
import 'package:stream_chat_flutter_core/stream_chat_flutter_core.dart';
|
||||
import 'package:stream_chat_flutter/src/extension.dart';
|
||||
|
||||
/// Callback called when tapping on a user
|
||||
typedef MessageSearchItemTapCallback = void Function(GetMessageResponse);
|
||||
@@ -140,6 +141,7 @@ class MessageSearchListView extends StatefulWidget {
|
||||
|
||||
class _MessageSearchListViewState extends State<MessageSearchListView> {
|
||||
late final _defaultController = MessageSearchListController();
|
||||
|
||||
MessageSearchListController get _messageSearchListController =>
|
||||
widget.messageSearchListController ?? _defaultController;
|
||||
|
||||
@@ -160,8 +162,8 @@ class _MessageSearchListViewState extends State<MessageSearchListView> {
|
||||
constraints: BoxConstraints(
|
||||
minHeight: viewportConstraints.maxHeight,
|
||||
),
|
||||
child: const Center(
|
||||
child: Text('There are no messages currently'),
|
||||
child: Center(
|
||||
child: Text(context.translations.emptyMessagesText),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -175,7 +177,7 @@ class _MessageSearchListViewState extends State<MessageSearchListView> {
|
||||
showMessage: widget.showErrorTile,
|
||||
tileAnchor: Alignment.topCenter,
|
||||
childAnchor: Alignment.topCenter,
|
||||
message: 'An error occurred.',
|
||||
message: context.translations.genericErrorText,
|
||||
child: Container(),
|
||||
);
|
||||
},
|
||||
@@ -226,10 +228,10 @@ class _MessageSearchListViewState extends State<MessageSearchListView> {
|
||||
.colorTheme
|
||||
.accentRed
|
||||
.withOpacity(.2),
|
||||
child: const Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 16),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 16),
|
||||
child: Center(
|
||||
child: Text('Error loading messages'),
|
||||
child: Text(context.translations.loadingMessagesError),
|
||||
),
|
||||
),
|
||||
);
|
||||
@@ -292,7 +294,7 @@ class _MessageSearchListViewState extends State<MessageSearchListView> {
|
||||
horizontal: 8,
|
||||
),
|
||||
child: Text(
|
||||
'${items.length} results',
|
||||
context.translations.resultCountText(items.length),
|
||||
style: TextStyle(
|
||||
color: chatThemeData.colorTheme.grey,
|
||||
),
|
||||
|
||||
@@ -3,7 +3,6 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_markdown/flutter_markdown.dart';
|
||||
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||
import 'package:stream_chat_flutter_core/stream_chat_flutter_core.dart';
|
||||
import 'package:stream_chat_flutter/src/extension.dart';
|
||||
|
||||
/// Text widget to display in message
|
||||
class MessageText extends StatelessWidget {
|
||||
@@ -30,8 +29,6 @@ class MessageText extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final texts = context.translations?.launchUrlError ?? 'defaultValue';
|
||||
return Text(texts);
|
||||
final text = _replaceMentions(message.text ?? '').replaceAll('\n', '\n\n');
|
||||
|
||||
final themeData = Theme.of(context);
|
||||
|
||||
@@ -16,6 +16,7 @@ import 'package:stream_chat_flutter/src/quoted_message_widget.dart';
|
||||
import 'package:stream_chat_flutter/src/reaction_bubble.dart';
|
||||
import 'package:stream_chat_flutter/src/url_attachment.dart';
|
||||
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||
import 'package:stream_chat_flutter/src/extension.dart';
|
||||
|
||||
/// Widget builder for building attachments
|
||||
typedef AttachmentBuilder = Widget Function(
|
||||
@@ -840,7 +841,7 @@ class _MessageWidgetState extends State<MessageWidget>
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
'Only visible to you',
|
||||
context.translations.onlyVisibleToYouText,
|
||||
style: chatThemeData.textTheme.footnote
|
||||
.copyWith(color: chatThemeData.colorTheme.grey),
|
||||
),
|
||||
@@ -854,9 +855,9 @@ class _MessageWidgetState extends State<MessageWidget>
|
||||
final showThreadParticipants = threadParticipants?.isNotEmpty == true;
|
||||
final replyCount = widget.message.replyCount;
|
||||
|
||||
var msg = 'Thread Reply';
|
||||
var msg = context.translations.threadReplyLabel;
|
||||
if (showThreadReplyIndicator && replyCount! > 1) {
|
||||
msg = '$replyCount Thread Replies';
|
||||
msg = context.translations.threadReplyCountText(replyCount);
|
||||
}
|
||||
|
||||
// ignore: prefer_function_declarations_over_variables
|
||||
@@ -1201,7 +1202,10 @@ class _MessageWidgetState extends State<MessageWidget>
|
||||
);
|
||||
}
|
||||
return Text(
|
||||
'Uploading $uploadRemaining/$totalAttachments ...',
|
||||
context.translations.attachmentsUploadProgressText(
|
||||
remaining: uploadRemaining,
|
||||
total: totalAttachments,
|
||||
),
|
||||
style: style,
|
||||
);
|
||||
}
|
||||
@@ -1275,8 +1279,8 @@ class _MessageWidgetState extends State<MessageWidget>
|
||||
}
|
||||
|
||||
Widget _buildPinnedMessage(Message message) {
|
||||
final pinnedBy = message.pinnedBy;
|
||||
final pinnedByMe = _streamChat.user!.id == pinnedBy!.id;
|
||||
final pinnedBy = message.pinnedBy!;
|
||||
final currentUser = _streamChat.user!;
|
||||
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(left: 8, right: 8, top: 4, bottom: 8),
|
||||
@@ -1290,7 +1294,10 @@ class _MessageWidgetState extends State<MessageWidget>
|
||||
width: 4,
|
||||
),
|
||||
Text(
|
||||
'Pinned by ${pinnedByMe ? 'You' : pinnedBy.name}',
|
||||
context.translations.pinnedByUserText(
|
||||
pinnedBy: pinnedBy,
|
||||
currentUser: currentUser,
|
||||
),
|
||||
style: TextStyle(
|
||||
color: _streamChatTheme.colorTheme.grey,
|
||||
fontSize: 13,
|
||||
|
||||
@@ -1,96 +0,0 @@
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
||||
// TODO : Fix localization instructions
|
||||
// ADDING A NEW STRING
|
||||
//
|
||||
// If you (someone contributing to the Stream Chat Flutter) want to add a new
|
||||
// string to the StreamChatLocalizations object (e.g. because you've added a new
|
||||
// widget and it has a tooltip), follow these steps:
|
||||
//
|
||||
// 1. Add the new getter to StreamChatLocalizations below.
|
||||
//
|
||||
// 2. Implement a default value in DefaultMaterialLocalizations below.
|
||||
//
|
||||
// 3. Add a test to test/material/localizations_test.dart that verifies that
|
||||
// this new value is implemented.
|
||||
//
|
||||
// 4. Update the flutter_localizations package. To add a new string to the
|
||||
// flutter_localizations package, you must first add it to the English
|
||||
// translations (lib/src/l10n/en.json), including a description.
|
||||
//
|
||||
// Then you need to add new entries for the string to all of the other
|
||||
// language locale files by running:
|
||||
// ```
|
||||
// dart dev/tools/localization/bin/gen_missing_localizations.dart
|
||||
// ```
|
||||
// Which will copy the english strings into the other locales as placeholders
|
||||
// until they can be translated.
|
||||
//
|
||||
// Finally you need to re-generate lib/src/l10n/localizations.dart by running:
|
||||
// ```
|
||||
// dart dev/tools/localization/bin/gen_localizations.dart --overwrite
|
||||
// ```
|
||||
//
|
||||
// There is a README file with further information in the lib/src/l10n/
|
||||
// directory.
|
||||
//
|
||||
// 5. If you are a Google employee, you should then also follow the instructions
|
||||
// at go/flutter-l10n. If you're not, don't worry about it.
|
||||
//
|
||||
// UPDATING AN EXISTING STRING
|
||||
//
|
||||
// If you (someone contributing to the Flutter framework) want to modify an
|
||||
// existing string in the MaterialLocalizations objects, follow these steps:
|
||||
//
|
||||
// 1. Modify the default value of the relevant getter(s) in
|
||||
// DefaultMaterialLocalizations below.
|
||||
//
|
||||
// 2. Update the flutter_localizations package. Modify the out-of-date English
|
||||
// strings in lib/src/l10n/material_en.arb.
|
||||
//
|
||||
// You also need to re-generate lib/src/l10n/localizations.dart by running:
|
||||
// ```
|
||||
// dart dev/tools/localization/bin/gen_localizations.dart --overwrite
|
||||
// ```
|
||||
//
|
||||
// This script may result in your updated getters being created in newer
|
||||
// locales and set to the old value of the strings. This is to be expected.
|
||||
// Leave them as they were generated, and they will be picked up for
|
||||
// translation.
|
||||
//
|
||||
// There is a README file with further information in the lib/src/l10n/
|
||||
// directory.
|
||||
//
|
||||
// 3. If you are a Google employee, you should then also follow the instructions
|
||||
// at go/flutter-l10n. If you're not, don't worry about it.
|
||||
|
||||
/// Defines the localized resource values used by the StreamChatFlutter widgets.
|
||||
///
|
||||
/// See also:
|
||||
///
|
||||
/// * [GlobalStreamChatLocalizations], which provides material localizations
|
||||
/// for many languages.
|
||||
abstract class StreamChatLocalizations {
|
||||
/// The `StreamChatLocalizations` from the closest [Localizations] instance
|
||||
/// that encloses the given context.
|
||||
///
|
||||
/// If no [StreamChatLocalizations] are available in the given `context`, this
|
||||
/// method returns null.
|
||||
///
|
||||
/// This method is just a convenient shorthand for:
|
||||
/// `Localizations.of<StreamChatLocalizations>(context, StreamChatLocalizations)`.
|
||||
///
|
||||
/// References to the localized resources defined by this class are typically
|
||||
/// written in terms of this method. For example:
|
||||
///
|
||||
/// ```dart
|
||||
/// tooltip: StreamChatLocalizations.of(context).backButtonTooltip,
|
||||
/// ```
|
||||
static StreamChatLocalizations? of(BuildContext context) =>
|
||||
Localizations.of<StreamChatLocalizations>(
|
||||
context,
|
||||
StreamChatLocalizations,
|
||||
);
|
||||
|
||||
String get launchUrlError;
|
||||
}
|
||||
@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:stream_chat_flutter/src/stream_chat_theme.dart';
|
||||
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||
import 'package:stream_chat_flutter_core/stream_chat_flutter_core.dart';
|
||||
import 'package:stream_chat_flutter/src/extension.dart';
|
||||
|
||||
/// 
|
||||
/// 
|
||||
@@ -149,7 +150,7 @@ class ThreadHeader extends StatelessWidget implements PreferredSizeWidget {
|
||||
children: [
|
||||
title ??
|
||||
Text(
|
||||
'Thread Reply',
|
||||
context.translations.threadReplyLabel,
|
||||
style: chatThemeData.channelTheme.channelHeaderTheme.title,
|
||||
),
|
||||
const SizedBox(height: 2),
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:lottie/lottie.dart';
|
||||
import 'package:stream_chat_flutter_core/stream_chat_flutter_core.dart';
|
||||
import 'package:stream_chat_flutter/src/extension.dart';
|
||||
|
||||
/// Widget to show the current list of typing users
|
||||
class TypingIndicator extends StatelessWidget {
|
||||
@@ -63,8 +64,7 @@ class TypingIndicator extends StatelessWidget {
|
||||
height: 4,
|
||||
),
|
||||
Text(
|
||||
// ignore: lines_longer_than_80_chars
|
||||
' ${data.elementAt(0).name}${data.length == 1 ? '' : ' and ${data.length - 1} more'} ${data.length == 1 ? 'is' : 'are'} typing',
|
||||
context.translations.userTypingText(data),
|
||||
maxLines: 1,
|
||||
style: style,
|
||||
),
|
||||
|
||||
@@ -4,6 +4,7 @@ import 'package:stream_chat_flutter/src/stream_svg_icon.dart';
|
||||
import 'package:stream_chat_flutter/src/user_list_view.dart';
|
||||
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||
import 'package:stream_chat_flutter_core/stream_chat_flutter_core.dart';
|
||||
import 'package:stream_chat_flutter/src/extension.dart';
|
||||
|
||||
///
|
||||
/// It shows the current [User] preview.
|
||||
@@ -86,12 +87,13 @@ class UserItem extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildLastActive(context) {
|
||||
Widget _buildLastActive(BuildContext context) {
|
||||
final chatTheme = StreamChatTheme.of(context);
|
||||
return Text(
|
||||
user.online == true
|
||||
? 'Online'
|
||||
: 'Last online ${Jiffy(user.lastActive).fromNow()}',
|
||||
? context.translations.userOnlineText
|
||||
: context.translations.userLastOnlineText +
|
||||
Jiffy(user.lastActive).fromNow(),
|
||||
style: chatTheme.textTheme.footnote
|
||||
.copyWith(color: chatTheme.colorTheme.black.withOpacity(.5)),
|
||||
);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||
import 'package:stream_chat_flutter_core/stream_chat_flutter_core.dart';
|
||||
import 'package:stream_chat_flutter/src/extension.dart';
|
||||
|
||||
/// Callback called when tapping on a user
|
||||
typedef UserTapCallback = void Function(User, Widget?);
|
||||
@@ -155,6 +156,7 @@ class _UserListViewState extends State<UserListView>
|
||||
bool get _isListView => widget.crossAxisCount == 1;
|
||||
|
||||
late final _defaultController = UserListController();
|
||||
|
||||
UserListController get _userListController =>
|
||||
widget.userListController ?? _defaultController;
|
||||
|
||||
@@ -207,9 +209,9 @@ class _UserListViewState extends State<UserListView>
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Text.rich(
|
||||
const TextSpan(
|
||||
TextSpan(
|
||||
children: [
|
||||
WidgetSpan(
|
||||
const WidgetSpan(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
right: 2,
|
||||
@@ -217,14 +219,14 @@ class _UserListViewState extends State<UserListView>
|
||||
child: Icon(Icons.error_outline),
|
||||
),
|
||||
),
|
||||
TextSpan(text: 'Error loading users'),
|
||||
TextSpan(text: context.translations.loadingUsersError),
|
||||
],
|
||||
),
|
||||
style: Theme.of(context).textTheme.headline6,
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () => _userListController.loadData!(),
|
||||
child: const Text('Retry'),
|
||||
child: Text(context.translations.retryLabel),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -237,8 +239,8 @@ class _UserListViewState extends State<UserListView>
|
||||
constraints: BoxConstraints(
|
||||
minHeight: viewportConstraints.maxHeight,
|
||||
),
|
||||
child: const Center(
|
||||
child: Text('There are no users currently'),
|
||||
child: Center(
|
||||
child: Text(context.translations.noUsersLabel),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -387,10 +389,10 @@ class _UserListViewState extends State<UserListView>
|
||||
.colorTheme
|
||||
.accentRed
|
||||
.withOpacity(.2),
|
||||
child: const Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 16),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 16),
|
||||
child: Center(
|
||||
child: Text('Error loading users'),
|
||||
child: Text(context.translations.loadingUsersError),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -4,17 +4,15 @@ import 'package:flutter/material.dart';
|
||||
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||
import 'package:stream_chat_flutter_core/stream_chat_flutter_core.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
import 'package:stream_chat_flutter/src/extension.dart';
|
||||
|
||||
/// Launch URL
|
||||
Future<void> launchURL(BuildContext context, String? url) async {
|
||||
if (url != null && await canLaunch(url)) {
|
||||
await launch(url);
|
||||
} else {
|
||||
// ignore: deprecated_member_use
|
||||
Scaffold.of(context).showSnackBar(
|
||||
const SnackBar(
|
||||
content: Text('Cannot launch the url'),
|
||||
),
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text(context.translations.launchUrlError)),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ export 'src/full_screen_media.dart';
|
||||
export 'src/image_footer.dart';
|
||||
export 'src/image_header.dart';
|
||||
export 'src/info_tile.dart';
|
||||
export 'src/localization/stream_chat_localizations.dart';
|
||||
export 'src/mention_tile.dart';
|
||||
export 'src/message_action.dart';
|
||||
export 'src/message_input.dart';
|
||||
@@ -28,7 +29,6 @@ export 'src/reaction_icon.dart';
|
||||
export 'src/reaction_picker.dart';
|
||||
export 'src/sending_indicator.dart';
|
||||
export 'src/stream_chat.dart';
|
||||
export 'src/stream_chat_localizations.dart';
|
||||
export 'src/stream_chat_theme.dart';
|
||||
export 'src/stream_neumorphic_button.dart';
|
||||
export 'src/stream_svg_icon.dart';
|
||||
|
||||
@@ -2,7 +2,7 @@ import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||
import 'package:stream_chat_flutter/stream_chat_flutter.dart'
|
||||
show StreamChatLocalizations;
|
||||
show StreamChatLocalizations, User;
|
||||
|
||||
part 'stream_chat_localizations_en.dart';
|
||||
|
||||
@@ -113,9 +113,6 @@ abstract class GlobalStreamChatLocalizations
|
||||
GlobalMaterialLocalizations.delegate,
|
||||
GlobalWidgetsLocalizations.delegate,
|
||||
];
|
||||
|
||||
@override
|
||||
String get launchUrlError;
|
||||
}
|
||||
|
||||
class _StreamChatLocalizationsDelegate
|
||||
|
||||
@@ -8,4 +8,319 @@ class StreamChatLocalizationsEn extends GlobalStreamChatLocalizations {
|
||||
|
||||
@override
|
||||
String get launchUrlError => 'Cannot launch the url';
|
||||
|
||||
@override
|
||||
String get loadingUsersError => 'Error loading users';
|
||||
|
||||
@override
|
||||
String get noUsersLabel => 'There are no users currently';
|
||||
|
||||
@override
|
||||
String get retryLabel => 'Retry';
|
||||
|
||||
@override
|
||||
String get userLastOnlineText => 'Last online';
|
||||
|
||||
@override
|
||||
String get userOnlineText => 'Online';
|
||||
|
||||
@override
|
||||
String userTypingText(Iterable<User> users) {
|
||||
if (users.isEmpty) return '';
|
||||
final first = users.first;
|
||||
if (users.length == 1) {
|
||||
return '${first.name} is typing';
|
||||
}
|
||||
return '${first.name} and ${users.length - 1} more are typing';
|
||||
}
|
||||
|
||||
@override
|
||||
String get threadReplyLabel => 'Thread Reply';
|
||||
|
||||
@override
|
||||
String get onlyVisibleToYouText => 'Only visible to you';
|
||||
|
||||
@override
|
||||
String threadReplyCountText(int count) => '$count Thread Replies';
|
||||
|
||||
@override
|
||||
String attachmentsUploadProgressText({
|
||||
required int remaining,
|
||||
required int total,
|
||||
}) =>
|
||||
'Uploading $remaining/$total ...';
|
||||
|
||||
@override
|
||||
String pinnedByUserText({
|
||||
required User pinnedBy,
|
||||
required User currentUser,
|
||||
}) {
|
||||
final pinnedByCurrentUser = currentUser.id == pinnedBy.id;
|
||||
if (pinnedByCurrentUser) return 'Pinned by You';
|
||||
return 'Pinned by ${pinnedBy.name}';
|
||||
}
|
||||
|
||||
@override
|
||||
String get emptyMessagesText => 'There are no messages currently';
|
||||
|
||||
@override
|
||||
String get genericErrorText => 'Something went wrong';
|
||||
|
||||
@override
|
||||
String get loadingMessagesError => 'Error loading messages';
|
||||
|
||||
@override
|
||||
String resultCountText(int count) => '$count results';
|
||||
|
||||
@override
|
||||
String get messageDeletedText => 'This message was deleted.';
|
||||
|
||||
@override
|
||||
String get messageDeletedLabel => 'Message deleted';
|
||||
|
||||
@override
|
||||
String get messageReactionsText => 'Message Reactions';
|
||||
|
||||
@override
|
||||
String get emptyChatMessagesText => 'No chats here yet...';
|
||||
|
||||
@override
|
||||
String threadSeparatorText(int replyCount) {
|
||||
if (replyCount == 1) return '1 Reply';
|
||||
return '$replyCount Replies';
|
||||
}
|
||||
|
||||
@override
|
||||
String get connectedLabel => 'Connected';
|
||||
|
||||
@override
|
||||
String get disconnectedLabel => 'Disconnected';
|
||||
|
||||
@override
|
||||
String get reconnectingLabel => 'Reconnecting...';
|
||||
|
||||
@override
|
||||
String get alsoSendAsDirectMessageLabel => 'Also send as direct message';
|
||||
|
||||
@override
|
||||
String get addACommentOrSendLabel => 'Add a comment or send';
|
||||
|
||||
@override
|
||||
String get searchGifLabel => 'Search GIFs';
|
||||
|
||||
@override
|
||||
String get writeAMessageLabel => 'Write a message';
|
||||
|
||||
@override
|
||||
String get instantCommandsLabel => 'Instant Commands';
|
||||
|
||||
@override
|
||||
String get fileTooLargeAfterCompressionError =>
|
||||
'The file is too large to upload. '
|
||||
'The file size limit is 20MB. '
|
||||
'We tried compressing it, but it was not enough.';
|
||||
|
||||
@override
|
||||
String get fileTooLargeError =>
|
||||
'The file is too large to upload. The file size limit is 20MB.';
|
||||
|
||||
@override
|
||||
String emojiMatchingQueryText(String query) => 'Emoji matching "$query"';
|
||||
|
||||
@override
|
||||
String get addAFileLabel => 'Add a file';
|
||||
|
||||
@override
|
||||
String get photoFromCameraLabel => 'Photo from camera';
|
||||
|
||||
@override
|
||||
String get uploadAFileLabel => 'Upload a file';
|
||||
|
||||
@override
|
||||
String get uploadAPhotoLabel => 'Upload a photo';
|
||||
|
||||
@override
|
||||
String get uploadAVideoLabel => 'Upload a video';
|
||||
|
||||
@override
|
||||
String get videoFromCameraLabel => 'Video from camera';
|
||||
|
||||
@override
|
||||
String get okLabel => 'OK';
|
||||
|
||||
@override
|
||||
String get somethingWentWrongLabel => 'Something went wrong';
|
||||
|
||||
@override
|
||||
String get addMoreFilesLabel => 'Add more files';
|
||||
|
||||
@override
|
||||
String get enablePhotoAndVideoAccessMessage =>
|
||||
'Please enable access to your photos'
|
||||
'\nand videos so you can share them with friends.';
|
||||
|
||||
@override
|
||||
String get allowGalleryAccessMessage => 'Allow access to your gallery';
|
||||
|
||||
@override
|
||||
String get flagMessageLabel => 'Flag Message';
|
||||
|
||||
@override
|
||||
String get flagMessageQuestion =>
|
||||
'Do you want to send a copy of this message to a'
|
||||
'\nmoderator for further investigation?';
|
||||
|
||||
@override
|
||||
String get flagLabel => 'FLAG';
|
||||
|
||||
@override
|
||||
String get cancelLabel => 'CANCEL';
|
||||
|
||||
@override
|
||||
String get flagMessageSuccessfulLabel => 'Message flagged';
|
||||
|
||||
@override
|
||||
String get flagMessageSuccessfulText =>
|
||||
'The message has been reported to a moderator.';
|
||||
|
||||
@override
|
||||
String get deleteLabel => 'DELETE';
|
||||
|
||||
@override
|
||||
String get deleteMessageLabel => 'Delete Message';
|
||||
|
||||
@override
|
||||
String get deleteMessageQuestion =>
|
||||
'Are you sure you want to permanently delete this\nmessage?';
|
||||
|
||||
@override
|
||||
String get operationCouldNotBeCompletedText =>
|
||||
'The operation couldn\'t be completed.';
|
||||
|
||||
@override
|
||||
String get replyLabel => 'Reply';
|
||||
|
||||
@override
|
||||
String togglePinUnpinText({required bool pinned}) {
|
||||
if (pinned) return 'Unpin from Conversation';
|
||||
return 'Pin to Conversation';
|
||||
}
|
||||
|
||||
@override
|
||||
String toggleDeleteRetryDeleteMessageText({required bool isDeleteFailed}) {
|
||||
if (isDeleteFailed) return 'Retry Deleting Message';
|
||||
return 'Delete Message';
|
||||
}
|
||||
|
||||
@override
|
||||
String get copyMessageLabel => 'Copy Message';
|
||||
|
||||
@override
|
||||
String get editMessageLabel => 'Edit Message';
|
||||
|
||||
@override
|
||||
String toggleResendOrResendEditedMessage({required bool isUpdateFailed}) {
|
||||
if (isUpdateFailed) return 'Resend Edited Message';
|
||||
return 'Resend';
|
||||
}
|
||||
|
||||
@override
|
||||
String get photosLabel => 'Photos';
|
||||
|
||||
@override
|
||||
String sentAtText({required DateTime date, required DateTime time}) =>
|
||||
'Sent $date at $time';
|
||||
|
||||
@override
|
||||
String get todayLabel => 'Today';
|
||||
|
||||
@override
|
||||
String get yesterdayLabel => 'Yesterday';
|
||||
|
||||
@override
|
||||
String get channelIsMutedText => ' Channel is muted';
|
||||
|
||||
@override
|
||||
String get noTitleText => 'No title';
|
||||
|
||||
@override
|
||||
String get letsStartChattingLabel => 'Let’s start chatting!';
|
||||
|
||||
@override
|
||||
String get sendingFirstMessageLabel =>
|
||||
'How about sending your first message to a friend?';
|
||||
|
||||
@override
|
||||
String get startAChatLabel => 'Start a chat';
|
||||
|
||||
@override
|
||||
String get loadingChannelsError => 'Error loading channels';
|
||||
|
||||
@override
|
||||
String get deleteConversationLabel => 'Delete Conversation';
|
||||
|
||||
@override
|
||||
String get deleteConversationQuestion =>
|
||||
'Are you sure you want to delete this conversation?';
|
||||
|
||||
@override
|
||||
String get streamChatLabel => 'Stream Chat';
|
||||
|
||||
@override
|
||||
String get searchingForNetworkLabel => 'Searching for Network';
|
||||
|
||||
@override
|
||||
String get offlineLabel => 'Offline...';
|
||||
|
||||
@override
|
||||
String get tryAgainLabel => 'Try Again';
|
||||
|
||||
@override
|
||||
String membersCountText(int count) {
|
||||
if (count == 1) return '1 Member';
|
||||
return '$count Members';
|
||||
}
|
||||
|
||||
@override
|
||||
String watchersCountText(int count) {
|
||||
if (count == 1) return '1 Online';
|
||||
return '$count Online';
|
||||
}
|
||||
|
||||
@override
|
||||
String get viewInfoLabel => 'View Info';
|
||||
|
||||
@override
|
||||
String get leaveGroupLabel => 'Leave Group';
|
||||
|
||||
@override
|
||||
String get leaveLabel => 'LEAVE';
|
||||
|
||||
@override
|
||||
String get leaveConversationLabel => 'Leave conversation';
|
||||
|
||||
@override
|
||||
String get leaveConversationQuestion =>
|
||||
'Are you sure you want to leave this conversation?';
|
||||
|
||||
@override
|
||||
String get showInChatLabel => 'Show in Chat';
|
||||
|
||||
@override
|
||||
String get saveImageLabel => 'Save Image';
|
||||
|
||||
@override
|
||||
String get saveVideoLabel => 'Save Video';
|
||||
|
||||
@override
|
||||
String get uploadErrorLabel => 'UPLOAD ERROR';
|
||||
|
||||
@override
|
||||
String get giphyLabel => 'Giphy';
|
||||
|
||||
@override
|
||||
String get shuffleLabel => 'Shuffle';
|
||||
|
||||
@override
|
||||
String get sendLabel => 'Send';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user