cleanup
This commit is contained in:
@@ -5,7 +5,7 @@ import 'channel_info.dart';
|
|||||||
import 'option_list_tile.dart';
|
import 'option_list_tile.dart';
|
||||||
|
|
||||||
class ChannelBottomSheet extends StatefulWidget {
|
class ChannelBottomSheet extends StatefulWidget {
|
||||||
VoidCallback onViewInfoTap;
|
final VoidCallback onViewInfoTap;
|
||||||
|
|
||||||
ChannelBottomSheet({this.onViewInfoTap});
|
ChannelBottomSheet({this.onViewInfoTap});
|
||||||
|
|
||||||
|
|||||||
@@ -48,14 +48,10 @@ class ImageFooter extends StatefulWidget {
|
|||||||
this.message,
|
this.message,
|
||||||
this.videoPackages,
|
this.videoPackages,
|
||||||
this.mediaSelectedCallBack,
|
this.mediaSelectedCallBack,
|
||||||
}) : preferredSize = Size.fromHeight(kToolbarHeight),
|
}) : super(key: key);
|
||||||
super(key: key);
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
_ImageFooterState createState() => _ImageFooterState();
|
_ImageFooterState createState() => _ImageFooterState();
|
||||||
|
|
||||||
@override
|
|
||||||
final Size preferredSize;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class _ImageFooterState extends State<ImageFooter> {
|
class _ImageFooterState extends State<ImageFooter> {
|
||||||
@@ -150,7 +146,7 @@ class _ImageFooterState extends State<ImageFooter> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildPhotosModal(context) {
|
void _buildPhotosModal(context) {
|
||||||
var videoAttachments = widget.mediaAttachments
|
var videoAttachments = widget.mediaAttachments
|
||||||
.where((element) => element.type == 'video')
|
.where((element) => element.type == 'video')
|
||||||
.toList();
|
.toList();
|
||||||
|
|||||||
@@ -37,13 +37,12 @@ class _MediaListViewState extends State<MediaListView> {
|
|||||||
final _media = <AssetEntity>[];
|
final _media = <AssetEntity>[];
|
||||||
final ScrollController _scrollController = ScrollController();
|
final ScrollController _scrollController = ScrollController();
|
||||||
int _currentPage = 0;
|
int _currentPage = 0;
|
||||||
bool _endPagination = false;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return LazyLoadScrollView(
|
return LazyLoadScrollView(
|
||||||
onEndOfPage: () {
|
onEndOfPage: () async {
|
||||||
_getMedia();
|
return _getMedia();
|
||||||
},
|
},
|
||||||
child: GridView.builder(
|
child: GridView.builder(
|
||||||
itemCount: _media.length,
|
itemCount: _media.length,
|
||||||
@@ -161,11 +160,7 @@ class _MediaListViewState extends State<MediaListView> {
|
|||||||
|
|
||||||
final media = await assetList.getAssetListPaged(_currentPage, 50);
|
final media = await assetList.getAssetListPaged(_currentPage, 50);
|
||||||
|
|
||||||
if (media.isEmpty) {
|
if (!media.isEmpty) {
|
||||||
setState(() {
|
|
||||||
_endPagination = true;
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
setState(() {
|
setState(() {
|
||||||
_media.addAll(media);
|
_media.addAll(media);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -573,33 +573,6 @@ class _MessageWidgetState extends State<MessageWidget> {
|
|||||||
widget.message.attachments?.any((element) => element.type == 'giphy') ==
|
widget.message.attachments?.any((element) => element.type == 'giphy') ==
|
||||||
true;
|
true;
|
||||||
|
|
||||||
Widget _buildReadIndicator() {
|
|
||||||
var padding = 0.0;
|
|
||||||
return Stack(
|
|
||||||
children: widget.readList.map((e) {
|
|
||||||
padding += 10.0;
|
|
||||||
return Positioned(
|
|
||||||
left: padding - 10,
|
|
||||||
bottom: 0,
|
|
||||||
top: 0,
|
|
||||||
child: Material(
|
|
||||||
color: StreamChatTheme.of(context).colorTheme.white,
|
|
||||||
clipBehavior: Clip.antiAlias,
|
|
||||||
shape: CircleBorder(),
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.all(1.0),
|
|
||||||
child: UserAvatar(
|
|
||||||
user: e.user,
|
|
||||||
constraints: BoxConstraints.loose(Size.fromRadius(8)),
|
|
||||||
showOnlineStatus: false,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}).toList(),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget _buildReactionIndicator(
|
Widget _buildReactionIndicator(
|
||||||
BuildContext context,
|
BuildContext context,
|
||||||
) {
|
) {
|
||||||
|
|||||||
@@ -112,7 +112,6 @@ class StreamChatState extends State<StreamChat> with WidgetsBindingObserver {
|
|||||||
inputBackground: themeData?.channelTheme?.inputBackground,
|
inputBackground: themeData?.channelTheme?.inputBackground,
|
||||||
messageInputButtonIconTheme:
|
messageInputButtonIconTheme:
|
||||||
themeData?.channelTheme?.messageInputButtonIconTheme,
|
themeData?.channelTheme?.messageInputButtonIconTheme,
|
||||||
inputGradient: themeData?.channelTheme?.inputGradient,
|
|
||||||
messageInputButtonTheme:
|
messageInputButtonTheme:
|
||||||
themeData?.channelTheme?.messageInputButtonTheme,
|
themeData?.channelTheme?.messageInputButtonTheme,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -92,12 +92,7 @@ class StreamChatThemeData {
|
|||||||
|
|
||||||
return defaultTheme.copyWith(
|
return defaultTheme.copyWith(
|
||||||
primaryIconTheme: theme.primaryIconTheme,
|
primaryIconTheme: theme.primaryIconTheme,
|
||||||
channelTheme: defaultTheme.channelTheme.copyWith(
|
channelTheme: defaultTheme.channelTheme,
|
||||||
inputGradient: LinearGradient(colors: [
|
|
||||||
theme.accentColor.withOpacity(.5),
|
|
||||||
theme.accentColor,
|
|
||||||
]),
|
|
||||||
),
|
|
||||||
ownMessageTheme: defaultTheme.ownMessageTheme.copyWith(
|
ownMessageTheme: defaultTheme.ownMessageTheme.copyWith(
|
||||||
replies: defaultTheme.ownMessageTheme.replies.copyWith(
|
replies: defaultTheme.ownMessageTheme.replies.copyWith(
|
||||||
color: theme.accentColor,
|
color: theme.accentColor,
|
||||||
@@ -168,8 +163,6 @@ class StreamChatThemeData {
|
|||||||
this.channelTheme.messageInputButtonIconTheme,
|
this.channelTheme.messageInputButtonIconTheme,
|
||||||
messageInputButtonTheme: channelTheme.messageInputButtonTheme ??
|
messageInputButtonTheme: channelTheme.messageInputButtonTheme ??
|
||||||
this.channelTheme.messageInputButtonTheme,
|
this.channelTheme.messageInputButtonTheme,
|
||||||
inputGradient:
|
|
||||||
channelTheme.inputGradient ?? this.channelTheme.inputGradient,
|
|
||||||
inputBackground: channelTheme.inputBackground ??
|
inputBackground: channelTheme.inputBackground ??
|
||||||
this.channelTheme.inputBackground,
|
this.channelTheme.inputBackground,
|
||||||
) ??
|
) ??
|
||||||
@@ -273,10 +266,6 @@ class StreamChatThemeData {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
inputBackground: colorTheme.white.withAlpha(12),
|
inputBackground: colorTheme.white.withAlpha(12),
|
||||||
inputGradient: LinearGradient(colors: [
|
|
||||||
Color(0xFF00AEFF),
|
|
||||||
Color(0xFF0076FF),
|
|
||||||
]),
|
|
||||||
),
|
),
|
||||||
ownMessageTheme: MessageTheme(
|
ownMessageTheme: MessageTheme(
|
||||||
messageText: TextStyle(
|
messageText: TextStyle(
|
||||||
@@ -597,9 +586,6 @@ class ChannelTheme {
|
|||||||
/// Theme of the send button in [MessageInput]
|
/// Theme of the send button in [MessageInput]
|
||||||
final ButtonThemeData messageInputButtonTheme;
|
final ButtonThemeData messageInputButtonTheme;
|
||||||
|
|
||||||
/// Gradient of [MessageInput]
|
|
||||||
final Gradient inputGradient;
|
|
||||||
|
|
||||||
/// Background color of [MessageInput]
|
/// Background color of [MessageInput]
|
||||||
final Color inputBackground;
|
final Color inputBackground;
|
||||||
|
|
||||||
@@ -608,7 +594,6 @@ class ChannelTheme {
|
|||||||
this.messageInputButtonIconTheme,
|
this.messageInputButtonIconTheme,
|
||||||
this.messageInputButtonTheme,
|
this.messageInputButtonTheme,
|
||||||
this.inputBackground,
|
this.inputBackground,
|
||||||
this.inputGradient,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
/// Creates a copy of [ChannelTheme] with specified attributes overridden.
|
/// Creates a copy of [ChannelTheme] with specified attributes overridden.
|
||||||
@@ -616,7 +601,6 @@ class ChannelTheme {
|
|||||||
ChannelHeaderTheme channelHeaderTheme,
|
ChannelHeaderTheme channelHeaderTheme,
|
||||||
IconThemeData messageInputButtonIconTheme,
|
IconThemeData messageInputButtonIconTheme,
|
||||||
ButtonThemeData messageInputButtonTheme,
|
ButtonThemeData messageInputButtonTheme,
|
||||||
Gradient inputGradient,
|
|
||||||
Color inputBackground,
|
Color inputBackground,
|
||||||
}) =>
|
}) =>
|
||||||
ChannelTheme(
|
ChannelTheme(
|
||||||
@@ -633,8 +617,6 @@ class ChannelTheme {
|
|||||||
messageInputButtonIconTheme ?? this.messageInputButtonIconTheme,
|
messageInputButtonIconTheme ?? this.messageInputButtonIconTheme,
|
||||||
messageInputButtonTheme:
|
messageInputButtonTheme:
|
||||||
messageInputButtonTheme ?? this.messageInputButtonTheme,
|
messageInputButtonTheme ?? this.messageInputButtonTheme,
|
||||||
inputGradient: inputGradient ?? this.inputGradient,
|
|
||||||
inputBackground: inputBackground ?? this.inputBackground,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user