Make the evolution layout more readable
This commit is contained in:
parent
32ae4f3e41
commit
03246aad71
3 changed files with 81 additions and 63 deletions
|
@ -1,7 +1,7 @@
|
|||
import 'dart:io';
|
||||
|
||||
class Constants {
|
||||
static const VERSION = "1.0.032425+0156";
|
||||
static const VERSION = "1.0.032425+0222";
|
||||
|
||||
static bool get isMobile => Platform.isAndroid || Platform.isIOS;
|
||||
}
|
||||
|
|
140
lib/pokemon.dart
140
lib/pokemon.dart
|
@ -134,32 +134,45 @@ class SingleEvolution extends Evolution {
|
|||
}
|
||||
Pokemon pkmn = Pokemon.values.where((x) => x.id == to).first;
|
||||
|
||||
var arrow = Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Icon(
|
||||
Constants.isMobile ? Icons.arrow_downward : Icons.arrow_forward,
|
||||
size: 48,
|
||||
),
|
||||
Text(printEvolution(), style: TextStyle(fontSize: 24)),
|
||||
],
|
||||
);
|
||||
List<Widget> cardRow = [];
|
||||
|
||||
Column col = Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Image.asset(
|
||||
pkmn.toDexPath(),
|
||||
width: Constants.isMobile ? 64 : 128,
|
||||
height: Constants.isMobile ? 64 : 128,
|
||||
),
|
||||
pkmn.getTypeWidgets(),
|
||||
],
|
||||
cardRow.add(
|
||||
Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Icon(
|
||||
Constants.isMobile ? Icons.arrow_downward : Icons.arrow_forward,
|
||||
size: 48,
|
||||
),
|
||||
Card(
|
||||
elevation: 50,
|
||||
child: SizedBox(
|
||||
width: 256,
|
||||
height: 256,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
|
||||
children: [
|
||||
Text(printEvolution(), style: TextStyle(fontSize: 16)),
|
||||
|
||||
Image.asset(
|
||||
pkmn.toDexPath(),
|
||||
width: Constants.isMobile ? 64 : 128,
|
||||
height: Constants.isMobile ? 64 : 128,
|
||||
),
|
||||
Text(pkmn.pokemonName, style: TextStyle(fontSize: 24)),
|
||||
pkmn.getTypeWidgets(),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
Column rw = Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [arrow, col],
|
||||
children: [Row(children: cardRow)],
|
||||
);
|
||||
|
||||
return rw;
|
||||
|
@ -184,7 +197,7 @@ class BranchedEvolution extends Evolution {
|
|||
sRet += "Level ${level}";
|
||||
}
|
||||
for (var condition in conds) {
|
||||
sRet += condition.name;
|
||||
sRet += condition.name + " ";
|
||||
}
|
||||
return sRet;
|
||||
}
|
||||
|
@ -192,11 +205,8 @@ class BranchedEvolution extends Evolution {
|
|||
@override
|
||||
Widget getEvolution() {
|
||||
// This is a branched evolution. So first, we print the arrows, and conditions.
|
||||
Row arrowRow;
|
||||
List<Widget> arrows = [];
|
||||
|
||||
List<Widget> pkmnRow = [];
|
||||
Row rowPkmn;
|
||||
List<Widget> cardRow = [];
|
||||
|
||||
for (var pkmn in alternates) {
|
||||
int index = alternates.indexOf(pkmn);
|
||||
|
@ -208,51 +218,47 @@ class BranchedEvolution extends Evolution {
|
|||
|
||||
Pokemon _pkmn = Pokemon.values.where((x) => x.id == pkmn).first;
|
||||
|
||||
arrows.add(
|
||||
cardRow.add(
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Icon(
|
||||
Constants.isMobile ? Icons.arrow_downward : Icons.arrow_forward,
|
||||
size: 48,
|
||||
),
|
||||
Text(
|
||||
_prntEV(conditions[index], levels[index]),
|
||||
style: TextStyle(fontSize: 24),
|
||||
),
|
||||
//Text(printEvolution(), style: TextStyle(fontSize: 24)),
|
||||
],
|
||||
),
|
||||
);
|
||||
Card(
|
||||
elevation: 50,
|
||||
child: SizedBox(
|
||||
width: 256,
|
||||
height: 256,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
|
||||
pkmnRow.add(
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Image.asset(
|
||||
_pkmn.toDexPath(),
|
||||
width: Constants.isMobile ? 64 : 128,
|
||||
height: Constants.isMobile ? 64 : 128,
|
||||
children: [
|
||||
Text(
|
||||
_prntEV(conditions[index], levels[index]),
|
||||
style: TextStyle(fontSize: 16),
|
||||
),
|
||||
|
||||
Image.asset(
|
||||
_pkmn.toDexPath(),
|
||||
width: Constants.isMobile ? 64 : 128,
|
||||
height: Constants.isMobile ? 64 : 128,
|
||||
),
|
||||
Text(_pkmn.pokemonName, style: TextStyle(fontSize: 24)),
|
||||
_pkmn.getTypeWidgets(),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
_pkmn.getTypeWidgets(),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
arrowRow = Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: arrows,
|
||||
);
|
||||
|
||||
rowPkmn = Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: pkmnRow,
|
||||
);
|
||||
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [arrowRow, rowPkmn],
|
||||
children: [Row(children: cardRow)],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -1338,13 +1344,25 @@ enum Pokemon {
|
|||
if (subID == 0) {
|
||||
sprites.add(Text("Evolutions: ", style: TextStyle(fontSize: 24)));
|
||||
sprites.add(
|
||||
Image.asset(
|
||||
toDexPath(),
|
||||
width: Constants.isMobile ? 64 : 128,
|
||||
height: Constants.isMobile ? 64 : 128,
|
||||
Card(
|
||||
elevation: 50,
|
||||
child: SizedBox(
|
||||
width: 256,
|
||||
height: 256,
|
||||
child: Column(
|
||||
children: [
|
||||
Image.asset(
|
||||
toDexPath(),
|
||||
width: Constants.isMobile ? 64 : 128,
|
||||
height: Constants.isMobile ? 64 : 128,
|
||||
),
|
||||
Text(pokemonName, style: TextStyle(fontSize: 24)),
|
||||
getTypeWidgets(),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
sprites.add(getTypeWidgets());
|
||||
sprites.add(evolution!.getEvolution());
|
||||
//print("Main page EV.");
|
||||
} else {
|
||||
|
|
|
@ -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.032425+0156
|
||||
version: 1.0.032425+0222
|
||||
|
||||
environment:
|
||||
sdk: ^3.7.0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue