You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
194 lines
7.8 KiB
194 lines
7.8 KiB
3 years ago
|
import 'package:flutter/cupertino.dart';
|
||
|
import 'package:flutter/material.dart';
|
||
|
import 'package:huixiang/retrofit/retrofit_api.dart';
|
||
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||
|
import 'package:huixiang/utils/font_weight.dart';
|
||
|
import 'package:huixiang/view_widget/classic_header.dart';
|
||
|
import 'package:huixiang/view_widget/custom_image.dart';
|
||
|
import 'package:huixiang/view_widget/my_footer.dart';
|
||
|
import 'package:pull_to_refresh/pull_to_refresh.dart';
|
||
|
|
||
|
class PersonalPage extends StatefulWidget {
|
||
|
@override
|
||
|
State<StatefulWidget> createState() {
|
||
|
return _PersonalPage();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
class _PersonalPage extends State<PersonalPage>
|
||
|
with WidgetsBindingObserver {
|
||
|
ApiService apiService;
|
||
|
final RefreshController refreshController = RefreshController();
|
||
|
final ScrollController scrollController = ScrollController();
|
||
|
|
||
|
@override
|
||
|
void initState() {
|
||
|
super.initState();
|
||
|
WidgetsBinding.instance.addObserver(this);
|
||
|
_onRefresh();
|
||
|
}
|
||
|
|
||
|
_onRefresh() {
|
||
|
|
||
|
}
|
||
|
|
||
|
@override
|
||
|
Widget build(BuildContext context) {
|
||
|
return Stack(
|
||
|
children: [
|
||
|
Positioned(
|
||
|
child: Container(
|
||
|
color: Colors.white,
|
||
|
child: SmartRefresher(
|
||
|
controller: refreshController,
|
||
|
enablePullDown: true,
|
||
|
enablePullUp: true,
|
||
|
header: MyHeader(),
|
||
|
footer: CustomFooter(
|
||
|
builder: (context, mode) {
|
||
|
return MyFooter(mode);
|
||
|
},
|
||
|
),
|
||
|
onRefresh: _onRefresh,
|
||
|
onLoading: () {
|
||
|
_onRefresh();
|
||
|
},
|
||
|
physics: BouncingScrollPhysics(),
|
||
|
scrollController: scrollController,
|
||
|
child: Container(
|
||
|
child: SingleChildScrollView(
|
||
|
physics: BouncingScrollPhysics(),
|
||
|
child: Container(
|
||
|
color: Color(0xFFF7F7F7),
|
||
|
child:Column(
|
||
|
children: [
|
||
|
Stack(
|
||
|
alignment: Alignment.bottomLeft,
|
||
|
children: [
|
||
|
Container(
|
||
|
// height: 286,
|
||
|
child:
|
||
|
Stack(
|
||
|
alignment: Alignment.bottomCenter,
|
||
|
children: [
|
||
|
Stack(
|
||
|
children: [
|
||
|
Positioned(
|
||
|
child: Container(
|
||
|
color: Colors.black,
|
||
|
child:Opacity(
|
||
|
opacity:0.9,
|
||
|
child: MImage(
|
||
|
"",
|
||
|
width: double.infinity,
|
||
|
height: 260.h,
|
||
|
fit: BoxFit.cover,
|
||
|
errorSrc: "assets/image/default_1.png",
|
||
|
fadeSrc: "assets/image/default_1.png",
|
||
|
)
|
||
|
)
|
||
|
)
|
||
|
),
|
||
|
Container(
|
||
|
margin: EdgeInsets.only(
|
||
|
top: 50.h, left: 16.w, right: 16.w),
|
||
|
decoration: BoxDecoration(
|
||
|
color: Colors.transparent,
|
||
|
),
|
||
|
child: Column(
|
||
|
mainAxisAlignment:
|
||
|
MainAxisAlignment.spaceBetween,
|
||
|
crossAxisAlignment:
|
||
|
CrossAxisAlignment.center,
|
||
|
children: [
|
||
|
GestureDetector(
|
||
|
child: Image.asset(
|
||
|
"assets/image/integral_return.png",
|
||
|
width: 24,
|
||
|
height: 24,
|
||
|
),
|
||
|
onTap: () {
|
||
|
Navigator.of(context).pop();
|
||
|
},
|
||
|
),
|
||
|
],
|
||
|
),
|
||
|
),
|
||
|
],
|
||
|
),
|
||
|
Container(
|
||
|
child: Column(
|
||
|
children: [
|
||
|
Padding(padding:EdgeInsets.only(right:16.w,bottom:16.h),
|
||
|
child: Row(
|
||
|
children: [
|
||
|
Spacer(),
|
||
|
Container(
|
||
|
margin: EdgeInsets.only(top: 8, right: 8),
|
||
|
padding: EdgeInsets.only(left: 2, right: 2),
|
||
|
width: 59.w,
|
||
|
height: 21.h,
|
||
|
alignment: Alignment.center,
|
||
|
decoration: BoxDecoration(
|
||
|
borderRadius: BorderRadius.circular(2),
|
||
|
color: Color(0x80000000),
|
||
|
),
|
||
|
child: Text(
|
||
|
"更换背景",
|
||
|
overflow:TextOverflow.ellipsis,
|
||
|
style: TextStyle(
|
||
|
fontSize: 12.sp,
|
||
|
fontWeight: MyFontWeight.regular,
|
||
|
color: Color(0xFFFFFFFF),
|
||
|
),
|
||
|
),
|
||
|
),
|
||
|
],
|
||
|
)),
|
||
|
|
||
|
],
|
||
|
),
|
||
|
),
|
||
|
],
|
||
|
),
|
||
|
),
|
||
|
// homeInfo(),
|
||
|
],
|
||
|
),
|
||
|
],
|
||
|
),
|
||
|
),
|
||
|
),
|
||
|
),
|
||
|
),
|
||
|
),
|
||
|
bottom: 0,
|
||
|
top: 0,
|
||
|
left: 0,
|
||
|
right: 0,
|
||
|
),
|
||
|
],
|
||
|
);
|
||
|
}
|
||
|
|
||
|
Widget homeInfo(){
|
||
|
return Container(
|
||
|
margin: EdgeInsets.only(left: 16),
|
||
|
child: Row(
|
||
|
children: [
|
||
|
MImage(
|
||
|
"",
|
||
|
isCircle: true,
|
||
|
width: 66,
|
||
|
height: 66,
|
||
|
fit: BoxFit.cover,
|
||
|
errorSrc: "assets/image/default_user.png",
|
||
|
fadeSrc: "assets/image/default_user.png",
|
||
|
),
|
||
|
],
|
||
|
),
|
||
|
);
|
||
|
}
|
||
|
|
||
|
}
|