Browse Source

UI

null_safety
fmk 3 years ago
parent
commit
f001c02ae1
  1. 6
      lib/mine/mine_vip_level_page.dart
  2. 287
      lib/view_widget/mine_vip_view.dart

6
lib/mine/mine_vip_level_page.dart

@ -69,16 +69,14 @@ class _MineVipLevelPage extends State<MineVipLevelPage> {
physics: BouncingScrollPhysics(),
child: Column(
children: [
AspectRatio(
aspectRatio: 1.6,
Container(
height: 224.h ,
child: Swiper(
viewportFraction: 0.95,
loop: false,
physics: BouncingScrollPhysics(),
// index: (ranks != null && ranks.isNotEmpty) ? widget.arguments["rankLevel"] - 1 : 0,
controller: controller,
itemBuilder: (context, position) {
// if(ranks == null || ranks.isEmpty) return Container(width: 10, height: 10,);
return MineVipView(
position + 1,
curLevel: widget.arguments["rankLevel"],

287
lib/view_widget/mine_vip_view.dart

@ -92,170 +92,169 @@ class MineVipView extends StatelessWidget {
break;
}
}
return AspectRatio(
aspectRatio: 1.6,
child: Container(
margin: EdgeInsets.fromLTRB(padding.w, 16.h, padding.w, 8.h),
decoration: BoxDecoration(
gradient: LinearGradient(
colors: linearColor,
begin: Alignment.topLeft,
end: Alignment.bottomRight,
),
borderRadius: BorderRadius.circular(8),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
),
],
return Container(
margin: EdgeInsets.fromLTRB(padding.w, 16.h, padding.w, 8.h),
width: MediaQuery.of(context).size.width - 32.w,
height: 200.h,
decoration: BoxDecoration(
gradient: LinearGradient(
colors: linearColor,
begin: Alignment.topLeft,
end: Alignment.bottomRight,
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
height: 95.h,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: [
Container(
padding: EdgeInsets.fromLTRB(9.w, 4.h, 8.w, 4.h),
decoration: BoxDecoration(
color: levelColor,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(8),
bottomRight: Radius.circular(8),
),
borderRadius: BorderRadius.circular(8),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
),
],
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
height: 95.h,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: [
Container(
padding: EdgeInsets.fromLTRB(9.w, 4.h, 8.w, 4.h),
decoration: BoxDecoration(
color: levelColor,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(8),
bottomRight: Radius.circular(8),
),
child: Text(
topLeft,
style: TextStyle(
fontSize: 12.sp,
fontWeight: FontWeight.bold,
color: Colors.white,
),
),
child: Text(
topLeft,
style: TextStyle(
fontSize: 12.sp,
fontWeight: FontWeight.bold,
color: Colors.white,
),
),
Container(
margin: EdgeInsets.only(left: 13.w),
child: Text(
levelText,
style: TextStyle(
color: textColor,
fontWeight: FontWeight.bold,
fontSize: 23.sp,
),
),
Container(
margin: EdgeInsets.only(left: 13.w),
child: Text(
levelText,
style: TextStyle(
color: textColor,
fontWeight: FontWeight.bold,
fontSize: 23.sp,
),
),
],
),
),
],
),
Container(
margin: EdgeInsets.only(right: 11.w, bottom: 9.h),
child: Image.asset(
"assets/image/icon_mine_huixiang_logo.png",
width: 86.w,
height: 86.h,
fit: BoxFit.contain,
),
),
Container(
margin: EdgeInsets.only(right: 11.w, bottom: 9.h),
child: Image.asset(
"assets/image/icon_mine_huixiang_logo.png",
width: 86.w,
height: 86.h,
fit: BoxFit.contain,
),
],
),
Container(
margin: EdgeInsets.only(left: 13.w, right: 12.w, bottom: 12.h),
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.baseline,
textBaseline: TextBaseline.alphabetic,
children: [
Expanded(
child: Text(
rank > rankMax
? S.of(context).dangqiandengji
: "${S.of(context).jifen_(rankMax - rank)} ${S.of(context).daoxiayidengji}",
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: textColor,
fontWeight: FontWeight.w400,
fontSize: 14.sp,
),
),
],
),
Container(
margin: EdgeInsets.only(left: 13.w, right: 12.w, bottom: 12.h),
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.baseline,
textBaseline: TextBaseline.alphabetic,
children: [
Expanded(
child: Text(
rank > rankMax
? S.of(context).dangqiandengji
: "${S.of(context).jifen_(rankMax - rank)} ${S.of(context).daoxiayidengji}",
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: textColor,
fontWeight: FontWeight.w400,
fontSize: 14.sp,
),
flex: 1,
),
Text.rich(
TextSpan(
children: [
flex: 1,
),
Text.rich(
TextSpan(
children: [
TextSpan(
text: "$rank",
style: TextStyle(
fontSize: 26.sp,
fontWeight: FontWeight.bold,
color: textColor,
),
),
if (rank <= rankMax)
TextSpan(
text: "$rank",
// string
text: rankMax > 0 ? "/$rankMax" : "/0",
style: TextStyle(
fontSize: 26.sp,
fontWeight: FontWeight.bold,
fontSize: 14.sp,
fontWeight: FontWeight.w400,
color: textColor,
),
),
if (rank <= rankMax)
TextSpan(
// string
text: rankMax > 0 ? "/$rankMax" : "/0",
style: TextStyle(
fontSize: 14.sp,
fontWeight: FontWeight.w400,
color: textColor,
),
),
],
),
),
],
),
Container(
margin: EdgeInsets.only(top: 12.h, bottom: 12.h),
height: 8.h,
child: ClipRRect(
borderRadius: BorderRadius.circular(6.5),
child: LinearProgressIndicator(
value: rankMax > 0 ? rank / rankMax : 0,
backgroundColor: Colors.white,
color: levelColor,
],
),
),
],
),
Container(
margin: EdgeInsets.only(top: 12.h, bottom: 12.h),
height: 8.h,
child: ClipRRect(
borderRadius: BorderRadius.circular(6.5),
child: LinearProgressIndicator(
value: rankMax > 0 ? rank / rankMax : 0,
backgroundColor: Colors.white,
color: levelColor,
),
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
S.of(context).kaitongriqi(
(createTime != null && createTime != "")
? createTime.split(" ")[0]
: "$createTime"),
style: TextStyle(
color: textColor,
fontWeight: FontWeight.w400,
fontSize: 12.sp,
),
),
Icon(
Icons.qr_code,
size: 24,
color: Colors.white,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
S.of(context).kaitongriqi(
(createTime != null && createTime != "")
? createTime.split(" ")[0]
: "$createTime"),
style: TextStyle(
color: textColor,
fontWeight: FontWeight.w400,
fontSize: 12.sp,
),
],
),
],
),
),
Icon(
Icons.qr_code,
size: 24,
color: Colors.white,
),
],
),
],
),
],
),
),
],
),
);
}

Loading…
Cancel
Save