Skip to content

Commit

Permalink
#731: Update change log and version/build number
Browse files Browse the repository at this point in the history
  • Loading branch information
cohenadair committed Jan 8, 2023
1 parent fa3f29b commit 65e378d
Show file tree
Hide file tree
Showing 11 changed files with 101 additions and 27 deletions.
9 changes: 9 additions & 0 deletions mobile/lib/i18n/english_strings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1083,5 +1083,14 @@ Map<String, Map<String, String>> get englishStrings => {
"changeLog_2.2.0_2":
"Fixed multiple issues with displaying baits on the \"Stats\" page",
"changeLog_2.2.0_3": "Fixed crash when photo data became unreadable",
"changeLog_2.3.0_1":
"Add live GPS tracking that can be enabled by tapping the %s button on the map",
"changeLog_2.3.0_2":
"Countries whose locale allows it, can now use commas as decimal points",
"changeLog_2.3.0_3":
"Fixed issue where a photo's time and location weren't always used when adding a catch",
"changeLog_2.3.0_4":
"Fixed a bug where the wrong catches were being shown on the stats page",
"changeLog_2.3.0_5": "Minor UI bug fixes",
},
};
10 changes: 10 additions & 0 deletions mobile/lib/i18n/strings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2141,6 +2141,16 @@ class Strings {
String get changeLog_220_2 => _string("changeLog_2.2.0_2");

String get changeLog_220_3 => _string("changeLog_2.2.0_3");

String get changeLog_230_1 => _string("changeLog_2.3.0_1");

String get changeLog_230_2 => _string("changeLog_2.3.0_2");

String get changeLog_230_3 => _string("changeLog_2.3.0_3");

String get changeLog_230_4 => _string("changeLog_2.3.0_4");

String get changeLog_230_5 => _string("changeLog_2.3.0_5");
}

class StringsDelegate extends LocalizationsDelegate<Strings> {
Expand Down
44 changes: 34 additions & 10 deletions mobile/lib/pages/onboarding/change_log_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import 'package:version/version.dart';

import '../../res/dimen.dart';
import '../../res/gen/custom_icons.dart';
import '../../widgets/button.dart';
import '../../widgets/widget.dart';

class ChangeLogPage extends StatelessWidget {
Expand All @@ -33,6 +34,7 @@ class ChangeLogPage extends StatelessWidget {
),
),
const VerticalSpace(paddingDefault),
_build2_3_0(context),
_build2_2_0(context),
_build2_1_6(context),
_build2_1_5(context),
Expand All @@ -44,12 +46,34 @@ class ChangeLogPage extends StatelessWidget {
);
}

Widget _build2_3_0(BuildContext context) {
return ExpansionListItem(
title: Text(_buildVersionText(context, "2.3.0")),
isExpanded: true,
children: [
BulletList(
padding: insetsHorizontalDefaultBottomDefault,
items: {
BulletListItem(
Strings.of(context).changeLog_230_1,
const Icon(iconGpsTrail, color: Colors.black),
),
BulletListItem(Strings.of(context).changeLog_230_2),
BulletListItem(Strings.of(context).changeLog_230_3),
BulletListItem(Strings.of(context).changeLog_230_4),
BulletListItem(Strings.of(context).changeLog_230_5),
},
),
],
);
}

