Improvements

- InkWell effect on avatar and image messages
This commit is contained in:
Linloir 2022-10-20 14:12:57 +08:00
parent a5d5fe5eef
commit 01f39f0ca8
No known key found for this signature in database
GPG Key ID: 58EEB209A0F2C366
5 changed files with 49 additions and 21 deletions

View File

@ -1,7 +1,7 @@
/*
* @Author : Linloir
* @Date : 2022-10-14 17:04:20
* @LastEditTime : 2022-10-20 11:05:37
* @LastEditTime : 2022-10-20 13:47:29
* @Description :
*/
@ -20,12 +20,24 @@ class ImageBox extends StatelessWidget {
@override
Widget build(BuildContext context) {
return InkWell(
onTap: (){},
child: Container(
constraints: const BoxConstraints(maxWidth: 500, maxHeight: 250),
return IntrinsicWidth(
child: IntrinsicHeight(
child: Stack(
children: [
Container(
constraints: const BoxConstraints(maxWidth: 500, maxHeight: 200),
child: history.preCachedImage ?? Image.memory(base64Decode(history.message.contentDecoded)),
),
Material(
color: Colors.transparent,
child: InkWell(
splashColor: Colors.white.withOpacity(0.1),
onTap: (){},
)
),
]
),
),
);
}
}

View File

@ -1,7 +1,7 @@
/*
* @Author : Linloir
* @Date : 2022-10-14 13:49:47
* @LastEditTime : 2022-10-19 23:45:16
* @LastEditTime : 2022-10-20 13:56:20
* @Description :
*/
@ -75,13 +75,16 @@ class InMessageBox extends StatelessWidget {
)
),
if(history.message.type == MessageType.image)
...[
const SizedBox(height: 4.0,),
Text(
_getTimeStamp(history.message.timeStamp),
style: TextStyle(
fontSize: 12,
color: Colors.grey[400],
color: Colors.grey[600],
),
)
),
]
]
);
}

View File

@ -1,7 +1,7 @@
/*
* @Author : Linloir
* @Date : 2022-10-13 21:49:53
* @LastEditTime : 2022-10-20 11:52:12
* @LastEditTime : 2022-10-20 13:46:16
* @Description :
*/
@ -75,18 +75,23 @@ class UserAvatar extends StatelessWidget {
),
child: ClipRRect(
borderRadius: BorderRadius.circular(5.0),
child: Material(
color: Colors.transparent,
child: InkWell(
onTap: onTap,
child: OverflowBox(
child: Stack(
fit: StackFit.passthrough,
children: [
OverflowBox(
alignment: Alignment.center,
child: FittedBox(
fit: BoxFit.cover,
child: Image.memory(base64.decode(state.userInfo.avatarEncoded!)),
),
)
),
Material(
color: Colors.transparent,
child: InkWell(
onTap: onTap,
),
),
],
),
),
);

View File

@ -78,6 +78,13 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.2+1"
easy_image_viewer:
dependency: "direct main"
description:
name: easy_image_viewer
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.0"
equatable:
dependency: "direct main"
description:

View File

@ -57,6 +57,7 @@ dependencies:
easy_debounce: ^2.0.2+1
path: ^1.8.2
window_manager: ^0.2.7
easy_image_viewer: ^1.1.0
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.