Skip to content

Commit

Permalink
Merge pull request #217 from dimipay/release/2.2.1+62
Browse files Browse the repository at this point in the history
Release/2.2.1+62
  • Loading branch information
sspzoa authored Dec 18, 2024
2 parents 9a273ad + 13eaea2 commit beb599f
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 44 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ google-services.json
**/ios/Runner.app.dSYM.zip
**/ios/Runner.ipa


firebase.json
firebase_options.dart

.fvm
.fvmrc
60 changes: 31 additions & 29 deletions lib/app/pages/home/widgets/admin_area.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import 'package:dimipay_app_v2/app/widgets/button.dart';
import 'package:dimipay_design_kit/dimipay_design_kit.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:shimmer/shimmer.dart';

import '../../../services/network/service.dart';

Expand Down Expand Up @@ -34,39 +33,42 @@ class AdminArea extends GetView<HomePageController> {
),
),
child: DPGestureDetectorWithOpacityInteraction(
onTap: isOffline
? null
: () {
controller.resetBrightness();
Get.toNamed(Routes.ADMIN);
},
child: Padding(
padding: const EdgeInsets.all(20),
child: Row(
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'관리자 페이지',
style: textTheme.itemTitle
.copyWith(color: colorTheme.grayscale900),
),
],
onTap: () => {},
child: DPGestureDetectorWithOpacityInteraction(
onTap: isOffline
? null
: () {
controller.resetBrightness();
Get.toNamed(Routes.ADMIN);
},
child: Padding(
padding: const EdgeInsets.all(20),
child: Row(
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'관리자 페이지',
style: textTheme.itemTitle
.copyWith(color: colorTheme.grayscale900),
),
],
),
),
),
Icon(
Icons.arrow_forward_ios_rounded,
size: 16,
color: colorTheme.grayscale500,
),
],
Icon(
Icons.arrow_forward_ios_rounded,
size: 16,
color: colorTheme.grayscale500,
),
],
),
),
),
),
),
);
});
}
}
}
39 changes: 30 additions & 9 deletions lib/app/pages/home/widgets/pay_area.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,38 +22,56 @@ class TokenLifeTimeIndicator extends StatefulWidget {

class _TokenLifeTimeIndicatorState extends State<TokenLifeTimeIndicator> with TickerProviderStateMixin {
AnimationController? animationController;

late Animation<double> _animation;
final int totalSeconds = 30;

void initAnimation() {
animationController?.dispose();

final remainingTime = widget.expireAt.difference(DateTime.now());
final startValue = 1 - (remainingTime.inSeconds / totalSeconds);

animationController = AnimationController(
duration: widget.expireAt.difference(DateTime.now()),
duration: remainingTime,
vsync: this,
);
_animation = Tween<double>(begin: 0, end: 1).animate(animationController!)
..addListener(
() => setState(() {}),
);

_animation = Tween<double>(
begin: startValue,
end: 1.0
).animate(CurvedAnimation(
parent: animationController!,
curve: Curves.linear,
));

animationController!.forward();

animationController!.addListener(() {
if (mounted) setState(() {});
});
}

@override
void initState() {
initAnimation();
super.initState();
initAnimation();
}

@override
void didUpdateWidget(covariant TokenLifeTimeIndicator oldWidget) {
initAnimation();
super.didUpdateWidget(oldWidget);
if (oldWidget.expireAt != widget.expireAt) {
initAnimation();
}
}

@override
Widget build(BuildContext context) {
DPColors colorTheme = Theme.of(context).extension<DPColors>()!;
DPTypography textTheme = Theme.of(context).extension<DPTypography>()!;

final remainingSeconds = (totalSeconds * (1 - _animation.value)).ceil();

return Stack(
alignment: Alignment.center,
children: [
Expand All @@ -66,7 +84,10 @@ class _TokenLifeTimeIndicatorState extends State<TokenLifeTimeIndicator> with Ti
color: colorTheme.grayscale400,
),
),
Text(((1 - _animation.value) * widget.lifetime.inSeconds).ceil().toString(), style: textTheme.token.copyWith(color: colorTheme.grayscale600)),
Text(
remainingSeconds.toString(),
style: textTheme.token.copyWith(color: colorTheme.grayscale600)
),
],
);
}
Expand Down
6 changes: 3 additions & 3 deletions lib/app/pages/pin/page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class OnboardingPinPage extends GetView<PinPageController> {
case PinPageStatus.wrong:
return PinPageBase(
headerText: '핀이 틀렸어요\n다시 입력해주세요',
textSpan: ' ${controller.pinCount}/5',
textSpan: '${controller.pinCount}/5',
onPinComplete: controller.onboardingAuth,
pinCount: controller.pinCount,
);
Expand All @@ -92,7 +92,7 @@ class UnlockPinPage extends GetView<PinPageController> {
case PinPageStatus.wrong:
return PinPageBase(
headerText: '핀이 틀렸어요\n다시 입력해주세요',
textSpan: ' ${controller.pinCount}/5',
textSpan: '${controller.pinCount}/5',
onPinComplete: controller.pinCheck,
pinCount: controller.pinCount,
faceIDAvailable: true,
Expand Down Expand Up @@ -128,7 +128,7 @@ class EditPinPage extends GetView<PinPageController> {
case PinPageStatus.wrong:
return PinPageBase(
headerText: '핀이 틀렸어요\n다시 입력해주세요',
textSpan: ' ${controller.pinCount}/5',
textSpan: '${controller.pinCount}/5',
onPinComplete: controller.changePinPreCheck,
pinCount: controller.pinCount,
);
Expand Down
2 changes: 1 addition & 1 deletion lib/app/services/pay/service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class PayService extends GetxController {

final int currentTime = DateTime.now().toLocal().millisecondsSinceEpoch;
final int t0 = paymentMethod.createdAt.toLocal().millisecondsSinceEpoch;
final int counter = (currentTime - t0) ~/ (30 * 1000); // 30초를 밀리초로 변환
final int counter = (currentTime - t0) ~/ (30 * 1000);

final currentStepStartTime = t0 + (counter * 30 * 1000);
final timeElapsedInStep = currentTime - currentStepStartTime;
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
# In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix.

version: 2.2.0+61
version: 2.2.1+62

environment:
sdk: ">=3.2.3 <4.0.0"
Expand Down

0 comments on commit beb599f

Please sign in to comment.