Widget _build2_2_0(BuildContext context) {
return ExpansionListItem(
title: Text(_buildVersionText(context, "2.2.0")),
isExpanded: true,
isExpanded: false,
children: [
_buildChangeList({
_buildStringChangeList({
Strings.of(context).changeLog_220_1,
Strings.of(context).changeLog_220_2,
Strings.of(context).changeLog_220_3,
Expand All @@ -63,7 +87,7 @@ class ChangeLogPage extends StatelessWidget {
title: Text(_buildVersionText(context, "2.1.6")),
isExpanded: false,
children: [
_buildChangeList({
_buildStringChangeList({
Strings.of(context).changeLog_216_1,
Strings.of(context).changeLog_216_2,
Strings.of(context).changeLog_216_3,
Expand All @@ -79,7 +103,7 @@ class ChangeLogPage extends StatelessWidget {
title: Text(_buildVersionText(context, "2.1.5")),
isExpanded: false,
children: [
_buildChangeList({
_buildStringChangeList({
Strings.of(context).changeLog_215_1,
}),
],
Expand All @@ -91,7 +115,7 @@ class ChangeLogPage extends StatelessWidget {
title: Text(_buildVersionText(context, "2.1.3")),
isExpanded: false,
children: [
_buildChangeList({
_buildStringChangeList({
Strings.of(context).changeLog_213_1,
Strings.of(context).changeLog_213_2,
Strings.of(context).changeLog_213_3,
Expand All @@ -106,7 +130,7 @@ class ChangeLogPage extends StatelessWidget {
title: Text(_buildVersionText(context, "2.1.2")),
isExpanded: false,
children: [
_buildChangeList({
_buildStringChangeList({
Strings.of(context).changeLog_212_1,
Strings.of(context).changeLog_212_2,
Strings.of(context).changeLog_212_3,
Expand All @@ -121,7 +145,7 @@ class ChangeLogPage extends StatelessWidget {
title: Text(_buildVersionText(context, "2.1.1")),
isExpanded: false,
children: [
_buildChangeList({
_buildStringChangeList({
Strings.of(context).changeLog_210_1,
Strings.of(context).changeLog_210_2,
Strings.of(context).changeLog_210_3,
Expand All @@ -135,7 +159,7 @@ class ChangeLogPage extends StatelessWidget {
return ExpansionListItem(
title: Text(_buildVersionText(context, "2.0.22")),
children: [
_buildChangeList({
_buildStringChangeList({
Strings.of(context).changeLog_2022_1,
Strings.of(context).changeLog_2022_2,
Strings.of(context).changeLog_2022_3,
Expand All @@ -147,10 +171,10 @@ class ChangeLogPage extends StatelessWidget {
);
}

Widget _buildChangeList(Set<String> items) {
Widget _buildStringChangeList(Set<String> items) {
return BulletList(
padding: insetsHorizontalDefaultBottomDefault,
items: items,
items: items.map((e) => BulletListItem(e)).toSet(),
);
}

Expand Down
2 changes: 1 addition & 1 deletion mobile/lib/pages/picker_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ class PickerPageState<T> extends State<PickerPage<T>> {
? Text(item.title!, style: styleNote(context))
: IconLabel(
text: item.title!,
icon: Icon(
textArg: Icon(
item.noteIcon,
color: Colors.black,
),
Expand Down
30 changes: 27 additions & 3 deletions mobile/lib/widgets/bullet_list.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import 'package:flutter/material.dart';
import 'package:mobile/res/dimen.dart';
import 'package:mobile/res/style.dart';
import 'package:mobile/widgets/text.dart';
import 'package:mobile/widgets/widget.dart';
import 'package:quiver/core.dart';

class BulletList extends StatelessWidget {
final EdgeInsets padding;
final Set<String> items;
final Set<BulletListItem> items;

const BulletList({
this.padding = insetsZero,
Expand All @@ -23,17 +25,39 @@ class BulletList extends StatelessWidget {
);
}

Widget _buildRow(BuildContext context, String item) {
Widget _buildRow(BuildContext context, BulletListItem item) {
return Padding(
padding: item == items.last ? insetsZero : insetsBottomSmall,
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text("\u2022", style: stylePrimary(context)),
const HorizontalSpace(paddingDefault),
Expanded(child: Text(item, style: stylePrimary(context))),
Expanded(
child: item.textArg == null
? Text(item.text, style: stylePrimary(context))
: IconLabel(
text: item.text,
textArg: item.textArg!,
textStyle: stylePrimary(context),
),
),
],
),
);
}
}

class BulletListItem {
final String text;
final Widget? textArg;

BulletListItem(this.text, [this.textArg]);

@override
bool operator ==(Object other) =>
other is BulletListItem && text == other.text && textArg == other.textArg;

@override
int get hashCode => hash2(text.hashCode, textArg.hashCode);
}
2 changes: 1 addition & 1 deletion mobile/lib/widgets/empty_list_placeholder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class EmptyListPlaceholder extends StatelessWidget {
} else {
descriptionWidget = IconLabel(
text: description,
icon: Icon(
textArg: Icon(
descriptionIcon,
color: Colors.black,
),
Expand Down
8 changes: 4 additions & 4 deletions mobile/lib/widgets/text.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,18 @@ class SingleLineText extends StatelessWidget {
}
}

/// A text widget that inserts an [Icon] into a [String]. The given [String]
/// A text widget that inserts an [Widget] into a [String]. The given [String]
/// can only have a single "%s" substitution.
class IconLabel extends StatelessWidget {
final String text;
final TextStyle? textStyle;
final TextAlign? align;
final TextOverflow? overflow;
final Icon icon;
final Widget textArg;

IconLabel({
required this.text,
required this.icon,
required this.textArg,
this.align,
this.overflow,
this.textStyle,
Expand All @@ -64,7 +64,7 @@ class IconLabel extends StatelessWidget {
style: style,
),
WidgetSpan(
child: icon,
child: textArg,
alignment: PlaceholderAlignment.middle,
),
TextSpan(
Expand Down
2 changes: 1 addition & 1 deletion mobile/lib/widgets/widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ class HeadingNoteDivider extends StatelessWidget {
bottom: false,
child: IconLabel(
text: note!,
icon: Icon(
textArg: Icon(
noteIcon,
color: Colors.black,
),
Expand Down
2 changes: 1 addition & 1 deletion mobile/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ description: Track, analyze, and share your catches in the sport of fishing.
#
# Both numbers must be incremented for Android. DO NOT add any suffix to the date, such as ".2". The
# period will be removed on Google Play and builds with lower numbers cannot be uploaded.
version: 2.2.0+20221113
version: 2.3.0+20230108
publish_to: none

environment:
Expand Down
15 changes: 11 additions & 4 deletions mobile/test/widget/bullet_list_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,28 @@ import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:mobile/res/dimen.dart';
import 'package:mobile/widgets/bullet_list.dart';
import 'package:mobile/widgets/text.dart';

import '../test_utils.dart';

void main() {
testWidgets("All items are shown", (tester) async {
await pumpContext(
tester,
(_) => const BulletList(
(_) => BulletList(
items: {
"Item 1",
"Item 2",
"Item 3",
BulletListItem("Item 1"),
BulletListItem("Item 2"),
BulletListItem("Item 3"),
BulletListItem("Item 4 %s", const Icon(Icons.add)),
},
),
);

expect(find.text("Item 1"), findsOneWidget);
expect(find.text("Item 2"), findsOneWidget);
expect(find.text("Item 3"), findsOneWidget);
expect(find.byType(IconLabel), findsOneWidget);

expect(
findFirstWithText<Padding>(tester, "Item 1").padding,
Expand All @@ -32,6 +35,10 @@ void main() {
);
expect(
findFirstWithText<Padding>(tester, "Item 3").padding,
insetsBottomSmall,
);
expect(
findFirstWithIcon<Padding>(tester, Icons.add).padding,
insetsZero,
);
});
Expand Down
4 changes: 2 additions & 2 deletions mobile/test/widget/text_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ void main() {
Testable(
(_) => IconLabel(
text: "Test",
icon: const Icon(Icons.group),
textArg: const Icon(Icons.group),
),
),
);
Expand All @@ -44,7 +44,7 @@ void main() {
Testable(
(_) => IconLabel(
text: "Test %s",
icon: const Icon(Icons.group),
textArg: const Icon(Icons.group),
),
),
);
Expand Down

0 comments on commit 65e378d

Please sign in to comment.