Merge pull request #48 from GetStream/feat/add-localization-cherry-pick
feat: add localizations
This commit is contained in:
@@ -62,5 +62,10 @@
|
|||||||
<true/>
|
<true/>
|
||||||
<key>UIStatusBarHidden</key>
|
<key>UIStatusBarHidden</key>
|
||||||
<false/>
|
<false/>
|
||||||
|
<key>CFBundleLocalizations</key>
|
||||||
|
<array>
|
||||||
|
<string>en</string>
|
||||||
|
<string>it</string>
|
||||||
|
</array>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
import 'package:example/home_page.dart';
|
import 'package:example/home_page.dart';
|
||||||
|
import 'package:example/localizations.dart';
|
||||||
import 'package:example/routes/routes.dart';
|
import 'package:example/routes/routes.dart';
|
||||||
import 'package:example/stream_version.dart';
|
import 'package:example/stream_version.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
@@ -40,7 +41,7 @@ class _AdvancedOptionsPageState extends State<AdvancedOptionsPage> {
|
|||||||
centerTitle: true,
|
centerTitle: true,
|
||||||
brightness: Theme.of(context).brightness,
|
brightness: Theme.of(context).brightness,
|
||||||
title: Text(
|
title: Text(
|
||||||
'Advanced Options',
|
AppLocalizations.of(context).advancedOptions,
|
||||||
style: StreamChatTheme.of(context).textTheme.headlineBold.copyWith(
|
style: StreamChatTheme.of(context).textTheme.headlineBold.copyWith(
|
||||||
color: StreamChatTheme.of(context).colorTheme.textHighEmphasis),
|
color: StreamChatTheme.of(context).colorTheme.textHighEmphasis),
|
||||||
),
|
),
|
||||||
@@ -74,8 +75,9 @@ class _AdvancedOptionsPageState extends State<AdvancedOptionsPage> {
|
|||||||
validator: (value) {
|
validator: (value) {
|
||||||
if (value!.isEmpty) {
|
if (value!.isEmpty) {
|
||||||
setState(() {
|
setState(() {
|
||||||
_apiKeyError =
|
_apiKeyError = AppLocalizations.of(context)
|
||||||
'Please enter the Chat API Key'.toUpperCase();
|
.apiKeyError
|
||||||
|
.toUpperCase();
|
||||||
});
|
});
|
||||||
return _apiKeyError;
|
return _apiKeyError;
|
||||||
}
|
}
|
||||||
@@ -105,8 +107,8 @@ class _AdvancedOptionsPageState extends State<AdvancedOptionsPage> {
|
|||||||
fillColor: StreamChatTheme.of(context).colorTheme.inputBg,
|
fillColor: StreamChatTheme.of(context).colorTheme.inputBg,
|
||||||
filled: true,
|
filled: true,
|
||||||
labelText: _apiKeyError != null
|
labelText: _apiKeyError != null
|
||||||
? 'CHAT API KEY: $_apiKeyError'
|
? '${AppLocalizations.of(context).chatApiKey.toUpperCase()}: $_apiKeyError'
|
||||||
: 'Chat API Key',
|
: AppLocalizations.of(context).chatApiKey,
|
||||||
),
|
),
|
||||||
textInputAction: TextInputAction.next,
|
textInputAction: TextInputAction.next,
|
||||||
),
|
),
|
||||||
@@ -123,8 +125,9 @@ class _AdvancedOptionsPageState extends State<AdvancedOptionsPage> {
|
|||||||
validator: (value) {
|
validator: (value) {
|
||||||
if (value!.isEmpty) {
|
if (value!.isEmpty) {
|
||||||
setState(() {
|
setState(() {
|
||||||
_userIdError =
|
_userIdError = AppLocalizations.of(context)
|
||||||
'Please enter the User ID'.toUpperCase();
|
.userIdError
|
||||||
|
.toUpperCase();
|
||||||
});
|
});
|
||||||
return _userIdError;
|
return _userIdError;
|
||||||
}
|
}
|
||||||
@@ -155,8 +158,8 @@ class _AdvancedOptionsPageState extends State<AdvancedOptionsPage> {
|
|||||||
fillColor: StreamChatTheme.of(context).colorTheme.inputBg,
|
fillColor: StreamChatTheme.of(context).colorTheme.inputBg,
|
||||||
filled: true,
|
filled: true,
|
||||||
labelText: _userIdError != null
|
labelText: _userIdError != null
|
||||||
? 'USER ID: $_userIdError'
|
? '${AppLocalizations.of(context).userId.toUpperCase()}: $_userIdError'
|
||||||
: 'User ID',
|
: AppLocalizations.of(context).userId,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(height: 8),
|
SizedBox(height: 8),
|
||||||
@@ -172,8 +175,9 @@ class _AdvancedOptionsPageState extends State<AdvancedOptionsPage> {
|
|||||||
validator: (value) {
|
validator: (value) {
|
||||||
if (value!.isEmpty) {
|
if (value!.isEmpty) {
|
||||||
setState(() {
|
setState(() {
|
||||||
_userTokenError =
|
_userTokenError = AppLocalizations.of(context)
|
||||||
'Please enter the user token'.toUpperCase();
|
.userTokenError
|
||||||
|
.toUpperCase();
|
||||||
});
|
});
|
||||||
return _userTokenError;
|
return _userTokenError;
|
||||||
}
|
}
|
||||||
@@ -204,8 +208,8 @@ class _AdvancedOptionsPageState extends State<AdvancedOptionsPage> {
|
|||||||
fillColor: StreamChatTheme.of(context).colorTheme.inputBg,
|
fillColor: StreamChatTheme.of(context).colorTheme.inputBg,
|
||||||
filled: true,
|
filled: true,
|
||||||
labelText: _userTokenError != null
|
labelText: _userTokenError != null
|
||||||
? 'USER TOKEN: $_userTokenError'
|
? '${AppLocalizations.of(context).userToken.toUpperCase()}: $_userTokenError'
|
||||||
: 'User Token',
|
: AppLocalizations.of(context).userToken,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(height: 8),
|
SizedBox(height: 8),
|
||||||
@@ -226,7 +230,7 @@ class _AdvancedOptionsPageState extends State<AdvancedOptionsPage> {
|
|||||||
),
|
),
|
||||||
fillColor: StreamChatTheme.of(context).colorTheme.inputBg,
|
fillColor: StreamChatTheme.of(context).colorTheme.inputBg,
|
||||||
filled: true,
|
filled: true,
|
||||||
labelText: 'Username (optional)',
|
labelText: AppLocalizations.of(context).usernameOptional,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Spacer(),
|
Spacer(),
|
||||||
@@ -248,7 +252,7 @@ class _AdvancedOptionsPageState extends State<AdvancedOptionsPage> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: Text(
|
child: Text(
|
||||||
'Login',
|
AppLocalizations.of(context).login,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
color: Theme.of(context).brightness != Brightness.light
|
color: Theme.of(context).brightness != Brightness.light
|
||||||
@@ -318,7 +322,8 @@ class _AdvancedOptionsPageState extends State<AdvancedOptionsPage> {
|
|||||||
value: userToken,
|
value: userToken,
|
||||||
);
|
);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
var errorText = 'Error connecting, retry';
|
var errorText =
|
||||||
|
AppLocalizations.of(context).errorConnecting;
|
||||||
if (e is Map) {
|
if (e is Map) {
|
||||||
errorText = e['message'] ?? errorText;
|
errorText = e['message'] ?? errorText;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import 'package:example/localizations.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||||
|
|
||||||
@@ -56,7 +57,7 @@ class _ChannelFileDisplayScreenState extends State<ChannelFileDisplayScreen> {
|
|||||||
elevation: 1,
|
elevation: 1,
|
||||||
centerTitle: true,
|
centerTitle: true,
|
||||||
title: Text(
|
title: Text(
|
||||||
'Files',
|
AppLocalizations.of(context).files,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: StreamChatTheme.of(context).colorTheme.textHighEmphasis,
|
color: StreamChatTheme.of(context).colorTheme.textHighEmphasis,
|
||||||
fontSize: 16.0),
|
fontSize: 16.0),
|
||||||
@@ -107,7 +108,7 @@ class _ChannelFileDisplayScreenState extends State<ChannelFileDisplayScreen> {
|
|||||||
),
|
),
|
||||||
SizedBox(height: 16.0),
|
SizedBox(height: 16.0),
|
||||||
Text(
|
Text(
|
||||||
'No Files',
|
AppLocalizations.of(context).noFiles,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 14.0,
|
fontSize: 14.0,
|
||||||
color:
|
color:
|
||||||
@@ -116,7 +117,7 @@ class _ChannelFileDisplayScreenState extends State<ChannelFileDisplayScreen> {
|
|||||||
),
|
),
|
||||||
SizedBox(height: 8.0),
|
SizedBox(height: 8.0),
|
||||||
Text(
|
Text(
|
||||||
'Files sent in this chat will appear here',
|
AppLocalizations.of(context).filesAppearHere,
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 14.0,
|
fontSize: 14.0,
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
|
import 'package:example/localizations.dart';
|
||||||
import 'package:example/routes/routes.dart';
|
import 'package:example/routes/routes.dart';
|
||||||
import 'package:example/search_text_field.dart';
|
import 'package:example/search_text_field.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
@@ -67,6 +68,7 @@ class _ChannelList extends State<ChannelList> {
|
|||||||
child: SearchTextField(
|
child: SearchTextField(
|
||||||
controller: _controller,
|
controller: _controller,
|
||||||
showCloseButton: _isSearchActive,
|
showCloseButton: _isSearchActive,
|
||||||
|
hintText: AppLocalizations.of(context).search,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -109,7 +111,7 @@ class _ChannelList extends State<ChannelList> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
'No results...',
|
AppLocalizations.of(context).noResults,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
|
import 'package:example/localizations.dart';
|
||||||
import 'package:example/routes/routes.dart';
|
import 'package:example/routes/routes.dart';
|
||||||
import 'package:example/user_mentions_page.dart';
|
import 'package:example/user_mentions_page.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
@@ -43,7 +44,7 @@ class _ChannelListPageState extends State<ChannelListPage> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
label: 'Chats',
|
label: AppLocalizations.of(context).chats,
|
||||||
),
|
),
|
||||||
BottomNavigationBarItem(
|
BottomNavigationBarItem(
|
||||||
icon: Stack(
|
icon: Stack(
|
||||||
@@ -56,7 +57,7 @@ class _ChannelListPageState extends State<ChannelListPage> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
label: 'Mentions',
|
label: AppLocalizations.of(context).mentions,
|
||||||
),
|
),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
@@ -192,7 +193,7 @@ class LeftDrawer extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
title: Text(
|
title: Text(
|
||||||
'New direct message',
|
AppLocalizations.of(context).newDirectMessage,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 14.5,
|
fontSize: 14.5,
|
||||||
),
|
),
|
||||||
@@ -212,7 +213,7 @@ class LeftDrawer extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
title: Text(
|
title: Text(
|
||||||
'New group',
|
AppLocalizations.of(context).newGroup,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 14.5,
|
fontSize: 14.5,
|
||||||
),
|
),
|
||||||
@@ -249,7 +250,7 @@ class LeftDrawer extends StatelessWidget {
|
|||||||
.withOpacity(.5),
|
.withOpacity(.5),
|
||||||
),
|
),
|
||||||
title: Text(
|
title: Text(
|
||||||
'Sign out',
|
AppLocalizations.of(context).signOut,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 14.5,
|
fontSize: 14.5,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import 'package:example/localizations.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||||
import 'package:video_player/video_player.dart';
|
import 'package:video_player/video_player.dart';
|
||||||
@@ -65,7 +66,7 @@ class _ChannelMediaDisplayScreenState extends State<ChannelMediaDisplayScreen> {
|
|||||||
elevation: 1,
|
elevation: 1,
|
||||||
centerTitle: true,
|
centerTitle: true,
|
||||||
title: Text(
|
title: Text(
|
||||||
'Photos & Videos',
|
AppLocalizations.of(context).photosAndVideos,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: StreamChatTheme.of(context).colorTheme.textHighEmphasis,
|
color: StreamChatTheme.of(context).colorTheme.textHighEmphasis,
|
||||||
fontSize: 16.0,
|
fontSize: 16.0,
|
||||||
@@ -103,7 +104,7 @@ class _ChannelMediaDisplayScreenState extends State<ChannelMediaDisplayScreen> {
|
|||||||
),
|
),
|
||||||
SizedBox(height: 16.0),
|
SizedBox(height: 16.0),
|
||||||
Text(
|
Text(
|
||||||
'No Media',
|
AppLocalizations.of(context).noMedia,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 14.0,
|
fontSize: 14.0,
|
||||||
color:
|
color:
|
||||||
@@ -112,7 +113,7 @@ class _ChannelMediaDisplayScreenState extends State<ChannelMediaDisplayScreen> {
|
|||||||
),
|
),
|
||||||
SizedBox(height: 8.0),
|
SizedBox(height: 8.0),
|
||||||
Text(
|
Text(
|
||||||
'Photos or video sent in this chat will \nappear here',
|
AppLocalizations.of(context).photosOrVideosWillAppearHere,
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 14.0,
|
fontSize: 14.0,
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import 'package:collection/collection.dart' show IterableExtension;
|
import 'package:collection/collection.dart' show IterableExtension;
|
||||||
|
import 'package:example/localizations.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:jiffy/jiffy.dart';
|
import 'package:jiffy/jiffy.dart';
|
||||||
@@ -149,7 +150,7 @@ class _ChatInfoScreenState extends State<ChatInfoScreen> {
|
|||||||
|
|
||||||
return OptionListTile(
|
return OptionListTile(
|
||||||
tileColor: StreamChatTheme.of(context).colorTheme.appBg,
|
tileColor: StreamChatTheme.of(context).colorTheme.appBg,
|
||||||
title: 'Mute user',
|
title: AppLocalizations.of(context).muteUser,
|
||||||
titleTextStyle: StreamChatTheme.of(context).textTheme.body,
|
titleTextStyle: StreamChatTheme.of(context).textTheme.body,
|
||||||
leading: Padding(
|
leading: Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 22.0),
|
padding: const EdgeInsets.symmetric(horizontal: 22.0),
|
||||||
@@ -201,7 +202,7 @@ class _ChatInfoScreenState extends State<ChatInfoScreen> {
|
|||||||
// onTap: () {},
|
// onTap: () {},
|
||||||
// ),
|
// ),
|
||||||
OptionListTile(
|
OptionListTile(
|
||||||
title: 'Pinned Messages',
|
title: AppLocalizations.of(context).pinnedMessages,
|
||||||
tileColor: StreamChatTheme.of(context).colorTheme.appBg,
|
tileColor: StreamChatTheme.of(context).colorTheme.appBg,
|
||||||
titleTextStyle: StreamChatTheme.of(context).textTheme.body,
|
titleTextStyle: StreamChatTheme.of(context).textTheme.body,
|
||||||
leading: Padding(
|
leading: Padding(
|
||||||
@@ -262,7 +263,7 @@ class _ChatInfoScreenState extends State<ChatInfoScreen> {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
OptionListTile(
|
OptionListTile(
|
||||||
title: 'Photos & Videos',
|
title: AppLocalizations.of(context).photosAndVideos,
|
||||||
tileColor: StreamChatTheme.of(context).colorTheme.appBg,
|
tileColor: StreamChatTheme.of(context).colorTheme.appBg,
|
||||||
titleTextStyle: StreamChatTheme.of(context).textTheme.body,
|
titleTextStyle: StreamChatTheme.of(context).textTheme.body,
|
||||||
leading: Padding(
|
leading: Padding(
|
||||||
@@ -323,7 +324,7 @@ class _ChatInfoScreenState extends State<ChatInfoScreen> {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
OptionListTile(
|
OptionListTile(
|
||||||
title: 'Files',
|
title: AppLocalizations.of(context).files,
|
||||||
tileColor: StreamChatTheme.of(context).colorTheme.appBg,
|
tileColor: StreamChatTheme.of(context).colorTheme.appBg,
|
||||||
titleTextStyle: StreamChatTheme.of(context).textTheme.body,
|
titleTextStyle: StreamChatTheme.of(context).textTheme.body,
|
||||||
leading: Padding(
|
leading: Padding(
|
||||||
@@ -364,7 +365,7 @@ class _ChatInfoScreenState extends State<ChatInfoScreen> {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
OptionListTile(
|
OptionListTile(
|
||||||
title: 'Shared groups',
|
title: AppLocalizations.of(context).sharedGroups,
|
||||||
tileColor: StreamChatTheme.of(context).colorTheme.appBg,
|
tileColor: StreamChatTheme.of(context).colorTheme.appBg,
|
||||||
titleTextStyle: StreamChatTheme.of(context).textTheme.body,
|
titleTextStyle: StreamChatTheme.of(context).textTheme.body,
|
||||||
leading: Padding(
|
leading: Padding(
|
||||||
@@ -416,10 +417,10 @@ class _ChatInfoScreenState extends State<ChatInfoScreen> {
|
|||||||
void _showDeleteDialog() async {
|
void _showDeleteDialog() async {
|
||||||
final res = await showConfirmationDialog(
|
final res = await showConfirmationDialog(
|
||||||
context,
|
context,
|
||||||
title: 'Delete Conversation',
|
title: AppLocalizations.of(context).deleteConversationTitle,
|
||||||
okText: 'DELETE',
|
okText: AppLocalizations.of(context).delete.toUpperCase(),
|
||||||
question: 'Are you sure you want to delete this conversation?',
|
question: AppLocalizations.of(context).deleteConversationAreYouSure,
|
||||||
cancelText: 'CANCEL',
|
cancelText: AppLocalizations.of(context).cancel.toUpperCase(),
|
||||||
icon: StreamSvgIcon.delete(
|
icon: StreamSvgIcon.delete(
|
||||||
color: StreamChatTheme.of(context).colorTheme.accentError,
|
color: StreamChatTheme.of(context).colorTheme.accentError,
|
||||||
),
|
),
|
||||||
@@ -441,7 +442,7 @@ class _ChatInfoScreenState extends State<ChatInfoScreen> {
|
|||||||
if (otherMember != null) {
|
if (otherMember != null) {
|
||||||
if (otherMember.online) {
|
if (otherMember.online) {
|
||||||
alternativeWidget = Text(
|
alternativeWidget = Text(
|
||||||
'Online',
|
AppLocalizations.of(context).online,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: StreamChatTheme.of(context)
|
color: StreamChatTheme.of(context)
|
||||||
.colorTheme
|
.colorTheme
|
||||||
@@ -450,7 +451,7 @@ class _ChatInfoScreenState extends State<ChatInfoScreen> {
|
|||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
alternativeWidget = Text(
|
alternativeWidget = Text(
|
||||||
'Last seen ${Jiffy(otherMember.lastActive).fromNow()}',
|
'${AppLocalizations.of(context).lastSeen} ${Jiffy(otherMember.lastActive).fromNow()}',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: StreamChatTheme.of(context)
|
color: StreamChatTheme.of(context)
|
||||||
.colorTheme
|
.colorTheme
|
||||||
@@ -511,7 +512,7 @@ class __SharedGroupsScreenState extends State<_SharedGroupsScreen> {
|
|||||||
elevation: 1,
|
elevation: 1,
|
||||||
centerTitle: true,
|
centerTitle: true,
|
||||||
title: Text(
|
title: Text(
|
||||||
'Shared Groups',
|
AppLocalizations.of(context).sharedGroups,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: StreamChatTheme.of(context).colorTheme.textHighEmphasis,
|
color: StreamChatTheme.of(context).colorTheme.textHighEmphasis,
|
||||||
fontSize: 16.0),
|
fontSize: 16.0),
|
||||||
@@ -544,7 +545,7 @@ class __SharedGroupsScreenState extends State<_SharedGroupsScreen> {
|
|||||||
),
|
),
|
||||||
SizedBox(height: 16.0),
|
SizedBox(height: 16.0),
|
||||||
Text(
|
Text(
|
||||||
'No Shared Groups',
|
AppLocalizations.of(context).noSharedGroups,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 14.0,
|
fontSize: 14.0,
|
||||||
color: StreamChatTheme.of(context)
|
color: StreamChatTheme.of(context)
|
||||||
@@ -554,7 +555,7 @@ class __SharedGroupsScreenState extends State<_SharedGroupsScreen> {
|
|||||||
),
|
),
|
||||||
SizedBox(height: 8.0),
|
SizedBox(height: 8.0),
|
||||||
Text(
|
Text(
|
||||||
'Group shared with User will appear here.',
|
AppLocalizations.of(context).groupSharedWithUserAppearHere,
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 14.0,
|
fontSize: 14.0,
|
||||||
@@ -602,8 +603,8 @@ class __SharedGroupsScreenState extends State<_SharedGroupsScreen> {
|
|||||||
child: LayoutBuilder(builder: (context, constraints) {
|
child: LayoutBuilder(builder: (context, constraints) {
|
||||||
String? title;
|
String? title;
|
||||||
if (extraData['name'] == null) {
|
if (extraData['name'] == null) {
|
||||||
final otherMembers = members.where(
|
final otherMembers = members.where((member) =>
|
||||||
(member) => member.userId != StreamChat.of(context).currentUser!.id);
|
member.userId != StreamChat.of(context).currentUser!.id);
|
||||||
if (otherMembers.isNotEmpty) {
|
if (otherMembers.isNotEmpty) {
|
||||||
final maxWidth = constraints.maxWidth;
|
final maxWidth = constraints.maxWidth;
|
||||||
final maxChars = maxWidth / textStyle.fontSize!;
|
final maxChars = maxWidth / textStyle.fontSize!;
|
||||||
@@ -649,7 +650,7 @@ class __SharedGroupsScreenState extends State<_SharedGroupsScreen> {
|
|||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
'${channel.memberCount} members',
|
'${channel.memberCount} ${AppLocalizations.of(context).members.toLowerCase()}',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: StreamChatTheme.of(context)
|
color: StreamChatTheme.of(context)
|
||||||
.colorTheme
|
.colorTheme
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import 'package:example/localizations.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||||
|
|
||||||
@@ -75,7 +76,7 @@ class ChipInputTextFieldState<T> extends State<ChipsInputTextField<T>> {
|
|||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.symmetric(vertical: 4.0),
|
padding: const EdgeInsets.symmetric(vertical: 4.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
'TO:',
|
'${AppLocalizations.of(context).to.toUpperCase()}:',
|
||||||
style: StreamChatTheme.of(context)
|
style: StreamChatTheme.of(context)
|
||||||
.textTheme
|
.textTheme
|
||||||
.footnote
|
.footnote
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import 'package:example/app_config.dart';
|
import 'package:example/app_config.dart';
|
||||||
import 'package:example/home_page.dart';
|
import 'package:example/home_page.dart';
|
||||||
|
import 'package:example/localizations.dart';
|
||||||
import 'package:example/stream_version.dart';
|
import 'package:example/stream_version.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
@@ -41,12 +42,12 @@ class ChooseUserPage extends StatelessWidget {
|
|||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(bottom: 13.0),
|
padding: const EdgeInsets.only(bottom: 13.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
'Welcome to Stream Chat',
|
AppLocalizations.of(context).welcomeToStreamChat,
|
||||||
style: StreamChatTheme.of(context).textTheme.title,
|
style: StreamChatTheme.of(context).textTheme.title,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
'Select a user to try the Flutter SDK:',
|
'${AppLocalizations.of(context).selectUserToTryFlutterSDK}:',
|
||||||
style: StreamChatTheme.of(context).textTheme.body,
|
style: StreamChatTheme.of(context).textTheme.body,
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
@@ -135,7 +136,7 @@ class ChooseUserPage extends StatelessWidget {
|
|||||||
StreamChatTheme.of(context).textTheme.bodyBold,
|
StreamChatTheme.of(context).textTheme.bodyBold,
|
||||||
),
|
),
|
||||||
subtitle: Text(
|
subtitle: Text(
|
||||||
'Stream test account',
|
AppLocalizations.of(context).streamTestAccount,
|
||||||
style: StreamChatTheme.of(context)
|
style: StreamChatTheme.of(context)
|
||||||
.textTheme
|
.textTheme
|
||||||
.footnote
|
.footnote
|
||||||
@@ -166,11 +167,11 @@ class ChooseUserPage extends StatelessWidget {
|
|||||||
StreamChatTheme.of(context).colorTheme.borders,
|
StreamChatTheme.of(context).colorTheme.borders,
|
||||||
),
|
),
|
||||||
title: Text(
|
title: Text(
|
||||||
'Advanced Options',
|
AppLocalizations.of(context).advancedOptions,
|
||||||
style: StreamChatTheme.of(context).textTheme.bodyBold,
|
style: StreamChatTheme.of(context).textTheme.bodyBold,
|
||||||
),
|
),
|
||||||
subtitle: Text(
|
subtitle: Text(
|
||||||
'Custom settings',
|
AppLocalizations.of(context).customSettings,
|
||||||
style: StreamChatTheme.of(context)
|
style: StreamChatTheme.of(context)
|
||||||
.textTheme
|
.textTheme
|
||||||
.footnote
|
.footnote
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import 'package:example/localizations.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||||
import 'package:uuid/uuid.dart';
|
import 'package:uuid/uuid.dart';
|
||||||
@@ -66,7 +67,7 @@ class _GroupChatDetailsScreenState extends State<GroupChatDetailsScreen> {
|
|||||||
backgroundColor: StreamChatTheme.of(context).colorTheme.barsBg,
|
backgroundColor: StreamChatTheme.of(context).colorTheme.barsBg,
|
||||||
leading: const StreamBackButton(),
|
leading: const StreamBackButton(),
|
||||||
title: Text(
|
title: Text(
|
||||||
'Name of Group Chat',
|
AppLocalizations.of(context).nameOfGroupChat,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: StreamChatTheme.of(context).colorTheme.textHighEmphasis,
|
color: StreamChatTheme.of(context).colorTheme.textHighEmphasis,
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
@@ -80,7 +81,7 @@ class _GroupChatDetailsScreenState extends State<GroupChatDetailsScreen> {
|
|||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'NAME',
|
AppLocalizations.of(context).name.toUpperCase(),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
color: StreamChatTheme.of(context)
|
color: StreamChatTheme.of(context)
|
||||||
@@ -100,7 +101,8 @@ class _GroupChatDetailsScreenState extends State<GroupChatDetailsScreen> {
|
|||||||
errorBorder: InputBorder.none,
|
errorBorder: InputBorder.none,
|
||||||
disabledBorder: InputBorder.none,
|
disabledBorder: InputBorder.none,
|
||||||
contentPadding: const EdgeInsets.all(0),
|
contentPadding: const EdgeInsets.all(0),
|
||||||
hintText: 'Choose a group chat name',
|
hintText:
|
||||||
|
AppLocalizations.of(context).chooseAGroupChatName,
|
||||||
hintStyle: TextStyle(
|
hintStyle: TextStyle(
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
color: StreamChatTheme.of(context)
|
color: StreamChatTheme.of(context)
|
||||||
@@ -161,14 +163,14 @@ class _GroupChatDetailsScreenState extends State<GroupChatDetailsScreen> {
|
|||||||
|
|
||||||
switch (status) {
|
switch (status) {
|
||||||
case ConnectionStatus.connected:
|
case ConnectionStatus.connected:
|
||||||
statusString = 'Connected';
|
statusString = AppLocalizations.of(context).connected;
|
||||||
showStatus = false;
|
showStatus = false;
|
||||||
break;
|
break;
|
||||||
case ConnectionStatus.connecting:
|
case ConnectionStatus.connecting:
|
||||||
statusString = 'Reconnecting...';
|
statusString = AppLocalizations.of(context).reconnecting;
|
||||||
break;
|
break;
|
||||||
case ConnectionStatus.disconnected:
|
case ConnectionStatus.disconnected:
|
||||||
statusString = 'Disconnected';
|
statusString = AppLocalizations.of(context).disconnected;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return InfoTile(
|
return InfoTile(
|
||||||
@@ -190,7 +192,7 @@ class _GroupChatDetailsScreenState extends State<GroupChatDetailsScreen> {
|
|||||||
horizontal: 8,
|
horizontal: 8,
|
||||||
),
|
),
|
||||||
child: Text(
|
child: Text(
|
||||||
'$_totalUsers ${_totalUsers > 1 ? 'Members' : 'Member'}',
|
'$_totalUsers ${_totalUsers > 1 ? AppLocalizations.of(context).members : AppLocalizations.of(context).member}',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: StreamChatTheme.of(context)
|
color: StreamChatTheme.of(context)
|
||||||
.colorTheme
|
.colorTheme
|
||||||
@@ -293,13 +295,13 @@ class _GroupChatDetailsScreenState extends State<GroupChatDetailsScreen> {
|
|||||||
height: 26.0,
|
height: 26.0,
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
'Something went wrong',
|
AppLocalizations.of(context).somethingWentWrongErrorMessage,
|
||||||
style: StreamChatTheme.of(context).textTheme.headlineBold,
|
style: StreamChatTheme.of(context).textTheme.headlineBold,
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 7.0,
|
height: 7.0,
|
||||||
),
|
),
|
||||||
Text('The operation couldn\'t be completed.'),
|
Text(AppLocalizations.of(context).operationCouldNotBeCompleted),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 36.0,
|
height: 36.0,
|
||||||
),
|
),
|
||||||
@@ -315,7 +317,7 @@ class _GroupChatDetailsScreenState extends State<GroupChatDetailsScreen> {
|
|||||||
children: [
|
children: [
|
||||||
TextButton(
|
TextButton(
|
||||||
child: Text(
|
child: Text(
|
||||||
'OK',
|
AppLocalizations.of(context).ok,
|
||||||
style: StreamChatTheme.of(context)
|
style: StreamChatTheme.of(context)
|
||||||
.textTheme
|
.textTheme
|
||||||
.bodyBold
|
.bodyBold
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:collection/collection.dart' show IterableExtension;
|
import 'package:collection/collection.dart' show IterableExtension;
|
||||||
|
import 'package:example/localizations.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:jiffy/jiffy.dart';
|
import 'package:jiffy/jiffy.dart';
|
||||||
import 'package:stream_chat_flutter/src/option_list_tile.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/stream_chat_flutter.dart';
|
||||||
|
|
||||||
import 'channel_file_display_screen.dart';
|
import 'channel_file_display_screen.dart';
|
||||||
@@ -106,7 +105,7 @@ class _GroupInfoScreenState extends State<GroupInfoScreen> {
|
|||||||
builder: (context, state) {
|
builder: (context, state) {
|
||||||
if (!state.hasData) {
|
if (!state.hasData) {
|
||||||
return Text(
|
return Text(
|
||||||
'Loading...',
|
AppLocalizations.of(context).loading,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: StreamChatTheme.of(context)
|
color: StreamChatTheme.of(context)
|
||||||
.colorTheme
|
.colorTheme
|
||||||
@@ -139,7 +138,7 @@ class _GroupInfoScreenState extends State<GroupInfoScreen> {
|
|||||||
height: 3.0,
|
height: 3.0,
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
'${channel.channel.memberCount} Members, ${snapshot.data?.where((e) => e.user!.online).length ?? 0} Online',
|
'${channel.channel.memberCount} ${AppLocalizations.of(context).members}, ${snapshot.data?.where((e) => e.user!.online).length ?? 0} ${AppLocalizations.of(context).online}',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: StreamChatTheme.of(context)
|
color: StreamChatTheme.of(context)
|
||||||
.colorTheme
|
.colorTheme
|
||||||
@@ -260,7 +259,9 @@ class _GroupInfoScreenState extends State<GroupInfoScreen> {
|
|||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
member.role == 'owner' ? 'Owner' : '',
|
member.role == 'owner'
|
||||||
|
? AppLocalizations.of(context).owner
|
||||||
|
: '',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: StreamChatTheme.of(context)
|
color: StreamChatTheme.of(context)
|
||||||
.colorTheme
|
.colorTheme
|
||||||
@@ -313,7 +314,7 @@ class _GroupInfoScreenState extends State<GroupInfoScreen> {
|
|||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'${members.length - groupMembersLength} more',
|
'${members.length - groupMembersLength} ${AppLocalizations.of(context).more}',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: StreamChatTheme.of(context)
|
color: StreamChatTheme.of(context)
|
||||||
.colorTheme
|
.colorTheme
|
||||||
@@ -352,7 +353,7 @@ class _GroupInfoScreenState extends State<GroupInfoScreen> {
|
|||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.all(7.0),
|
padding: const EdgeInsets.all(7.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
'NAME',
|
AppLocalizations.of(context).name.toUpperCase(),
|
||||||
style: StreamChatTheme.of(context).textTheme.footnote.copyWith(
|
style: StreamChatTheme.of(context).textTheme.footnote.copyWith(
|
||||||
color: StreamChatTheme.of(context)
|
color: StreamChatTheme.of(context)
|
||||||
.colorTheme
|
.colorTheme
|
||||||
@@ -370,7 +371,7 @@ class _GroupInfoScreenState extends State<GroupInfoScreen> {
|
|||||||
cursorColor:
|
cursorColor:
|
||||||
StreamChatTheme.of(context).colorTheme.textHighEmphasis,
|
StreamChatTheme.of(context).colorTheme.textHighEmphasis,
|
||||||
decoration: InputDecoration.collapsed(
|
decoration: InputDecoration.collapsed(
|
||||||
hintText: 'Add a group name',
|
hintText: AppLocalizations.of(context).addAGroupName,
|
||||||
hintStyle: StreamChatTheme.of(context)
|
hintStyle: StreamChatTheme.of(context)
|
||||||
.textTheme
|
.textTheme
|
||||||
.bodyBold
|
.bodyBold
|
||||||
@@ -457,7 +458,7 @@ class _GroupInfoScreenState extends State<GroupInfoScreen> {
|
|||||||
return OptionListTile(
|
return OptionListTile(
|
||||||
tileColor: StreamChatTheme.of(context).colorTheme.appBg,
|
tileColor: StreamChatTheme.of(context).colorTheme.appBg,
|
||||||
separatorColor: StreamChatTheme.of(context).colorTheme.disabled,
|
separatorColor: StreamChatTheme.of(context).colorTheme.disabled,
|
||||||
title: 'Mute group',
|
title: AppLocalizations.of(context).muteGroup,
|
||||||
titleTextStyle: StreamChatTheme.of(context).textTheme.body,
|
titleTextStyle: StreamChatTheme.of(context).textTheme.body,
|
||||||
leading: Padding(
|
leading: Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16.0),
|
padding: const EdgeInsets.symmetric(horizontal: 16.0),
|
||||||
@@ -491,7 +492,7 @@ class _GroupInfoScreenState extends State<GroupInfoScreen> {
|
|||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
OptionListTile(
|
OptionListTile(
|
||||||
title: 'Pinned Messages',
|
title: AppLocalizations.of(context).pinnedMessages,
|
||||||
tileColor: StreamChatTheme.of(context).colorTheme.appBg,
|
tileColor: StreamChatTheme.of(context).colorTheme.appBg,
|
||||||
titleTextStyle: StreamChatTheme.of(context).textTheme.body,
|
titleTextStyle: StreamChatTheme.of(context).textTheme.body,
|
||||||
leading: Padding(
|
leading: Padding(
|
||||||
@@ -554,7 +555,7 @@ class _GroupInfoScreenState extends State<GroupInfoScreen> {
|
|||||||
OptionListTile(
|
OptionListTile(
|
||||||
tileColor: StreamChatTheme.of(context).colorTheme.appBg,
|
tileColor: StreamChatTheme.of(context).colorTheme.appBg,
|
||||||
separatorColor: StreamChatTheme.of(context).colorTheme.disabled,
|
separatorColor: StreamChatTheme.of(context).colorTheme.disabled,
|
||||||
title: 'Photos & Videos',
|
title: AppLocalizations.of(context).photosAndVideos,
|
||||||
titleTextStyle: StreamChatTheme.of(context).textTheme.body,
|
titleTextStyle: StreamChatTheme.of(context).textTheme.body,
|
||||||
leading: Padding(
|
leading: Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 12.0),
|
padding: const EdgeInsets.symmetric(horizontal: 12.0),
|
||||||
@@ -616,7 +617,7 @@ class _GroupInfoScreenState extends State<GroupInfoScreen> {
|
|||||||
OptionListTile(
|
OptionListTile(
|
||||||
tileColor: StreamChatTheme.of(context).colorTheme.appBg,
|
tileColor: StreamChatTheme.of(context).colorTheme.appBg,
|
||||||
separatorColor: StreamChatTheme.of(context).colorTheme.disabled,
|
separatorColor: StreamChatTheme.of(context).colorTheme.disabled,
|
||||||
title: 'Files',
|
title: AppLocalizations.of(context).files,
|
||||||
titleTextStyle: StreamChatTheme.of(context).textTheme.body,
|
titleTextStyle: StreamChatTheme.of(context).textTheme.body,
|
||||||
leading: Padding(
|
leading: Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 12.0),
|
padding: const EdgeInsets.symmetric(horizontal: 12.0),
|
||||||
@@ -659,7 +660,7 @@ class _GroupInfoScreenState extends State<GroupInfoScreen> {
|
|||||||
OptionListTile(
|
OptionListTile(
|
||||||
tileColor: StreamChatTheme.of(context).colorTheme.appBg,
|
tileColor: StreamChatTheme.of(context).colorTheme.appBg,
|
||||||
separatorColor: StreamChatTheme.of(context).colorTheme.disabled,
|
separatorColor: StreamChatTheme.of(context).colorTheme.disabled,
|
||||||
title: 'Leave Group',
|
title: AppLocalizations.of(context).leaveGroup,
|
||||||
titleTextStyle: StreamChatTheme.of(context).textTheme.body,
|
titleTextStyle: StreamChatTheme.of(context).textTheme.body,
|
||||||
leading: Padding(
|
leading: Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16.0),
|
padding: const EdgeInsets.symmetric(horizontal: 16.0),
|
||||||
@@ -678,10 +679,11 @@ class _GroupInfoScreenState extends State<GroupInfoScreen> {
|
|||||||
onTap: () async {
|
onTap: () async {
|
||||||
final res = await showConfirmationDialog(
|
final res = await showConfirmationDialog(
|
||||||
context,
|
context,
|
||||||
title: 'Leave conversation',
|
title: AppLocalizations.of(context).leaveConversation,
|
||||||
okText: 'LEAVE',
|
okText: AppLocalizations.of(context).leave.toUpperCase(),
|
||||||
question: 'Are you sure you want to leave this conversation?',
|
question:
|
||||||
cancelText: 'CANCEL',
|
AppLocalizations.of(context).leaveConversationAreYouSure,
|
||||||
|
cancelText: AppLocalizations.of(context).cancel.toUpperCase(),
|
||||||
icon: StreamSvgIcon.userRemove(
|
icon: StreamSvgIcon.userRemove(
|
||||||
color: StreamChatTheme.of(context).colorTheme.accentError,
|
color: StreamChatTheme.of(context).colorTheme.accentError,
|
||||||
),
|
),
|
||||||
@@ -777,8 +779,8 @@ class _GroupInfoScreenState extends State<GroupInfoScreen> {
|
|||||||
.textLowEmphasis,
|
.textLowEmphasis,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Text(
|
Text(AppLocalizations.of(context)
|
||||||
'No user matches these keywords...'),
|
.noUserMatchesTheseKeywords),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -815,7 +817,7 @@ class _GroupInfoScreenState extends State<GroupInfoScreen> {
|
|||||||
cursorColor: theme.colorTheme.textHighEmphasis,
|
cursorColor: theme.colorTheme.textHighEmphasis,
|
||||||
autofocus: true,
|
autofocus: true,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
hintText: 'Search',
|
hintText: AppLocalizations.of(context).search,
|
||||||
hintStyle: theme.textTheme.body.copyWith(
|
hintStyle: theme.textTheme.body.copyWith(
|
||||||
color: theme.colorTheme.textLowEmphasis,
|
color: theme.colorTheme.textLowEmphasis,
|
||||||
),
|
),
|
||||||
@@ -916,7 +918,7 @@ class _GroupInfoScreenState extends State<GroupInfoScreen> {
|
|||||||
.textLowEmphasis,
|
.textLowEmphasis,
|
||||||
size: 24.0,
|
size: 24.0,
|
||||||
),
|
),
|
||||||
'View info',
|
AppLocalizations.of(context).viewInfo,
|
||||||
() async {
|
() async {
|
||||||
var client = StreamChat.of(context).client;
|
var client = StreamChat.of(context).client;
|
||||||
|
|
||||||
@@ -952,7 +954,7 @@ class _GroupInfoScreenState extends State<GroupInfoScreen> {
|
|||||||
.textLowEmphasis,
|
.textLowEmphasis,
|
||||||
size: 24.0,
|
size: 24.0,
|
||||||
),
|
),
|
||||||
'Message',
|
AppLocalizations.of(context).message,
|
||||||
() async {
|
() async {
|
||||||
var client = StreamChat.of(context).client;
|
var client = StreamChat.of(context).client;
|
||||||
|
|
||||||
@@ -999,14 +1001,16 @@ class _GroupInfoScreenState extends State<GroupInfoScreen> {
|
|||||||
.accentError,
|
.accentError,
|
||||||
size: 24.0,
|
size: 24.0,
|
||||||
),
|
),
|
||||||
'Remove From Group', () async {
|
AppLocalizations.of(context).removeFromGroup, () async {
|
||||||
final res = await showConfirmationDialog(
|
final res = await showConfirmationDialog(
|
||||||
context,
|
context,
|
||||||
title: 'Remove member',
|
title: AppLocalizations.of(context).removeMember,
|
||||||
okText: 'REMOVE',
|
okText:
|
||||||
|
AppLocalizations.of(context).remove.toUpperCase(),
|
||||||
question:
|
question:
|
||||||
'Are you sure you want to remove this member?',
|
AppLocalizations.of(context).removeMemberAreYouSure,
|
||||||
cancelText: 'CANCEL',
|
cancelText:
|
||||||
|
AppLocalizations.of(context).cancel.toUpperCase(),
|
||||||
);
|
);
|
||||||
|
|
||||||
if (res == true) {
|
if (res == true) {
|
||||||
@@ -1024,7 +1028,7 @@ class _GroupInfoScreenState extends State<GroupInfoScreen> {
|
|||||||
.textLowEmphasis,
|
.textLowEmphasis,
|
||||||
size: 24.0,
|
size: 24.0,
|
||||||
),
|
),
|
||||||
'Cancel', () {
|
AppLocalizations.of(context).cancel, () {
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
@@ -1050,7 +1054,7 @@ class _GroupInfoScreenState extends State<GroupInfoScreen> {
|
|||||||
if (otherMember != null) {
|
if (otherMember != null) {
|
||||||
if (otherMember.online) {
|
if (otherMember.online) {
|
||||||
alternativeWidget = Text(
|
alternativeWidget = Text(
|
||||||
'Online',
|
AppLocalizations.of(context).online,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: StreamChatTheme.of(context)
|
color: StreamChatTheme.of(context)
|
||||||
.colorTheme
|
.colorTheme
|
||||||
@@ -1059,7 +1063,7 @@ class _GroupInfoScreenState extends State<GroupInfoScreen> {
|
|||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
alternativeWidget = Text(
|
alternativeWidget = Text(
|
||||||
'Last seen ${Jiffy(otherMember.lastActive).fromNow()}',
|
'${AppLocalizations.of(context).lastSeen} ${Jiffy(otherMember.lastActive).fromNow()}',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: StreamChatTheme.of(context)
|
color: StreamChatTheme.of(context)
|
||||||
.colorTheme
|
.colorTheme
|
||||||
@@ -1139,7 +1143,7 @@ class _GroupInfoScreenState extends State<GroupInfoScreen> {
|
|||||||
title =
|
title =
|
||||||
'${currentMembers.map((e) => e.user!.name).join(', ')} ${exceedingMembers > 0 ? '+ $exceedingMembers' : ''}';
|
'${currentMembers.map((e) => e.user!.name).join(', ')} ${exceedingMembers > 0 ? '+ $exceedingMembers' : ''}';
|
||||||
} else {
|
} else {
|
||||||
title = 'No title';
|
title = AppLocalizations.of(context).noTitle;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
title = extraData['name'];
|
title = extraData['name'];
|
||||||
@@ -1149,9 +1153,9 @@ class _GroupInfoScreenState extends State<GroupInfoScreen> {
|
|||||||
|
|
||||||
String _getLastSeen(User user) {
|
String _getLastSeen(User user) {
|
||||||
if (user.online) {
|
if (user.online) {
|
||||||
return 'Online';
|
return AppLocalizations.of(context).online;
|
||||||
} else {
|
} else {
|
||||||
return 'Last seen ${Jiffy(user.lastActive).fromNow()}';
|
return '${AppLocalizations.of(context).lastSeen} ${Jiffy(user.lastActive).fromNow()}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,558 @@
|
|||||||
|
import 'package:flutter/foundation.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class AppLocalizations {
|
||||||
|
static const _localizedValues = <String, Map<String, String>>{
|
||||||
|
'en': {
|
||||||
|
'add_a_group_name': 'Add a group name',
|
||||||
|
'add_group_members': 'Add Group Members',
|
||||||
|
'advanced_options': 'Advanced Options',
|
||||||
|
'api_key_error': 'Please enter the Chat API Key',
|
||||||
|
'attachment': 'attachment',
|
||||||
|
'attachments': 'attachments',
|
||||||
|
'cancel': 'Cancel',
|
||||||
|
'chat_api_key': 'Chat API Key',
|
||||||
|
'chats': 'Chats',
|
||||||
|
'choose_a_group_chat_name': 'Choose a group chat name',
|
||||||
|
'connected': 'Connected',
|
||||||
|
'create_a_group': 'Create a Group',
|
||||||
|
'custom_settings': 'Custom settings',
|
||||||
|
'delete': 'Delete',
|
||||||
|
'delete_conversation_are_you_sure':
|
||||||
|
'Are you sure you want to delete this conversation?',
|
||||||
|
'delete_conversation_title': 'Delete Conversation',
|
||||||
|
'disconnected': 'Disconnected',
|
||||||
|
'error_connecting': 'Error connecting, retry',
|
||||||
|
'files': 'Files',
|
||||||
|
'files_appear_here': 'Files sent in this chat will appear here',
|
||||||
|
'group_shared_with_user_appear_here':
|
||||||
|
'Group shared with User will appear here.',
|
||||||
|
'last_seen': 'Last seen',
|
||||||
|
'leave': 'Leave',
|
||||||
|
'leave_conversation': 'Leave conversation',
|
||||||
|
'leave_conversation_are_you_sure':
|
||||||
|
'Are you sure you want to leave this conversation?',
|
||||||
|
'leave_group': 'Leave Group',
|
||||||
|
'loading': 'Loading...',
|
||||||
|
'login': 'Login',
|
||||||
|
'long_press_message': 'Long-press an important message and\nchoose',
|
||||||
|
'matches_for': 'Matches for',
|
||||||
|
'member': 'Member',
|
||||||
|
'members': 'Members',
|
||||||
|
'mentions': 'Mentions',
|
||||||
|
'message': 'Message',
|
||||||
|
'message_channel_description': 'Channel used for showing messages',
|
||||||
|
'message_channel_name': 'Message channel',
|
||||||
|
'more': 'more',
|
||||||
|
'mute_group': 'Mute group',
|
||||||
|
'mute_user': 'Mute user',
|
||||||
|
'name': 'Name',
|
||||||
|
'name_of_group_chat': 'Name of Group Chat',
|
||||||
|
'new_chat': 'New Chat',
|
||||||
|
'new_direct_message': 'New direct message',
|
||||||
|
'new_group': 'New group',
|
||||||
|
'no_chats_here_yet': 'No chats here yet...',
|
||||||
|
'no_files': 'No Files',
|
||||||
|
'no_media': 'No Media',
|
||||||
|
'no_mentions_exist_yet': 'No mentions exist yet...',
|
||||||
|
'no_pinned_items': 'No pinned items',
|
||||||
|
'no_results': 'No results...',
|
||||||
|
'no_shared_groups': 'No Shared Groups',
|
||||||
|
'no_title': 'No title',
|
||||||
|
'no_user_matches_these_keywords': 'No user matches these keywords...',
|
||||||
|
'ok': 'OK',
|
||||||
|
'online': 'Online',
|
||||||
|
'on_the_platform': 'On the platform',
|
||||||
|
'operation_could_not_be_completed':
|
||||||
|
'The operation couldn\'t be completed.',
|
||||||
|
'owner': 'Owner',
|
||||||
|
'photos_and_videos': 'Photos & Videos',
|
||||||
|
'photos_or_videos_will_appear_here':
|
||||||
|
'Photos or videos sent in this chat will \nappear here',
|
||||||
|
'pinned_messages': 'Pinned Messages',
|
||||||
|
'pin_to_conversation': 'Pin to conversation',
|
||||||
|
'reconnecting': 'Reconnecting...',
|
||||||
|
'remove': 'Remove',
|
||||||
|
'remove_from_group': 'Remove From Group',
|
||||||
|
'remove_member': 'Remove member',
|
||||||
|
'remove_member_are_you_sure':
|
||||||
|
'Are you sure you want to remove this member?',
|
||||||
|
'search': 'Search',
|
||||||
|
'select_user_to_try_flutter_sdk': 'Select a user to try the Flutter SDK',
|
||||||
|
'shared_groups': 'Shared Groups',
|
||||||
|
'sign_out': 'Sign out',
|
||||||
|
'something_went_wrong_error_message': 'Something went wrong',
|
||||||
|
'stream_sdk': 'Stream SDK',
|
||||||
|
'stream_test_account': 'Stream test account',
|
||||||
|
'to': 'To',
|
||||||
|
'type_a_name_hint': 'Type a name',
|
||||||
|
'user_id': 'User ID',
|
||||||
|
'user_id_error': 'Please enter the User ID',
|
||||||
|
'username_optional': 'Username (optional)',
|
||||||
|
'user_token': 'User Token',
|
||||||
|
'user_token_error': 'Please enter the user token',
|
||||||
|
'view_info': 'View info',
|
||||||
|
'welcome_to_stream_chat': 'Welcome to Stream Chat',
|
||||||
|
},
|
||||||
|
'it': {
|
||||||
|
'add_a_group_name': 'Aggiungi un nome al gruppo',
|
||||||
|
'add_group_members': 'Aggiungi un membro',
|
||||||
|
'advanced_options': 'Opzioni Avanzate',
|
||||||
|
'api_key_error': 'Per favore inserisci l\'API Key',
|
||||||
|
'attachment': 'allegato',
|
||||||
|
'attachments': 'allegati',
|
||||||
|
'cancel': 'Annulla',
|
||||||
|
'chat_api_key': 'Chat API Key',
|
||||||
|
'chats': 'Conversazioni',
|
||||||
|
'choose_a_group_chat_name': 'Scegli un nome per il gruppo',
|
||||||
|
'connected': 'Connesso',
|
||||||
|
'create_a_group': 'Crea un Gruppo',
|
||||||
|
'custom_settings': 'Opzioni Personalizzate',
|
||||||
|
'delete': 'Cancella',
|
||||||
|
'delete_conversation_are_you_sure':
|
||||||
|
'Sei sicuro di voler eliminare la conversazione?',
|
||||||
|
'delete_conversation_title': 'Elimina Conversazione',
|
||||||
|
'disconnected': 'Disconnesso',
|
||||||
|
'error_connecting': 'Errore durante la connessione, riprova',
|
||||||
|
'files': 'File',
|
||||||
|
'files_appear_here': 'I file inviati in questa chat compariranno qui',
|
||||||
|
'group_shared_with_user_appear_here':
|
||||||
|
'I gruppi in comune con quest\'utente compariranno qui',
|
||||||
|
'last_seen': 'Ultimo accesso',
|
||||||
|
'leave': 'Lascia',
|
||||||
|
'leave_conversation': 'Lascia conversazione',
|
||||||
|
'leave_conversation_are_you_sure':
|
||||||
|
'Sei sicuro di voler lasciare questa conversazione?',
|
||||||
|
'leave_group': 'Lascia Gruppo',
|
||||||
|
'loading': 'Caricamento...',
|
||||||
|
'login': 'Login',
|
||||||
|
'long_press_message': 'Premi a lungo su un messaggio importante e scegli',
|
||||||
|
'matches_for': 'Risultati per',
|
||||||
|
'member': 'Membro',
|
||||||
|
'members': 'Membri',
|
||||||
|
'mentions': 'Menzioni',
|
||||||
|
'message': 'Messaggi',
|
||||||
|
'message_channel_description': 'Canale usato per mostrare i messaggi',
|
||||||
|
'message_channel_name': 'Invia un messaggio al canale',
|
||||||
|
'more': 'altro',
|
||||||
|
'mute_group': 'Silenzia gruppo',
|
||||||
|
'mute_user': 'Silenzia utente',
|
||||||
|
'name': 'Nome',
|
||||||
|
'name_of_group_chat': 'Nome del gruppo',
|
||||||
|
'new_chat': 'Nuova conversazione',
|
||||||
|
'new_direct_message': 'Nuovo messaggio diretto',
|
||||||
|
'new_group': 'Nuovo gruppo',
|
||||||
|
'no_chats_here_yet': 'Ancora nessun messaggio...',
|
||||||
|
'no_files': 'Nessun File',
|
||||||
|
'no_media': 'Nessun Media',
|
||||||
|
'no_mentions_exist_yet': 'Ancora nessuna menzione...',
|
||||||
|
'no_pinned_items': 'Nessun messaggio in evidenza',
|
||||||
|
'no_results': 'Nessun risultato...',
|
||||||
|
'no_shared_groups': 'Nessun gruppo in comune',
|
||||||
|
'no_title': 'Nessun titolo',
|
||||||
|
'no_user_matches_these_keywords': 'Nessun utente per questa ricerca...',
|
||||||
|
'ok': 'OK',
|
||||||
|
'online': 'Online',
|
||||||
|
'on_the_platform': 'Sulla piattaforma',
|
||||||
|
'operation_could_not_be_completed':
|
||||||
|
'Non é stato possibile completare l\'operazione.',
|
||||||
|
'owner': 'Proprietario',
|
||||||
|
'photos_and_videos': 'Foto & Video',
|
||||||
|
'photos_or_videos_will_appear_here':
|
||||||
|
'Foto or video inviati in questa chat \ncompariranno qui',
|
||||||
|
'pinned_messages': 'Messaggi in evidenza',
|
||||||
|
'pin_to_conversation': 'Metti in evidenza',
|
||||||
|
'reconnecting': 'Riconnessione...',
|
||||||
|
'remove': 'Rimuovi',
|
||||||
|
'remove_from_group': 'Rimuovi Dal Gruppo',
|
||||||
|
'remove_member': 'Rimuovi membro',
|
||||||
|
'remove_member_are_you_sure':
|
||||||
|
'Sei sicuro di voler rimuovere questo membro?',
|
||||||
|
'search': 'Cerca',
|
||||||
|
'select_user_to_try_flutter_sdk':
|
||||||
|
'Selezione un utente per provare l\'SDK Flutter',
|
||||||
|
'shared_groups': 'Gruppi in comune',
|
||||||
|
'sign_out': 'Sign out',
|
||||||
|
'something_went_wrong_error_message': 'Qualcosa é andato storto',
|
||||||
|
'stream_sdk': 'Stream SDK',
|
||||||
|
'stream_test_account': 'Account di test',
|
||||||
|
'to': 'A',
|
||||||
|
'type_a_name_hint': 'Scrivi un nome',
|
||||||
|
'user_id': 'User ID',
|
||||||
|
'user_id_error': 'Per favore inserisci l\'ID dell\'utente',
|
||||||
|
'username_optional': 'Username (opzionale)',
|
||||||
|
'user_token': 'Token Utente',
|
||||||
|
'user_token_error': 'Per favore inserisci il token',
|
||||||
|
'view_info': 'Vedi info',
|
||||||
|
'welcome_to_stream_chat': 'Benvenuto in Stream Chat',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
final Locale locale;
|
||||||
|
|
||||||
|
AppLocalizations(this.locale);
|
||||||
|
|
||||||
|
String get addAGroupName {
|
||||||
|
return _localizedValues[locale.languageCode]!['add_a_group_name']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get addGroupMembers {
|
||||||
|
return _localizedValues[locale.languageCode]!['add_group_members']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get advancedOptions {
|
||||||
|
return _localizedValues[locale.languageCode]!['advanced_options']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get apiKeyError {
|
||||||
|
return _localizedValues[locale.languageCode]!['api_key_error']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get attachment {
|
||||||
|
return _localizedValues[locale.languageCode]!['attachment']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get attachments {
|
||||||
|
return _localizedValues[locale.languageCode]!['attachments']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get cancel {
|
||||||
|
return _localizedValues[locale.languageCode]!['cancel']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get chatApiKey {
|
||||||
|
return _localizedValues[locale.languageCode]!['chat_api_key']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get chats {
|
||||||
|
return _localizedValues[locale.languageCode]!['chats']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get chooseAGroupChatName {
|
||||||
|
return _localizedValues[locale.languageCode]!['choose_a_group_chat_name']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get connected {
|
||||||
|
return _localizedValues[locale.languageCode]!['connected']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get createAGroup {
|
||||||
|
return _localizedValues[locale.languageCode]!['create_a_group']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get customSettings {
|
||||||
|
return _localizedValues[locale.languageCode]!['custom_settings']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get delete {
|
||||||
|
return _localizedValues[locale.languageCode]!['delete']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get deleteConversationAreYouSure {
|
||||||
|
return _localizedValues[locale.languageCode]![
|
||||||
|
'delete_conversation_are_you_sure']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get deleteConversationTitle {
|
||||||
|
return _localizedValues[locale.languageCode]!['delete_conversation_title']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get disconnected {
|
||||||
|
return _localizedValues[locale.languageCode]!['disconnected']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get errorConnecting {
|
||||||
|
return _localizedValues[locale.languageCode]!['error_connecting']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get files {
|
||||||
|
return _localizedValues[locale.languageCode]!['files']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get filesAppearHere {
|
||||||
|
return _localizedValues[locale.languageCode]!['files_appear_here']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get groupSharedWithUserAppearHere {
|
||||||
|
return _localizedValues[locale.languageCode]![
|
||||||
|
'group_shared_with_user_appear_here']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get lastSeen {
|
||||||
|
return _localizedValues[locale.languageCode]!['last_seen']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get leave {
|
||||||
|
return _localizedValues[locale.languageCode]!['leave']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get leaveConversation {
|
||||||
|
return _localizedValues[locale.languageCode]!['leave_conversation']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get leaveConversationAreYouSure {
|
||||||
|
return _localizedValues[locale.languageCode]![
|
||||||
|
'leave_conversation_are_you_sure']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get leaveGroup {
|
||||||
|
return _localizedValues[locale.languageCode]!['leave_group']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get loading {
|
||||||
|
return _localizedValues[locale.languageCode]!['loading']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get login {
|
||||||
|
return _localizedValues[locale.languageCode]!['login']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get longPressMessage {
|
||||||
|
return _localizedValues[locale.languageCode]!['long_press_message']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get matchesFor {
|
||||||
|
return _localizedValues[locale.languageCode]!['matches_for']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get member {
|
||||||
|
return _localizedValues[locale.languageCode]!['member']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get members {
|
||||||
|
return _localizedValues[locale.languageCode]!['members']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get mentions {
|
||||||
|
return _localizedValues[locale.languageCode]!['mentions']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get message {
|
||||||
|
return _localizedValues[locale.languageCode]!['message']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get messageChannelDescription {
|
||||||
|
return _localizedValues[locale.languageCode]![
|
||||||
|
'message_channel_description']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get messageChannelName {
|
||||||
|
return _localizedValues[locale.languageCode]!['message_channel_name']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get more {
|
||||||
|
return _localizedValues[locale.languageCode]!['more']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get muteGroup {
|
||||||
|
return _localizedValues[locale.languageCode]!['mute_group']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get muteUser {
|
||||||
|
return _localizedValues[locale.languageCode]!['mute_user']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get name {
|
||||||
|
return _localizedValues[locale.languageCode]!['name']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get nameOfGroupChat {
|
||||||
|
return _localizedValues[locale.languageCode]!['name_of_group_chat']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get newChat {
|
||||||
|
return _localizedValues[locale.languageCode]!['new_chat']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get newDirectMessage {
|
||||||
|
return _localizedValues[locale.languageCode]!['new_direct_message']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get newGroup {
|
||||||
|
return _localizedValues[locale.languageCode]!['new_group']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get noChatsHereYet {
|
||||||
|
return _localizedValues[locale.languageCode]!['no_chats_here_yet']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get noFiles {
|
||||||
|
return _localizedValues[locale.languageCode]!['no_files']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get noMedia {
|
||||||
|
return _localizedValues[locale.languageCode]!['no_media']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get noMentionsExistYet {
|
||||||
|
return _localizedValues[locale.languageCode]!['no_mentions_exist_yet']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get noPinnedItems {
|
||||||
|
return _localizedValues[locale.languageCode]!['no_pinned_items']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get noResults {
|
||||||
|
return _localizedValues[locale.languageCode]!['no_results']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get noSharedGroups {
|
||||||
|
return _localizedValues[locale.languageCode]!['no_shared_groups']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get noTitle {
|
||||||
|
return _localizedValues[locale.languageCode]!['no_title']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get noUserMatchesTheseKeywords {
|
||||||
|
return _localizedValues[locale.languageCode]![
|
||||||
|
'no_user_matches_these_keywords']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get ok {
|
||||||
|
return _localizedValues[locale.languageCode]!['ok']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get online {
|
||||||
|
return _localizedValues[locale.languageCode]!['online']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get onThePlatorm {
|
||||||
|
return _localizedValues[locale.languageCode]!['on_the_platform']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get operationCouldNotBeCompleted {
|
||||||
|
return _localizedValues[locale.languageCode]![
|
||||||
|
'operation_could_not_be_completed']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get owner {
|
||||||
|
return _localizedValues[locale.languageCode]!['owner']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get photosAndVideos {
|
||||||
|
return _localizedValues[locale.languageCode]!['photos_and_videos']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get photosOrVideosWillAppearHere {
|
||||||
|
return _localizedValues[locale.languageCode]![
|
||||||
|
'photos_or_videos_will_appear_here']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get pinnedMessages {
|
||||||
|
return _localizedValues[locale.languageCode]!['pinned_messages']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get pinToConversation {
|
||||||
|
return _localizedValues[locale.languageCode]!['pin_to_conversation']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get reconnecting {
|
||||||
|
return _localizedValues[locale.languageCode]!['reconnecting']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get remove {
|
||||||
|
return _localizedValues[locale.languageCode]!['remove']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get removeFromGroup {
|
||||||
|
return _localizedValues[locale.languageCode]!['remove_from_group']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get removeMember {
|
||||||
|
return _localizedValues[locale.languageCode]!['remove_member']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get removeMemberAreYouSure {
|
||||||
|
return _localizedValues[locale.languageCode]![
|
||||||
|
'remove_member_are_you_sure']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get search {
|
||||||
|
return _localizedValues[locale.languageCode]!['search']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get selectUserToTryFlutterSDK {
|
||||||
|
return _localizedValues[locale.languageCode]![
|
||||||
|
'select_user_to_try_flutter_sdk']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get sharedGroups {
|
||||||
|
return _localizedValues[locale.languageCode]!['shared_groups']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get signOut {
|
||||||
|
return _localizedValues[locale.languageCode]!['sign_out']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get somethingWentWrongErrorMessage {
|
||||||
|
return _localizedValues[locale.languageCode]![
|
||||||
|
'something_went_wrong_error_message']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get streamSDK {
|
||||||
|
return _localizedValues[locale.languageCode]!['stream_sdk']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get streamTestAccount {
|
||||||
|
return _localizedValues[locale.languageCode]!['stream_test_account']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get to {
|
||||||
|
return _localizedValues[locale.languageCode]!['to']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get typeANameHint {
|
||||||
|
return _localizedValues[locale.languageCode]!['type_a_name_hint']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get userId {
|
||||||
|
return _localizedValues[locale.languageCode]!['user_id']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get userIdError {
|
||||||
|
return _localizedValues[locale.languageCode]!['user_id_error']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get usernameOptional {
|
||||||
|
return _localizedValues[locale.languageCode]!['username_optional']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get userToken {
|
||||||
|
return _localizedValues[locale.languageCode]!['user_token']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get userTokenError {
|
||||||
|
return _localizedValues[locale.languageCode]!['user_token_error']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get viewInfo {
|
||||||
|
return _localizedValues[locale.languageCode]!['view_info']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
String get welcomeToStreamChat {
|
||||||
|
return _localizedValues[locale.languageCode]!['welcome_to_stream_chat']!;
|
||||||
|
}
|
||||||
|
|
||||||
|
static List<String> languages() => _localizedValues.keys.toList();
|
||||||
|
|
||||||
|
static AppLocalizations of(BuildContext context) {
|
||||||
|
return Localizations.of<AppLocalizations>(context, AppLocalizations)!;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class AppLocalizationsDelegate extends LocalizationsDelegate<AppLocalizations> {
|
||||||
|
const AppLocalizationsDelegate();
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool isSupported(Locale locale) =>
|
||||||
|
AppLocalizations.languages().contains(locale.languageCode);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<AppLocalizations> load(Locale locale) {
|
||||||
|
return SynchronousFuture<AppLocalizations>(AppLocalizations(locale));
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool shouldReload(AppLocalizationsDelegate old) => false;
|
||||||
|
}
|
||||||
@@ -2,6 +2,7 @@ import 'dart:async';
|
|||||||
|
|
||||||
import 'package:example/choose_user_page.dart';
|
import 'package:example/choose_user_page.dart';
|
||||||
import 'package:example/home_page.dart';
|
import 'package:example/home_page.dart';
|
||||||
|
import 'package:example/localizations.dart';
|
||||||
import 'package:example/splash_screen.dart';
|
import 'package:example/splash_screen.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
@@ -9,6 +10,7 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:flutter/scheduler.dart';
|
import 'package:flutter/scheduler.dart';
|
||||||
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
|
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
|
||||||
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||||
|
import 'package:stream_chat_localizations/stream_chat_localizations.dart';
|
||||||
import 'package:stream_chat_persistence/stream_chat_persistence.dart';
|
import 'package:stream_chat_persistence/stream_chat_persistence.dart';
|
||||||
import 'package:streaming_shared_preferences/streaming_shared_preferences.dart';
|
import 'package:streaming_shared_preferences/streaming_shared_preferences.dart';
|
||||||
|
|
||||||
@@ -107,6 +109,16 @@ class _MyAppState extends State<MyApp>
|
|||||||
0: ThemeMode.system,
|
0: ThemeMode.system,
|
||||||
1: ThemeMode.light,
|
1: ThemeMode.light,
|
||||||
}[snapshot],
|
}[snapshot],
|
||||||
|
supportedLocales: const [
|
||||||
|
Locale('en'),
|
||||||
|
Locale('it'),
|
||||||
|
],
|
||||||
|
localizationsDelegates: const [
|
||||||
|
AppLocalizationsDelegate(),
|
||||||
|
GlobalStreamChatLocalizations.delegate,
|
||||||
|
GlobalMaterialLocalizations.delegate,
|
||||||
|
GlobalWidgetsLocalizations.delegate,
|
||||||
|
],
|
||||||
builder: (context, child) => StreamChatTheme(
|
builder: (context, child) => StreamChatTheme(
|
||||||
data: StreamChatThemeData(
|
data: StreamChatThemeData(
|
||||||
brightness: Theme.of(context).brightness,
|
brightness: Theme.of(context).brightness,
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
|
import 'package:example/localizations.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||||
|
|
||||||
@@ -124,7 +125,7 @@ class _NewChatScreenState extends State<NewChatScreen> {
|
|||||||
backgroundColor: StreamChatTheme.of(context).colorTheme.barsBg,
|
backgroundColor: StreamChatTheme.of(context).colorTheme.barsBg,
|
||||||
leading: const StreamBackButton(),
|
leading: const StreamBackButton(),
|
||||||
title: Text(
|
title: Text(
|
||||||
'New Chat',
|
AppLocalizations.of(context).newChat,
|
||||||
style: StreamChatTheme.of(context).textTheme.headlineBold.copyWith(
|
style: StreamChatTheme.of(context).textTheme.headlineBold.copyWith(
|
||||||
color: StreamChatTheme.of(context).colorTheme.textHighEmphasis),
|
color: StreamChatTheme.of(context).colorTheme.textHighEmphasis),
|
||||||
),
|
),
|
||||||
@@ -137,14 +138,14 @@ class _NewChatScreenState extends State<NewChatScreen> {
|
|||||||
|
|
||||||
switch (status) {
|
switch (status) {
|
||||||
case ConnectionStatus.connected:
|
case ConnectionStatus.connected:
|
||||||
statusString = 'Connected';
|
statusString = AppLocalizations.of(context).connected;
|
||||||
showStatus = false;
|
showStatus = false;
|
||||||
break;
|
break;
|
||||||
case ConnectionStatus.connecting:
|
case ConnectionStatus.connecting:
|
||||||
statusString = 'Reconnecting...';
|
statusString = AppLocalizations.of(context).reconnecting;
|
||||||
break;
|
break;
|
||||||
case ConnectionStatus.disconnected:
|
case ConnectionStatus.disconnected:
|
||||||
statusString = 'Disconnected';
|
statusString = AppLocalizations.of(context).disconnected;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return InfoTile(
|
return InfoTile(
|
||||||
@@ -162,6 +163,7 @@ class _NewChatScreenState extends State<NewChatScreen> {
|
|||||||
key: _chipInputTextFieldStateKey,
|
key: _chipInputTextFieldStateKey,
|
||||||
controller: _controller,
|
controller: _controller,
|
||||||
focusNode: _searchFocusNode,
|
focusNode: _searchFocusNode,
|
||||||
|
hint: AppLocalizations.of(context).typeANameHint,
|
||||||
chipBuilder: (context, user) {
|
chipBuilder: (context, user) {
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
@@ -245,7 +247,7 @@ class _NewChatScreenState extends State<NewChatScreen> {
|
|||||||
),
|
),
|
||||||
SizedBox(width: 8),
|
SizedBox(width: 8),
|
||||||
Text(
|
Text(
|
||||||
'Create a Group',
|
AppLocalizations.of(context).createAGroup,
|
||||||
style: StreamChatTheme.of(context)
|
style: StreamChatTheme.of(context)
|
||||||
.textTheme
|
.textTheme
|
||||||
.bodyBold,
|
.bodyBold,
|
||||||
@@ -269,8 +271,8 @@ class _NewChatScreenState extends State<NewChatScreen> {
|
|||||||
),
|
),
|
||||||
child: Text(
|
child: Text(
|
||||||
_isSearchActive
|
_isSearchActive
|
||||||
? "Matches for \"$_userNameQuery\""
|
? '${AppLocalizations.of(context).matchesFor} "$_userNameQuery"'
|
||||||
: 'On the platform',
|
: AppLocalizations.of(context).onThePlatorm,
|
||||||
style: StreamChatTheme.of(context)
|
style: StreamChatTheme.of(context)
|
||||||
.textTheme
|
.textTheme
|
||||||
.footnote
|
.footnote
|
||||||
@@ -307,8 +309,8 @@ class _NewChatScreenState extends State<NewChatScreen> {
|
|||||||
filter: Filter.and([
|
filter: Filter.and([
|
||||||
if (_userNameQuery.isNotEmpty)
|
if (_userNameQuery.isNotEmpty)
|
||||||
Filter.autoComplete('name', _userNameQuery),
|
Filter.autoComplete('name', _userNameQuery),
|
||||||
Filter.notEqual(
|
Filter.notEqual('id',
|
||||||
'id', StreamChat.of(context).currentUser!.id),
|
StreamChat.of(context).currentUser!.id),
|
||||||
]),
|
]),
|
||||||
sort: [
|
sort: [
|
||||||
SortOption(
|
SortOption(
|
||||||
@@ -339,7 +341,8 @@ class _NewChatScreenState extends State<NewChatScreen> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
'No user matches these keywords...',
|
AppLocalizations.of(context)
|
||||||
|
.noUserMatchesTheseKeywords,
|
||||||
style: StreamChatTheme.of(
|
style: StreamChatTheme.of(
|
||||||
context)
|
context)
|
||||||
.textTheme
|
.textTheme
|
||||||
@@ -371,7 +374,7 @@ class _NewChatScreenState extends State<NewChatScreen> {
|
|||||||
|
|
||||||
return Center(
|
return Center(
|
||||||
child: Text(
|
child: Text(
|
||||||
'No chats here yet...',
|
AppLocalizations.of(context).noChatsHereYet,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
color: StreamChatTheme.of(context)
|
color: StreamChatTheme.of(context)
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
|
import 'package:example/localizations.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||||
|
|
||||||
@@ -57,7 +58,7 @@ class _NewGroupChatScreenState extends State<NewGroupChatScreen> {
|
|||||||
backgroundColor: StreamChatTheme.of(context).colorTheme.barsBg,
|
backgroundColor: StreamChatTheme.of(context).colorTheme.barsBg,
|
||||||
leading: const StreamBackButton(),
|
leading: const StreamBackButton(),
|
||||||
title: Text(
|
title: Text(
|
||||||
'Add Group Members',
|
AppLocalizations.of(context).addGroupMembers,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: StreamChatTheme.of(context).colorTheme.textHighEmphasis,
|
color: StreamChatTheme.of(context).colorTheme.textHighEmphasis,
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
@@ -94,14 +95,14 @@ class _NewGroupChatScreenState extends State<NewGroupChatScreen> {
|
|||||||
|
|
||||||
switch (status) {
|
switch (status) {
|
||||||
case ConnectionStatus.connected:
|
case ConnectionStatus.connected:
|
||||||
statusString = 'Connected';
|
statusString = AppLocalizations.of(context).connected;
|
||||||
showStatus = false;
|
showStatus = false;
|
||||||
break;
|
break;
|
||||||
case ConnectionStatus.connecting:
|
case ConnectionStatus.connecting:
|
||||||
statusString = 'Reconnecting...';
|
statusString = AppLocalizations.of(context).reconnecting;
|
||||||
break;
|
break;
|
||||||
case ConnectionStatus.disconnected:
|
case ConnectionStatus.disconnected:
|
||||||
statusString = 'Disconnected';
|
statusString = AppLocalizations.of(context).disconnected;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return InfoTile(
|
return InfoTile(
|
||||||
@@ -117,6 +118,7 @@ class _NewGroupChatScreenState extends State<NewGroupChatScreen> {
|
|||||||
SliverToBoxAdapter(
|
SliverToBoxAdapter(
|
||||||
child: SearchTextField(
|
child: SearchTextField(
|
||||||
controller: _controller,
|
controller: _controller,
|
||||||
|
hintText: AppLocalizations.of(context).search,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (_selectedUsers.isNotEmpty)
|
if (_selectedUsers.isNotEmpty)
|
||||||
@@ -209,8 +211,8 @@ class _NewGroupChatScreenState extends State<NewGroupChatScreen> {
|
|||||||
),
|
),
|
||||||
child: Text(
|
child: Text(
|
||||||
_isSearchActive
|
_isSearchActive
|
||||||
? 'Matches for \"$_userNameQuery\"'
|
? '${AppLocalizations.of(context).matchesFor} \"$_userNameQuery\"'
|
||||||
: 'On the platform',
|
: AppLocalizations.of(context).onThePlatorm,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: StreamChatTheme.of(context)
|
color: StreamChatTheme.of(context)
|
||||||
.colorTheme
|
.colorTheme
|
||||||
@@ -248,7 +250,8 @@ class _NewGroupChatScreenState extends State<NewGroupChatScreen> {
|
|||||||
filter: Filter.and([
|
filter: Filter.and([
|
||||||
if (_userNameQuery.isNotEmpty)
|
if (_userNameQuery.isNotEmpty)
|
||||||
Filter.autoComplete('name', _userNameQuery),
|
Filter.autoComplete('name', _userNameQuery),
|
||||||
Filter.notEqual('id', StreamChat.of(context).currentUser!.id),
|
Filter.notEqual(
|
||||||
|
'id', StreamChat.of(context).currentUser!.id),
|
||||||
]),
|
]),
|
||||||
sort: [
|
sort: [
|
||||||
SortOption(
|
SortOption(
|
||||||
@@ -278,7 +281,8 @@ class _NewGroupChatScreenState extends State<NewGroupChatScreen> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
'No user matches these keywords...',
|
AppLocalizations.of(context)
|
||||||
|
.noUserMatchesTheseKeywords,
|
||||||
style: StreamChatTheme.of(context)
|
style: StreamChatTheme.of(context)
|
||||||
.textTheme
|
.textTheme
|
||||||
.footnote
|
.footnote
|
||||||
|
|||||||
@@ -1,8 +1,11 @@
|
|||||||
|
import 'package:example/localizations.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_local_notifications/flutter_local_notifications.dart'
|
import 'package:flutter_local_notifications/flutter_local_notifications.dart'
|
||||||
hide Message;
|
hide Message;
|
||||||
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||||
|
|
||||||
void showLocalNotification(Event event, String currentUserId) async {
|
void showLocalNotification(
|
||||||
|
Event event, String currentUserId, BuildContext context) async {
|
||||||
if (![
|
if (![
|
||||||
EventType.messageNew,
|
EventType.messageNew,
|
||||||
EventType.notificationMessageNew,
|
EventType.notificationMessageNew,
|
||||||
@@ -27,8 +30,8 @@ void showLocalNotification(Event event, String currentUserId) async {
|
|||||||
NotificationDetails(
|
NotificationDetails(
|
||||||
android: AndroidNotificationDetails(
|
android: AndroidNotificationDetails(
|
||||||
'message channel',
|
'message channel',
|
||||||
'Message channel',
|
AppLocalizations.of(context).messageChannelName,
|
||||||
'Channel used for showing messages',
|
AppLocalizations.of(context).messageChannelDescription,
|
||||||
priority: Priority.high,
|
priority: Priority.high,
|
||||||
importance: Importance.high,
|
importance: Importance.high,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import 'package:example/localizations.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||||
import 'package:video_player/video_player.dart';
|
import 'package:video_player/video_player.dart';
|
||||||
@@ -64,7 +65,7 @@ class _PinnedMessagesScreenState extends State<PinnedMessagesScreen> {
|
|||||||
elevation: 1,
|
elevation: 1,
|
||||||
centerTitle: true,
|
centerTitle: true,
|
||||||
title: Text(
|
title: Text(
|
||||||
'Pinned Messages',
|
AppLocalizations.of(context).pinnedMessages,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: StreamChatTheme.of(context).colorTheme.textHighEmphasis,
|
color: StreamChatTheme.of(context).colorTheme.textHighEmphasis,
|
||||||
fontSize: 16.0,
|
fontSize: 16.0,
|
||||||
@@ -102,7 +103,7 @@ class _PinnedMessagesScreenState extends State<PinnedMessagesScreen> {
|
|||||||
),
|
),
|
||||||
SizedBox(height: 16.0),
|
SizedBox(height: 16.0),
|
||||||
Text(
|
Text(
|
||||||
'No pinned items',
|
AppLocalizations.of(context).noPinnedItems,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 17.0,
|
fontSize: 17.0,
|
||||||
color:
|
color:
|
||||||
@@ -115,7 +116,7 @@ class _PinnedMessagesScreenState extends State<PinnedMessagesScreen> {
|
|||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
text: TextSpan(children: [
|
text: TextSpan(children: [
|
||||||
TextSpan(
|
TextSpan(
|
||||||
text: 'Long-press an important message and\nchoose ',
|
text: '${AppLocalizations.of(context).longPressMessage} ',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 14.0,
|
fontSize: 14.0,
|
||||||
color: StreamChatTheme.of(context)
|
color: StreamChatTheme.of(context)
|
||||||
@@ -125,7 +126,7 @@ class _PinnedMessagesScreenState extends State<PinnedMessagesScreen> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
TextSpan(
|
TextSpan(
|
||||||
text: 'Pin to conversation',
|
text: AppLocalizations.of(context).pinToConversation,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 14.0,
|
fontSize: 14.0,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
@@ -186,7 +187,7 @@ class _PinnedMessagesScreenState extends State<PinnedMessagesScreen> {
|
|||||||
text != ''
|
text != ''
|
||||||
? text
|
? text
|
||||||
: (attachments.isNotEmpty
|
: (attachments.isNotEmpty
|
||||||
? '${attachments.length} attachment${attachments.length > 1 ? 's' : ''}'
|
? '${attachments.length} ${attachments.length > 1 ? AppLocalizations.of(context).attachments : AppLocalizations.of(context).attachment}'
|
||||||
: ''),
|
: ''),
|
||||||
),
|
),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import 'package:example/localizations.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:yaml/yaml.dart';
|
import 'package:yaml/yaml.dart';
|
||||||
@@ -26,7 +27,7 @@ class StreamVersion extends StatelessWidget {
|
|||||||
yaml['packages']['stream_chat_flutter']['version'];
|
yaml['packages']['stream_chat_flutter']['version'];
|
||||||
|
|
||||||
return Text(
|
return Text(
|
||||||
'Stream SDK v $streamChatDep',
|
'${AppLocalizations.of(context).streamSDK} v $streamChatDep',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
color: StreamChatTheme.of(context).colorTheme.disabled,
|
color: StreamChatTheme.of(context).colorTheme.disabled,
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import 'package:example/localizations.dart';
|
||||||
import 'package:example/routes/routes.dart';
|
import 'package:example/routes/routes.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||||
@@ -45,7 +46,7 @@ class UserMentionsPage extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
'No mentions exist yet...',
|
AppLocalizations.of(context).noMentionsExistYet,
|
||||||
style: StreamChatTheme.of(context)
|
style: StreamChatTheme.of(context)
|
||||||
.textTheme
|
.textTheme
|
||||||
.body
|
.body
|
||||||
|
|||||||
@@ -20,6 +20,11 @@ dependencies:
|
|||||||
url: https://github.com/GetStream/stream-chat-flutter.git
|
url: https://github.com/GetStream/stream-chat-flutter.git
|
||||||
ref: develop
|
ref: develop
|
||||||
path: packages/stream_chat_persistence
|
path: packages/stream_chat_persistence
|
||||||
|
stream_chat_localizations:
|
||||||
|
git:
|
||||||
|
url: https://github.com/GetStream/stream-chat-flutter.git
|
||||||
|
ref: develop
|
||||||
|
path: packages/stream_chat_localizations
|
||||||
flutter_local_notifications: ^5.0.0+4
|
flutter_local_notifications: ^5.0.0+4
|
||||||
flutter_svg: ^0.22.0
|
flutter_svg: ^0.22.0
|
||||||
flutter_secure_storage: ^4.2.0
|
flutter_secure_storage: ^4.2.0
|
||||||
@@ -44,6 +49,11 @@ dependency_overrides:
|
|||||||
url: https://github.com/GetStream/stream-chat-flutter.git
|
url: https://github.com/GetStream/stream-chat-flutter.git
|
||||||
ref: develop
|
ref: develop
|
||||||
path: packages/stream_chat_flutter_core
|
path: packages/stream_chat_flutter_core
|
||||||
|
stream_chat_flutter:
|
||||||
|
git:
|
||||||
|
url: https://github.com/GetStream/stream-chat-flutter.git
|
||||||
|
ref: develop
|
||||||
|
path: packages/stream_chat_flutter
|
||||||
|
|
||||||
flutter:
|
flutter:
|
||||||
assets:
|
assets:
|
||||||
|
|||||||
Reference in New Issue
Block a user