Skip to content

Commit 2d0bd70

Browse files
committed
more formatting
1 parent 43a5577 commit 2d0bd70

File tree

152 files changed

+1800
-2217
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

152 files changed

+1800
-2217
lines changed

flutter_news_example/api/lib/src/client/flutter_news_example_api_client.dart

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ class FlutterNewsExampleApiClient {
4747
required TokenProvider tokenProvider,
4848
http.Client? httpClient,
4949
}) : this._(
50-
baseUrl: 'https://example-api.a.run.app',
51-
httpClient: httpClient,
52-
tokenProvider: tokenProvider,
53-
);
50+
baseUrl: 'https://example-api.a.run.app',
51+
httpClient: httpClient,
52+
tokenProvider: tokenProvider,
53+
);
5454

5555
/// Create an instance of [FlutterNewsExampleApiClient] that integrates
5656
/// with a local instance of the API (http://localhost:8080).
@@ -60,19 +60,19 @@ class FlutterNewsExampleApiClient {
6060
required TokenProvider tokenProvider,
6161
http.Client? httpClient,
6262
}) : this._(
63-
baseUrl: 'http://localhost:8080',
64-
httpClient: httpClient,
65-
tokenProvider: tokenProvider,
66-
);
63+
baseUrl: 'http://localhost:8080',
64+
httpClient: httpClient,
65+
tokenProvider: tokenProvider,
66+
);
6767

6868
/// {@macro flutter_news_example_api_client}
6969
FlutterNewsExampleApiClient._({
7070
required String baseUrl,
7171
required TokenProvider tokenProvider,
7272
http.Client? httpClient,
73-
}) : _baseUrl = baseUrl,
74-
_httpClient = httpClient ?? http.Client(),
75-
_tokenProvider = tokenProvider;
73+
}) : _baseUrl = baseUrl,
74+
_httpClient = httpClient ?? http.Client(),
75+
_tokenProvider = tokenProvider;
7676

7777
final String _baseUrl;
7878
final http.Client _httpClient;
@@ -250,9 +250,9 @@ class FlutterNewsExampleApiClient {
250250
/// GET /api/v1/search/relevant?q=term
251251
/// Requests relevant content based on the provided search [term].
252252
Future<RelevantSearchResponse> relevantSearch({required String term}) async {
253-
final uri = Uri.parse('$_baseUrl/api/v1/search/relevant').replace(
254-
queryParameters: <String, String>{'q': term},
255-
);
253+
final uri = Uri.parse(
254+
'$_baseUrl/api/v1/search/relevant',
255+
).replace(queryParameters: <String, String>{'q': term});
256256
final response = await _httpClient.get(
257257
uri,
258258
headers: await _getRequestHeaders(),
@@ -289,9 +289,7 @@ class FlutterNewsExampleApiClient {
289289

290290
/// POST /api/v1/subscriptions
291291
/// Creates a new subscription for the associated user.
292-
Future<void> createSubscription({
293-
required String subscriptionId,
294-
}) async {
292+
Future<void> createSubscription({required String subscriptionId}) async {
295293
final uri = Uri.parse('$_baseUrl/api/v1/subscriptions').replace(
296294
queryParameters: <String, String>{'subscriptionId': subscriptionId},
297295
);

flutter_news_example/api/lib/src/data/in_memory_news_data_source.dart

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,18 @@ class InMemoryNewsDataSource implements NewsDataSource {
4444
final result = _newsItems.where((item) => item.post.id == id);
4545
if (result.isEmpty) return null;
4646
final articleNewsItem = result.first;
47-
final article = (preview
48-
? articleNewsItem.contentPreview
49-
: articleNewsItem.content)
50-
.toArticle(title: articleNewsItem.post.title, url: articleNewsItem.url);
47+
final article =
48+
(preview ? articleNewsItem.contentPreview : articleNewsItem.content)
49+
.toArticle(
50+
title: articleNewsItem.post.title,
51+
url: articleNewsItem.url,
52+
);
5153
final totalBlocks = article.totalBlocks;
5254
final normalizedOffset = math.min(offset, totalBlocks);
53-
final blocks =
54-
article.blocks.sublist(normalizedOffset).take(limit).toList();
55+
final blocks = article.blocks
56+
.sublist(normalizedOffset)
57+
.take(limit)
58+
.toList();
5559
return Article(
5660
title: article.title,
5761
blocks: blocks,

flutter_news_example/api/lib/src/data/models/article.g.dart

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flutter_news_example/api/lib/src/data/models/feed.g.dart

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flutter_news_example/api/lib/src/data/models/subscription.g.dart

Lines changed: 8 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flutter_news_example/api/lib/src/data/models/user.g.dart

Lines changed: 6 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)