Skip to content

Commit

Permalink
Added documentation to results.dart
Browse files Browse the repository at this point in the history
Described all relevant methods
  • Loading branch information
martin-headspace committed Feb 18, 2020
1 parent 4d6f95e commit e088b36
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 14 deletions.
32 changes: 19 additions & 13 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 11 additions & 1 deletion eight_queens/lib/results.dart
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -15,6 +16,11 @@ class ResultsPage extends StatefulWidget {
class _ResultsPageState extends State<ResultsPage> {
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();
Expand All @@ -36,7 +42,11 @@ class _ResultsPageState extends State<ResultsPage> {
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++ ){
Expand Down

0 comments on commit e088b36

Please sign in to comment.