|
|
@ -258,130 +258,125 @@ class ChatView extends StatelessWidget {
|
|
|
|
onDragDone: controller.onDragDone,
|
|
|
|
onDragDone: controller.onDragDone,
|
|
|
|
onDragEntered: controller.onDragEntered,
|
|
|
|
onDragEntered: controller.onDragEntered,
|
|
|
|
onDragExited: controller.onDragExited,
|
|
|
|
onDragExited: controller.onDragExited,
|
|
|
|
child: DecoratedBox(
|
|
|
|
child: Stack(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
children: <Widget>[
|
|
|
|
color: theme.colorScheme.surfaceContainer,
|
|
|
|
if (accountConfig.wallpaperUrl != null)
|
|
|
|
),
|
|
|
|
Opacity(
|
|
|
|
child: Stack(
|
|
|
|
opacity: accountConfig.wallpaperOpacity ?? 1,
|
|
|
|
children: <Widget>[
|
|
|
|
child: MxcImage(
|
|
|
|
if (accountConfig.wallpaperUrl != null)
|
|
|
|
uri: accountConfig.wallpaperUrl,
|
|
|
|
Opacity(
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
opacity: accountConfig.wallpaperOpacity ?? 1,
|
|
|
|
isThumbnail: true,
|
|
|
|
child: MxcImage(
|
|
|
|
width: FluffyThemes.columnWidth * 4,
|
|
|
|
uri: accountConfig.wallpaperUrl,
|
|
|
|
height: FluffyThemes.columnWidth * 4,
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
placeholder: (_) => Container(),
|
|
|
|
isThumbnail: true,
|
|
|
|
|
|
|
|
width: FluffyThemes.columnWidth * 4,
|
|
|
|
|
|
|
|
height: FluffyThemes.columnWidth * 4,
|
|
|
|
|
|
|
|
placeholder: (_) => Container(),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
SafeArea(
|
|
|
|
),
|
|
|
|
child: Column(
|
|
|
|
SafeArea(
|
|
|
|
children: <Widget>[
|
|
|
|
child: Column(
|
|
|
|
Expanded(
|
|
|
|
children: <Widget>[
|
|
|
|
child: GestureDetector(
|
|
|
|
Expanded(
|
|
|
|
onTap: controller.clearSingleSelectedEvent,
|
|
|
|
child: GestureDetector(
|
|
|
|
child: Builder(
|
|
|
|
onTap: controller.clearSingleSelectedEvent,
|
|
|
|
builder: (context) {
|
|
|
|
child: Builder(
|
|
|
|
if (controller.timeline == null) {
|
|
|
|
builder: (context) {
|
|
|
|
return const Center(
|
|
|
|
if (controller.timeline == null) {
|
|
|
|
child:
|
|
|
|
return const Center(
|
|
|
|
CircularProgressIndicator.adaptive(
|
|
|
|
child: CircularProgressIndicator.adaptive(
|
|
|
|
strokeWidth: 2,
|
|
|
|
strokeWidth: 2,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return ChatEventList(
|
|
|
|
|
|
|
|
controller: controller,
|
|
|
|
|
|
|
|
);
|
|
|
|
);
|
|
|
|
},
|
|
|
|
}
|
|
|
|
),
|
|
|
|
return ChatEventList(
|
|
|
|
|
|
|
|
controller: controller,
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
if (controller.room.canSendDefaultMessages &&
|
|
|
|
),
|
|
|
|
controller.room.membership == Membership.join)
|
|
|
|
if (controller.room.canSendDefaultMessages &&
|
|
|
|
Container(
|
|
|
|
controller.room.membership == Membership.join)
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
Container(
|
|
|
|
bottom: bottomSheetPadding,
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
left: bottomSheetPadding,
|
|
|
|
bottom: bottomSheetPadding,
|
|
|
|
right: bottomSheetPadding,
|
|
|
|
left: bottomSheetPadding,
|
|
|
|
),
|
|
|
|
right: bottomSheetPadding,
|
|
|
|
constraints: const BoxConstraints(
|
|
|
|
),
|
|
|
|
maxWidth: FluffyThemes.columnWidth * 2.5,
|
|
|
|
constraints: const BoxConstraints(
|
|
|
|
|
|
|
|
maxWidth: FluffyThemes.columnWidth * 2.5,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
alignment: Alignment.center,
|
|
|
|
|
|
|
|
child: Material(
|
|
|
|
|
|
|
|
clipBehavior: Clip.hardEdge,
|
|
|
|
|
|
|
|
color: theme
|
|
|
|
|
|
|
|
.colorScheme
|
|
|
|
|
|
|
|
// ignore: deprecated_member_use
|
|
|
|
|
|
|
|
.surfaceVariant,
|
|
|
|
|
|
|
|
borderRadius: const BorderRadius.all(
|
|
|
|
|
|
|
|
Radius.circular(24),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
alignment: Alignment.center,
|
|
|
|
child: controller.room.isAbandonedDMRoom == true
|
|
|
|
child: Material(
|
|
|
|
? Row(
|
|
|
|
clipBehavior: Clip.hardEdge,
|
|
|
|
mainAxisAlignment:
|
|
|
|
color: theme.colorScheme.surfaceBright,
|
|
|
|
MainAxisAlignment.spaceEvenly,
|
|
|
|
borderRadius: const BorderRadius.all(
|
|
|
|
children: [
|
|
|
|
Radius.circular(24),
|
|
|
|
TextButton.icon(
|
|
|
|
),
|
|
|
|
style: TextButton.styleFrom(
|
|
|
|
child: controller.room.isAbandonedDMRoom ==
|
|
|
|
padding: const EdgeInsets.all(
|
|
|
|
true
|
|
|
|
16,
|
|
|
|
? Row(
|
|
|
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
|
|
|
MainAxisAlignment.spaceEvenly,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
TextButton.icon(
|
|
|
|
|
|
|
|
style: TextButton.styleFrom(
|
|
|
|
|
|
|
|
padding: const EdgeInsets.all(
|
|
|
|
|
|
|
|
16,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
foregroundColor:
|
|
|
|
|
|
|
|
theme.colorScheme.error,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
icon: const Icon(
|
|
|
|
|
|
|
|
Icons.archive_outlined,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
onPressed: controller.leaveChat,
|
|
|
|
|
|
|
|
label: Text(
|
|
|
|
|
|
|
|
L10n.of(context).leave,
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
foregroundColor:
|
|
|
|
|
|
|
|
theme.colorScheme.error,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
TextButton.icon(
|
|
|
|
icon: const Icon(
|
|
|
|
style: TextButton.styleFrom(
|
|
|
|
Icons.archive_outlined,
|
|
|
|
padding: const EdgeInsets.all(
|
|
|
|
),
|
|
|
|
16,
|
|
|
|
onPressed: controller.leaveChat,
|
|
|
|
),
|
|
|
|
label: Text(
|
|
|
|
),
|
|
|
|
L10n.of(context).leave,
|
|
|
|
icon: const Icon(
|
|
|
|
),
|
|
|
|
Icons.forum_outlined,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
TextButton.icon(
|
|
|
|
onPressed:
|
|
|
|
style: TextButton.styleFrom(
|
|
|
|
controller.recreateChat,
|
|
|
|
padding: const EdgeInsets.all(
|
|
|
|
label: Text(
|
|
|
|
16,
|
|
|
|
L10n.of(context).reopenChat,
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
icon: const Icon(
|
|
|
|
)
|
|
|
|
Icons.forum_outlined,
|
|
|
|
: Column(
|
|
|
|
),
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
onPressed: controller.recreateChat,
|
|
|
|
children: [
|
|
|
|
label: Text(
|
|
|
|
const ConnectionStatusHeader(),
|
|
|
|
L10n.of(context).reopenChat,
|
|
|
|
ReactionsPicker(controller),
|
|
|
|
),
|
|
|
|
ReplyDisplay(controller),
|
|
|
|
),
|
|
|
|
ChatInputRow(controller),
|
|
|
|
],
|
|
|
|
ChatEmojiPicker(controller),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
: Column(
|
|
|
|
),
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
),
|
|
|
|
children: [
|
|
|
|
|
|
|
|
const ConnectionStatusHeader(),
|
|
|
|
|
|
|
|
ReactionsPicker(controller),
|
|
|
|
|
|
|
|
ReplyDisplay(controller),
|
|
|
|
|
|
|
|
ChatInputRow(controller),
|
|
|
|
|
|
|
|
ChatEmojiPicker(controller),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
if (controller.dragging)
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
if (controller.dragging)
|
|
|
|
color: theme.scaffoldBackgroundColor.withOpacity(0.9),
|
|
|
|
Container(
|
|
|
|
alignment: Alignment.center,
|
|
|
|
color: theme.scaffoldBackgroundColor.withOpacity(0.9),
|
|
|
|
child: const Icon(
|
|
|
|
alignment: Alignment.center,
|
|
|
|
Icons.upload_outlined,
|
|
|
|
child: const Icon(
|
|
|
|
size: 100,
|
|
|
|
Icons.upload_outlined,
|
|
|
|
),
|
|
|
|
size: 100,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|