fix backdrop filter

This commit is contained in:
Salvatore Giordano
2020-10-28 10:39:55 +01:00
parent d2801b2b13
commit 3f619fe79c
3 changed files with 46 additions and 38 deletions
+12 -8
View File
@@ -43,27 +43,28 @@ class MessageActionsModal extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final ownId = StreamChat.of(context).user.id;
return GestureDetector( return GestureDetector(
behavior: HitTestBehavior.translucent, behavior: HitTestBehavior.translucent,
onTap: () { onTap: () {
Navigator.pop(context); Navigator.pop(context);
}, },
child: Center(
child: SingleChildScrollView(
child: Stack( child: Stack(
children: [ children: [
Positioned.fill( Positioned.fill(
child: BackdropFilter( child: BackdropFilter(
filter: ImageFilter.blur( filter: ImageFilter.blur(
sigmaX: 10, sigmaX: 10.8731,
sigmaY: 10, sigmaY: 10.8731,
), ),
child: Container( child: Container(
color: Colors.transparent, color: Colors.black.withOpacity(0.2),
), ),
), ),
), ),
Padding( Center(
child: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 8.0), padding: const EdgeInsets.symmetric(vertical: 8.0),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
@@ -91,6 +92,9 @@ class MessageActionsModal extends StatelessWidget {
showReactions: false, showReactions: false,
showUsername: false, showUsername: false,
showReplyIndicator: false, showReplyIndicator: false,
showUserAvatar: message.user.id == ownId
? DisplayWidget.gone
: DisplayWidget.show,
showTimestamp: false, showTimestamp: false,
showSendingIndicator: DisplayWidget.gone, showSendingIndicator: DisplayWidget.gone,
shape: messageShape, shape: messageShape,
@@ -131,10 +135,10 @@ class MessageActionsModal extends StatelessWidget {
], ],
), ),
), ),
),
),
], ],
), ),
),
),
); );
} }
+12 -8
View File
@@ -34,27 +34,28 @@ class MessageReactionsModal extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final ownId = StreamChat.of(context).user.id;
return GestureDetector( return GestureDetector(
behavior: HitTestBehavior.translucent, behavior: HitTestBehavior.translucent,
onTap: () { onTap: () {
Navigator.pop(context); Navigator.pop(context);
}, },
child: Center(
child: SingleChildScrollView(
child: Stack( child: Stack(
children: [ children: [
Positioned.fill( Positioned.fill(
child: BackdropFilter( child: BackdropFilter(
filter: ImageFilter.blur( filter: ImageFilter.blur(
sigmaX: 10, sigmaX: 10.8731,
sigmaY: 10, sigmaY: 10.8731,
), ),
child: Container( child: Container(
color: Colors.transparent, color: Colors.black.withOpacity(0.2),
), ),
), ),
), ),
Padding( Center(
child: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 8.0), padding: const EdgeInsets.symmetric(vertical: 8.0),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
@@ -81,6 +82,9 @@ class MessageReactionsModal extends StatelessWidget {
messageTheme: messageTheme, messageTheme: messageTheme,
showReactions: false, showReactions: false,
showUsername: false, showUsername: false,
showUserAvatar: message.user.id == ownId
? DisplayWidget.gone
: DisplayWidget.show,
showReplyIndicator: false, showReplyIndicator: false,
showTimestamp: false, showTimestamp: false,
showSendingIndicator: DisplayWidget.gone, showSendingIndicator: DisplayWidget.gone,
@@ -95,10 +99,10 @@ class MessageReactionsModal extends StatelessWidget {
], ],
), ),
), ),
),
),
], ],
), ),
),
),
); );
} }
+4 -4
View File
@@ -220,8 +220,8 @@ class StreamChatThemeData {
return StreamChatThemeData( return StreamChatThemeData(
accentColor: accentColor, accentColor: accentColor,
primaryColor: isDark ? Colors.black : Colors.white, primaryColor: isDark ? Colors.black : Colors.white,
primaryIconTheme: primaryIconTheme: IconThemeData(
IconThemeData(color: isDark ? Colors.white : Colors.black), color: isDark ? Colors.white : Colors.black.withOpacity(.5)),
defaultChannelImage: (context, channel) => SizedBox(), defaultChannelImage: (context, channel) => SizedBox(),
backgroundColor: isDark ? Colors.black : Colors.white, backgroundColor: isDark ? Colors.black : Colors.white,
defaultUserImage: (context, user) => Center( defaultUserImage: (context, user) => Center(
@@ -287,7 +287,7 @@ class StreamChatThemeData {
), ),
ownMessageTheme: MessageTheme( ownMessageTheme: MessageTheme(
messageText: TextStyle( messageText: TextStyle(
fontSize: 15, fontSize: 14.5,
color: isDark ? Colors.white : Colors.black, color: isDark ? Colors.white : Colors.black,
), ),
createdAt: TextStyle( createdAt: TextStyle(
@@ -320,7 +320,7 @@ class StreamChatThemeData {
isDark ? Color(0xff191919) : Color(0xffEAEAEA), isDark ? Color(0xff191919) : Color(0xffEAEAEA),
reactionsBorderColor: isDark ? Colors.black : Colors.white, reactionsBorderColor: isDark ? Colors.black : Colors.white,
messageText: TextStyle( messageText: TextStyle(
fontSize: 15, fontSize: 14.5,
color: isDark ? Colors.white : Colors.black, color: isDark ? Colors.white : Colors.black,
), ),
createdAt: TextStyle( createdAt: TextStyle(