forked from lxm_flutter/FlutterUnit
代码 me 界面优化布局
This commit is contained in:
@@ -24,9 +24,9 @@
|
||||
|
||||
```
|
||||
a1@toly ~ % flutter --version
|
||||
Flutter 1.22.4 • channel stable • https://github.com/flutter/flutter.git
|
||||
Framework • revision 1aafb3a8b9 (4 days ago) • 2020-11-13 09:59:28 -0800
|
||||
Engine • revision 2c956a31c0
|
||||
Flutter 1.22.5 • channel stable • https://github.com/flutter/flutter.git
|
||||
Framework • revision 7891006299 (4 weeks ago) • 2020-12-10 11:54:40 -0800
|
||||
Engine • revision ae90085a84
|
||||
Tools • Dart 2.10.4
|
||||
```
|
||||
|
||||
|
||||
@@ -1,18 +1,50 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_unit/views/components/permanent/circle_image.dart';
|
||||
|
||||
import 'home_drawer.dart';
|
||||
import 'page_item.dart';
|
||||
|
||||
/// create by 张风捷特烈 on 2020/4/26
|
||||
/// contact me by email 1981462002@qq.com
|
||||
/// 说明:
|
||||
/// 说明:
|
||||
|
||||
class MePage extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
// appBar: AppBar(title: Text('我的账号'),),
|
||||
body: HomeDrawer(),
|
||||
);
|
||||
body: Column(
|
||||
children: [
|
||||
Container(
|
||||
height: 180,
|
||||
width: MediaQuery.of(context).size.width,
|
||||
child: Image.asset(
|
||||
'assets/images/sabar_bar.webp',
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
SizedOverflowBox(
|
||||
size: Size(0, 0),
|
||||
child: Align(
|
||||
alignment: Alignment(-0.7, 0),
|
||||
child: CircleImage(
|
||||
size: 80,
|
||||
shadowColor: Theme.of(context).primaryColor.withAlpha(33),
|
||||
image: AssetImage("assets/images/icon_head.webp"),
|
||||
),
|
||||
),
|
||||
),
|
||||
Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(right: 20, top: 8),
|
||||
child: Text(
|
||||
'张风捷特烈',
|
||||
style: TextStyle(
|
||||
fontSize: 18, color: Theme.of(context).primaryColor),
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(child: MePageItem())
|
||||
],
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_unit/app/res/style/behavior/no_scroll_behavior.dart';
|
||||
import 'package:flutter_unit/app/res/toly_icon.dart';
|
||||
import 'package:flutter_unit/app/router/unit_router.dart';
|
||||
import 'package:flutter_unit/views/components/permanent/circle_image.dart';
|
||||
@@ -7,10 +8,10 @@ import 'package:flutter_unit/views/components/permanent/circle_image.dart';
|
||||
/// contact me by email 1981462002@qq.com
|
||||
/// 说明:
|
||||
|
||||
class HomeDrawer extends StatelessWidget {
|
||||
class MePageItem extends StatelessWidget {
|
||||
final Color color;
|
||||
|
||||
HomeDrawer({this.color = Colors.white});
|
||||
MePageItem({this.color = Colors.white});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -18,37 +19,14 @@ class HomeDrawer extends StatelessWidget {
|
||||
}
|
||||
|
||||
Widget _buildChild(BuildContext context) {
|
||||
return Container(
|
||||
color: color.withAlpha(33),
|
||||
return ScrollConfiguration(
|
||||
behavior: NoScrollBehavior(),
|
||||
child: ListView(
|
||||
padding: EdgeInsets.zero,
|
||||
children: <Widget>[
|
||||
Stack(
|
||||
children: <Widget>[
|
||||
Column(
|
||||
children: <Widget>[
|
||||
Container(
|
||||
height: 180,
|
||||
width: MediaQuery.of(context).size.width,
|
||||
margin: EdgeInsets.only(bottom: 50),
|
||||
child: Image.asset(
|
||||
'assets/images/sabar_bar.webp',
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Positioned(
|
||||
bottom: 0,
|
||||
left: 50,
|
||||
child: CircleImage(
|
||||
size: 80,
|
||||
shadowColor: Theme.of(context).primaryColor.withAlpha(33),
|
||||
image: AssetImage("assets/images/icon_head.webp"),
|
||||
)),
|
||||
],
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
SizedBox(height: 10,),
|
||||
_buildItem(context, TolyIcon.icon_them, '应用设置', UnitRouter.setting),
|
||||
_buildItem(context, TolyIcon.icon_layout, '数据统计', null),
|
||||
_buildItem(context, TolyIcon.icon_collect, '我的收藏', UnitRouter.collect),
|
||||
@@ -61,13 +39,11 @@ class HomeDrawer extends StatelessWidget {
|
||||
height: 1,
|
||||
),
|
||||
_buildItem(context, TolyIcon.icon_kafei, '联系本王', UnitRouter.about_me),
|
||||
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Widget _buildItem(
|
||||
BuildContext context, IconData icon, String title, String linkTo,
|
||||
{VoidCallback onTap}) =>
|
||||
Reference in New Issue
Block a user