Add more entries
BIN
assets/sprites/clefable.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
assets/sprites/clefairy.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
assets/sprites/nidoking.png
Normal file
After Width: | Height: | Size: 15 KiB |
BIN
assets/sprites/nidoqueen.png
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
assets/sprites/nidoran-f.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
assets/sprites/nidoran-m.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
assets/sprites/nidorina.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
assets/sprites/nidorino.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
assets/sprites/ninetales.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
assets/sprites/pikachu.png
Normal file
After Width: | Height: | Size: 8.5 KiB |
BIN
assets/sprites/raichu.png
Normal file
After Width: | Height: | Size: 9.9 KiB |
BIN
assets/sprites/sandshrew.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
assets/sprites/sandslash.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
assets/sprites/vulpix.png
Normal file
After Width: | Height: | Size: 12 KiB |
|
@ -1,7 +1,7 @@
|
|||
import 'dart:io';
|
||||
|
||||
class Constants {
|
||||
static const VERSION = "1.0.032225+2037";
|
||||
static const VERSION = "1.0.032225+2127";
|
||||
|
||||
static bool get isMobile => Platform.isAndroid || Platform.isIOS;
|
||||
}
|
||||
|
|
|
@ -62,10 +62,34 @@ enum Type {
|
|||
const Type(this.backgroundColor, this.textColor);
|
||||
}
|
||||
|
||||
enum EvolutionCondition {
|
||||
HighFriendship,
|
||||
ThunderStone,
|
||||
WaterStone,
|
||||
Trading,
|
||||
MoonStone,
|
||||
FireStone,
|
||||
}
|
||||
|
||||
class Evolution {
|
||||
final int to;
|
||||
final int level;
|
||||
const Evolution(this.to, this.level);
|
||||
final EvolutionCondition? condition;
|
||||
const Evolution(this.to, this.level, {this.condition = null});
|
||||
|
||||
String printEvolution() {
|
||||
String sRet = "";
|
||||
if (level != -1) {
|
||||
sRet += "Level $level";
|
||||
}
|
||||
if (condition != null) {
|
||||
if (sRet.isNotEmpty) {
|
||||
sRet += "\n";
|
||||
}
|
||||
sRet += condition.toString().split('.').last;
|
||||
}
|
||||
return sRet;
|
||||
}
|
||||
}
|
||||
|
||||
enum LearnType { TM, HM }
|
||||
|
@ -125,7 +149,27 @@ enum Pokemon {
|
|||
Rattata(19, Generation.One, [Type.Normal], Evolution(20, 20)),
|
||||
Raticate(20, Generation.One, [Type.Normal], null),
|
||||
Spearow(21, Generation.One, [Type.Normal, Type.Flying], Evolution(22, 20)),
|
||||
Fearow(22, Generation.One, [Type.Normal, Type.Flying], null);
|
||||
Fearow(22, Generation.One, [Type.Normal, Type.Flying], null),
|
||||
Pikachu(25, Generation.One, [
|
||||
Type.Electric,
|
||||
], Evolution(26, -1, condition: EvolutionCondition.ThunderStone)),
|
||||
Raichu(26, Generation.One, [Type.Electric], null),
|
||||
Sandshrew(27, Generation.One, [Type.Ground], Evolution(28, 22)),
|
||||
Sandslash(28, Generation.One, [Type.Ground], null),
|
||||
NidoranF(29, Generation.One, [Type.Poison], Evolution(30, 16)),
|
||||
Nidorina(30, Generation.One, [Type.Poison], Evolution(31, 36)),
|
||||
NidoQueen(31, Generation.One, [Type.Poison, Type.Ground], null),
|
||||
NidoranM(32, Generation.One, [Type.Poison], Evolution(33, 16)),
|
||||
Nidorino(33, Generation.One, [Type.Poison], Evolution(34, 36)),
|
||||
NidoKing(34, Generation.One, [Type.Poison, Type.Ground], null),
|
||||
Clefairy(35, Generation.One, [
|
||||
Type.Fairy,
|
||||
], Evolution(36, -1, condition: EvolutionCondition.MoonStone)),
|
||||
Clefable(36, Generation.One, [Type.Fairy], null),
|
||||
Vulpix(37, Generation.One, [
|
||||
Type.Fire,
|
||||
], Evolution(38, -1, condition: EvolutionCondition.FireStone)),
|
||||
NineTales(38, Generation.One, [Type.Fire], null);
|
||||
|
||||
final int id;
|
||||
final Generation generation;
|
||||
|
@ -135,7 +179,7 @@ enum Pokemon {
|
|||
const Pokemon(this.id, this.generation, this.types, this.evolution);
|
||||
|
||||
String toDexPath() {
|
||||
return 'assets/sprites/${name.toLowerCase()}.png';
|
||||
return 'assets/sprites/${printName().replaceAll("♀", "-f").replaceAll("♂", "-m").toLowerCase()}.png';
|
||||
}
|
||||
|
||||
Widget getTypeWidgets() {
|
||||
|
@ -159,6 +203,14 @@ enum Pokemon {
|
|||
return Row(children: widgets);
|
||||
}
|
||||
|
||||
String printName() {
|
||||
String sRet = name.replaceAll("_", " ");
|
||||
if (sRet.endsWith("F")) sRet = sRet.substring(0, sRet.length - 1) + "♀";
|
||||
if (sRet.endsWith("M")) sRet = sRet.substring(0, sRet.length - 1) + "♂";
|
||||
|
||||
return sRet;
|
||||
}
|
||||
|
||||
List<Widget> getEvolutions(int subID) {
|
||||
if (!hasEvolutions) return [];
|
||||
|
||||
|
@ -189,7 +241,7 @@ enum Pokemon {
|
|||
Constants.isMobile ? Icons.arrow_downward : Icons.arrow_forward,
|
||||
size: 48,
|
||||
),
|
||||
Text("Level ${evolution!.level}", style: TextStyle(fontSize: 24)),
|
||||
Text(evolution!.printEvolution(), style: TextStyle(fontSize: 24)),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
@ -217,7 +269,7 @@ enum Pokemon {
|
|||
size: 48,
|
||||
),
|
||||
Text(
|
||||
"Level ${ev.evolution!.level}",
|
||||
ev.evolution!.printEvolution(),
|
||||
style: TextStyle(fontSize: 24),
|
||||
),
|
||||
],
|
||||
|
|
16
pubspec.yaml
|
@ -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: 1.0.032225+2037
|
||||
version: 1.0.032225+2127
|
||||
|
||||
environment:
|
||||
sdk: ^3.7.0
|
||||
|
@ -88,6 +88,20 @@ flutter:
|
|||
- assets/sprites/fearow.png
|
||||
- assets/sprites/ekans.png
|
||||
- assets/sprites/arbok.png
|
||||
- assets/sprites/pikachu.png
|
||||
- assets/sprites/raichu.png
|
||||
- assets/sprites/sandshrew.png
|
||||
- assets/sprites/sandslash.png
|
||||
- assets/sprites/nidoran-f.png
|
||||
- assets/sprites/nidorina.png
|
||||
- assets/sprites/nidoqueen.png
|
||||
- assets/sprites/nidoran-m.png
|
||||
- assets/sprites/nidorino.png
|
||||
- assets/sprites/nidoking.png
|
||||
- assets/sprites/clefairy.png
|
||||
- assets/sprites/clefable.png
|
||||
- assets/sprites/vulpix.png
|
||||
- assets/sprites/ninetales.png
|
||||
|
||||
# An image asset can refer to one or more resolution-specific "variants", see
|
||||
# https://flutter.dev/to/resolution-aware-images
|
||||
|
|