Add more entries, restore desktop app support

This commit is contained in:
zontreck 2025-03-22 20:21:56 -07:00
parent 2ade0cca22
commit 2b52ada9b9
28 changed files with 79 additions and 19 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 650 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 317 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 283 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 595 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 287 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 319 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 796 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 394 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 413 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 900 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 411 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 444 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 907 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 414 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 431 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 394 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 295 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 316 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

View file

@ -1,3 +1,7 @@
import 'dart:io';
class Constants { class Constants {
static const VERSION = "1.0.032225+1922"; static const VERSION = "1.0.032225+2020";
static bool get isMobile => Platform.isAndroid || Platform.isIOS;
} }

View file

@ -94,16 +94,22 @@ class _HomeState extends State<Home> {
children: [ children: [
Image.asset( Image.asset(
Pokemon.values[index].toDexPath(), Pokemon.values[index].toDexPath(),
width: 64, width: Constants.isMobile ? 64 : 198,
height: 64, height: Constants.isMobile ? 64 : 198,
), ),
Text( Text(
Pokemon.values[index].name, Pokemon.values[index].name,
style: TextStyle(fontSize: 16, color: Colors.black), style: TextStyle(
fontSize: Constants.isMobile ? 16 : 32,
color: Colors.black,
),
), ),
Text( Text(
"#${Pokemon.values[index].id}", "#${Pokemon.values[index].id}",
style: TextStyle(fontSize: 16, color: Colors.black), style: TextStyle(
fontSize: Constants.isMobile ? 16 : 32,
color: Colors.black,
),
), ),
], ],
), ),
@ -113,7 +119,7 @@ class _HomeState extends State<Home> {
}, },
itemCount: Pokemon.values.length, itemCount: Pokemon.values.length,
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3, crossAxisCount: Constants.isMobile ? 3 : 4,
), ),
), ),
), ),
@ -153,7 +159,9 @@ class _DexEntryState extends State<DexEntry> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Center(child: Image.asset(_pkmn.toDexPath())), Center(child: Image.asset(_pkmn.toDexPath())),
Text("ID: ${_pkmn.id}", style: TextStyle(fontSize: 24)), Center(
child: Text("ID: ${_pkmn.id}", style: TextStyle(fontSize: 24)),
),
Row( Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -163,10 +171,12 @@ class _DexEntryState extends State<DexEntry> {
), ),
SizedBox(height: 32), SizedBox(height: 32),
if (_pkmn.hasEvolutions) if (_pkmn.hasEvolutions)
Column( if (Constants.isMobile)
crossAxisAlignment: CrossAxisAlignment.start, Column(
children: _pkmn.getEvolutions(0), crossAxisAlignment: CrossAxisAlignment.start,
), children: _pkmn.getEvolutions(0),
),
if (!Constants.isMobile) Row(children: _pkmn.getEvolutions(0)),
], ],
), ),
), ),

View file

