Skip to content

Commit

Permalink
Add sony icons
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobaraujo7 committed Jan 15, 2024
1 parent df50535 commit 49a87a0
Show file tree
Hide file tree
Showing 7 changed files with 157 additions and 6 deletions.
83 changes: 83 additions & 0 deletions assets/static/play1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/static/ps2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
54 changes: 54 additions & 0 deletions assets/static/psp.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions lib/app/core/assets/static.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,19 @@ const allSVG = 'assets/static/all.svg';
const switchSVG = 'assets/static/switch.svg';
const favoriteSVG = 'assets/static/favorite.svg';
const androidSVG = 'assets/static/android.svg';
const ps1SVG = 'assets/static/ps1.svg';
const ps2SVG = 'assets/static/ps2.svg';
const pspSVG = 'assets/static/psp.svg';

Future<void> precacheCache(BuildContext context) async {
for (final asset in [
allSVG,
switchSVG,
favoriteSVG,
androidSVG,
ps1SVG,
ps2SVG,
pspSVG,
]) {
const loader = SvgAssetLoader(allSVG);
await svg.cache
Expand Down
14 changes: 9 additions & 5 deletions lib/app/data/mocks/mock_game_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ class MockGameRepository implements GameRepository {
name: 'Super Mario Odyssey',
description: 'Super Mario Odyssey',
platform: Yuzu(),
image: await cacheImage('https://cgngamesbh.com.br/product_images/p/512/Mario_Odyssey_Switch__68057_zoom.jpg'),
image: await cacheImage(
'https://cgngamesbh.com.br/product_images/p/512/Mario_Odyssey_Switch__68057_zoom.jpg'),
path: 'caminho_do_jogo',
category: {
defaultCategoryAllState,
Expand All @@ -36,7 +37,8 @@ class MockGameRepository implements GameRepository {
name: 'Dave the diver',
description: 'Dave to Diver',
platform: Yuzu(),
image: await cacheImage('https://images.nintendolife.com/08ce0f98414a5/dave-the-diver-cover.cover_large.jpg'),
image: await cacheImage(
'https://images.nintendolife.com/08ce0f98414a5/dave-the-diver-cover.cover_large.jpg'),
path: 'caminho_do_jogo',
category: {
defaultCategoryAllState,
Expand All @@ -50,11 +52,12 @@ class MockGameRepository implements GameRepository {
name: 'Prince of Persia - The Sands of Time',
description: 'Prince game',
platform: AetherSX2(),
image: await cacheImage('https://upload.wikimedia.org/wikipedia/pt/thumb/8/85/Prince-of-Persia-The-Sands-of-Time-Cover.jpg/250px-Prince-of-Persia-The-Sands-of-Time-Cover.jpg'),
image: await cacheImage(
'https://upload.wikimedia.org/wikipedia/pt/thumb/8/85/Prince-of-Persia-The-Sands-of-Time-Cover.jpg/250px-Prince-of-Persia-The-Sands-of-Time-Cover.jpg'),
path: 'caminho_do_jogo',
category: {
defaultCategoryAllState,
categorieState.firstWhere((e) => e.name == "Nintendo Switch"),
categorieState.firstWhere((e) => e.name == "Playstation 2"),
},
genre: 'Platform',
publisher: 'Nintendo',
Expand Down Expand Up @@ -113,7 +116,8 @@ class MockGameRepository implements GameRepository {

if (!file.existsSync()) {
await file.create(recursive: true);
final response = await uno.get(imageUrl, responseType: ResponseType.arraybuffer);
final response =
await uno.get(imageUrl, responseType: ResponseType.arraybuffer);
await file.writeAsBytes(response.data);
}

Expand Down
3 changes: 3 additions & 0 deletions lib/app/interactor/atoms/game_atom.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,7 @@ final defaultCategoryFavorite =
final categorieState = <GameCategory>[
GameCategory(name: 'Android', image: img.androidSVG),
GameCategory(name: 'Nintendo Switch', image: img.switchSVG),
GameCategory(name: 'Playstation 1', image: img.ps1SVG),
GameCategory(name: 'Playstation 2', image: img.ps2SVG),
GameCategory(name: 'Playstation Portable', image: img.pspSVG),
];
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# 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: 0.0.1+4
version: 0.0.1+5

environment:
sdk: '>=3.2.4 <4.0.0'
Expand Down

0 comments on commit 49a87a0

Please sign in to comment.