Skip to content
This repository has been archived by the owner on Nov 4, 2022. It is now read-only.

Commit

Permalink
typo fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
woshikie committed Aug 8, 2020
1 parent e9fba40 commit f60e9d2
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
6 changes: 3 additions & 3 deletions lib/classes/api/poe_compact_stash.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ class PoeCompactStash {
final int index;

@JsonKey(fromJson: _colorFromJson, toJson: _colorToJson)
final Color color;
final Color colour;

static Color _colorFromJson(dynamic json) {
return Color.fromARGB(255, json.r, json.g, json.b);
return Color.fromARGB(255, json['r'], json['g'], json['b']);
}

static Map<String, int> _colorToJson(Color color) {
Expand All @@ -28,7 +28,7 @@ class PoeCompactStash {
};
}

PoeCompactStash(this.n, this.id, this.index, this.color);
PoeCompactStash(this.n, this.id, this.index, this.colour);

factory PoeCompactStash.fromJson(Map<String, dynamic> json) => _$PoeCompactStashFromJson(json);
Map<String, dynamic> toJson() => _$PoeCompactStashToJson(this);
Expand Down
4 changes: 2 additions & 2 deletions lib/classes/api/poe_compact_stash.g.dart

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

2 changes: 1 addition & 1 deletion lib/components/option_row_text_form_field.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class OptionRowTextFormField extends StatelessWidget {

@override
Widget build(BuildContext context) {
String buffer = '';
String buffer = controller != null ? controller.text : (initialValue ?? '');
return OptionRow(
title: title,
control: SizedBox(
Expand Down
11 changes: 9 additions & 2 deletions lib/views/setting.dart
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ class _SettingsState extends State<Settings> {
itemCount: stashes.length,
itemBuilder: (BuildContext context, int index) {
return Container(
color: stashes[index].color,
color: stashes[index].colour,
child: CheckboxListTile(
value: (selectedTabs.contains(stashes[index].id)),
onChanged: (isChecked) {
Expand Down Expand Up @@ -293,9 +293,15 @@ class _SettingsState extends State<Settings> {
_poesessidController.text = poesessid;
}

bool isInitStashTabsDone = true;
Future<void> initStashTabs() async {
if (!isInitStashTabsDone) return;
isInitStashTabsDone = false;
final required = [selectedLeague, selectedRealm, accountName];
if (required.any((element) => (element == null))) return;
if (required.any((element) => (element == null))) {
isInitStashTabsDone = true;
return;
}
setState(() {
stashes = null;
});
Expand All @@ -305,6 +311,7 @@ class _SettingsState extends State<Settings> {
accountName: accountName,
);
setState(() {});
isInitStashTabsDone = true;
}

Future<void> initSelectedStashTabs() async {
Expand Down

0 comments on commit f60e9d2

Please sign in to comment.