From 5dce313ed7642548658d9cb2634d9b56762dd267 Mon Sep 17 00:00:00 2001 From: Mo Kweon Date: Thu, 9 Sep 2021 09:30:32 -0700 Subject: [PATCH] fix: build errors in Flutter --- client/.gitignore | 2 + client/analysis_options.yaml | 3 + client/lib/protos/pkg/pr12er/database.pb.dart | 34 ++++- client/lib/protos/pkg/pr12er/messages.pb.dart | 122 ++++++++++++++--- client/lib/protos/pkg/pr12er/service.pb.dart | 7 +- .../widgets/components/expandable_text.dart | 4 +- client/lib/widgets/main/pr12video.dart | 2 +- client/lib/widgets/main/report.dart | 7 +- client/pubspec.lock | 124 +++++++++--------- client/pubspec.yaml | 8 +- .../screens/main_screen_with_mocks_test.dart | 33 +++-- client/test/utils/share_service_test.dart | 14 +- client/test_driver/app_test.dart | 6 +- 13 files changed, 251 insertions(+), 115 deletions(-) diff --git a/client/.gitignore b/client/.gitignore index 0fa6b675..0e6722ef 100644 --- a/client/.gitignore +++ b/client/.gitignore @@ -44,3 +44,5 @@ app.*.map.json /android/app/debug /android/app/profile /android/app/release + +build diff --git a/client/analysis_options.yaml b/client/analysis_options.yaml index cb81f350..a198a157 100644 --- a/client/analysis_options.yaml +++ b/client/analysis_options.yaml @@ -10,3 +10,6 @@ linter: sort_unnamed_constructors_first: false implementation_imports: false invalid_implementation_override: false + unnecessary_overrides: false + require_trailing_commas: false + camel_case_types: false diff --git a/client/lib/protos/pkg/pr12er/database.pb.dart b/client/lib/protos/pkg/pr12er/database.pb.dart index 82485f1e..ba55f54c 100644 --- a/client/lib/protos/pkg/pr12er/database.pb.dart +++ b/client/lib/protos/pkg/pr12er/database.pb.dart @@ -94,8 +94,11 @@ class MappingTableRow extends $pb.GeneratedMessage { const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'paperArxivIds') - ..aOS(3, - const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'youtubeVideoId') + ..aOS( + 3, + const $core.bool.fromEnvironment('protobuf.omit_field_names') + ? '' + : 'youtubeVideoId') ..hasRequiredFields = false; MappingTableRow._() : super(); @@ -250,10 +253,17 @@ class PrVideo extends $pb.GeneratedMessage { : 'prId', $pb.PbFieldType.O3) ..pc<$2.Paper>( - 2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'papers', $pb.PbFieldType.PM, + 2, + const $core.bool.fromEnvironment('protobuf.omit_field_names') + ? '' + : 'papers', + $pb.PbFieldType.PM, subBuilder: $2.Paper.create) ..aOM( - 3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'video', + 3, + const $core.bool.fromEnvironment('protobuf.omit_field_names') + ? '' + : 'video', subBuilder: YouTubeVideo.create) ..hasRequiredFields = false; @@ -332,7 +342,10 @@ class PrVideo extends $pb.GeneratedMessage { } class YouTubeVideo extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'YouTubeVideo', + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + const $core.bool.fromEnvironment('protobuf.omit_message_names') + ? '' + : 'YouTubeVideo', package: const $pb.PackageName( const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' @@ -359,9 +372,16 @@ class YouTubeVideo extends $pb.GeneratedMessage { ? '' : 'numberOfViews') ..aOM<$1.Timestamp>( - 5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'publishedDate', + 5, + const $core.bool.fromEnvironment('protobuf.omit_field_names') + ? '' + : 'publishedDate', subBuilder: $1.Timestamp.create) - ..aOS(6, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'uploader') + ..aOS( + 6, + const $core.bool.fromEnvironment('protobuf.omit_field_names') + ? '' + : 'uploader') ..hasRequiredFields = false; YouTubeVideo._() : super(); diff --git a/client/lib/protos/pkg/pr12er/messages.pb.dart b/client/lib/protos/pkg/pr12er/messages.pb.dart index 8d069ff3..0d3e9e5b 100644 --- a/client/lib/protos/pkg/pr12er/messages.pb.dart +++ b/client/lib/protos/pkg/pr12er/messages.pb.dart @@ -37,14 +37,46 @@ class Video extends $pb.GeneratedMessage { const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'title') - ..aOS(3, - const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'link') - ..aOS(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'presenter') - ..e(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'category', $pb.PbFieldType.OE, defaultOrMaker: Category.CATEGORY_UNSPECIFIED, valueOf: Category.valueOf, enumValues: Category.values) - ..aInt64(6, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'numberOfLike') - ..pPS(7, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'keywords') - ..aInt64(8, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'numberOfViews') - ..aOM<$1.Timestamp>(9, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'publishedDate', subBuilder: $1.Timestamp.create) + ..aOS( + 3, + const $core.bool.fromEnvironment('protobuf.omit_field_names') + ? '' + : 'link') + ..aOS( + 4, + const $core.bool.fromEnvironment('protobuf.omit_field_names') + ? '' + : 'presenter') + ..e( + 5, + const $core.bool.fromEnvironment('protobuf.omit_field_names') + ? '' + : 'category', + $pb.PbFieldType.OE, + defaultOrMaker: Category.CATEGORY_UNSPECIFIED, + valueOf: Category.valueOf, + enumValues: Category.values) + ..aInt64( + 6, + const $core.bool.fromEnvironment('protobuf.omit_field_names') + ? '' + : 'numberOfLike') + ..pPS( + 7, + const $core.bool.fromEnvironment('protobuf.omit_field_names') + ? '' + : 'keywords') + ..aInt64( + 8, + const $core.bool.fromEnvironment('protobuf.omit_field_names') + ? '' + : 'numberOfViews') + ..aOM<$1.Timestamp>( + 9, + const $core.bool.fromEnvironment('protobuf.omit_field_names') + ? '' + : 'publishedDate', + subBuilder: $1.Timestamp.create) ..hasRequiredFields = false; Video._() : super(); @@ -234,12 +266,26 @@ class Detail extends $pb.GeneratedMessage { : 'prId', $pb.PbFieldType.O3) ..pc( - 2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'papers', $pb.PbFieldType.PM, + 2, + const $core.bool.fromEnvironment('protobuf.omit_field_names') + ? '' + : 'papers', + $pb.PbFieldType.PM, + subBuilder: Paper.create) + ..pc( + 3, + const $core.bool.fromEnvironment('protobuf.omit_field_names') + ? '' + : 'relevantPapers', + $pb.PbFieldType.PM, subBuilder: Paper.create) ..pc( - 3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'relevantPapers', $pb.PbFieldType.PM, + 4, + const $core.bool.fromEnvironment('protobuf.omit_field_names') + ? '' + : 'sameAuthorPapers', + $pb.PbFieldType.PM, subBuilder: Paper.create) - ..pc(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'sameAuthorPapers', $pb.PbFieldType.PM, subBuilder: Paper.create) ..hasRequiredFields = false; Detail._() : super(); @@ -337,12 +383,36 @@ class Paper extends $pb.GeneratedMessage { const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'arxivId') - ..aOS(4, - const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'abstract') - ..aOM<$1.Timestamp>(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'publishedDate', subBuilder: $1.Timestamp.create) - ..pPS(6, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'authors') - ..pc(7, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'repositories', $pb.PbFieldType.PM, subBuilder: Repository.create) - ..pc(8, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'methods', $pb.PbFieldType.PM, subBuilder: Method.create) + ..aOS( + 4, + const $core.bool.fromEnvironment('protobuf.omit_field_names') + ? '' + : 'abstract') + ..aOM<$1.Timestamp>( + 5, + const $core.bool.fromEnvironment('protobuf.omit_field_names') + ? '' + : 'publishedDate', + subBuilder: $1.Timestamp.create) + ..pPS( + 6, + const $core.bool.fromEnvironment('protobuf.omit_field_names') + ? '' + : 'authors') + ..pc( + 7, + const $core.bool.fromEnvironment('protobuf.omit_field_names') + ? '' + : 'repositories', + $pb.PbFieldType.PM, + subBuilder: Repository.create) + ..pc( + 8, + const $core.bool.fromEnvironment('protobuf.omit_field_names') + ? '' + : 'methods', + $pb.PbFieldType.PM, + subBuilder: Method.create) ..hasRequiredFields = false; Paper._() : super(); @@ -507,12 +577,24 @@ class Repository extends $pb.GeneratedMessage { ? '' : 'owner') ..e( - 4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'framework', $pb.PbFieldType.OE, + 4, + const $core.bool.fromEnvironment('protobuf.omit_field_names') + ? '' + : 'framework', + $pb.PbFieldType.OE, defaultOrMaker: Framework.FRAMEWORK_UNSPECIFIED, valueOf: Framework.valueOf, enumValues: Framework.values) - ..aInt64(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'numberOfStars') - ..aOS(6, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'description') + ..aInt64( + 5, + const $core.bool.fromEnvironment('protobuf.omit_field_names') + ? '' + : 'numberOfStars') + ..aOS( + 6, + const $core.bool.fromEnvironment('protobuf.omit_field_names') + ? '' + : 'description') ..hasRequiredFields = false; Repository._() : super(); diff --git a/client/lib/protos/pkg/pr12er/service.pb.dart b/client/lib/protos/pkg/pr12er/service.pb.dart index bc993d53..2deac474 100644 --- a/client/lib/protos/pkg/pr12er/service.pb.dart +++ b/client/lib/protos/pkg/pr12er/service.pb.dart @@ -408,8 +408,11 @@ class ReportRequest extends $pb.GeneratedMessage { defaultOrMaker: ReportRequest_ReportType.REPORT_TYPE_UNSPECIFIED, valueOf: ReportRequest_ReportType.valueOf, enumValues: ReportRequest_ReportType.values) - ..aOS(2, - const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'body') + ..aOS( + 2, + const $core.bool.fromEnvironment('protobuf.omit_field_names') + ? '' + : 'body') ..hasRequiredFields = false; ReportRequest._() : super(); diff --git a/client/lib/widgets/components/expandable_text.dart b/client/lib/widgets/components/expandable_text.dart index 967e3f91..3b37d28d 100644 --- a/client/lib/widgets/components/expandable_text.dart +++ b/client/lib/widgets/components/expandable_text.dart @@ -36,7 +36,7 @@ class _ExpandableTextState extends State { IconButton( iconSize: iconSize, onPressed: onPressed, - color: Theme.of(context).accentColor, + color: Theme.of(context).colorScheme.secondary, icon: const Icon(Icons.keyboard_arrow_up)), ], ), @@ -58,7 +58,7 @@ class _ExpandableTextState extends State { child: IconButton( iconSize: iconSize, onPressed: onPressed, - color: Theme.of(context).accentColor, + color: Theme.of(context).colorScheme.secondary, icon: const Icon(Icons.keyboard_arrow_down))) ]), ); diff --git a/client/lib/widgets/main/pr12video.dart b/client/lib/widgets/main/pr12video.dart index 9a05820d..d661f7bc 100644 --- a/client/lib/widgets/main/pr12video.dart +++ b/client/lib/widgets/main/pr12video.dart @@ -100,7 +100,7 @@ class PR12Video extends StatelessWidget { ? Icons.bookmark_add_rounded : Icons.bookmark_add_outlined, size: 30, - color: Theme.of(context).accentColor, + color: Theme.of(context).colorScheme.secondary, ), ); }, diff --git a/client/lib/widgets/main/report.dart b/client/lib/widgets/main/report.dart index a5870486..958f57b3 100644 --- a/client/lib/widgets/main/report.dart +++ b/client/lib/widgets/main/report.dart @@ -30,14 +30,14 @@ class _ReportWidgetState extends State { .textTheme .headline1 ?.apply(fontWeightDelta: 5)), - leading: - Icon(Icons.report, size: 30, color: Theme.of(context).accentColor), + leading: Icon(Icons.report, + size: 30, color: Theme.of(context).colorScheme.secondary), ), Divider( indent: 20, endIndent: 20, thickness: 2, - color: Theme.of(context).accentColor, + color: Theme.of(context).colorScheme.secondary, ), Container( padding: const EdgeInsets.only(left: 20, right: 20), @@ -92,6 +92,7 @@ class _ReportWidgetState extends State { final resp = await context .read() .report(currentReportType, _reportTextFieldController.text); + if (!mounted) return; Navigator.of(context).pop(); showSnackbar(resp.issueUrl); }, diff --git a/client/pubspec.lock b/client/pubspec.lock index 529493e8..75a0aa73 100644 --- a/client/pubspec.lock +++ b/client/pubspec.lock @@ -7,14 +7,14 @@ packages: name: _fe_analyzer_shared url: "https://pub.dartlang.org" source: hosted - version: "22.0.0" + version: "25.0.0" analyzer: dependency: transitive description: name: analyzer url: "https://pub.dartlang.org" source: hosted - version: "1.7.1" + version: "2.2.0" archive: dependency: transitive description: @@ -28,14 +28,14 @@ packages: name: args url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.2.0" async: dependency: "direct main" description: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.6.1" + version: "2.8.1" boolean_selector: dependency: transitive description: @@ -49,7 +49,7 @@ packages: name: build url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "2.1.0" build_config: dependency: transitive description: @@ -70,35 +70,35 @@ packages: name: build_resolvers url: "https://pub.dartlang.org" source: hosted - version: "2.0.3" + version: "2.0.4" build_runner: dependency: "direct dev" description: name: build_runner url: "https://pub.dartlang.org" source: hosted - version: "2.0.4" + version: "2.1.2" build_runner_core: dependency: transitive description: name: build_runner_core url: "https://pub.dartlang.org" source: hosted - version: "7.0.0" + version: "7.1.0" built_collection: dependency: transitive description: name: built_collection url: "https://pub.dartlang.org" source: hosted - version: "5.0.0" + version: "5.1.1" built_value: dependency: transitive description: name: built_value url: "https://pub.dartlang.org" source: hosted - version: "8.0.6" + version: "8.1.2" change_app_package_name: dependency: "direct dev" description: @@ -119,7 +119,7 @@ packages: name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.1" checked_yaml: dependency: transitive description: @@ -133,7 +133,7 @@ packages: name: cli_util url: "https://pub.dartlang.org" source: hosted - version: "0.3.0" + version: "0.3.3" clock: dependency: transitive description: @@ -147,7 +147,7 @@ packages: name: code_builder url: "https://pub.dartlang.org" source: hosted - version: "4.0.0" + version: "4.1.0" collection: dependency: transitive description: @@ -161,7 +161,7 @@ packages: name: convert url: "https://pub.dartlang.org" source: hosted - version: "3.0.0" + version: "3.0.1" coverage: dependency: transitive description: @@ -189,7 +189,7 @@ packages: name: dart_style url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "2.1.0" fake_async: dependency: transitive description: @@ -210,9 +210,9 @@ packages: name: file url: "https://pub.dartlang.org" source: hosted - version: "6.1.0" + version: "6.1.2" fixnum: - dependency: transitive + dependency: "direct main" description: name: fixnum url: "https://pub.dartlang.org" @@ -241,14 +241,14 @@ packages: name: flutter_launcher_icons url: "https://pub.dartlang.org" source: hosted - version: "0.9.0" + version: "0.9.2" flutter_test: dependency: "direct dev" description: flutter source: sdk version: "0.0.0" flutter_web_plugins: - dependency: transitive + dependency: "direct main" description: flutter source: sdk version: "0.0.0" @@ -258,7 +258,7 @@ packages: name: frontend_server_client url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.2" fuchsia_remote_debug_protocol: dependency: transitive description: flutter @@ -298,7 +298,7 @@ packages: name: grpc url: "https://pub.dartlang.org" source: hosted - version: "3.0.0" + version: "3.0.2" http: dependency: transitive description: @@ -347,7 +347,7 @@ packages: name: io url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "1.0.3" js: dependency: transitive description: @@ -361,7 +361,7 @@ packages: name: json_annotation url: "https://pub.dartlang.org" source: hosted - version: "4.0.1" + version: "4.1.0" link_text: dependency: "direct main" description: @@ -375,7 +375,7 @@ packages: name: lint url: "https://pub.dartlang.org" source: hosted - version: "1.5.3" + version: "1.7.2" logging: dependency: transitive description: @@ -396,7 +396,7 @@ packages: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0" + version: "1.7.0" mime: dependency: transitive description: @@ -410,7 +410,7 @@ packages: name: mockito url: "https://pub.dartlang.org" source: hosted - version: "5.0.9" + version: "5.0.15" modal_bottom_sheet: dependency: "direct main" description: @@ -431,7 +431,7 @@ packages: name: node_preamble url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.0.1" package_config: dependency: transitive description: @@ -452,21 +452,21 @@ packages: name: path_provider url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "2.0.3" path_provider_linux: dependency: transitive description: name: path_provider_linux url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.0.2" path_provider_macos: dependency: transitive description: name: path_provider_macos url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.0.2" path_provider_platform_interface: dependency: transitive description: @@ -480,21 +480,21 @@ packages: name: path_provider_windows url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "2.0.3" pedantic: dependency: transitive description: name: pedantic url: "https://pub.dartlang.org" source: hosted - version: "1.11.0" + version: "1.11.1" petitparser: dependency: transitive description: name: petitparser url: "https://pub.dartlang.org" source: hosted - version: "4.1.0" + version: "4.2.0" platform: dependency: transitive description: @@ -508,7 +508,7 @@ packages: name: plugin_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.0.1" pool: dependency: transitive description: @@ -522,7 +522,7 @@ packages: name: process url: "https://pub.dartlang.org" source: hosted - version: "4.2.1" + version: "4.2.3" protobuf: dependency: "direct main" description: @@ -536,7 +536,7 @@ packages: name: provider url: "https://pub.dartlang.org" source: hosted - version: "5.0.0" + version: "6.0.0" pub_semver: dependency: transitive description: @@ -564,7 +564,7 @@ packages: name: share_plus_linux url: "https://pub.dartlang.org" source: hosted - version: "2.0.3" + version: "2.0.4" share_plus_macos: dependency: transitive description: @@ -580,7 +580,7 @@ packages: source: hosted version: "2.0.1" share_plus_web: - dependency: transitive + dependency: "direct main" description: name: share_plus_web url: "https://pub.dartlang.org" @@ -599,21 +599,21 @@ packages: name: shared_preferences url: "https://pub.dartlang.org" source: hosted - version: "2.0.6" + version: "2.0.7" shared_preferences_linux: dependency: transitive description: name: shared_preferences_linux url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.0.2" shared_preferences_macos: dependency: transitive description: name: shared_preferences_macos url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.0.2" shared_preferences_platform_interface: dependency: transitive description: @@ -622,26 +622,26 @@ packages: source: hosted version: "2.0.0" shared_preferences_web: - dependency: transitive + dependency: "direct main" description: name: shared_preferences_web url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.0.2" shared_preferences_windows: dependency: transitive description: name: shared_preferences_windows url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.0.2" shelf: dependency: transitive description: name: shelf url: "https://pub.dartlang.org" source: hosted - version: "1.1.4" + version: "1.2.0" shelf_packages_handler: dependency: transitive description: @@ -655,7 +655,7 @@ packages: name: shelf_static url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "1.1.0" shelf_web_socket: dependency: transitive description: @@ -674,7 +674,7 @@ packages: name: source_gen url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "1.1.0" source_map_stack_trace: dependency: transitive description: @@ -744,21 +744,21 @@ packages: name: test url: "https://pub.dartlang.org" source: hosted - version: "1.16.8" + version: "1.17.10" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.3.0" + version: "0.4.2" test_core: dependency: transitive description: name: test_core url: "https://pub.dartlang.org" source: hosted - version: "0.3.19" + version: "0.4.0" timing: dependency: transitive description: @@ -779,42 +779,42 @@ packages: name: url_launcher url: "https://pub.dartlang.org" source: hosted - version: "6.0.6" + version: "6.0.10" url_launcher_linux: dependency: transitive description: name: url_launcher_linux url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.0.2" url_launcher_macos: dependency: transitive description: name: url_launcher_macos url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.0.2" url_launcher_platform_interface: dependency: transitive description: name: url_launcher_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.0.3" + version: "2.0.4" url_launcher_web: - dependency: transitive + dependency: "direct main" description: name: url_launcher_web url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "2.0.4" url_launcher_windows: dependency: transitive description: name: url_launcher_windows url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.0.2" vector_math: dependency: transitive description: @@ -828,7 +828,7 @@ packages: name: vm_service url: "https://pub.dartlang.org" source: hosted - version: "6.2.0" + version: "7.1.1" watcher: dependency: transitive description: @@ -863,7 +863,7 @@ packages: name: win32 url: "https://pub.dartlang.org" source: hosted - version: "2.2.4" + version: "2.2.9" xdg_directories: dependency: transitive description: @@ -877,7 +877,7 @@ packages: name: xml url: "https://pub.dartlang.org" source: hosted - version: "5.1.2" + version: "5.2.0" yaml: dependency: transitive description: @@ -898,7 +898,7 @@ packages: name: youtube_player_iframe url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.2.2" sdks: - dart: ">=2.13.0 <3.0.0" + dart: ">=2.14.0-360.0.dev <3.0.0" flutter: ">=2.0.0" diff --git a/client/pubspec.yaml b/client/pubspec.yaml index dff83042..50f9a486 100644 --- a/client/pubspec.yaml +++ b/client/pubspec.yaml @@ -23,19 +23,25 @@ environment: dependencies: async: ^2.5.0 cupertino_icons: ^1.0.2 + fixnum: ^1.0.0 flutter: sdk: flutter flutter_inappwebview: ^5.3.2 + flutter_web_plugins: + sdk: flutter google_fonts: ^2.1.0 grpc: ^3.0.0 intl: ^0.17.0 link_text: ^0.2.0 modal_bottom_sheet: ^2.0.0 protobuf: ^2.0.0 - provider: ^5.0.0 + provider: ^6.0.0 share_plus: ^2.1.4 + share_plus_web: ^2.0.4 shared_preferences: ^2.0.6 + shared_preferences_web: ^2.0.2 url_launcher: ^6.0.6 + url_launcher_web: ^2.0.4 youtube_player_flutter: ^8.0.0 youtube_player_iframe: ^2.0.0 diff --git a/client/test/screens/main_screen_with_mocks_test.dart b/client/test/screens/main_screen_with_mocks_test.dart index f0f021c9..2150b991 100644 --- a/client/test/screens/main_screen_with_mocks_test.dart +++ b/client/test/screens/main_screen_with_mocks_test.dart @@ -38,10 +38,13 @@ void main() { testWidgets('MainWidget has a load view', (WidgetTester tester) async { when(mockGrpcClient.getVideos()).thenAnswer((_) => Future.value(videos)); - await tester.pumpWidget(wrapWithProviders( + await tester.pumpWidget( + wrapWithProviders( mockGrpcClient: mockGrpcClient, mockCustomTheme: mockCustomTheme, - mockFavoriteVideoViewModel: mockFavoriteVideoViewModel)); + mockFavoriteVideoViewModel: mockFavoriteVideoViewModel, + ), + ); final loadView = find.byType(CircularProgressIndicator); expect(loadView, findsOneWidget); @@ -57,10 +60,13 @@ void main() { when(mockFavoriteVideoViewModel.isFavoriteVideo(2)) .thenAnswer((_) => Future.value(false)); - await tester.pumpWidget(wrapWithProviders( + await tester.pumpWidget( + wrapWithProviders( mockGrpcClient: mockGrpcClient, mockCustomTheme: mockCustomTheme, - mockFavoriteVideoViewModel: mockFavoriteVideoViewModel)); + mockFavoriteVideoViewModel: mockFavoriteVideoViewModel, + ), + ); await tester.pumpAndSettle(); final firstTile = find.byKey(const ValueKey("ListTile-1")); expect(firstTile, findsOneWidget); @@ -81,10 +87,13 @@ void main() { when(mockFavoriteVideoViewModel.isFavoriteVideo(2)) .thenAnswer((_) => Future.value(false)); - await tester.pumpWidget(wrapWithProviders( + await tester.pumpWidget( + wrapWithProviders( mockGrpcClient: mockGrpcClient, mockCustomTheme: mockCustomTheme, - mockFavoriteVideoViewModel: mockFavoriteVideoViewModel)); + mockFavoriteVideoViewModel: mockFavoriteVideoViewModel, + ), + ); await tester.pumpAndSettle(); // GIVEN the theme toggle button. @@ -103,16 +112,18 @@ void main() { } /// wrapWithProviders is a helper function that initializes material app with mock providers. -MultiProvider wrapWithProviders( - {required MockGrpcClient mockGrpcClient, - required MockCustomTheme mockCustomTheme, - required MockFavoriteVideoViewModel mockFavoriteVideoViewModel}) { +MultiProvider wrapWithProviders({ + required MockGrpcClient mockGrpcClient, + required MockCustomTheme mockCustomTheme, + required MockFavoriteVideoViewModel mockFavoriteVideoViewModel, +}) { return MultiProvider( providers: [ Provider(create: (context) => mockGrpcClient), ChangeNotifierProvider(create: (context) => mockCustomTheme), ChangeNotifierProvider( - create: (context) => mockFavoriteVideoViewModel), + create: (context) => mockFavoriteVideoViewModel, + ), ChangeNotifierProvider( create: (context) => SortMode(), ) diff --git a/client/test/utils/share_service_test.dart b/client/test/utils/share_service_test.dart index 3f8b1bba..597988a9 100644 --- a/client/test/utils/share_service_test.dart +++ b/client/test/utils/share_service_test.dart @@ -9,10 +9,13 @@ void main() { ..prId = 1 ..title = "Title" ..link = "https://youtube.com/www"; - expect(generateShareSummary(video, null), """ + expect( + generateShareSummary(video, null), + """ [YouTube 주소] https://youtube.com/www -"""); +""", + ); }); test("should generate a full report when detail is set", () { @@ -26,13 +29,16 @@ https://youtube.com/www ..title = "paper-title" ..arxivId = "arxiv-id" ]); - expect(generateShareSummary(video, detail), """ + expect( + generateShareSummary(video, detail), + """ [YouTube 주소] https://youtube.com/www [논문] paper-title (https://arxiv.org/abs/arxiv-id) -"""); +""", + ); }); }); } diff --git a/client/test_driver/app_test.dart b/client/test_driver/app_test.dart index 3925e139..1b3305cd 100644 --- a/client/test_driver/app_test.dart +++ b/client/test_driver/app_test.dart @@ -18,8 +18,10 @@ void main() { await driver.tap(listTile); final detailScreenTitle = find.byValueKey("detail_app/appBar/title"); - expect(await driver.getText(detailScreenTitle), - "Generative Adversarial Nets"); + expect( + await driver.getText(detailScreenTitle), + "Generative Adversarial Nets", + ); }); }); }