Files
weiyu/visitor/flutter/demo/example/lib/notification/custom_notification.dart
jack ning 8a84e6b738 update
2024-04-05 15:53:09 +08:00

39 lines
977 B
Dart
Executable File

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: const Icon(Icons.reply),
onPressed: () {
if (onReply != null) onReply!();
}),
),
),
);
}
}