添加签到成功弹窗

hmxc
张萌 3 years ago
parent 2e709bdb41
commit 3bdc5ff851

Binary file not shown.

After

Width:  |  Height:  |  Size: 620 KiB

@ -172,6 +172,10 @@ class $AssetsIconsGen {
/// File path: assets/icons/change.png
AssetGenImage get change => const AssetGenImage('assets/icons/change.png');
/// File path: assets/icons/clock_success.png
AssetGenImage get clockSuccess =>
const AssetGenImage('assets/icons/clock_success.png');
/// File path: assets/icons/collect.png
AssetGenImage get collect => const AssetGenImage('assets/icons/collect.png');

@ -5,11 +5,13 @@ import 'package:aku_new_community/extensions/widget_list_ext.dart';
import 'package:aku_new_community/gen/assets.gen.dart';
import 'package:aku_new_community/models/integral/add_integral_config_model.dart';
import 'package:aku_new_community/models/integral/clocked_record_list_model.dart';
import 'package:aku_new_community/pages/personal/clock_in/clock_success_dialog.dart';
import 'package:aku_new_community/widget/bee_back_button.dart';
import 'package:aku_new_community/widget/others/user_tool.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:velocity_x/velocity_x.dart';
class ClockInPage extends StatefulWidget {
@ -21,7 +23,7 @@ class ClockInPage extends StatefulWidget {
class _ClockInPageState extends State<ClockInPage> {
List<AddIntegralConfigModel> _configs = [
AddIntegralConfigModel(addIntegral: 1, hasClocked: true),
AddIntegralConfigModel(addIntegral: 1, hasClocked: false),
AddIntegralConfigModel(addIntegral: 2, hasClocked: false),
AddIntegralConfigModel(addIntegral: 3, hasClocked: false),
AddIntegralConfigModel(addIntegral: 5, hasClocked: false),
@ -44,6 +46,7 @@ class _ClockInPageState extends State<ClockInPage> {
];
bool _openRemind = false; //
bool get hasClocked => _configs[0].hasClocked;
@override
Widget build(BuildContext context) {
@ -195,45 +198,34 @@ class _ClockInPageState extends State<ClockInPage> {
),
Spacer(),
MaterialButton(
onPressed: () {},
onPressed: hasClocked
? null
: () async {
await Get.dialog(ClockSuccessDialog(
todayIntegral: _configs[0].addIntegral,
tomorrowIntegral: _configs[1].addIntegral));
_configs[0] = AddIntegralConfigModel(
addIntegral: _configs[0].addIntegral, hasClocked: true);
setState(() {});
},
elevation: 0,
color: kPrimaryColor,
disabledColor: kPrimaryColor.withOpacity(0.4),
minWidth: 560,
height: 93.w,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(59.w)),
child: '签到'.text.size(32.sp).black.bold.make(),
child: (hasClocked ? '已签到' : '签到')
.text
.size(32.sp)
.color(Colors.black.withOpacity(hasClocked ? 0.4 : 1.0))
.bold
.make(),
)
],
),
);
return Scaffold(
appBar: AppBar(
backgroundColor: Colors.transparent,
title: '每日签到'.text.size(32.sp).white.make(),
leading: BeeBackButton(
color: Colors.white,
),
),
extendBody: true,
extendBodyBehindAppBar: true,
body: Container(
width: double.infinity,
height: double.infinity,
decoration: BoxDecoration(
image: DecorationImage(
alignment: Alignment.topCenter,
fit: BoxFit.fitHeight,
image: AssetImage(Assets.static.signInBackground.path)),
),
child: SafeArea(
child: Column(
children: [
top,
80.hb,
clockInCard,
40.hb,
Flexible(
var bottomList = Flexible(
child: Container(
width: double.infinity,
decoration: BoxDecoration(
@ -244,8 +236,7 @@ class _ClockInPageState extends State<ClockInPage> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding:
EdgeInsets.only(top: 32.w, left: 32.w, right: 32.w),
padding: EdgeInsets.only(top: 32.w, left: 32.w, right: 32.w),
child: '签到记录'.text.size(32.sp).black.bold.make(),
),
24.hb,
@ -254,8 +245,7 @@ class _ClockInPageState extends State<ClockInPage> {
shrinkWrap: true,
children: [
..._records
.mapIndexed((currentValue, index) =>
recordListTile(
.mapIndexed((currentValue, index) => recordListTile(
currentValue.day,
currentValue.date,
currentValue.addIntegral))
@ -265,11 +255,8 @@ class _ClockInPageState extends State<ClockInPage> {
height: 82.w,
alignment: Alignment.center,
color: Color(0xFFE5E5E5),
child: '没有更多记录了~'
.text
.size(28.sp)
.color(ktextSubColor)
.make(),
child:
'没有更多记录了~'.text.size(28.sp).color(ktextSubColor).make(),
),
].sepWidget(separate: 32.hb),
),
@ -277,7 +264,34 @@ class _ClockInPageState extends State<ClockInPage> {
],
),
),
);
return Scaffold(
appBar: AppBar(
backgroundColor: Colors.transparent,
title: '每日签到'.text.size(32.sp).white.make(),
leading: BeeBackButton(
color: Colors.white,
),
),
extendBody: true,
extendBodyBehindAppBar: true,
body: Container(
width: double.infinity,
height: double.infinity,
decoration: BoxDecoration(
image: DecorationImage(
alignment: Alignment.topCenter,
fit: BoxFit.fitHeight,
image: AssetImage(Assets.static.signInBackground.path)),
),
child: SafeArea(
child: Column(
children: [
top,
80.hb,
clockInCard,
40.hb,
bottomList,
],
),
),

@ -0,0 +1,95 @@
import 'package:aku_new_community/base/base_style.dart';
import 'package:aku_new_community/extensions/num_ext.dart';
import 'package:aku_new_community/gen/assets.gen.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:velocity_x/velocity_x.dart';
class ClockSuccessDialog extends StatelessWidget {
final int todayIntegral;
final int tomorrowIntegral;
const ClockSuccessDialog(
{Key? key, required this.todayIntegral, required this.tomorrowIntegral})
: super(key: key);
@override
Widget build(BuildContext context) {
return Center(
child: Material(
borderRadius: BorderRadius.circular(16.w),
clipBehavior: Clip.antiAliasWithSaveLayer,
color: Colors.transparent,
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Container(
width: 500.w,
height: 600.w,
alignment: Alignment.center,
decoration: BoxDecoration(color: Colors.white),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Assets.icons.clockSuccess.image(width: 240.w, height: 240.w),
48.hb,
'签到成功'.text.size(40.sp).black.isIntrinsic.bold.make(),
14.hb,
'获得'
.richText
.withTextSpanChildren([
'$todayIntegral'
.textSpan
.size(28.sp)
.color(kPrimaryColor)
.make(),
'点积分'.textSpan.size(28.sp).color(ktextSubColor).make(),
])
.size(28.sp)
.color(ktextSubColor)
.isIntrinsic
.make(),
56.hb,
Container(
width: 355.w,
height: 58.w,
alignment: Alignment.center,
decoration: BoxDecoration(
color: Color(0xFFFFE7BA),
borderRadius: BorderRadius.circular(44.w),
),
child: '明日继续签到可获得'
.richText
.withTextSpanChildren([
'$tomorrowIntegral点积分'
.textSpan
.size(24.sp)
.color(kPrimaryColor)
.make(),
])
.size(24.sp)
.color(Colors.black.withOpacity(0.45))
.isIntrinsic
.make(),
),
],
),
),
24.hb,
IconButton(
onPressed: () {
Get.back();
},
icon: Icon(
CupertinoIcons.xmark_circle,
size: 60.w,
color: Colors.white.withOpacity(0.5),
))
],
),
),
);
}
}

@ -200,6 +200,22 @@ class _integralCenterPageState extends State<integralCenterPage> {
back,
top,
midCard,
Positioned(
right: 0,
top: 168.w,
child: Container(
width: 176.w,
height: 58.w,
decoration: BoxDecoration(
color: Color(0xFFFFF7E1),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(29.w),
bottomLeft: Radius.circular(29.w))),
alignment: Alignment.center,
child:
'购物得活跃度'.text.size(24.sp).color(Color(0xFFFE905A)).make(),
),
),
],
),
),

Loading…
Cancel
Save