Alter updatetool to include the completed and total task count in output file
This commit is contained in:
parent
8e823e7b9c
commit
310098b39d
1 changed files with 11 additions and 0 deletions
|
@ -49,6 +49,9 @@ class _main extends State<MainGen> {
|
||||||
Generation? currentGen;
|
Generation? currentGen;
|
||||||
int maxTasks = 5;
|
int maxTasks = 5;
|
||||||
|
|
||||||
|
int total = 0;
|
||||||
|
int completed = 0;
|
||||||
|
|
||||||
int state = 0;
|
int state = 0;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -125,8 +128,12 @@ class _main extends State<MainGen> {
|
||||||
var pokemon = Pokemon.values[iterNumber];
|
var pokemon = Pokemon.values[iterNumber];
|
||||||
|
|
||||||
if (currentGen != pokemon.generation) {
|
if (currentGen != pokemon.generation) {
|
||||||
|
sb.append("\n- Completed ${completed}/${total}\n");
|
||||||
|
|
||||||
sb.append("\n# Generation ${pokemon.generation.name}\n\n");
|
sb.append("\n# Generation ${pokemon.generation.name}\n\n");
|
||||||
currentGen = pokemon.generation;
|
currentGen = pokemon.generation;
|
||||||
|
total = 0;
|
||||||
|
completed = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
progress = index * 100 / Pokemon.values.length;
|
progress = index * 100 / Pokemon.values.length;
|
||||||
|
@ -156,6 +163,7 @@ class _main extends State<MainGen> {
|
||||||
if (pokemon.locations.isNotEmpty &&
|
if (pokemon.locations.isNotEmpty &&
|
||||||
pokemon.dexEntries.isNotEmpty) {
|
pokemon.dexEntries.isNotEmpty) {
|
||||||
sb.append("- [x] ${pokemon.pokemonName}\n");
|
sb.append("- [x] ${pokemon.pokemonName}\n");
|
||||||
|
completed++;
|
||||||
} else if (pokemon.locations.isNotEmpty) {
|
} else if (pokemon.locations.isNotEmpty) {
|
||||||
sb.append(
|
sb.append(
|
||||||
"- [ ] ${pokemon.pokemonName} (MISSING DEX ENTRIES)\n",
|
"- [ ] ${pokemon.pokemonName} (MISSING DEX ENTRIES)\n",
|
||||||
|
@ -169,6 +177,7 @@ class _main extends State<MainGen> {
|
||||||
sb.append("- [ ] ${pokemon.pokemonName} (OUT OF DATE DATA)\n");
|
sb.append("- [ ] ${pokemon.pokemonName} (OUT OF DATE DATA)\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
total++;
|
||||||
index++;
|
index++;
|
||||||
progress = progress / 100; // push it into a 0-1 range.
|
progress = progress / 100; // push it into a 0-1 range.
|
||||||
state++;
|
state++;
|
||||||
|
@ -176,6 +185,8 @@ class _main extends State<MainGen> {
|
||||||
setState(() {});
|
setState(() {});
|
||||||
} else if (state - index == 6) {
|
} else if (state - index == 6) {
|
||||||
// Task - write file
|
// Task - write file
|
||||||
|
sb.append("\n- Completed ${completed}/${total}\n");
|
||||||
|
|
||||||
maxTasks += 3;
|
maxTasks += 3;
|
||||||
statusMessage = "Saving to COMPLETED.md";
|
statusMessage = "Saving to COMPLETED.md";
|
||||||
File complete = File("COMPLETED.md");
|
File complete = File("COMPLETED.md");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue