Skip to content

Commit b986f7a

Browse files
committed
Reformatted new code from PR 439 and fixed example code lint warning. Bumped version to 11.1.0 for release.
1 parent 999a6ae commit b986f7a

File tree

6 files changed

+27
-17
lines changed

6 files changed

+27
-17
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 11.1.0
2+
3+
- [439] Added: Passed the language code to iTunes search api to get localized release notes for the iOS App Store. Thanks to @ibraheemalayan and @Add00w for the changes.
4+
15
## 11.0.0
26

37
- [413] Fixed Haitian Creole messages to use correct grammar. (thanks to @wjeanvilma)

example/lib/main_messages.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ class MyUpgraderMessages extends UpgraderMessages {
183183
@override
184184
String get buttonTitleIgnore => 'My Ignore 1';
185185

186-
MyUpgraderMessages({String? code}) : super(code: code);
186+
MyUpgraderMessages({super.code});
187187

188188
/// Override the message function to provide your own language localization.
189189
@override

example/pubspec.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ dependencies:
1414
sdk: flutter
1515

1616
go_router: ^7.1.1
17-
http: ^1.0.0
18-
path: ^1.8.3
17+
http: ^1.2.2
18+
path: ^1.9.0
1919

2020
upgrader:
2121
path: ../
@@ -24,7 +24,7 @@ dev_dependencies:
2424
flutter_driver:
2525
sdk: flutter
2626

27-
flutter_lints: ^2.0.3
27+
flutter_lints: ^4.0.0
2828

2929
flutter_test:
3030
sdk: flutter

lib/src/itunes_search_api.dart

+14-10
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,18 @@ class ITunesSearchAPI {
3232
/// ```lookupURLByBundleId('com.google.Maps');```
3333
/// ```lookupURLByBundleId('com.google.Maps', country: 'FR');```
3434
Future<Map?> lookupByBundleId(String bundleId,
35-
{String? country = 'US',String? language = 'en', bool useCacheBuster =
36-
true}) async {
35+
{String? country = 'US',
36+
String? language = 'en',
37+
bool useCacheBuster = true}) async {
3738
assert(bundleId.isNotEmpty);
3839
if (bundleId.isEmpty) {
3940
return null;
4041
}
4142

4243
final url = lookupURLByBundleId(bundleId,
43-
country: country ?? '', language: language ?? '', useCacheBuster:
44-
useCacheBuster)!;
44+
country: country ?? '',
45+
language: language ?? '',
46+
useCacheBuster: useCacheBuster)!;
4547
if (debugLogging) {
4648
print('upgrader: download: $url');
4749
}
@@ -96,16 +98,18 @@ class ITunesSearchAPI {
9698
/// ```lookupURLByBundleId('com.google.Maps');```
9799
/// ```lookupURLByBundleId('com.google.Maps', country: 'FR');```
98100
String? lookupURLByBundleId(String bundleId,
99-
{String country = 'US', String language = 'en', bool useCacheBuster =
100-
true}) {
101+
{String country = 'US',
102+
String language = 'en',
103+
bool useCacheBuster = true}) {
101104
if (bundleId.isEmpty) {
102105
return null;
103106
}
104107

105-
return lookupURLByQSP(
106-
{'bundleId': bundleId, 'country': country.toUpperCase(),
107-
'lang': language},
108-
useCacheBuster: useCacheBuster);
108+
return lookupURLByQSP({
109+
'bundleId': bundleId,
110+
'country': country.toUpperCase(),
111+
'lang': language
112+
}, useCacheBuster: useCacheBuster);
109113
}
110114

111115
/// Look up URL by id.

lib/src/upgrade_store_controller.dart

+4-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,10 @@ class UpgraderAppStore extends UpgraderStore {
3838
iTunes.debugLogging = state.debugLogging;
3939
iTunes.client = state.client;
4040
iTunes.clientHeaders = state.clientHeaders;
41-
final response = await (iTunes
42-
.lookupByBundleId(state.packageInfo!.packageName, country: country, language: language));
41+
final response = await (iTunes.lookupByBundleId(
42+
state.packageInfo!.packageName,
43+
country: country,
44+
language: language));
4345

4446
if (response != null) {
4547
final version = iTunes.version(response);

pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: upgrader
22
description: Flutter package for prompting users to upgrade when there is a newer version of the app in the store.
3-
version: 11.0.0
3+
version: 11.1.0
44
homepage: https://github.com/larryaasen/upgrader
55

66
environment:

0 commit comments

Comments
 (0)