增加广告组件,个人中心
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
/// widget
|
||||
import './widget/user_info.dart';
|
||||
import './widget/user_order.dart';
|
||||
|
||||
class UserPages extends StatefulWidget {
|
||||
const UserPages({Key? key}) : super(key: key);
|
||||
|
||||
@@ -11,12 +15,14 @@ class _UserPagesState extends State<UserPages> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('我的'),
|
||||
shadowColor: Colors.transparent,
|
||||
),
|
||||
body: const Center(
|
||||
child: Text('我的'),
|
||||
body: SingleChildScrollView(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: const <Widget>[
|
||||
UserInfo(),
|
||||
UserOrder(),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
58
lib/pages/user/widget/user_info.dart
Normal file
58
lib/pages/user/widget/user_info.dart
Normal file
@@ -0,0 +1,58 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class UserInfo extends StatefulWidget {
|
||||
const UserInfo({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<UserInfo> createState() => _UserInfoState();
|
||||
}
|
||||
|
||||
class _UserInfoState extends State<UserInfo> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
padding: EdgeInsets.fromLTRB(
|
||||
20.0,
|
||||
MediaQuery.of(context).padding.top,
|
||||
20.0,
|
||||
50.0,
|
||||
),
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage('assets/login/auth_bg.png'),
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
const SizedBox(height: 40.0),
|
||||
ClipOval(
|
||||
child: Image.network(
|
||||
'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fup.enterdesk.com%2Fedpic%2F78%2Fab%2Ffc%2F78abfc26e04035fc8fd68aaee233c5b7.jpg&refer=http%3A%2F%2Fup.enterdesk.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1656234411&t=4544b17883f935447981f761b1e2a941',
|
||||
height: 65.0,
|
||||
width: 65.0,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 15.0),
|
||||
const Text(
|
||||
'唐明明',
|
||||
style: TextStyle(
|
||||
fontSize: 20.0,
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 5.0),
|
||||
const Text(
|
||||
'NTF编号00001',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
93
lib/pages/user/widget/user_order.dart
Normal file
93
lib/pages/user/widget/user_order.dart
Normal file
@@ -0,0 +1,93 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../../main_color.dart';
|
||||
|
||||
class UserOrder extends StatelessWidget {
|
||||
const UserOrder({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
padding: const EdgeInsets.all(10.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const Text(
|
||||
'订单管理',
|
||||
style: TextStyle(
|
||||
fontSize: 15.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10.0),
|
||||
Card(
|
||||
child: Row(children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: Column(children: const <Widget>[
|
||||
Icon(Icons.home),
|
||||
Text(
|
||||
'全部',
|
||||
style: TextStyle(fontSize: 12.0, color: tTextColor),
|
||||
textAlign: TextAlign.center,
|
||||
)
|
||||
]),
|
||||
),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: Column(children: <Widget>[
|
||||
Image.asset(
|
||||
'assets/icons/order_icon_00.png',
|
||||
width: 20.0,
|
||||
fit: BoxFit.fitWidth,
|
||||
),
|
||||
const SizedBox(height: 5.0),
|
||||
const Text(
|
||||
'待支付',
|
||||
style: TextStyle(fontSize: 12.0, color: tTextColor),
|
||||
textAlign: TextAlign.center,
|
||||
)
|
||||
]),
|
||||
),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: Column(children: const <Widget>[
|
||||
Icon(Icons.card_giftcard),
|
||||
Text(
|
||||
'待发货',
|
||||
style: TextStyle(fontSize: 12.0, color: tTextColor),
|
||||
textAlign: TextAlign.center,
|
||||
)
|
||||
]),
|
||||
),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: Column(children: const <Widget>[
|
||||
Icon(Icons.check),
|
||||
Text(
|
||||
'待收货',
|
||||
style: TextStyle(fontSize: 12.0, color: tTextColor),
|
||||
textAlign: TextAlign.center,
|
||||
)
|
||||
]),
|
||||
),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: Column(children: const <Widget>[
|
||||
SizedBox(height: 15.0),
|
||||
Icon(Icons.home),
|
||||
Text(
|
||||
'已完成',
|
||||
style: TextStyle(fontSize: 12.0, color: tTextColor),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
SizedBox(height: 15.0),
|
||||
]),
|
||||
),
|
||||
]),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user