Files
chat-flutter/lib/component/component_card.dart
2025-09-12 20:35:12 +08:00

58 lines
1.4 KiB
Dart
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import 'package:flutter/material.dart';
import 'package:demo/component/component_common.dart';
// 名片组件
class ComponentCard extends StatelessWidget {
final String nickname;
final String portrait;
final String userNo;
const ComponentCard({
super.key,
required this.nickname,
required this.portrait,
required this.userNo,
});
@override
Widget build(BuildContext context) {
return SizedBox(
height: 80,
child: Row(
children: [
Padding(
padding: const EdgeInsets.only(right: 10),
child: ComponentCommon.showAvatar(
portrait,
size: 55,
),
),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
nickname,
style: const TextStyle(
fontWeight: FontWeight.bold,
),
overflow: TextOverflow.ellipsis,
),
const SizedBox(
height: 10,
),
Text(
'ID$userNo',
style: const TextStyle(
color: Color.fromARGB(255, 123, 122, 122),
),
),
],
),
),
],
),
);
}
}