diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts
index bc2e45c..06978aa 100644
--- a/android/app/build.gradle.kts
+++ b/android/app/build.gradle.kts
@@ -1,11 +1,24 @@
// Author: fruit.com.cn
+import java.io.FileInputStream
+import java.util.Properties
+
plugins {
id("com.android.application")
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
id("dev.flutter.flutter-gradle-plugin")
}
+// 正式包签名信息从 android/key.properties 读取;该文件与 keystore 都已忽略入库。
+// 文件缺失时回落到 debug 签名,保证本地 `flutter run --release` 仍可调试。
+val keystorePropertiesFile = rootProject.file("key.properties")
+val keystoreProperties = Properties()
+if (keystorePropertiesFile.exists()) {
+ FileInputStream(keystorePropertiesFile).use { keystoreProperties.load(it) }
+}
+val hasReleaseKeystore = keystorePropertiesFile.exists() &&
+ keystoreProperties.getProperty("storeFile").orEmpty().isNotEmpty()
+
android {
namespace = "com.stormg.lumadrama"
// permission_handler_android 14 的 AAR 元数据要求依赖方 compileSdk >= 37,
@@ -29,6 +42,21 @@ android {
versionName = flutter.versionName
}
+ signingConfigs {
+ if (hasReleaseKeystore) {
+ create("release") {
+ storeFile = file(keystoreProperties.getProperty("storeFile"))
+ storePassword = keystoreProperties.getProperty("storePassword")
+ keyAlias = keystoreProperties.getProperty("keyAlias")
+ keyPassword = keystoreProperties.getProperty("keyPassword")
+ // Google Play 要求上传包必须使用固定密钥签名,且开启 Play 应用签名后该密钥成为上传密钥。
+ enableV1Signing = true
+ enableV2Signing = true
+ enableV3Signing = true
+ }
+ }
+ }
+
buildTypes {
release {
// 生产包只保留 arm64-v8a 与 armeabi-v7a,避免插件带入 x86_64 原生库
@@ -42,9 +70,8 @@ android {
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro",
)
- // TODO: Add your own signing config for the release build.
- // Signing with the debug keys for now, so `flutter run --release` works.
- signingConfig = signingConfigs.getByName("debug")
+ // 有 upload keystore 时用正式签名,否则回落到 debug 便于本地调试。
+ signingConfig = signingConfigs.getByName(if (hasReleaseKeystore) "release" else "debug")
}
}
}
diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml
index cc1e67c..9734e00 100644
--- a/android/app/src/main/AndroidManifest.xml
+++ b/android/app/src/main/AndroidManifest.xml
@@ -6,7 +6,7 @@
diff --git a/assets/icon/google_g.png b/assets/icon/google_g.png
new file mode 100644
index 0000000..8d17e48
Binary files /dev/null and b/assets/icon/google_g.png differ
diff --git a/assets/icon/vip_membership_badge.png b/assets/icon/vip_membership_badge.png
new file mode 100644
index 0000000..879edaf
Binary files /dev/null and b/assets/icon/vip_membership_badge.png differ
diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj
index 7609503..233b1fe 100644
--- a/ios/Runner.xcodeproj/project.pbxproj
+++ b/ios/Runner.xcodeproj/project.pbxproj
@@ -387,7 +387,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
- PRODUCT_BUNDLE_IDENTIFIER = com.stormg.lumadramv;
+ PRODUCT_BUNDLE_IDENTIFIER = com.stormg.lumadrama;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
@@ -567,7 +567,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
- PRODUCT_BUNDLE_IDENTIFIER = com.stormg.lumadramv;
+ PRODUCT_BUNDLE_IDENTIFIER = com.stormg.lumadrama;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
@@ -590,7 +590,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
- PRODUCT_BUNDLE_IDENTIFIER = com.stormg.lumadramv;
+ PRODUCT_BUNDLE_IDENTIFIER = com.stormg.lumadrama;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
diff --git a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
new file mode 100644
index 0000000..0e9c078
--- /dev/null
+++ b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
@@ -0,0 +1,68 @@
+{
+ "pins" : [
+ {
+ "identity" : "app-check",
+ "kind" : "remoteSourceControl",
+ "location" : "https://github.com/google/app-check.git",
+ "state" : {
+ "revision" : "b7c71458b70284cc0f5a87103f66f0b1d98b1873",
+ "version" : "12.1.0"
+ }
+ },
+ {
+ "identity" : "appauth-ios",
+ "kind" : "remoteSourceControl",
+ "location" : "https://github.com/openid/AppAuth-iOS.git",
+ "state" : {
+ "revision" : "a972daac82d449d58ab119e91c68153e29ddac33",
+ "version" : "3.0.0"
+ }
+ },
+ {
+ "identity" : "googlesignin-ios",
+ "kind" : "remoteSourceControl",
+ "location" : "https://github.com/google/GoogleSignIn-iOS.git",
+ "state" : {
+ "revision" : "bfaebbc04a4d13ed7a89b0fc1fb8ad66b362cc1c",
+ "version" : "10.1.0"
+ }
+ },
+ {
+ "identity" : "googleutilities",
+ "kind" : "remoteSourceControl",
+ "location" : "https://github.com/google/GoogleUtilities.git",
+ "state" : {
+ "revision" : "5459ee5603def3db0fe14ca522185f42c48d978e",
+ "version" : "8.1.5"
+ }
+ },
+ {
+ "identity" : "gtm-session-fetcher",
+ "kind" : "remoteSourceControl",
+ "location" : "https://github.com/google/gtm-session-fetcher.git",
+ "state" : {
+ "revision" : "724a52eea6329b7e12d3ad8300d76ca9f3895fcc",
+ "version" : "5.3.1"
+ }
+ },
+ {
+ "identity" : "gtmappauth",
+ "kind" : "remoteSourceControl",
+ "location" : "https://github.com/google/GTMAppAuth.git",
+ "state" : {
+ "revision" : "57094cd46bc8700d3a887e2a429f42b6e8ea3f0b",
+ "version" : "6.0.0"
+ }
+ },
+ {
+ "identity" : "interop-ios-for-google-sdks",
+ "kind" : "remoteSourceControl",
+ "location" : "https://github.com/google/interop-ios-for-google-sdks.git",
+ "state" : {
+ "revision" : "040d087ac2267d2ddd4cca36c757d1c6a05fdbfe",
+ "version" : "101.0.0"
+ }
+ }
+ ],
+ "version" : 2
+}
diff --git a/ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved b/ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved
new file mode 100644
index 0000000..0e9c078
--- /dev/null
+++ b/ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved
@@ -0,0 +1,68 @@
+{
+ "pins" : [
+ {
+ "identity" : "app-check",
+ "kind" : "remoteSourceControl",
+ "location" : "https://github.com/google/app-check.git",
+ "state" : {
+ "revision" : "b7c71458b70284cc0f5a87103f66f0b1d98b1873",
+ "version" : "12.1.0"
+ }
+ },
+ {
+ "identity" : "appauth-ios",
+ "kind" : "remoteSourceControl",
+ "location" : "https://github.com/openid/AppAuth-iOS.git",
+ "state" : {
+ "revision" : "a972daac82d449d58ab119e91c68153e29ddac33",
+ "version" : "3.0.0"
+ }
+ },
+ {
+ "identity" : "googlesignin-ios",
+ "kind" : "remoteSourceControl",
+ "location" : "https://github.com/google/GoogleSignIn-iOS.git",
+ "state" : {
+ "revision" : "bfaebbc04a4d13ed7a89b0fc1fb8ad66b362cc1c",
+ "version" : "10.1.0"
+ }
+ },
+ {
+ "identity" : "googleutilities",
+ "kind" : "remoteSourceControl",
+ "location" : "https://github.com/google/GoogleUtilities.git",
+ "state" : {
+ "revision" : "5459ee5603def3db0fe14ca522185f42c48d978e",
+ "version" : "8.1.5"
+ }
+ },
+ {
+ "identity" : "gtm-session-fetcher",
+ "kind" : "remoteSourceControl",
+ "location" : "https://github.com/google/gtm-session-fetcher.git",
+ "state" : {
+ "revision" : "724a52eea6329b7e12d3ad8300d76ca9f3895fcc",
+ "version" : "5.3.1"
+ }
+ },
+ {
+ "identity" : "gtmappauth",
+ "kind" : "remoteSourceControl",
+ "location" : "https://github.com/google/GTMAppAuth.git",
+ "state" : {
+ "revision" : "57094cd46bc8700d3a887e2a429f42b6e8ea3f0b",
+ "version" : "6.0.0"
+ }
+ },
+ {
+ "identity" : "interop-ios-for-google-sdks",
+ "kind" : "remoteSourceControl",
+ "location" : "https://github.com/google/interop-ios-for-google-sdks.git",
+ "state" : {
+ "revision" : "040d087ac2267d2ddd4cca36c757d1c6a05fdbfe",
+ "version" : "101.0.0"
+ }
+ }
+ ],
+ "version" : 2
+}
diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist
index 25c3834..dea50b7 100644
--- a/ios/Runner/Info.plist
+++ b/ios/Runner/Info.plist
@@ -7,7 +7,7 @@
CFBundleDevelopmentRegion
$(DEVELOPMENT_LANGUAGE)
CFBundleDisplayName
- ymb
+ YMB
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
@@ -24,6 +24,19 @@
????
CFBundleVersion
$(FLUTTER_BUILD_NUMBER)
+ CFBundleURLTypes
+
+
+ CFBundleTypeRole
+ Editor
+ CFBundleURLSchemes
+
+ com.googleusercontent.apps.11115008580-51gv4sj2c78rud6n127g3shu4d2n96un
+
+
+
+ GIDClientID
+ 11115008580-51gv4sj2c78rud6n127g3shu4d2n96un.apps.googleusercontent.com
LSRequiresIPhoneOS
NSAppTransportSecurity
diff --git a/lib/app.dart b/lib/app.dart
index 47ea1e3..422737b 100644
--- a/lib/app.dart
+++ b/lib/app.dart
@@ -21,6 +21,7 @@ import 'core/data/remote/interaction_api.dart';
import 'core/data/remote/library_api.dart';
import 'core/data/remote/notice_api.dart';
import 'core/data/remote/playback_api.dart';
+import 'core/data/remote/reward_api.dart';
import 'core/data/remote/watch_api.dart';
import 'core/data/repositories/catalog_repository.dart';
import 'core/data/repositories/account_repository.dart';
@@ -33,6 +34,7 @@ import 'core/data/repositories/interaction_repository.dart';
import 'core/data/repositories/notice_repository.dart';
import 'core/data/repositories/playback_repository.dart';
import 'core/data/repositories/playlist_repository.dart';
+import 'core/data/repositories/reward_repository.dart';
import 'core/data/repositories/search_repository.dart';
import 'core/data/repositories/store_repository.dart';
import 'core/data/repositories/watch_history_repository.dart';
@@ -49,6 +51,7 @@ import 'core/data/services/playlist_controller.dart';
import 'core/data/services/event_tracker.dart';
import 'core/data/services/playback_position_cache.dart';
import 'core/data/services/playback_session.dart';
+import 'core/data/services/reward_controller.dart';
import 'core/data/services/unlocked_episode_registry.dart';
import 'core/data/services/video_player_port.dart';
import 'core/data/services/wallet_controller.dart';
@@ -90,6 +93,7 @@ class LumaDramaApp extends StatefulWidget {
this.storeRepository,
this.searchRepository,
this.playlistRepository,
+ this.rewardRepository,
this.haptics = const FlutterHaptics(),
});
@@ -111,6 +115,7 @@ class LumaDramaApp extends StatefulWidget {
final StoreRepository? storeRepository;
final SearchRepository? searchRepository;
final PlaylistRepository? playlistRepository;
+ final RewardRepository? rewardRepository;
final Haptics haptics;
@override
@@ -179,6 +184,13 @@ class _LumaDramaAppState extends State {
_commerceRepository,
);
+ late final RewardRepository _rewardRepository =
+ widget.rewardRepository ?? HttpRewardRepository(RewardApi(_apiClient));
+
+ late final RewardController _rewardController = RewardController(
+ _rewardRepository,
+ );
+
late final SearchRepository _searchRepository =
widget.searchRepository ?? HttpSearchRepository(CatalogApi(_apiClient));
@@ -249,6 +261,7 @@ class _LumaDramaAppState extends State {
unawaited(_favoriteController.load());
_downloadController.reset();
_walletController.reset();
+ _rewardController.reset();
}
}
@@ -258,6 +271,7 @@ class _LumaDramaAppState extends State {
_favoriteController.dispose();
_downloadController.dispose();
_walletController.dispose();
+ _rewardController.dispose();
_interactionController.dispose();
_localeController.dispose();
_appConfigController.dispose();
@@ -313,6 +327,7 @@ class _LumaDramaAppState extends State {
ChangeNotifierProvider.value(value: _favoriteController),
ChangeNotifierProvider.value(value: _downloadController),
ChangeNotifierProvider.value(value: _walletController),
+ ChangeNotifierProvider.value(value: _rewardController),
ChangeNotifierProvider.value(value: _interactionController),
ChangeNotifierProvider.value(value: _localeController),
ChangeNotifierProvider.value(value: _appConfigController),
diff --git a/lib/core/config/dev_config.dart b/lib/core/config/dev_config.dart
index e98de84..e8bf20e 100644
--- a/lib/core/config/dev_config.dart
+++ b/lib/core/config/dev_config.dart
@@ -2,9 +2,11 @@
/// 开发环境配置。
///
-/// 本机联调用:模拟器与桌面端可直接用回环地址,但 iOS/Android 真机必须用
-/// 开发机的局域网 IP(真机上的 127.0.0.1 指向手机自己)。地址不要带结尾斜杠。
+/// UAT Debug 默认地址。
+///
+/// `uat` 分支的 Debug 包也应访问 UAT 服务,不应回落到开发机局域网地址。
+/// 地址不要带结尾斜杠。
abstract final class DevConfig {
- /// 开发机后端地址(Mac 当前 Wi-Fi 地址,换网络后需要同步修改)。
- static const String baseUrl = 'http://192.168.31.243:8081';
+ /// UAT 客户端 API 地址。
+ static const String baseUrl = 'https://drama-api.frostgiant.vip';
}
diff --git a/lib/core/config/prod_config.dart b/lib/core/config/prod_config.dart
index 4eebfc8..9792991 100644
--- a/lib/core/config/prod_config.dart
+++ b/lib/core/config/prod_config.dart
@@ -5,5 +5,5 @@
/// 发版前确认这里的 [baseUrl],地址不要带结尾斜杠。
abstract final class ProdConfig {
/// 生产后端地址。
- static const String baseUrl = 'http://39.162.50.99:8081';
+ static const String baseUrl = 'https://drama-api.frostgiant.vip';
}
diff --git a/lib/core/config/server_endpoint.dart b/lib/core/config/server_endpoint.dart
index 3ec6161..f58fe08 100644
--- a/lib/core/config/server_endpoint.dart
+++ b/lib/core/config/server_endpoint.dart
@@ -10,6 +10,9 @@ abstract final class ServerEndpoint {
/// Preference key used for the runtime server address.
static const String preferenceKey = 'dev.api_base_url';
+ /// 地址迁移前的开发机默认值;UAT 启动时不能继续使用它。
+ static const String legacyLocalBaseUrl = 'http://192.168.31.120:8081';
+
/// Returns a normalized http(s) URL, or null for invalid input.
static String? normalize(String? raw) {
final value = raw?.trim() ?? '';
@@ -38,8 +41,15 @@ abstract final class ServerEndpoint {
try {
final prefs = preferences ?? SharedPreferencesAsync();
final stored = await prefs.getString(preferenceKey);
+ final normalizedStored = normalize(stored);
+ if (normalizedStored == legacyLocalBaseUrl &&
+ normalize(AppConfig.baseUrl) != legacyLocalBaseUrl) {
+ await prefs.remove(preferenceKey);
+ AppConfig.clearRuntimeBaseUrl();
+ return;
+ }
AppConfig.applyRuntimeBaseUrl(
- resolve(stored: stored, fallback: AppConfig.baseUrl),
+ resolve(stored: normalizedStored, fallback: AppConfig.baseUrl),
);
} catch (_) {
AppConfig.clearRuntimeBaseUrl();
diff --git a/lib/core/data/models/reward.dart b/lib/core/data/models/reward.dart
new file mode 100644
index 0000000..fc3195b
--- /dev/null
+++ b/lib/core/data/models/reward.dart
@@ -0,0 +1,242 @@
+// Author: fruit.com.cn
+
+import 'json_numbers.dart';
+
+/// 奖励中心首屏数据。
+class RewardOverview {
+ const RewardOverview({
+ required this.serverDate,
+ required this.timezone,
+ required this.coinBalance,
+ required this.checkin,
+ this.sections = const [],
+ this.activities = const [],
+ });
+
+ final String serverDate;
+ final String timezone;
+ final int coinBalance;
+ final RewardCheckinState checkin;
+ final List sections;
+ final List activities;
+
+ factory RewardOverview.fromJson(Map json) {
+ return RewardOverview(
+ serverDate: json['serverDate'] as String? ?? '',
+ timezone: json['timezone'] as String? ?? '',
+ coinBalance: jsonToInt(json['coinBalance']),
+ checkin: RewardCheckinState.fromJson(_map(json['checkin'])),
+ sections: _maps(json['sections']).map(RewardSection.fromJson).toList(),
+ activities: _maps(
+ json['activities'],
+ ).map(RewardActivity.fromJson).toList(),
+ );
+ }
+}
+
+/// 七日签到状态。
+class RewardCheckinState {
+ const RewardCheckinState({
+ required this.taskId,
+ required this.checkedInToday,
+ required this.streak,
+ required this.currentDay,
+ this.days = const [],
+ });
+
+ final String taskId;
+ final bool checkedInToday;
+ final int streak;
+ final int currentDay;
+ final List days;
+
+ factory RewardCheckinState.fromJson(Map json) {
+ return RewardCheckinState(
+ taskId: (json['taskId'] ?? '').toString(),
+ checkedInToday: json['checkedInToday'] == true,
+ streak: jsonToInt(json['streak']),
+ currentDay: jsonToInt(json['currentDay']),
+ days: _maps(json['days']).map(RewardCheckinDay.fromJson).toList(),
+ );
+ }
+}
+
+/// 签到周期中的一天。
+class RewardCheckinDay {
+ const RewardCheckinDay({
+ required this.dayIndex,
+ required this.rewardCoin,
+ required this.checked,
+ required this.current,
+ });
+
+ final int dayIndex;
+ final int rewardCoin;
+ final bool checked;
+ final bool current;
+
+ factory RewardCheckinDay.fromJson(Map json) {
+ return RewardCheckinDay(
+ dayIndex: jsonToInt(json['dayIndex']),
+ rewardCoin: jsonToInt(json['rewardCoin']),
+ checked: json['checked'] == true,
+ current: json['current'] == true,
+ );
+ }
+}
+
+/// 一组奖励任务。
+class RewardSection {
+ const RewardSection({
+ required this.code,
+ required this.title,
+ this.tasks = const [],
+ });
+
+ final String code;
+ final String title;
+ final List tasks;
+
+ factory RewardSection.fromJson(Map json) {
+ return RewardSection(
+ code: json['code'] as String? ?? '',
+ title: json['title'] as String? ?? '',
+ tasks: _maps(json['tasks']).map(RewardTask.fromJson).toList(),
+ );
+ }
+}
+
+/// 奖励任务卡片。
+class RewardTask {
+ const RewardTask({
+ required this.id,
+ required this.code,
+ required this.type,
+ required this.title,
+ required this.subtitle,
+ required this.ctaText,
+ required this.actionType,
+ required this.actionUrl,
+ required this.progressValue,
+ required this.targetValue,
+ required this.rewardCoin,
+ required this.status,
+ this.iconUrl = '',
+ });
+
+ final String id;
+ final String code;
+ final String type;
+ final String title;
+ final String subtitle;
+ final String ctaText;
+ final String actionType;
+ final String actionUrl;
+ final String iconUrl;
+ final int progressValue;
+ final int targetValue;
+ final int rewardCoin;
+ final String status;
+
+ bool get claimable => status == 'COMPLETED';
+ bool get claimed => status == 'CLAIMED';
+ double get progress =>
+ targetValue <= 0 ? 0 : (progressValue / targetValue).clamp(0.0, 1.0);
+
+ factory RewardTask.fromJson(Map json) {
+ return RewardTask(
+ id: (json['id'] ?? '').toString(),
+ code: json['code'] as String? ?? '',
+ type: json['type'] as String? ?? '',
+ title: json['title'] as String? ?? '',
+ subtitle: json['subtitle'] as String? ?? '',
+ ctaText: json['ctaText'] as String? ?? '',
+ actionType: json['actionType'] as String? ?? '',
+ actionUrl: json['actionUrl'] as String? ?? '',
+ iconUrl: json['iconUrl'] as String? ?? '',
+ progressValue: jsonToInt(json['progressValue']),
+ targetValue: jsonToInt(json['targetValue']),
+ rewardCoin: jsonToInt(json['rewardCoin']),
+ status: json['status'] as String? ?? 'IN_PROGRESS',
+ );
+ }
+}
+
+/// 奖励活动展示卡片。
+class RewardActivity {
+ const RewardActivity({
+ required this.id,
+ required this.code,
+ required this.title,
+ required this.summary,
+ required this.ctaText,
+ required this.actionType,
+ required this.actionUrl,
+ this.coverUrl = '',
+ });
+
+ final String id;
+ final String code;
+ final String title;
+ final String summary;
+ final String ctaText;
+ final String actionType;
+ final String actionUrl;
+ final String coverUrl;
+
+ factory RewardActivity.fromJson(Map json) {
+ return RewardActivity(
+ id: (json['id'] ?? '').toString(),
+ code: json['code'] as String? ?? '',
+ title: json['title'] as String? ?? '',
+ summary: json['summary'] as String? ?? '',
+ ctaText: json['ctaText'] as String? ?? '',
+ actionType: json['actionType'] as String? ?? '',
+ actionUrl: json['actionUrl'] as String? ?? '',
+ coverUrl: json['coverUrl'] as String? ?? '',
+ );
+ }
+}
+
+/// 签到或任务领取后的余额变化结果。
+class RewardActionResult {
+ const RewardActionResult({
+ required this.rewardCoin,
+ required this.coinBalance,
+ required this.alreadyCompleted,
+ });
+
+ final int rewardCoin;
+ final int coinBalance;
+ final bool alreadyCompleted;
+
+ factory RewardActionResult.fromCheckin(Map json) {
+ return RewardActionResult(
+ rewardCoin: jsonToInt(json['rewardCoin']),
+ coinBalance: jsonToInt(json['coinBalance']),
+ alreadyCompleted: json['alreadyCheckedIn'] == true,
+ );
+ }
+
+ factory RewardActionResult.fromClaim(Map json) {
+ return RewardActionResult(
+ rewardCoin: jsonToInt(json['rewardCoin']),
+ coinBalance: jsonToInt(json['coinBalance']),
+ alreadyCompleted: json['alreadyGranted'] == true,
+ );
+ }
+}
+
+Map _map(Object? value) {
+ if (value is Map) return value;
+ if (value is Map) return value.cast();
+ return const {};
+}
+
+List