You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
971 B
39 lines
971 B
import 'package:flutter/material.dart';
|
|
|
|
class MessageNotification extends StatelessWidget {
|
|
//
|
|
final VoidCallback? onReply;
|
|
final String? avatar;
|
|
final String? nickname;
|
|
final String? content;
|
|
|
|
const MessageNotification({
|
|
Key? key,
|
|
@required this.onReply,
|
|
@required this.avatar,
|
|
@required this.nickname,
|
|
@required this.content,
|
|
}) : super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Card(
|
|
margin: const EdgeInsets.symmetric(horizontal: 4),
|
|
child: SafeArea(
|
|
child: ListTile(
|
|
leading: SizedBox.fromSize(
|
|
size: const Size(40, 40),
|
|
child: ClipOval(child: Image.network(avatar!))),
|
|
title: Text(nickname!),
|
|
subtitle: Text(content!),
|
|
trailing: IconButton(
|
|
icon: Icon(Icons.reply),
|
|
onPressed: () {
|
|
if (onReply != null) onReply!();
|
|
}),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|