Skip to content

Commit d342c35

Browse files
committed
Run Dart format across codebase to bring in line with current formatting standard.
1 parent de8501a commit d342c35

File tree

6 files changed

+43
-49
lines changed

6 files changed

+43
-49
lines changed

lib/src/feed/feed.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import 'package:podcast_search/src/utils/utils.dart';
2525
import 'package:podcast_search/src/utils/vtt_parser.dart';
2626
import 'package:rss_dart/domain/rss_feed.dart';
2727

28-
2928
class Feed {
3029
/// Fetches the last-modified date from the response header. This
3130
/// is an option field, so a null will be returned if no value exists.

lib/src/model/item.dart

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -144,13 +144,12 @@ class Item {
144144
artworkUrl60: json['artworkUrl60'] as String?,
145145
artworkUrl100: json['artworkUrl100'] as String?,
146146
artworkUrl600: json['artworkUrl600'] as String?,
147-
genre:
148-
json['genreIds'] == null
149-
? <Genre>[]
150-
: Item._loadGenres(
151-
json['genreIds'].cast<String>(),
152-
json['genres'].cast<String>(),
153-
),
147+
genre: json['genreIds'] == null
148+
? <Genre>[]
149+
: Item._loadGenres(
150+
json['genreIds'].cast<String>(),
151+
json['genres'].cast<String>(),
152+
),
154153
releaseDate: DateTime.tryParse(json['releaseDate'] ?? ''),
155154
country: json['country'] as String?,
156155
primaryGenreName: json['primaryGenreName'] as String?,

lib/src/model/search_result.dart

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,18 @@ class SearchResult {
4646
final DateTime processedTime;
4747

4848
SearchResult({this.resultCount = 0, this.items = const <Item>[]})
49-
: successful = true,
50-
lastError = '',
51-
lastErrorType = ErrorType.none,
52-
processedTime = DateTime.now();
49+
: successful = true,
50+
lastError = '',
51+
lastErrorType = ErrorType.none,
52+
processedTime = DateTime.now();
5353

5454
SearchResult.fromError({
5555
this.lastError = '',
5656
this.lastErrorType = ErrorType.none,
57-
}) : successful = false,
58-
resultCount = 0,
59-
processedTime = DateTime.now(),
60-
items = [];
57+
}) : successful = false,
58+
resultCount = 0,
59+
processedTime = DateTime.now(),
60+
items = [];
6161

6262
factory SearchResult.fromJson({
6363
required dynamic json,
@@ -75,14 +75,13 @@ class SearchResult {
7575
var dataCount = countTagMap[type];
7676

7777
/// Fetch the results from the JSON data.
78-
final items =
79-
json[dataStart] == null
80-
? null
81-
: (json[dataStart] as List).cast<Map<String, dynamic>>().map((
82-
Map<String, dynamic> item,
83-
) {
84-
return Item.fromJson(json: item, type: type);
85-
}).toList();
78+
final items = json[dataStart] == null
79+
? null
80+
: (json[dataStart] as List).cast<Map<String, dynamic>>().map((
81+
Map<String, dynamic> item,
82+
) {
83+
return Item.fromJson(json: item, type: type);
84+
}).toList();
8685

8786
return SearchResult(
8887
resultCount: json[dataCount] ?? 0,

lib/src/search/itunes_search.dart

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -71,19 +71,18 @@ final class ITunesSearch extends BaseSearch {
7171
String? userAgent;
7272

7373
ITunesSearch({this.timeout = 20000, this.userAgent})
74-
: _client = Dio(
75-
BaseOptions(
76-
responseType: ResponseType.plain,
77-
connectTimeout: Duration(milliseconds: timeout),
78-
receiveTimeout: Duration(milliseconds: timeout),
79-
headers: {
80-
'User-Agent':
81-
userAgent == null || userAgent.isEmpty
82-
? podcastSearchAgent
83-
: userAgent,
84-
},
85-
),
86-
);
74+
: _client = Dio(
75+
BaseOptions(
76+
responseType: ResponseType.plain,
77+
connectTimeout: Duration(milliseconds: timeout),
78+
receiveTimeout: Duration(milliseconds: timeout),
79+
headers: {
80+
'User-Agent': userAgent == null || userAgent.isEmpty
81+
? podcastSearchAgent
82+
: userAgent,
83+
},
84+
),
85+
);
8786

8887
/// Search iTunes using the term [term]. You can limit the results to
8988
/// podcasts available in a specific country by supplying a [Country] option.

lib/src/search/podcast_index_search.dart

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,10 +190,9 @@ final class PodcastIndexSearch extends BaseSearch {
190190
'X-Auth-Date': newUnixTime,
191191
'X-Auth-Key': podcastIndexProvider.key,
192192
'Authorization': digest.toString(),
193-
'User-Agent':
194-
userAgent == null || userAgent!.isEmpty
195-
? podcastSearchAgent
196-
: userAgent,
193+
'User-Agent': userAgent == null || userAgent!.isEmpty
194+
? podcastSearchAgent
195+
: userAgent,
197196
},
198197
),
199198
);

lib/src/search/search.dart

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,13 @@ class Search {
6565
_version = version;
6666
_explicit = explicit;
6767

68-
var s =
69-
(searchProvider is ITunesProvider)
70-
? ITunesSearch(userAgent: userAgent, timeout: timeout)
71-
: PodcastIndexSearch(
72-
userAgent: userAgent,
73-
timeout: timeout,
74-
podcastIndexProvider: searchProvider as PodcastIndexProvider,
75-
);
68+
var s = (searchProvider is ITunesProvider)
69+
? ITunesSearch(userAgent: userAgent, timeout: timeout)
70+
: PodcastIndexSearch(
71+
userAgent: userAgent,
72+
timeout: timeout,
73+
podcastIndexProvider: searchProvider as PodcastIndexProvider,
74+
);
7675

7776
return s.search(
7877
term: term,

0 commit comments

Comments
 (0)