feat:增加菜单栏模块
This commit is contained in:
78
lib/pages/profile_page.dart
Normal file
78
lib/pages/profile_page.dart
Normal file
@@ -0,0 +1,78 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ProfilePage extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SingleChildScrollView(
|
||||
padding: EdgeInsets.all(16),
|
||||
child: Column(
|
||||
children: [
|
||||
// 个人信息卡片
|
||||
Card(
|
||||
elevation: 4,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(20),
|
||||
child: Row(
|
||||
children: [
|
||||
CircleAvatar(
|
||||
radius: 40,
|
||||
backgroundColor: Colors.blue,
|
||||
child: Icon(Icons.person, size: 40, color: Colors.white),
|
||||
),
|
||||
SizedBox(width: 16),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'张小明',
|
||||
style: TextStyle(
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 4),
|
||||
Text('高级用户', style: TextStyle(color: Colors.grey)),
|
||||
SizedBox(height: 8),
|
||||
Row(
|
||||
children: [
|
||||
Icon(Icons.star, size: 16, color: Colors.amber),
|
||||
SizedBox(width: 4),
|
||||
Text('会员等级: VIP3'),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
SizedBox(height: 20),
|
||||
|
||||
// 详细信息
|
||||
_buildInfoItem('手机号码', '138****1234', Icons.phone),
|
||||
_buildInfoItem('邮箱地址', 'zhang@example.com', Icons.email),
|
||||
_buildInfoItem('注册时间', '2024年1月15日', Icons.calendar_today),
|
||||
_buildInfoItem('所在地区', '北京市朝阳区', Icons.location_on),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildInfoItem(String title, String value, IconData icon) {
|
||||
return Card(
|
||||
margin: EdgeInsets.only(bottom: 12),
|
||||
child: ListTile(
|
||||
leading: Icon(icon, color: Colors.blue),
|
||||
title: Text(title),
|
||||
subtitle: Text(value),
|
||||
trailing: Icon(Icons.edit, size: 20),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user