Compare commits

...

2 Commits

Author SHA1 Message Date
47c535910d 💄 Optimize the style with background image 2024-10-06 19:54:32 +08:00
66f2f33394 🐛 Bug fixes with background image 2024-10-06 19:41:44 +08:00
4 changed files with 158 additions and 187 deletions

View File

@ -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,7 +218,8 @@ class _ChannelChatScreenState extends State<ChannelChatScreen>
); );
} }
return Scaffold( return RootContainer(
child: Scaffold(
appBar: AppBar( appBar: AppBar(
leading: AppBarLeadingButton.adaptive(context), leading: AppBarLeadingButton.adaptive(context),
title: AppBarTitle(title), title: AppBarTitle(title),
@ -253,7 +255,8 @@ class _ChannelChatScreenState extends State<ChannelChatScreen>
.then((value) { .then((value) {
if (value == false) AppRouter.instance.pop(); if (value == false) AppRouter.instance.pop();
if (value != null) { if (value != null) {
final resp = Channel.fromJson(value as Map<String, dynamic>); final resp =
Channel.fromJson(value as Map<String, dynamic>);
_getChannel(alias: resp.alias); _getChannel(alias: resp.alias);
} }
}); });
@ -290,7 +293,8 @@ class _ChannelChatScreenState extends State<ChannelChatScreen>
Expanded( Expanded(
child: ChatEventList( child: ChatEventList(
noAnimated: noAnimated:
_prefs.getBool('non_animated_message_list') ?? false, _prefs.getBool('non_animated_message_list') ??
false,
scope: widget.realm, scope: widget.realm,
channel: _channel!, channel: _channel!,
chatController: _chatController, chatController: _chatController,
@ -356,6 +360,7 @@ class _ChannelChatScreenState extends State<ChannelChatScreen>
], ],
); );
}), }),
),
); );
} }

View File

@ -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(

View File

@ -117,29 +117,15 @@ class _PostItemState extends State<PostItem> {
), ),
), ),
), ),
],
),
if (_contentHeight >= 80 && !widget.isFullContent) if (_contentHeight >= 80 && !widget.isFullContent)
Align( Opacity(
alignment: Alignment.bottomCenter, opacity: 0.8,
child: IgnorePointer( child: InkWell(child: Text('readMore'.tr)),
child: Container( ).paddingOnly(
height: 80, left: 12,
decoration: BoxDecoration( top: 4,
gradient: LinearGradient(
begin: Alignment.bottomCenter,
end: Alignment.topCenter,
colors: [
Theme.of(context).colorScheme.surfaceContainerLow,
Theme.of(context)
.colorScheme
.surface
.withOpacity(0),
],
),
),
),
),
),
],
), ),
LinkExpansion(content: item.body['content']).paddingOnly( LinkExpansion(content: item.body['content']).paddingOnly(
left: 8, left: 8,
@ -225,33 +211,15 @@ class _PostItemState extends State<PostItem> {
), ),
), ),
), ),
],
),
if (_contentHeight >= 320 && !widget.isFullContent) if (_contentHeight >= 320 && !widget.isFullContent)
Align( Opacity(
alignment: Alignment.bottomCenter, opacity: 0.8,
child: IgnorePointer( child: InkWell(child: Text('readMore'.tr)),
child: Container( ).paddingOnly(
height: 320, left: 12,
decoration: BoxDecoration( top: 4,
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 (widget.item.replyTo != null && widget.isShowEmbed) if (widget.item.replyTo != null && widget.isShowEmbed)
Container( Container(
@ -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,
); );
} }

View File

@ -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,
), ),