Skip to content

Commit

Permalink
chore: Design follow up
Browse files Browse the repository at this point in the history
  • Loading branch information
krille-chan committed Nov 3, 2024
1 parent 65fd8a4 commit cdaaad9
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 38 deletions.
23 changes: 3 additions & 20 deletions lib/pages/chat/events/message.dart
Original file line number Diff line number Diff line change
Expand Up @@ -306,27 +306,10 @@ class Message extends StatelessWidget {
curve: FluffyThemes.animationCurve,
child: Container(
decoration: BoxDecoration(
color: ownMessage
? null
: noBubble
? Colors.transparent
: color,
color: noBubble
? Colors.transparent
: color,
borderRadius: borderRadius,
gradient: ownMessage && !noBubble
? LinearGradient(
colors: [
theme.colorScheme.primary,
theme.brightness ==
Brightness.light
? theme.colorScheme
.onPrimaryFixedVariant
: theme.colorScheme
.primaryFixed,
],
begin: Alignment.centerLeft,
end: Alignment.bottomRight,
)
: null,
),
clipBehavior: Clip.antiAlias,
child: Container(
Expand Down
7 changes: 4 additions & 3 deletions lib/pages/chat/events/reply_content.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ class ReplyContent extends StatelessWidget {
timeline != null ? replyEvent.getDisplayEvent(timeline) : replyEvent;
final fontSize = AppConfig.messageFontSize * AppConfig.fontSizeFactor;
final color = ownMessage
? theme.colorScheme.primaryContainer
: theme.colorScheme.primary;
? theme.colorScheme.tertiaryContainer
: theme.colorScheme.tertiary;

return Material(
color: backgroundColor ??
Expand All @@ -56,6 +56,7 @@ class ReplyContent extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
FutureBuilder<User?>(
initialData: displayEvent.senderFromMemoryOrFallback,
future: displayEvent.fetchSenderUser(),
builder: (context, snapshot) {
return Text(
Expand All @@ -80,7 +81,7 @@ class ReplyContent extends StatelessWidget {
maxLines: 1,
style: TextStyle(
color: ownMessage
? theme.colorScheme.onPrimary
? theme.colorScheme.onTertiary
: theme.colorScheme.onSurface,
fontSize: fontSize,
),
Expand Down
19 changes: 15 additions & 4 deletions lib/pages/chat_details/participant_list_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class ParticipantListItem extends StatelessWidget {
Membership.leave => L10n.of(context).leftTheChat,
};

final permissionBatch = user.powerLevel == 100
final permissionBatch = user.powerLevel >= 100
? L10n.of(context).admin
: user.powerLevel >= 50
? L10n.of(context).moderator
Expand Down Expand Up @@ -56,14 +56,20 @@ class ParticipantListItem extends StatelessWidget {
vertical: 6,
),
decoration: BoxDecoration(
color: theme.colorScheme.primaryContainer,
color: user.powerLevel >= 100
? theme.colorScheme.tertiary
: theme.colorScheme.tertiaryContainer,
borderRadius: BorderRadius.circular(
AppConfig.borderRadius,
),
),
child: Text(
permissionBatch,
style: TextStyle(color: theme.colorScheme.onPrimaryContainer),
style: theme.textTheme.labelSmall?.copyWith(
color: user.powerLevel >= 100
? theme.colorScheme.onTertiary
: theme.colorScheme.onTertiaryContainer,
),
),
),
membershipBatch == null
Expand All @@ -75,7 +81,12 @@ class ParticipantListItem extends StatelessWidget {
color: theme.secondaryHeaderColor,
borderRadius: BorderRadius.circular(8),
),
child: Center(child: Text(membershipBatch)),
child: Center(
child: Text(
membershipBatch,
style: theme.textTheme.labelSmall,
),
),
),
],
),
Expand Down
12 changes: 1 addition & 11 deletions lib/pages/settings_style/settings_style_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -213,17 +213,7 @@ class SettingsStyleView extends StatelessWidget {
),
child: DecoratedBox(
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [
theme.colorScheme.primary,
theme.brightness == Brightness.light
? theme.colorScheme
.onPrimaryFixedVariant
: theme.colorScheme.primaryFixed,
],
begin: Alignment.centerLeft,
end: Alignment.bottomRight,
),
color: theme.colorScheme.primary,
borderRadius: BorderRadius.circular(
AppConfig.borderRadius,
),
Expand Down

0 comments on commit cdaaad9

Please sign in to comment.