fix: pre release (#324)
* use share_plus plugin * bump dependency versions * fix ui for web * unfocus messageinput only on commands * fix default error for messagesearchlistview * fix thumbnail animation
This commit is contained in:
@@ -44,7 +44,12 @@ class MyApp extends StatelessWidget {
|
|||||||
final defaultTheme = StreamChatThemeData.fromTheme(themeData);
|
final defaultTheme = StreamChatThemeData.fromTheme(themeData);
|
||||||
final colorTheme = defaultTheme.colorTheme;
|
final colorTheme = defaultTheme.colorTheme;
|
||||||
final customTheme = defaultTheme.merge(StreamChatThemeData(
|
final customTheme = defaultTheme.merge(StreamChatThemeData(
|
||||||
ownMessageTheme: MessageTheme(
|
channelPreviewTheme: ChannelPreviewTheme(
|
||||||
|
avatarTheme: AvatarTheme(
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
otherMessageTheme: MessageTheme(
|
||||||
messageBackgroundColor: colorTheme.black,
|
messageBackgroundColor: colorTheme.black,
|
||||||
messageText: TextStyle(
|
messageText: TextStyle(
|
||||||
color: colorTheme.white,
|
color: colorTheme.white,
|
||||||
|
|||||||
@@ -96,7 +96,11 @@ class ChannelImage extends StatelessWidget {
|
|||||||
initialData: otherMember.user,
|
initialData: otherMember.user,
|
||||||
builder: (context, snapshot) {
|
builder: (context, snapshot) {
|
||||||
return UserAvatar(
|
return UserAvatar(
|
||||||
borderRadius: borderRadius,
|
borderRadius: borderRadius ??
|
||||||
|
StreamChatTheme.of(context)
|
||||||
|
.channelPreviewTheme
|
||||||
|
.avatarTheme
|
||||||
|
.borderRadius,
|
||||||
user: snapshot.data ?? otherMember.user,
|
user: snapshot.data ?? otherMember.user,
|
||||||
constraints: constraints ??
|
constraints: constraints ??
|
||||||
StreamChatTheme.of(context)
|
StreamChatTheme.of(context)
|
||||||
@@ -120,7 +124,11 @@ class ChannelImage extends StatelessWidget {
|
|||||||
.toList();
|
.toList();
|
||||||
return GroupImage(
|
return GroupImage(
|
||||||
images: images,
|
images: images,
|
||||||
borderRadius: borderRadius,
|
borderRadius: borderRadius ??
|
||||||
|
StreamChatTheme.of(context)
|
||||||
|
.channelPreviewTheme
|
||||||
|
.avatarTheme
|
||||||
|
.borderRadius,
|
||||||
constraints: constraints ??
|
constraints: constraints ??
|
||||||
StreamChatTheme.of(context)
|
StreamChatTheme.of(context)
|
||||||
.channelPreviewTheme
|
.channelPreviewTheme
|
||||||
|
|||||||
@@ -243,7 +243,7 @@ class VideoPackage {
|
|||||||
|
|
||||||
ChewieController get chewieController => _chewieController;
|
ChewieController get chewieController => _chewieController;
|
||||||
|
|
||||||
bool get initialized => _videoPlayerController.value.initialized;
|
bool get initialized => _videoPlayerController.value.isInitialized;
|
||||||
|
|
||||||
VideoPackage(
|
VideoPackage(
|
||||||
Attachment attachment, {
|
Attachment attachment, {
|
||||||
|
|||||||
@@ -3,9 +3,10 @@ import 'dart:io';
|
|||||||
|
|
||||||
import 'package:cached_network_image/cached_network_image.dart';
|
import 'package:cached_network_image/cached_network_image.dart';
|
||||||
import 'package:dio/dio.dart';
|
import 'package:dio/dio.dart';
|
||||||
import 'package:esys_flutter_share/esys_flutter_share.dart';
|
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:share_plus/share_plus.dart';
|
||||||
|
import 'package:path_provider/path_provider.dart';
|
||||||
import 'package:stream_chat_flutter/src/stream_chat_theme.dart';
|
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/src/video_thumbnail_image.dart';
|
||||||
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||||
@@ -90,27 +91,40 @@ class _ImageFooterState extends State<ImageFooter> {
|
|||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
IconButton(
|
kIsWeb
|
||||||
icon: StreamSvgIcon.iconShare(
|
? SizedBox()
|
||||||
size: 24.0,
|
: IconButton(
|
||||||
color: StreamChatTheme.of(context).colorTheme.black,
|
icon: StreamSvgIcon.iconShare(
|
||||||
),
|
size: 24.0,
|
||||||
onPressed: () async {
|
color: StreamChatTheme.of(context).colorTheme.black,
|
||||||
final attachment =
|
),
|
||||||
widget.mediaAttachments[widget.currentPage];
|
onPressed: () async {
|
||||||
var url = attachment.imageUrl ??
|
final attachment =
|
||||||
attachment.assetUrl ??
|
widget.mediaAttachments[widget.currentPage];
|
||||||
attachment.thumbUrl;
|
final url = attachment.imageUrl ??
|
||||||
var type = attachment.type == 'image'
|
attachment.assetUrl ??
|
||||||
? 'jpg'
|
attachment.thumbUrl;
|
||||||
: url?.split('?')?.first?.split('.')?.last ?? 'jpg';
|
final type = attachment.type == 'image'
|
||||||
var request = await HttpClient().getUrl(Uri.parse(url));
|
? 'jpg'
|
||||||
var response = await request.close();
|
: url?.split('?')?.first?.split('.')?.last ?? 'jpg';
|
||||||
var bytes =
|
final request =
|
||||||
await consolidateHttpClientResponseBytes(response);
|
await HttpClient().getUrl(Uri.parse(url));
|
||||||
await Share.file('File', 'image.$type', bytes, 'image/$type');
|
final response = await request.close();
|
||||||
},
|
final bytes =
|
||||||
),
|
await consolidateHttpClientResponseBytes(response);
|
||||||
|
final tmpPath = await getTemporaryDirectory();
|
||||||
|
final filePath =
|
||||||
|
'${tmpPath.path}/${attachment.id}.$type';
|
||||||
|
final file = File(filePath);
|
||||||
|
await file.writeAsBytes(bytes);
|
||||||
|
await Share.shareFiles(
|
||||||
|
[filePath],
|
||||||
|
mimeTypes: [
|
||||||
|
'image/$type',
|
||||||
|
],
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: widget.onTitleTap,
|
onTap: widget.onTitleTap,
|
||||||
child: Container(
|
child: Container(
|
||||||
|
|||||||
@@ -2012,9 +2012,10 @@ class MessageInputState extends State<MessageInput> {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final shouldUnfocus = _commandEnabled;
|
||||||
|
|
||||||
if (_commandEnabled) {
|
if (_commandEnabled) {
|
||||||
text = '/${_chosenCommand.name} ' + text;
|
text = '/${_chosenCommand.name} ' + text;
|
||||||
FocusScope.of(context).unfocus();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
final attachments = [..._attachments.values];
|
final attachments = [..._attachments.values];
|
||||||
@@ -2081,6 +2082,10 @@ class MessageInputState extends State<MessageInput> {
|
|||||||
sendingFuture = channel.updateMessage(message);
|
sendingFuture = channel.updateMessage(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!shouldUnfocus) {
|
||||||
|
FocusScope.of(context).requestFocus(_focusNode);
|
||||||
|
}
|
||||||
|
|
||||||
return sendingFuture.then((resp) {
|
return sendingFuture.then((resp) {
|
||||||
if (resp.message?.type == 'error') {
|
if (resp.message?.type == 'error') {
|
||||||
_parseExistingMessage(message);
|
_parseExistingMessage(message);
|
||||||
|
|||||||
@@ -157,53 +157,14 @@ class _MessageSearchListViewState extends State<MessageSearchListView> {
|
|||||||
errorBuilder: widget.errorBuilder ??
|
errorBuilder: widget.errorBuilder ??
|
||||||
(BuildContext context, dynamic error) {
|
(BuildContext context, dynamic error) {
|
||||||
if (error is Error) {
|
if (error is Error) {
|
||||||
print((error).stackTrace);
|
print(error.stackTrace);
|
||||||
}
|
|
||||||
|
|
||||||
var message = error.toString();
|
|
||||||
if (error is DioError) {
|
|
||||||
if (error.type == DioErrorType.RESPONSE) {
|
|
||||||
message = error.message;
|
|
||||||
} else {
|
|
||||||
message = 'Check your connection and retry';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return InfoTile(
|
return InfoTile(
|
||||||
showMessage: widget.showErrorTile,
|
showMessage: widget.showErrorTile,
|
||||||
tileAnchor: Alignment.topCenter,
|
tileAnchor: Alignment.topCenter,
|
||||||
childAnchor: Alignment.topCenter,
|
childAnchor: Alignment.topCenter,
|
||||||
message: 'An error occurred.',
|
message: 'An error occurred.',
|
||||||
child: Center(
|
child: Container(),
|
||||||
child: Column(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: <Widget>[
|
|
||||||
Text.rich(
|
|
||||||
TextSpan(
|
|
||||||
children: [
|
|
||||||
WidgetSpan(
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.only(right: 2.0),
|
|
||||||
child: Icon(Icons.error_outline),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
TextSpan(text: 'Error loading messages'),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
style: Theme.of(context).textTheme.headline6,
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.only(top: 16.0),
|
|
||||||
child: Text(message),
|
|
||||||
),
|
|
||||||
ElevatedButton(
|
|
||||||
onPressed: () {
|
|
||||||
_messageSearchListController.loadData();
|
|
||||||
},
|
|
||||||
child: Text('Retry'),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
loadingBuilder: widget.loadingBuilder ??
|
loadingBuilder: widget.loadingBuilder ??
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ class _VideoAttachmentThumbnailState extends State<_VideoAttachmentThumbnail> {
|
|||||||
return Container(
|
return Container(
|
||||||
height: widget.size.height,
|
height: widget.size.height,
|
||||||
width: widget.size.width,
|
width: widget.size.width,
|
||||||
child: _controller.value.initialized
|
child: _controller.value.isInitialized
|
||||||
? VideoPlayer(_controller)
|
? VideoPlayer(_controller)
|
||||||
: CircularProgressIndicator());
|
: CircularProgressIndicator());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,21 +67,27 @@ class _VideoThumbnailImageState extends State<VideoThumbnailImage> {
|
|||||||
builder: (_) {
|
builder: (_) {
|
||||||
if (snapshot.hasError) {
|
if (snapshot.hasError) {
|
||||||
return widget.errorBuilder?.call(context, snapshot.error) ??
|
return widget.errorBuilder?.call(context, snapshot.error) ??
|
||||||
Center(child: StreamSvgIcon.error());
|
Center(
|
||||||
|
child: StreamSvgIcon.error(),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if (!snapshot.hasData) {
|
if (!snapshot.hasData) {
|
||||||
return widget.placeholderBuilder?.call(context) ??
|
return Container(
|
||||||
Shimmer.fromColors(
|
constraints: BoxConstraints.expand(),
|
||||||
baseColor:
|
child: widget.placeholderBuilder?.call(context) ??
|
||||||
StreamChatTheme.of(context).colorTheme.greyGainsboro,
|
Shimmer.fromColors(
|
||||||
highlightColor:
|
baseColor: StreamChatTheme.of(context)
|
||||||
StreamChatTheme.of(context).colorTheme.whiteSmoke,
|
.colorTheme
|
||||||
child: Image.asset(
|
.greyGainsboro,
|
||||||
'images/placeholder.png',
|
highlightColor:
|
||||||
fit: BoxFit.cover,
|
StreamChatTheme.of(context).colorTheme.whiteSmoke,
|
||||||
package: 'stream_chat_flutter',
|
child: Image.asset(
|
||||||
|
'images/placeholder.png',
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
package: 'stream_chat_flutter',
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return Image.memory(
|
return Image.memory(
|
||||||
snapshot.data,
|
snapshot.data,
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ 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_flutter_core
|
path: packages/stream_chat_flutter_core
|
||||||
photo_view: ^0.10.3
|
photo_view: ^0.11.0
|
||||||
rxdart: ^0.25.0
|
rxdart: ^0.25.0
|
||||||
scrollable_positioned_list: ^0.1.8
|
scrollable_positioned_list: ^0.1.8
|
||||||
jiffy: ^3.0.1
|
jiffy: ^3.0.1
|
||||||
@@ -27,8 +27,8 @@ dependencies:
|
|||||||
flutter_markdown: ^0.5.2
|
flutter_markdown: ^0.5.2
|
||||||
url_launcher: ^5.7.10
|
url_launcher: ^5.7.10
|
||||||
emojis: ^0.9.3
|
emojis: ^0.9.3
|
||||||
video_player: ^1.0.1
|
video_player: ^2.0.0
|
||||||
chewie: ^0.12.1+1
|
chewie: ^1.0.0
|
||||||
file_picker: ^2.1.5
|
file_picker: ^2.1.5
|
||||||
image_picker: ^0.6.7+17
|
image_picker: ^0.6.7+17
|
||||||
flutter_keyboard_visibility: ^4.0.2
|
flutter_keyboard_visibility: ^4.0.2
|
||||||
@@ -41,11 +41,11 @@ dependencies:
|
|||||||
flutter_slidable: ^0.5.7
|
flutter_slidable: ^0.5.7
|
||||||
clipboard: ^0.1.2+8
|
clipboard: ^0.1.2+8
|
||||||
image_gallery_saver: ^1.6.7
|
image_gallery_saver: ^1.6.7
|
||||||
esys_flutter_share: ^1.0.2
|
share_plus: ^1.2.0
|
||||||
photo_manager: ^0.6.0
|
photo_manager: ^1.0.0
|
||||||
transparent_image: ^1.0.0
|
transparent_image: ^1.0.0
|
||||||
ezanimation: ^0.4.1
|
ezanimation: ^0.4.1
|
||||||
synchronized: ^2.2.0+2
|
synchronized: ^2.1.0
|
||||||
characters: ^1.0.0
|
characters: ^1.0.0
|
||||||
dio: ^3.0.10
|
dio: ^3.0.10
|
||||||
path_provider: ^1.6.27
|
path_provider: ^1.6.27
|
||||||
|
|||||||
Reference in New Issue
Block a user