feat: New chat background colors and chatlist design

This commit is contained in:
Christian Pauly 2021-08-29 11:29:14 +02:00
commit caaa7bd2dc
8 changed files with 92 additions and 48 deletions

View file

@ -0,0 +1,26 @@
import 'package:flutter/material.dart';
class BackgroundGradientBox extends StatelessWidget {
final Widget child;
const BackgroundGradientBox({
Key key,
this.child,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topRight,
end: Alignment.bottomLeft,
colors: [
Theme.of(context).scaffoldBackgroundColor,
Theme.of(context).secondaryHeaderColor,
],
),
),
child: child,
);
}
}

View file

@ -54,7 +54,7 @@ class Message extends StatelessWidget {
final client = Matrix.of(context).client;
final ownMessage = event.senderId == client.userID;
final alignment = ownMessage ? Alignment.topRight : Alignment.topLeft;
var color = Theme.of(context).secondaryHeaderColor;
var color = Theme.of(context).scaffoldBackgroundColor;
final sameSender = nextEvent != null &&
[EventTypes.Message, EventTypes.Sticker].contains(nextEvent.type)
? nextEvent.sender.id == event.sender.id

View file

@ -32,6 +32,7 @@ class StateMessage extends StatelessWidget {
border: Border.all(
color: Theme.of(context).dividerColor,
),
color: Theme.of(context).scaffoldBackgroundColor,
borderRadius: BorderRadius.circular(AppConfig.borderRadius),
),
child: Column(

View file

@ -3,6 +3,8 @@ import 'dart:math';
import 'package:fluffychat/config/themes.dart';
import 'package:flutter/material.dart';
import '../background_gradient_box.dart';
class OnePageCard extends StatelessWidget {
final Widget child;
@ -16,32 +18,16 @@ class OnePageCard extends StatelessWidget {
? child
: Material(
color: Theme.of(context).backgroundColor,
child: Container(
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topRight,
end: Alignment.bottomLeft,
stops: [
0.1,
0.4,
0.6,
0.9,
],
colors: [
Theme.of(context).secondaryHeaderColor.withAlpha(alpha),
Theme.of(context).primaryColor.withAlpha(alpha),
Theme.of(context).colorScheme.secondary.withAlpha(alpha),
Theme.of(context).backgroundColor.withAlpha(alpha),
],
child: BackgroundGradientBox(
child: Padding(
padding: EdgeInsets.symmetric(
horizontal:
max((MediaQuery.of(context).size.width - 600) / 2, 12),
vertical:
max((MediaQuery.of(context).size.height - 800) / 2, 12),
),
child: SafeArea(child: Card(elevation: 3, child: child)),
),
padding: EdgeInsets.symmetric(
horizontal:
max((MediaQuery.of(context).size.width - 600) / 2, 12),
vertical:
max((MediaQuery.of(context).size.height - 800) / 2, 12),
),
child: SafeArea(child: Card(elevation: 7, child: child)),
),
);
}