From e088b36aa42e4317b949f24f72228ca8fc85ca50 Mon Sep 17 00:00:00 2001 From: Fernando Martin Garcia Del Angel Date: Mon, 17 Feb 2020 18:15:54 -0600 Subject: [PATCH] Added documentation to results.dart Described all relevant methods --- .idea/workspace.xml | 32 +++++++++++++++++++------------- eight_queens/lib/results.dart | 12 +++++++++++- 2 files changed, 30 insertions(+), 14 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index f0fbb95..4da9e8b 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,7 +2,7 @@ - + @@ -328,13 +331,6 @@ - - - - - - - @@ -390,5 +386,15 @@ + + + + + + + + + + \ No newline at end of file diff --git a/eight_queens/lib/results.dart b/eight_queens/lib/results.dart index 2b606f0..23e0843 100644 --- a/eight_queens/lib/results.dart +++ b/eight_queens/lib/results.dart @@ -1,4 +1,5 @@ +import 'package:eight_queens/queens.dart'; import 'package:flutter/material.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'dart:convert'; @@ -15,6 +16,11 @@ class ResultsPage extends StatefulWidget { class _ResultsPageState extends State { var boards = new List(); + /// + /// Retrieves the [QueenResolver] [boards] that were calculated. + /// Will call [SharedPreferences] and get [String] for every posible solution. + /// Will then append it to [boards] and [setState()] + /// Future retrieveEightQueensResults() async { final prefs = await SharedPreferences.getInstance(); var _boards = new List(); @@ -36,7 +42,11 @@ class _ResultsPageState extends State { super.initState(); }); } - + + /// + /// Simple Item builder to display a [board] + /// Uses [String] concatenation to make it work + /// Widget ResultItem(BuildContext context, int index) { String todisplay = ""; for(int x = 0; x < boards[index].length; x++ ){