mirror of
https://github.com/lakaola/chat-flutter.git
synced 2026-05-22 18:10:06 +08:00
58 lines
1.4 KiB
Dart
58 lines
1.4 KiB
Dart
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),
|
||
),
|
||
),
|
||
],
|
||
),
|
||
),
|
||
],
|
||
),
|
||
);
|
||
}
|
||
}
|