Skip to content

Commit

Permalink
Minor warning fixes
Browse files Browse the repository at this point in the history
Wolfteam committed Aug 27, 2023
1 parent 64bc736 commit 838231c
Showing 5 changed files with 4 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -118,7 +118,6 @@ class WishBannerHistoryBloc extends Bloc<WishBannerHistoryEvent, WishBannerHisto
switch (state.groupedType) {
case WishBannerGroupedType.version:
filteredPeriods.addAll(state.allPeriods.where((el) => keys.contains(el.groupingKey)));
break;
case WishBannerGroupedType.character:
case WishBannerGroupedType.weapon:
final groupByCharacter = state.groupedType == WishBannerGroupedType.character;
@@ -132,18 +131,15 @@ class WishBannerHistoryBloc extends Bloc<WishBannerHistoryEvent, WishBannerHisto
filteredPeriods.add(period);
}
}
break;
}
} else {
switch (state.groupedType) {
case WishBannerGroupedType.version:
filteredPeriods.addAll(state.allPeriods);
break;
case WishBannerGroupedType.character:
case WishBannerGroupedType.weapon:
final periods = _getGroupedByCharacterOrWeaponPeriod(state.allPeriods, state.groupedType);
filteredPeriods.addAll(periods);
break;
}
}

Original file line number Diff line number Diff line change
@@ -73,7 +73,7 @@ class WishSimulatorResultBloc extends Bloc<WishSimulatorResultEvent, WishSimulat
rarity: e.rarity,
weaponType: e.weaponType,
),
)
),
].where((el) {
if (el.rarity != randomRarity) {
return false;
@@ -219,7 +219,7 @@ class _RatesPerBannerType {
final BannerItemType type;
final List<_BannerRate> _rates = [];

Map<int, int> get getDefaultXStarCount => {for (var v in _rates) v.rarity: 0};
Map<int, int> get getDefaultXStarCount => {for (final v in _rates) v.rarity: 0};

_RatesPerBannerType(this.type) {
switch (type) {
@@ -228,12 +228,10 @@ class _RatesPerBannerType {
_rates.add(const _BannerRate(5, 90, 0.6, 40, 74));
_rates.add(const _BannerRate(4, 10, 5.1, 4, 7));
_rates.add(const _BannerRate.simple(3, 94.3));
break;
case BannerItemType.weapon:
_rates.add(const _BannerRate(5, 80, 0.7, 30, 64));
_rates.add(const _BannerRate(4, 10, 6.0, 4, 7));
_rates.add(const _BannerRate.simple(3, 93.3));
break;
}
}

4 changes: 0 additions & 4 deletions lib/infrastructure/file/banner_history_file_service.dart
Original file line number Diff line number Diff line change
@@ -359,13 +359,11 @@ class BannerHistoryFileServiceImpl extends BannerHistoryFileService {
),
);
featured.add(WishBannerFeaturedItemModel(key: key, iconImage: iconImagePath, rarity: character.rarity, type: ItemType.character));
break;
case BannerHistoryItemType.weapon:
final weapon = _weapons.getWeapon(key);
final imagePath = _resourceService.getWeaponImagePath(weapon.image, weapon.type);
weapons.add(WishBannerWeaponModel(key: key, rarity: weapon.rarity, image: imagePath, iconImage: imagePath, weaponType: weapon.type));
featured.add(WishBannerFeaturedItemModel(key: key, iconImage: imagePath, rarity: weapon.rarity, type: ItemType.weapon));
break;
}
}

@@ -539,13 +537,11 @@ class BannerHistoryFileServiceImpl extends BannerHistoryFileService {
if (character != null && !characters.any((el) => el.key == key)) {
characters.add(ItemCommonWithNameAndRarity(key, character.name, character.rarity));
}
break;
case BannerHistoryItemType.weapon:
final weapon = possiblePromotedItems.firstWhereOrNull((el) => el.key == key);
if (weapon != null && !weapons.any((el) => el.key == key)) {
weapons.add(ItemCommonWithNameAndRarity(key, weapon.name, weapon.rarity));
}
break;
}
}

Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@ class ItemCommonWithNameAppBarSearchDelegate extends SearchDelegate<List<String>
query = '';
}
},
)
),
];

@override
5 changes: 1 addition & 4 deletions lib/presentation/wish_simulator/wish_simulator_page.dart
Original file line number Diff line number Diff line change
@@ -155,7 +155,7 @@ class _WishSimulatorPageState extends State<WishSimulatorPage> {
),
),
),
)
),
],
),
),
@@ -249,15 +249,12 @@ class _CenterPageView extends StatelessWidget {
final elementType = banner.characters.firstWhere((c) => c.key == banner.featuredItems.first.key).elementType;
topTitle = s.characterEventWish;
color = elementType.getElementColor(true);
break;
case BannerItemType.weapon:
topTitle = s.weaponEventWish;
color = Colors.orange;
break;
case BannerItemType.standard:
topTitle = s.standardEventWish;
color = Colors.deepPurple;
break;
}
return BannerMainImage(
topTitle: topTitle,

0 comments on commit 838231c

Please sign in to comment.