i8n과 광고 수정
This commit is contained in:
@@ -6,6 +6,8 @@ import '../services/notification_service.dart';
|
||||
import '../providers/subscription_provider.dart';
|
||||
import 'package:hive_flutter/hive_flutter.dart';
|
||||
import 'package:flutter/foundation.dart' show kIsWeb;
|
||||
import '../l10n/app_localizations.dart';
|
||||
import '../navigator_key.dart';
|
||||
|
||||
class AppLockProvider extends ChangeNotifier {
|
||||
final Box<bool> _appLockBox;
|
||||
@@ -72,8 +74,11 @@ class AppLockProvider extends ChangeNotifier {
|
||||
return true;
|
||||
}
|
||||
|
||||
final ctx = navigatorKey.currentContext;
|
||||
final loc = ctx != null ? AppLocalizations.of(ctx) : null;
|
||||
final authenticated = await _localAuth.authenticate(
|
||||
localizedReason: '생체 인증을 사용하여 앱 잠금을 해제하세요.',
|
||||
localizedReason:
|
||||
loc?.unlockWithBiometric ?? 'Unlock with biometric authentication.',
|
||||
options: const AuthenticationOptions(
|
||||
stickyAuth: true,
|
||||
biometricOnly: true,
|
||||
|
||||
@@ -8,6 +8,8 @@ import '../services/notification_service.dart';
|
||||
import '../services/exchange_rate_service.dart';
|
||||
import '../services/currency_util.dart';
|
||||
import 'category_provider.dart';
|
||||
import '../l10n/app_localizations.dart';
|
||||
import '../navigator_key.dart';
|
||||
|
||||
class SubscriptionProvider extends ChangeNotifier {
|
||||
late Box<SubscriptionModel> _subscriptionBox;
|
||||
@@ -239,10 +241,13 @@ class SubscriptionProvider extends ChangeNotifier {
|
||||
SubscriptionModel subscription) async {
|
||||
if (subscription.eventEndDate != null &&
|
||||
subscription.eventEndDate!.isAfter(DateTime.now())) {
|
||||
final ctx = navigatorKey.currentContext;
|
||||
final loc = ctx != null ? AppLocalizations.of(ctx) : null;
|
||||
await NotificationService.scheduleNotification(
|
||||
id: '${subscription.id}_event_end'.hashCode,
|
||||
title: '이벤트 종료 알림',
|
||||
body: '${subscription.serviceName}의 할인 이벤트가 종료되었습니다.',
|
||||
title: loc?.eventEndNotificationTitle ?? 'Event end notification',
|
||||
body: loc?.eventEndNotificationBody(subscription.serviceName) ??
|
||||
"${subscription.serviceName}'s discount event has ended.",
|
||||
scheduledDate: subscription.eventEndDate!,
|
||||
channelId: NotificationService.expirationChannelId,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user