@ -1,5 +1,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'package:pokedex/Consts.dart';
enum Generation { enum Generation {
One, One,
@ -114,7 +115,10 @@ enum Pokemon {
Blastoise(9, Generation.One, [Type.Water], null), Blastoise(9, Generation.One, [Type.Water], null),
Caterpie(10, Generation.One, [Type.Bug], Evolution(11, 7)), Caterpie(10, Generation.One, [Type.Bug], Evolution(11, 7)),
Metapod(11, Generation.One, [Type.Bug], Evolution(12, 10)), Metapod(11, Generation.One, [Type.Bug], Evolution(12, 10)),
Butterfree(12, Generation.One, [Type.Bug, Type.Flying], null); Butterfree(12, Generation.One, [Type.Bug, Type.Flying], null),
Weedle(13, Generation.One, [Type.Bug, Type.Poison], Evolution(14, 7)),
Kakuna(14, Generation.One, [Type.Bug, Type.Poison], Evolution(15, 10)),
Beedrill(15, Generation.One, [Type.Bug, Type.Poison], null);
final int id; final int id;
final Generation generation; final Generation generation;
@ -146,7 +150,10 @@ enum Pokemon {
foregroundColor: WidgetStatePropertyAll(type.textColor), foregroundColor: WidgetStatePropertyAll(type.textColor),
), ),
child: Text(type.name, style: TextStyle(fontSize: 16)), child: Text(
type.name,
style: TextStyle(fontSize: Constants.isMobile ? 16 : 32),
),
), ),
); );
} }
@ -161,12 +168,16 @@ enum Pokemon {
List<Widget> sprites = []; List<Widget> sprites = [];
if (subID == 0) { if (subID == 0) {
sprites.add(Text("Evolutions: ", style: TextStyle(fontSize: 24)));
sprites.add( sprites.add(
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text("Evolutions: ", style: TextStyle(fontSize: 24)), Image.asset(
Image.asset(toDexPath(), width: 64, height: 64), toDexPath(),
width: Constants.isMobile ? 64 : 128,
height: Constants.isMobile ? 64 : 128,
),
getTypeWidgets(), getTypeWidgets(),
], ],
), ),
@ -175,7 +186,10 @@ enum Pokemon {
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Icon(Icons.arrow_downward, size: 48), Icon(
Constants.isMobile ? Icons.arrow_downward : Icons.arrow_forward,
size: 48,
),
Text("Level ${evolution!.level}", style: TextStyle(fontSize: 24)), Text("Level ${evolution!.level}", style: TextStyle(fontSize: 24)),
], ],
), ),
@ -186,7 +200,9 @@ enum Pokemon {
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Image.asset(ev.toDexPath(), width: 64, height: 64), Constants.isMobile
? Image.asset(ev.toDexPath(), width: 64, height: 64)
: Image.asset(ev.toDexPath(), width: 128, height: 128),
ev.getTypeWidgets(), ev.getTypeWidgets(),
], ],
), ),
@ -197,7 +213,10 @@ enum Pokemon {
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Icon(Icons.arrow_downward, size: 48), Icon(
Constants.isMobile ? Icons.arrow_downward : Icons.arrow_forward,
size: 48,
),
Text( Text(
"Level ${ev.evolution!.level}", "Level ${ev.evolution!.level}",
style: TextStyle(fontSize: 24), style: TextStyle(fontSize: 24),

View file

@ -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 # 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 # 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. # of the product and file versions while build-number is used as the build suffix.
version: 1.0.032225+1922 version: 1.0.032225+2020
environment: environment:
sdk: ^3.7.0 sdk: ^3.7.0
@ -181,6 +181,33 @@ flutter:
- assets/sprites/gen7/butterfree.png - assets/sprites/gen7/butterfree.png
- assets/sprites/gen8/butterfree.png - assets/sprites/gen8/butterfree.png
- assets/sprites/gen1/weedle.png
- assets/sprites/gen2/weedle.png
- assets/sprites/gen3/weedle.png
- assets/sprites/gen4/weedle.png
- assets/sprites/gen5/weedle.png
- assets/sprites/gen6/weedle.png
- assets/sprites/gen7/weedle.png
- assets/sprites/gen8/weedle.png
- assets/sprites/gen1/kakuna.png
- assets/sprites/gen2/kakuna.png
- assets/sprites/gen3/kakuna.png
- assets/sprites/gen4/kakuna.png
- assets/sprites/gen5/kakuna.png
- assets/sprites/gen6/kakuna.png
- assets/sprites/gen7/kakuna.png
- assets/sprites/gen8/kakuna.png
- assets/sprites/gen1/beedrill.png
- assets/sprites/gen2/beedrill.png
- assets/sprites/gen3/beedrill.png
- assets/sprites/gen4/beedrill.png
- assets/sprites/gen5/beedrill.png
- assets/sprites/gen6/beedrill.png
- assets/sprites/gen7/beedrill.png
- assets/sprites/gen8/beedrill.png
# An image asset can refer to one or more resolution-specific "variants", see # An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/to/resolution-aware-images # https://flutter.dev/to/resolution-aware-images