|
|
|
@ -34,13 +34,14 @@ class LocalLevelDatasourceImpl implements ILevelDatasource { |
|
|
|
response?['path'], |
|
|
|
(json) => NodeModel.fromJson(json), |
|
|
|
); |
|
|
|
final maxLevel = levels.takeWhile((e) => e.nodeType != NodeType.comingSoon).length; |
|
|
|
final playableLevels = levels |
|
|
|
.takeWhile((e) => e.nodeType != NodeType.comingSoon) |
|
|
|
.where((e) => e.nodeType == NodeType.level) |
|
|
|
.toList(); |
|
|
|
|
|
|
|
LocalStorage.saveData( |
|
|
|
key: MyConstants.maxLevelCount, |
|
|
|
value: |
|
|
|
'$maxLevel', |
|
|
|
); |
|
|
|
final maxLevel = playableLevels.length; |
|
|
|
debugPrint("Saving maxLevel to $maxLevel"); |
|
|
|
LocalStorage.saveData(key: MyConstants.maxLevelCount, value: '$maxLevel'); |
|
|
|
|
|
|
|
final Box<TotalDataEntity> levelBox = Hive.box(MyConstants.levelBox); |
|
|
|
dynamic existingKey; |
|
|
|
@ -82,4 +83,4 @@ class LocalLevelDatasourceImpl implements ILevelDatasource { |
|
|
|
throw const MyException(errorMessage: 'Operation Failed'); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |