32Flutter仿京东商城项目 用户中心页面布局
2024-09-01 13:05:26
import 'package:flutter/material.dart';
import 'package:flutter_jdshop/services/ScreenAdapter.dart'; class UserPage extends StatefulWidget {
UserPage({Key key}) : super(key: key); _UserPageState createState() => _UserPageState();
} class _UserPageState extends State<UserPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("用户中心"),
),
body: ListView(
children: <Widget>[
Container(
height: ScreenAdapter.height(),
width: double.infinity,
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage('images/user_bg.jpg'),
fit: BoxFit.cover)),
child: Row(
children: <Widget>[
Container(
margin: EdgeInsets.fromLTRB(, , , ),
child: ClipOval(
child: Image.asset(
'images/user.png',
fit: BoxFit.cover,
width: ScreenAdapter.width(),
height: ScreenAdapter.width(),
),
),
),
// Expanded(
// flex: 1,
// child: Text('登录/注册',style: TextStyle(
// color: Colors.white
// )),
// )
Expanded(
flex: ,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text("用户名:123456789",
style: TextStyle(
color: Colors.white,
fontSize: ScreenAdapter.size())),
Text("普通会员",
style: TextStyle(
color: Colors.white,
fontSize: ScreenAdapter.size()))
],
),
)
],
),
),
ListTile(
leading: Icon(Icons.home, color: Colors.red), title: Text('首页')),
Divider(),
ListTile(leading: Icon(Icons.home), title: Text('首页')),
ListTile(leading: Icon(Icons.home), title: Text('首页')),
ListTile(leading: Icon(Icons.home), title: Text('首页'))
],
),
);
}
}
pubspec.yaml
assets:
- images/user_bg.jpg
- images/.0x/user_bg.jpg
- images/.0x/user_bg.jpg
- images/user.png
- images/.0x/user.png
- images/.0x/user.png
最新文章
- Segment set
- Python Set Literals
- 数学 - Whu 1603 - Minimum Sum
- mysql数据库的主从
- iOS字符串大小转换
- python学习之random模块
- 当 tcpdump -w 遇到 Permission denied
- C语言(按键获取与函数)
- winform控件跨线程委托
- Python虚拟环境安装virtualenv
- Android Studio的使用(六)
- Linux查看文件夹大小du
- Bootstrap每天必学之导航条
- 可视化之Berkeley Earth
- Fedora 19: How to resize/extend (LVM) partition?
- Python基础面试,看这篇文章画重点吧,Python面试题No1
- PyTorch(一)Basics
- extjs store快速创建的几种方式
- Kotlin provideDelegate
- 动态规划 51nod 1183