Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Every request must be reviewed and accepted by:

- @felangel @AnnaPS @simpson-peter @marwfair @valentinallavayol
- @marwfair @matiasleyba @SofiaRey
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ updates:
directory: "/"
schedule:
interval: "daily"
# Updating patch versions for "github-actions" is too chatty.
# See https://github.com/flutter/flutter/issues/158350.
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-patch"]
- package-ecosystem: "pub"
directory: "/api"
schedule:
Expand Down Expand Up @@ -105,3 +110,8 @@ updates:
directory: "/packages/news_blocks_ui"
schedule:
interval: "daily"
- package-ecosystem: "pub"
directory: "/flutter_news_template/hooks"
schedule:
interval: "daily"
target-branch: "templates"
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
build:
uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/dart_package.yml@v1
with:
dart_sdk: 3.5.2
dart_sdk: 3.10.0
working_directory: api
analyze_directories: "routes lib test"
coverage_excludes: "**/*.g.dart"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ jobs:
build:
uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/dart_package.yml@v1
with:
dart_sdk: 3.5.2
dart_sdk: 3.10.0
working_directory: packages/article_repository
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ jobs:
build:
uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/dart_package.yml@v1
with:
dart_sdk: 3.5.2
dart_sdk: 3.10.0
working_directory: packages/authentication_client/authentication_client
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ jobs:
build:
uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/dart_package.yml@v1
with:
dart_sdk: 3.4.3
dart_sdk: 3.10.0
working_directory: packages/deep_link_client/deep_link_client
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ jobs:
build:
uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/dart_package.yml@v1
with:
dart_sdk: 3.5.2
dart_sdk: 3.10.0
working_directory: packages/form_inputs
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ jobs:
uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/dart_package.yml@v1
with:
coverage_excludes: "**/*.g.dart"
dart_sdk: 3.5.2
dart_sdk: 3.10.0
working_directory: api/packages/news_blocks
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ jobs:
build:
uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/dart_package.yml@v1
with:
dart_sdk: 3.5.2
dart_sdk: 3.10.0
working_directory: packages/notifications_client/notifications_client
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ jobs:
build:
uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/dart_package.yml@v1
with:
dart_sdk: 3.5.2
dart_sdk: 3.10.0
working_directory: packages/package_info_client
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- uses: zwaldowski/cspell-action@v1
with:
paths: "**/*.{md,dart}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ jobs:
build:
uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/dart_package.yml@v1
with:
dart_sdk: 3.5.2
dart_sdk: 3.10.0
working_directory: packages/storage/storage
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ jobs:
build:
uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/dart_package.yml@v1
with:
dart_sdk: 3.5.2
dart_sdk: 3.10.0
working_directory: packages/authentication_client/token_storage
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ jobs:
channel: [stable]

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- uses: subosito/flutter-action@v2.18.0
- uses: subosito/flutter-action@e938fdf56512cc96ef2f93601a5a40bde3801046
with:
channel: ${{#mustacheCase}}matrix.channel{{/mustacheCase}}
flutter-version: {{flutter_version}}
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:
pubviz print -d > pubviz.html

- name: Upload Visual Architecture Artifact
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v5
with:
name: visual-architecture-report
path: ./pubviz.html
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ unlinked_spec.ds
**/ios/Flutter/app.zip
**/ios/Flutter/flutter_assets/
**/ios/Flutter/flutter_export_environment.sh
**/ios/Flutter/ephemeral/**
**/ios/ServiceDefinitions.json
**/ios/Runner/GeneratedPluginRegistrant.*

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,14 @@
"xcworkspace",
"xxlg",
"xxxlg",
"xxxs"
"xxxs",
"ARGB",
"canonicalized"
],
"ignorePaths": [
".github/workflows/**",
"**/api/lib/api/v1/projects/templates/*_bundle.dart",
"**/api/lib/src/data/static_news_data.dart",
"**/lib/terms_of_service/terms_of_service_mock_text.dart"
]
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
## Getting Started 🚀

To get started, see the official documentation at https://flutter.github.io/news_toolkit.
To get started, see the official documentation at https://vgventures.github.io/news_toolkit/.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
include: package:very_good_analysis/analysis_options.6.0.0.yaml
include: package:very_good_analysis/analysis_options.10.0.0.yaml
analyzer:
errors:
document_ignores: ignore
exclude:
- lib/l10n/*
- lib/generated/*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
include: package:very_good_analysis/analysis_options.6.0.0.yaml
include: package:very_good_analysis/analysis_options.10.0.0.yaml
analyzer:
errors:
document_ignores: ignore
exclude:
- build/**
- lib/**/*.g.dart
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
/// {{app_name}} API Server-Side Library
library api;

export 'src/data/in_memory_news_data_source.dart' show InMemoryNewsDataSource;
export 'src/data/models/models.dart'
show
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
/// {{app_name}} API Client-Side Library
library client;

export 'package:news_blocks/news_blocks.dart'
show
BlockAction,
Expand All @@ -9,7 +6,6 @@ export 'package:news_blocks/news_blocks.dart'
ImageBlock,
NewsBlock,
NewsBlocksConverter,
PostCategory,
PostGridGroupBlock,
PostGridTileBlock,
PostLargeBlock,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ class {{project_name.pascalCase()}}ApiClient {
required TokenProvider tokenProvider,
http.Client? httpClient,
}) : this._(
baseUrl: 'https://{{api_url}}',
httpClient: httpClient,
tokenProvider: tokenProvider,
);
baseUrl: 'https://{{api_url}}',
httpClient: httpClient,
tokenProvider: tokenProvider,
);

