48 lines
1.3 KiB
Dart
48 lines
1.3 KiB
Dart
// user_info_card.dart
|
|
import 'package:flutter/material.dart';
|
|
|
|
class UserInfoCard extends StatelessWidget {
|
|
final String userName;
|
|
final String userId;
|
|
|
|
const UserInfoCard({super.key, required this.userName, required this.userId});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Row(
|
|
children: [
|
|
Container(
|
|
width: 48,
|
|
height: 48,
|
|
decoration: BoxDecoration(
|
|
borderRadius: BorderRadius.circular(8),
|
|
image: DecorationImage(
|
|
image: NetworkImage('https://pic4.zhimg.com/v2-c34c61a90095abb8713de9d1dca7ec7b_r.jpg'),
|
|
fit: BoxFit.cover,
|
|
),
|
|
),
|
|
),
|
|
SizedBox(width: 12),
|
|
Expanded(
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Text(userName, style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold)),
|
|
Text('用户id:$userId', style: TextStyle(fontSize: 12, color: Colors.grey)),
|
|
],
|
|
),
|
|
),
|
|
IconButton(
|
|
icon: Icon(Icons.edit),
|
|
onPressed: () {},
|
|
),
|
|
Spacer(),
|
|
IconButton(
|
|
icon: Icon(Icons.add),
|
|
onPressed: () {},
|
|
),
|
|
],
|
|
);
|
|
}
|
|
}
|