Compare commits
2 Commits
f5fbe1f483
...
47c535910d
Author | SHA1 | Date | |
---|---|---|---|
47c535910d | |||
66f2f33394 |
@ -26,6 +26,7 @@ import 'package:solian/widgets/chat/chat_event_list.dart';
|
|||||||
import 'package:solian/widgets/chat/chat_message_input.dart';
|
import 'package:solian/widgets/chat/chat_message_input.dart';
|
||||||
import 'package:solian/widgets/chat/chat_typing_indicator.dart';
|
import 'package:solian/widgets/chat/chat_typing_indicator.dart';
|
||||||
import 'package:solian/widgets/current_state_action.dart';
|
import 'package:solian/widgets/current_state_action.dart';
|
||||||
|
import 'package:solian/widgets/root_container.dart';
|
||||||
|
|
||||||
class ChannelChatScreen extends StatefulWidget {
|
class ChannelChatScreen extends StatefulWidget {
|
||||||
final String alias;
|
final String alias;
|
||||||
@ -217,145 +218,149 @@ class _ChannelChatScreenState extends State<ChannelChatScreen>
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Scaffold(
|
return RootContainer(
|
||||||
appBar: AppBar(
|
child: Scaffold(
|
||||||
leading: AppBarLeadingButton.adaptive(context),
|
appBar: AppBar(
|
||||||
title: AppBarTitle(title),
|
leading: AppBarLeadingButton.adaptive(context),
|
||||||
centerTitle: false,
|
title: AppBarTitle(title),
|
||||||
titleSpacing: AppTheme.titleSpacing(context),
|
centerTitle: false,
|
||||||
toolbarHeight: AppTheme.toolbarHeight(context),
|
titleSpacing: AppTheme.titleSpacing(context),
|
||||||
actions: [
|
toolbarHeight: AppTheme.toolbarHeight(context),
|
||||||
const BackgroundStateWidget(),
|
actions: [
|
||||||
Builder(builder: (context) {
|
const BackgroundStateWidget(),
|
||||||
if (_isBusy || _channel == null) return const SizedBox.shrink();
|
Builder(builder: (context) {
|
||||||
|
if (_isBusy || _channel == null) return const SizedBox.shrink();
|
||||||
|
|
||||||
return ChatCallButton(
|
return ChatCallButton(
|
||||||
realm: _channel!.realm,
|
realm: _channel!.realm,
|
||||||
channel: _channel!,
|
channel: _channel!,
|
||||||
ongoingCall: _ongoingCall,
|
ongoingCall: _ongoingCall,
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
IconButton(
|
IconButton(
|
||||||
icon: const Icon(Icons.more_vert),
|
icon: const Icon(Icons.more_vert),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
if (_channel == null) return;
|
if (_channel == null) return;
|
||||||
|
|
||||||
AppRouter.instance
|
AppRouter.instance
|
||||||
.pushNamed(
|
.pushNamed(
|
||||||
'channelDetail',
|
'channelDetail',
|
||||||
pathParameters: {'alias': widget.alias},
|
pathParameters: {'alias': widget.alias},
|
||||||
queryParameters: {'realm': widget.realm},
|
queryParameters: {'realm': widget.realm},
|
||||||
extra: ChannelDetailArguments(
|
extra: ChannelDetailArguments(
|
||||||
profile: _channelProfile!,
|
profile: _channelProfile!,
|
||||||
channel: _channel!,
|
channel: _channel!,
|
||||||
),
|
|
||||||
)
|
|
||||||
.then((value) {
|
|
||||||
if (value == false) AppRouter.instance.pop();
|
|
||||||
if (value != null) {
|
|
||||||
final resp = Channel.fromJson(value as Map<String, dynamic>);
|
|
||||||
_getChannel(alias: resp.alias);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
width: AppTheme.isLargeScreen(context) ? 8 : 16,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
body: Builder(builder: (context) {
|
|
||||||
if (_isBusy || _channel == null) {
|
|
||||||
return const Center(
|
|
||||||
child: CircularProgressIndicator(),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return Row(
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
child: Column(
|
|
||||||
children: [
|
|
||||||
if (_ongoingCall != null)
|
|
||||||
ChannelCallIndicator(
|
|
||||||
channel: _channel!,
|
|
||||||
ongoingCall: _ongoingCall!,
|
|
||||||
onJoin: () {
|
|
||||||
if (!AppTheme.isUltraLargeScreen(context)) {
|
|
||||||
final ChatCallProvider call = Get.find();
|
|
||||||
call.gotoScreen(context);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
),
|
|
||||||
Expanded(
|
|
||||||
child: ChatEventList(
|
|
||||||
noAnimated:
|
|
||||||
_prefs.getBool('non_animated_message_list') ?? false,
|
|
||||||
scope: widget.realm,
|
|
||||||
channel: _channel!,
|
|
||||||
chatController: _chatController,
|
|
||||||
onEdit: (item) {
|
|
||||||
setState(() => _messageToEditing = item);
|
|
||||||
},
|
|
||||||
onReply: (item) {
|
|
||||||
setState(() => _messageToReplying = item);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
ClipRect(
|
)
|
||||||
child: BackdropFilter(
|
.then((value) {
|
||||||
filter: ImageFilter.blur(sigmaX: 50, sigmaY: 50),
|
if (value == false) AppRouter.instance.pop();
|
||||||
child: SafeArea(
|
if (value != null) {
|
||||||
child: Column(
|
final resp =
|
||||||
children: [
|
Channel.fromJson(value as Map<String, dynamic>);
|
||||||
ChatTypingIndicator(users: _typingUsers),
|
_getChannel(alias: resp.alias);
|
||||||
ChatMessageInput(
|
}
|
||||||
edit: _messageToEditing,
|
});
|
||||||
reply: _messageToReplying,
|
},
|
||||||
realm: widget.realm,
|
),
|
||||||
placeholder: placeholder,
|
SizedBox(
|
||||||
channel: _channel!,
|
width: AppTheme.isLargeScreen(context) ? 8 : 16,
|
||||||
onSent: (Event item) {
|
),
|
||||||
setState(() {
|
],
|
||||||
_chatController.addPendingEvent(item);
|
),
|
||||||
});
|
body: Builder(builder: (context) {
|
||||||
},
|
if (_isBusy || _channel == null) {
|
||||||
onReset: () {
|
return const Center(
|
||||||
setState(() {
|
child: CircularProgressIndicator(),
|
||||||
_messageToReplying = null;
|
);
|
||||||
_messageToEditing = null;
|
}
|
||||||
});
|
|
||||||
},
|
return Row(
|
||||||
),
|
children: [
|
||||||
],
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
if (_ongoingCall != null)
|
||||||
|
ChannelCallIndicator(
|
||||||
|
channel: _channel!,
|
||||||
|
ongoingCall: _ongoingCall!,
|
||||||
|
onJoin: () {
|
||||||
|
if (!AppTheme.isUltraLargeScreen(context)) {
|
||||||
|
final ChatCallProvider call = Get.find();
|
||||||
|
call.gotoScreen(context);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: ChatEventList(
|
||||||
|
noAnimated:
|
||||||
|
_prefs.getBool('non_animated_message_list') ??
|
||||||
|
false,
|
||||||
|
scope: widget.realm,
|
||||||
|
channel: _channel!,
|
||||||
|
chatController: _chatController,
|
||||||
|
onEdit: (item) {
|
||||||
|
setState(() => _messageToEditing = item);
|
||||||
|
},
|
||||||
|
onReply: (item) {
|
||||||
|
setState(() => _messageToReplying = item);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
ClipRect(
|
||||||
|
child: BackdropFilter(
|
||||||
|
filter: ImageFilter.blur(sigmaX: 50, sigmaY: 50),
|
||||||
|
child: SafeArea(
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
ChatTypingIndicator(users: _typingUsers),
|
||||||
|
ChatMessageInput(
|
||||||
|
edit: _messageToEditing,
|
||||||
|
reply: _messageToReplying,
|
||||||
|
realm: widget.realm,
|
||||||
|
placeholder: placeholder,
|
||||||
|
channel: _channel!,
|
||||||
|
onSent: (Event item) {
|
||||||
|
setState(() {
|
||||||
|
_chatController.addPendingEvent(item);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onReset: () {
|
||||||
|
setState(() {
|
||||||
|
_messageToReplying = null;
|
||||||
|
_messageToEditing = null;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
),
|
Obx(() {
|
||||||
Obx(() {
|
final ChatCallProvider call = Get.find();
|
||||||
final ChatCallProvider call = Get.find();
|
if (call.isMounted.value &&
|
||||||
if (call.isMounted.value &&
|
AppTheme.isUltraLargeScreen(context)) {
|
||||||
AppTheme.isUltraLargeScreen(context)) {
|
return const Expanded(
|
||||||
return const Expanded(
|
child: Row(children: [
|
||||||
child: Row(children: [
|
VerticalDivider(width: 0.3, thickness: 0.3),
|
||||||
VerticalDivider(width: 0.3, thickness: 0.3),
|
Expanded(
|
||||||
Expanded(
|
child: CallScreen(
|
||||||
child: CallScreen(
|
hideAppBar: true,
|
||||||
hideAppBar: true,
|
isExpandable: true,
|
||||||
isExpandable: true,
|
),
|
||||||
),
|
),
|
||||||
),
|
]),
|
||||||
]),
|
);
|
||||||
);
|
}
|
||||||
}
|
return const SizedBox.shrink();
|
||||||
return const SizedBox.shrink();
|
}),
|
||||||
}),
|
],
|
||||||
],
|
);
|
||||||
);
|
}),
|
||||||
}),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -177,9 +177,6 @@ class _AttachmentListState extends State<AttachmentList> {
|
|||||||
if (element == null) return const SizedBox.shrink();
|
if (element == null) return const SizedBox.shrink();
|
||||||
double ratio = element.metadata?['ratio']?.toDouble() ?? 16 / 9;
|
double ratio = element.metadata?['ratio']?.toDouble() ?? 16 / 9;
|
||||||
return Container(
|
return Container(
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: Theme.of(context).colorScheme.surfaceContainerHigh,
|
|
||||||
),
|
|
||||||
constraints: BoxConstraints(
|
constraints: BoxConstraints(
|
||||||
maxWidth: widget.columnMaxWidth,
|
maxWidth: widget.columnMaxWidth,
|
||||||
maxHeight: 640,
|
maxHeight: 640,
|
||||||
@ -247,7 +244,7 @@ class _AttachmentListState extends State<AttachmentList> {
|
|||||||
maxHeight: widget.flatMaxHeight,
|
maxHeight: widget.flatMaxHeight,
|
||||||
),
|
),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Theme.of(context).colorScheme.surfaceContainerHigh,
|
color: Colors.transparent,
|
||||||
border: Border.symmetric(
|
border: Border.symmetric(
|
||||||
horizontal: BorderSide(
|
horizontal: BorderSide(
|
||||||
width: 0.3,
|
width: 0.3,
|
||||||
@ -257,6 +254,7 @@ class _AttachmentListState extends State<AttachmentList> {
|
|||||||
),
|
),
|
||||||
child: CarouselSlider.builder(
|
child: CarouselSlider.builder(
|
||||||
options: CarouselOptions(
|
options: CarouselOptions(
|
||||||
|
animateToClosest: true,
|
||||||
aspectRatio: _aspectRatio,
|
aspectRatio: _aspectRatio,
|
||||||
viewportFraction:
|
viewportFraction:
|
||||||
widget.viewport ?? (widget.attachmentsId.length > 1 ? 0.95 : 1),
|
widget.viewport ?? (widget.attachmentsId.length > 1 ? 0.95 : 1),
|
||||||
@ -319,6 +317,7 @@ class AttachmentListEntry extends StatelessWidget {
|
|||||||
width: width ?? MediaQuery.of(context).size.width,
|
width: width ?? MediaQuery.of(context).size.width,
|
||||||
height: height,
|
height: height,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.transparent,
|
||||||
border: showBorder
|
border: showBorder
|
||||||
? Border.symmetric(
|
? Border.symmetric(
|
||||||
vertical: BorderSide(
|
vertical: BorderSide(
|
||||||
|
@ -117,30 +117,16 @@ class _PostItemState extends State<PostItem> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (_contentHeight >= 80 && !widget.isFullContent)
|
|
||||||
Align(
|
|
||||||
alignment: Alignment.bottomCenter,
|
|
||||||
child: IgnorePointer(
|
|
||||||
child: Container(
|
|
||||||
height: 80,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
gradient: LinearGradient(
|
|
||||||
begin: Alignment.bottomCenter,
|
|
||||||
end: Alignment.topCenter,
|
|
||||||
colors: [
|
|
||||||
Theme.of(context).colorScheme.surfaceContainerLow,
|
|
||||||
Theme.of(context)
|
|
||||||
.colorScheme
|
|
||||||
.surface
|
|
||||||
.withOpacity(0),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
if (_contentHeight >= 80 && !widget.isFullContent)
|
||||||
|
Opacity(
|
||||||
|
opacity: 0.8,
|
||||||
|
child: InkWell(child: Text('readMore'.tr)),
|
||||||
|
).paddingOnly(
|
||||||
|
left: 12,
|
||||||
|
top: 4,
|
||||||
|
),
|
||||||
LinkExpansion(content: item.body['content']).paddingOnly(
|
LinkExpansion(content: item.body['content']).paddingOnly(
|
||||||
left: 8,
|
left: 8,
|
||||||
right: 8,
|
right: 8,
|
||||||
@ -225,34 +211,16 @@ class _PostItemState extends State<PostItem> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (_contentHeight >= 320 && !widget.isFullContent)
|
|
||||||
Align(
|
|
||||||
alignment: Alignment.bottomCenter,
|
|
||||||
child: IgnorePointer(
|
|
||||||
child: Container(
|
|
||||||
height: 320,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
gradient: LinearGradient(
|
|
||||||
begin: Alignment.bottomCenter,
|
|
||||||
end: Alignment.topCenter,
|
|
||||||
colors: [
|
|
||||||
(widget.backgroundColor ??
|
|
||||||
Theme.of(context)
|
|
||||||
.colorScheme
|
|
||||||
.surface),
|
|
||||||
(widget.backgroundColor ??
|
|
||||||
Theme.of(context)
|
|
||||||
.colorScheme
|
|
||||||
.surface)
|
|
||||||
.withOpacity(0),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
if (_contentHeight >= 320 && !widget.isFullContent)
|
||||||
|
Opacity(
|
||||||
|
opacity: 0.8,
|
||||||
|
child: InkWell(child: Text('readMore'.tr)),
|
||||||
|
).paddingOnly(
|
||||||
|
left: 12,
|
||||||
|
top: 4,
|
||||||
|
),
|
||||||
if (widget.item.replyTo != null && widget.isShowEmbed)
|
if (widget.item.replyTo != null && widget.isShowEmbed)
|
||||||
Container(
|
Container(
|
||||||
constraints: const BoxConstraints(maxWidth: 480),
|
constraints: const BoxConstraints(maxWidth: 480),
|
||||||
@ -336,8 +304,7 @@ class _PostItemState extends State<PostItem> {
|
|||||||
),
|
),
|
||||||
closedElevation: 0,
|
closedElevation: 0,
|
||||||
openElevation: 0,
|
openElevation: 0,
|
||||||
closedColor:
|
closedColor: Colors.transparent,
|
||||||
widget.backgroundColor ?? Theme.of(context).colorScheme.surface,
|
|
||||||
openColor: Theme.of(context).colorScheme.surface,
|
openColor: Theme.of(context).colorScheme.surface,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -574,7 +541,7 @@ class _PostEmbedWidget extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
closedElevation: 0,
|
closedElevation: 0,
|
||||||
openElevation: 0,
|
openElevation: 0,
|
||||||
closedColor: Theme.of(context).colorScheme.surface,
|
closedColor: Colors.transparent,
|
||||||
openColor: Theme.of(context).colorScheme.surface,
|
openColor: Theme.of(context).colorScheme.surface,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,7 @@ class RootContainer extends StatelessWidget {
|
|||||||
backgroundBlendMode: BlendMode.darken,
|
backgroundBlendMode: BlendMode.darken,
|
||||||
color: Theme.of(context).colorScheme.surface,
|
color: Theme.of(context).colorScheme.surface,
|
||||||
image: DecorationImage(
|
image: DecorationImage(
|
||||||
opacity: 0.5,
|
opacity: 0.2,
|
||||||
image: FileImage(file),
|
image: FileImage(file),
|
||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
),
|
),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user