/// Create an instance of [{{project_name.pascalCase()}}ApiClient] that integrates
/// with a local instance of the API (http://localhost:8080).
Expand All @@ -60,25 +60,25 @@ class {{project_name.pascalCase()}}ApiClient {
required TokenProvider tokenProvider,
http.Client? httpClient,
}) : this._(
baseUrl: 'http://localhost:8080',
httpClient: httpClient,
tokenProvider: tokenProvider,
);
baseUrl: 'http://localhost:8080',
httpClient: httpClient,
tokenProvider: tokenProvider,
);

/// {@macro {{project_name.snakeCase()}}_api_client}
{{project_name.pascalCase()}}ApiClient._({
required String baseUrl,
required TokenProvider tokenProvider,
http.Client? httpClient,
}) : _baseUrl = baseUrl,
_httpClient = httpClient ?? http.Client(),
_tokenProvider = tokenProvider;
}) : _baseUrl = baseUrl,
_httpClient = httpClient ?? http.Client(),
_tokenProvider = tokenProvider;

final String _baseUrl;
final http.Client _httpClient;
final TokenProvider _tokenProvider;

/// GET /api/v1/articles/<id>
/// GET /api/v1/articles/&lt;id&gt;
/// Requests article content metadata.
///
/// Supported parameters:
Expand Down Expand Up @@ -116,7 +116,7 @@ class {{project_name.pascalCase()}}ApiClient {
return ArticleResponse.fromJson(body);
}

/// GET /api/v1/articles/<id>/related
/// GET /api/v1/articles/&lt;id&gt;/related
/// Requests related articles.
///
/// Supported parameters:
Expand Down Expand Up @@ -155,18 +155,18 @@ class {{project_name.pascalCase()}}ApiClient {
/// Requests news feed metadata.
///
/// Supported parameters:
/// * [category] - The desired news [Category].
/// * [categoryId] - The desired id of news category.
/// * [limit] - The number of results to return.
/// * [offset] - The (zero-based) offset of the first item
/// in the collection to return.
Future<FeedResponse> getFeed({
Category? category,
String? categoryId,
int? limit,
int? offset,
}) async {
final uri = Uri.parse('$_baseUrl/api/v1/feed').replace(
queryParameters: <String, String>{
if (category != null) 'category': category.name,
'category': ?categoryId,
if (limit != null) 'limit': '$limit',
if (offset != null) 'offset': '$offset',
},
Expand Down Expand Up @@ -250,9 +250,9 @@ class {{project_name.pascalCase()}}ApiClient {
/// GET /api/v1/search/relevant?q=term
/// Requests relevant content based on the provided search [term].
Future<RelevantSearchResponse> relevantSearch({required String term}) async {
final uri = Uri.parse('$_baseUrl/api/v1/search/relevant').replace(
queryParameters: <String, String>{'q': term},
);
final uri = Uri.parse(
'$_baseUrl/api/v1/search/relevant',
).replace(queryParameters: <String, String>{'q': term});
final response = await _httpClient.get(
uri,
headers: await _getRequestHeaders(),
Expand Down Expand Up @@ -289,9 +289,7 @@ class {{project_name.pascalCase()}}ApiClient {

/// POST /api/v1/subscriptions
/// Creates a new subscription for the associated user.
Future<void> createSubscription({
required String subscriptionId,
}) async {
Future<void> createSubscription({required String subscriptionId}) async {
final uri = Uri.parse('$_baseUrl/api/v1/subscriptions').replace(
queryParameters: <String, String>{'subscriptionId': subscriptionId},
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,18 @@ class InMemoryNewsDataSource implements NewsDataSource {
final result = _newsItems.where((item) => item.post.id == id);
if (result.isEmpty) return null;
final articleNewsItem = result.first;
final article = (preview
? articleNewsItem.contentPreview
: articleNewsItem.content)
.toArticle(title: articleNewsItem.post.title, url: articleNewsItem.url);
final article =
(preview ? articleNewsItem.contentPreview : articleNewsItem.content)
.toArticle(
title: articleNewsItem.post.title,
url: articleNewsItem.url,
);
final totalBlocks = article.totalBlocks;
final normalizedOffset = math.min(offset, totalBlocks);
final blocks =
article.blocks.sublist(normalizedOffset).take(limit).toList();
final blocks = article.blocks
.sublist(normalizedOffset)
.take(limit)
.toList();
return Article(
title: article.title,
blocks: blocks,
Expand Down Expand Up @@ -102,20 +106,20 @@ class InMemoryNewsDataSource implements NewsDataSource {

@override
Future<Feed> getFeed({
Category category = Category.top,
required String categoryId,
int limit = 20,
int offset = 0,
}) async {
final feed =
_newsFeedData[category] ?? const Feed(blocks: [], totalBlocks: 0);
_newsFeedData[categoryId] ?? const Feed(blocks: [], totalBlocks: 0);
final totalBlocks = feed.totalBlocks;
final normalizedOffset = math.min(offset, totalBlocks);
final blocks = feed.blocks.sublist(normalizedOffset).take(limit).toList();
return Feed(blocks: blocks, totalBlocks: totalBlocks);
}

@override
Future<List<Category>> getCategories() async => _newsFeedData.keys.toList();
Future<List<Category>> getCategories() async => _categories;

@override
Future<User> getUser({required String userId}) async {
Expand Down

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

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

Loading