From 1a1ec274e9480fee798cb1b88856c4f2b13bbf8c Mon Sep 17 00:00:00 2001 From: Jakub Homlala <1329033+jhomlala@users.noreply.github.com> Date: Mon, 8 Jul 2024 20:24:34 +0200 Subject: [PATCH] feat: Added require_trailing_commas lint (#224) * feat: updated lint, dart fix * feat: updated metadata, dart format * fix: fixed PR comment --- examples/alice/analysis_options.yaml | 2 +- examples/alice/lib/main.dart | 2 +- examples/alice_chopper/analysis_options.yaml | 2 +- examples/alice_chopper/lib/main.dart | 2 +- examples/alice_dio/analysis_options.yaml | 2 +- examples/alice_dio/lib/main.dart | 4 +- examples/alice_http/analysis_options.yaml | 2 +- examples/alice_http/lib/main.dart | 4 +- .../alice_http_client/analysis_options.yaml | 2 +- examples/alice_http_client/lib/main.dart | 14 +- .../alice_objectbox/analysis_options.yaml | 2 +- examples/alice_objectbox/lib/main.dart | 6 +- packages/alice/CHANGELOG.md | 2 + packages/alice/analysis_options.yaml | 2 +- packages/alice/lib/core/alice_core.dart | 4 +- .../alice/lib/core/alice_memory_storage.dart | 18 +- .../alice/lib/core/alice_translations.dart | 654 +++++++++--------- .../alice/lib/helper/alice_export_helper.dart | 7 +- packages/alice/lib/model/alice_http_call.dart | 2 +- .../widget/alice_call_error_screen.dart | 5 +- .../widget/alice_call_overview_screen.dart | 5 +- .../widget/alice_call_request_screen.dart | 75 +- .../widget/alice_call_response_screen.dart | 83 ++- .../page/alice_calls_list_page.dart | 10 +- .../widget/alice_call_list_item_widget.dart | 2 +- .../widget/alice_calls_list_screen.dart | 66 +- .../widget/alice_inspector_screen.dart | 6 +- .../widget/alice_log_list_widget.dart | 9 +- .../alice/lib/ui/common/alice_dialog.dart | 2 +- .../alice/lib/ui/common/alice_navigation.dart | 4 +- .../alice/lib/ui/stats/alice_stats_page.dart | 68 +- .../test/core/alice_memory_storage_test.dart | 34 +- .../test/helper/alice_export_helper_test.dart | 16 +- .../alice/test/utils/alice_parser_test.dart | 40 +- packages/alice_chopper/CHANGELOG.md | 6 + packages/alice_chopper/analysis_options.yaml | 2 +- .../lib/alice_chopper_adapter.dart | 16 +- packages/alice_chopper/pubspec.yaml | 2 +- packages/alice_dio/CHANGELOG.md | 2 + packages/alice_dio/analysis_options.yaml | 2 +- packages/alice_dio/lib/alice_dio_adapter.dart | 7 +- .../test/alice_dio_adapter_test.dart | 200 +++--- packages/alice_http/CHANGELOG.md | 5 + packages/alice_http/analysis_options.yaml | 2 +- .../alice_http/lib/alice_http_extensions.dart | 6 +- packages/alice_http/pubspec.yaml | 2 +- packages/alice_http_client/CHANGELOG.md | 6 + .../alice_http_client/analysis_options.yaml | 2 +- packages/alice_http_client/pubspec.yaml | 2 +- packages/alice_objectbox/CHANGELOG.md | 6 + .../alice_objectbox/analysis_options.yaml | 2 +- .../alice_objectbox/lib/alice_objectbox.dart | 13 +- .../lib/model/cached_alice_http_call.dart | 2 +- packages/alice_objectbox/pubspec.yaml | 2 +- packages/alice_test/analysis_options.yaml | 2 +- .../lib/matcher/alice_call_matcher.dart | 7 +- .../lib/matcher/alice_error_matcher.dart | 11 +- .../lib/matcher/alice_log_matcher.dart | 10 +- .../lib/matcher/alice_request_matcher.dart | 60 +- .../lib/matcher/alice_response_matcher.dart | 22 +- .../lib/matcher/form_data_field_matcher.dart | 8 +- .../lib/matcher/form_data_file_matcher.dart | 8 +- .../lib/matcher/header_matcher.dart | 8 +- 63 files changed, 905 insertions(+), 676 deletions(-) diff --git a/examples/alice/analysis_options.yaml b/examples/alice/analysis_options.yaml index d4e71cb5..beb10ea9 100644 --- a/examples/alice/analysis_options.yaml +++ b/examples/alice/analysis_options.yaml @@ -9,4 +9,4 @@ include: package:flutter_lints/flutter.yaml linter: rules: - #library_annotations: false + - require_trailing_commas diff --git a/examples/alice/lib/main.dart b/examples/alice/lib/main.dart index 6d2ddf3a..b75e421b 100644 --- a/examples/alice/lib/main.dart +++ b/examples/alice/lib/main.dart @@ -50,7 +50,7 @@ class _MyAppState extends State { child: const Text( 'Run HTTP Inspector', ), - ) + ), ], ), ), diff --git a/examples/alice_chopper/analysis_options.yaml b/examples/alice_chopper/analysis_options.yaml index 05fe6c70..9e04d5ba 100644 --- a/examples/alice_chopper/analysis_options.yaml +++ b/examples/alice_chopper/analysis_options.yaml @@ -10,4 +10,4 @@ include: package:flutter_lints/flutter.yaml linter: rules: - #library_annotations: false + - require_trailing_commas diff --git a/examples/alice_chopper/lib/main.dart b/examples/alice_chopper/lib/main.dart index fce75b50..1367cd97 100644 --- a/examples/alice_chopper/lib/main.dart +++ b/examples/alice_chopper/lib/main.dart @@ -476,7 +476,7 @@ class _MyAppState extends State { ElevatedButton( onPressed: _runHttpInspector, child: const Text('Run HTTP Inspector'), - ) + ), ], ), ), diff --git a/examples/alice_dio/analysis_options.yaml b/examples/alice_dio/analysis_options.yaml index d4e71cb5..beb10ea9 100644 --- a/examples/alice_dio/analysis_options.yaml +++ b/examples/alice_dio/analysis_options.yaml @@ -9,4 +9,4 @@ include: package:flutter_lints/flutter.yaml linter: rules: - #library_annotations: false + - require_trailing_commas diff --git a/examples/alice_dio/lib/main.dart b/examples/alice_dio/lib/main.dart index d85883b2..abc828f8 100644 --- a/examples/alice_dio/lib/main.dart +++ b/examples/alice_dio/lib/main.dart @@ -62,7 +62,7 @@ class _MyAppState extends State { child: const Text( 'Run HTTP Inspector', ), - ) + ), ], ), ), @@ -74,7 +74,7 @@ class _MyAppState extends State { final Map body = { 'title': 'foo', 'body': 'bar', - 'userId': '1' + 'userId': '1', }; _dio.get( 'https://httpbin.org/redirect-to?url=https%3A%2F%2Fhttpbin.org', diff --git a/examples/alice_http/analysis_options.yaml b/examples/alice_http/analysis_options.yaml index d4e71cb5..beb10ea9 100644 --- a/examples/alice_http/analysis_options.yaml +++ b/examples/alice_http/analysis_options.yaml @@ -9,4 +9,4 @@ include: package:flutter_lints/flutter.yaml linter: rules: - #library_annotations: false + - require_trailing_commas diff --git a/examples/alice_http/lib/main.dart b/examples/alice_http/lib/main.dart index 249f6421..9635a495 100644 --- a/examples/alice_http/lib/main.dart +++ b/examples/alice_http/lib/main.dart @@ -58,7 +58,7 @@ class _MyAppState extends State { child: const Text( 'Run HTTP Inspector', ), - ) + ), ], ), ), @@ -70,7 +70,7 @@ class _MyAppState extends State { final Map body = { 'title': 'foo', 'body': 'bar', - 'userId': '1' + 'userId': '1', }; http diff --git a/examples/alice_http_client/analysis_options.yaml b/examples/alice_http_client/analysis_options.yaml index d4e71cb5..beb10ea9 100644 --- a/examples/alice_http_client/analysis_options.yaml +++ b/examples/alice_http_client/analysis_options.yaml @@ -9,4 +9,4 @@ include: package:flutter_lints/flutter.yaml linter: rules: - #library_annotations: false + - require_trailing_commas diff --git a/examples/alice_http_client/lib/main.dart b/examples/alice_http_client/lib/main.dart index 0302e699..421f2e3e 100644 --- a/examples/alice_http_client/lib/main.dart +++ b/examples/alice_http_client/lib/main.dart @@ -41,7 +41,9 @@ class _MyAppState extends State { children: [ const SizedBox(height: 8), const Text( - 'Welcome to example of Alice Http Inspector. Click buttons below to generate sample data.'), + 'Welcome to example of Alice Http Inspector.' + ' Click buttons below to generate sample data.', + ), ElevatedButton( onPressed: _runHttpHttpClientRequests, child: const Text( @@ -50,14 +52,16 @@ class _MyAppState extends State { ), const SizedBox(height: 8), const Text( - 'After clicking on buttons above, you should receive notification.' - ' Click on it to show inspector. You can also shake your device or click button below.'), + 'After clicking on buttons above, you should receive' + ' notification. Click on it to show inspector. You can ' + 'also shake your device or click button below.', + ), ElevatedButton( onPressed: _runHttpInspector, child: const Text( 'Run HTTP Inspector', ), - ) + ), ], ), ), @@ -69,7 +73,7 @@ class _MyAppState extends State { final Map body = { 'title': 'foo', 'body': 'bar', - 'userId': '1' + 'userId': '1', }; _httpClient diff --git a/examples/alice_objectbox/analysis_options.yaml b/examples/alice_objectbox/analysis_options.yaml index abad9922..bc190a7c 100644 --- a/examples/alice_objectbox/analysis_options.yaml +++ b/examples/alice_objectbox/analysis_options.yaml @@ -7,4 +7,4 @@ include: package:flutter_lints/flutter.yaml linter: rules: - #library_annotations: false + - require_trailing_commas diff --git a/examples/alice_objectbox/lib/main.dart b/examples/alice_objectbox/lib/main.dart index efbf2013..ae3d81ff 100644 --- a/examples/alice_objectbox/lib/main.dart +++ b/examples/alice_objectbox/lib/main.dart @@ -42,7 +42,7 @@ class _MyAppState extends State { ), ); late final Alice _alice = Alice( - configuration: configuration + configuration: configuration, )..addAdapter(_aliceHttpAdapter); @override @@ -82,7 +82,7 @@ class _MyAppState extends State { child: const Text( 'Run HTTP Inspector', ), - ) + ), ], ), ), @@ -94,7 +94,7 @@ class _MyAppState extends State { final Map body = { 'title': 'foo', 'body': 'bar', - 'userId': '1' + 'userId': '1', }; http diff --git a/packages/alice/CHANGELOG.md b/packages/alice/CHANGELOG.md index 2557ab49..800986d0 100644 --- a/packages/alice/CHANGELOG.md +++ b/packages/alice/CHANGELOG.md @@ -1,5 +1,7 @@ # 1.0.0-dev.11 * Fixed issue with invalid count of error calls in stats page. +* Added lint for trailing commas. +* General refactor of code base. # 1.0.0-dev.10 diff --git a/packages/alice/analysis_options.yaml b/packages/alice/analysis_options.yaml index abad9922..bc190a7c 100644 --- a/packages/alice/analysis_options.yaml +++ b/packages/alice/analysis_options.yaml @@ -7,4 +7,4 @@ include: package:flutter_lints/flutter.yaml linter: rules: - #library_annotations: false + - require_trailing_commas diff --git a/packages/alice/lib/core/alice_core.dart b/packages/alice/lib/core/alice_core.dart index 51b2473d..860167b0 100644 --- a/packages/alice/lib/core/alice_core.dart +++ b/packages/alice/lib/core/alice_core.dart @@ -129,7 +129,9 @@ class AliceCore { /// Save all calls to file. Future saveCallsToFile(BuildContext context) => AliceExportHelper.saveCallsToFile( - context, _configuration.aliceStorage.getCalls()); + context, + _configuration.aliceStorage.getCalls(), + ); /// Adds new log to Alice logger. void addLog(AliceLog log) => _configuration.aliceLogger.add(log); diff --git a/packages/alice/lib/core/alice_memory_storage.dart b/packages/alice/lib/core/alice_memory_storage.dart index bd7c603f..7752156b 100644 --- a/packages/alice/lib/core/alice_memory_storage.dart +++ b/packages/alice/lib/core/alice_memory_storage.dart @@ -45,15 +45,19 @@ class AliceMemoryStorage implements AliceStorage { ) .length, redirects: calls - .where((AliceHttpCall call) => - (call.response?.status.gte(300) ?? false) && - (call.response?.status.lt(400) ?? false)) + .where( + (AliceHttpCall call) => + (call.response?.status.gte(300) ?? false) && + (call.response?.status.lt(400) ?? false), + ) .length, errors: calls - .where((AliceHttpCall call) => - ((call.response?.status.gte(400) ?? false) && - (call.response?.status.lt(600) ?? false)) || - const [-1, 0].contains(call.response?.status)) + .where( + (AliceHttpCall call) => + ((call.response?.status.gte(400) ?? false) && + (call.response?.status.lt(600) ?? false)) || + const [-1, 0].contains(call.response?.status), + ) .length, loading: calls.where((AliceHttpCall call) => call.loading).length, ); diff --git a/packages/alice/lib/core/alice_translations.dart b/packages/alice/lib/core/alice_translations.dart index a8391c1f..8e029ff1 100644 --- a/packages/alice/lib/core/alice_translations.dart +++ b/packages/alice/lib/core/alice_translations.dart @@ -15,332 +15,342 @@ class AliceTranslations { /// Builds [AliceTranslationData] for english language. static AliceTranslationData _buildEnTranslations() { - return AliceTranslationData(languageCode: "en", values: { - AliceTranslationKey.alice: "Alice", - AliceTranslationKey.callDetails: "HTTP Call Details", - AliceTranslationKey.emailSubject: "Alice report", - AliceTranslationKey.callDetailsRequest: "Request", - AliceTranslationKey.callDetailsResponse: "Response", - AliceTranslationKey.callDetailsOverview: "Overview", - AliceTranslationKey.callDetailsError: "Error", - AliceTranslationKey.callDetailsEmpty: "Loading data failed", - AliceTranslationKey.callErrorScreenErrorEmpty: "Error is empty", - AliceTranslationKey.callErrorScreenError: "Error:", - AliceTranslationKey.callErrorScreenStacktrace: "Stack trace:", - AliceTranslationKey.callErrorScreenEmpty: "Nothing to display here", - AliceTranslationKey.callOverviewMethod: "Method:", - AliceTranslationKey.callOverviewServer: "Server:", - AliceTranslationKey.callOverviewEndpoint: "Endpoint:", - AliceTranslationKey.callOverviewStarted: "Started:", - AliceTranslationKey.callOverviewFinished: "Finished:", - AliceTranslationKey.callOverviewDuration: "Duration:", - AliceTranslationKey.callOverviewBytesSent: "Bytes sent:", - AliceTranslationKey.callOverviewBytesReceived: "Bytes received:", - AliceTranslationKey.callOverviewClient: "Client:", - AliceTranslationKey.callOverviewSecure: "Secure:", - AliceTranslationKey.callRequestStarted: "Started:", - AliceTranslationKey.callRequestBytesSent: "Bytes sent:", - AliceTranslationKey.callRequestContentType: "Content type:", - AliceTranslationKey.callRequestBody: "Body:", - AliceTranslationKey.callRequestBodyEmpty: "Body is empty", - AliceTranslationKey.callRequestFormDataFields: "Form data fields:", - AliceTranslationKey.callRequestFormDataFiles: "Form files:", - AliceTranslationKey.callRequestHeaders: "Headers:", - AliceTranslationKey.callRequestHeadersEmpty: "Headers are empty", - AliceTranslationKey.callRequestQueryParameters: "Query parameters", - AliceTranslationKey.callRequestQueryParametersEmpty: - "Query parameters are empty", - AliceTranslationKey.callResponseWaitingForResponse: - "Awaiting response...", - AliceTranslationKey.callResponseError: "Error", - AliceTranslationKey.callResponseReceived: "Received:", - AliceTranslationKey.callResponseBytesReceived: "Bytes received:", - AliceTranslationKey.callResponseStatus: "Status:", - AliceTranslationKey.callResponseHeaders: "Headers:", - AliceTranslationKey.callResponseHeadersEmpty: "Headers are empty", - AliceTranslationKey.callResponseBodyImage: "Body: Image", - AliceTranslationKey.callResponseBody: "Body:", - AliceTranslationKey.callResponseTooLargeToShow: "Too large to show", - AliceTranslationKey.callResponseBodyShow: "Show body", - AliceTranslationKey.callResponseLargeBodyShowWarning: - 'Warning! It will take some time to render output.', - AliceTranslationKey.callResponseBodyVideo: 'Body: Video', - AliceTranslationKey.callResponseBodyVideoWebBrowser: - 'Open video in web browser', - AliceTranslationKey.callResponseHeadersUnknown: "Unknown", - AliceTranslationKey.callResponseBodyUnknown: 'Unsupported body. Alice' - ' can render video/image/text body. Response has Content-Type: ' - "[contentType] which can't be handled. If you're feeling lucky you " - "can try button below to try render body as text, but it may fail.", - AliceTranslationKey.callResponseBodyUnknownShow: "Show unsupported body", - AliceTranslationKey.callsListInspector: "Inspector", - AliceTranslationKey.callsListLogger: "Logger", - AliceTranslationKey.callsListDeleteLogsDialogTitle: "Delete logs", - AliceTranslationKey.callsListDeleteLogsDialogDescription: - "Do you want to clear logs?", - AliceTranslationKey.callsListYes: "Yes", - AliceTranslationKey.callsListNo: "No", - AliceTranslationKey.callsListDeleteCallsDialogTitle: "Delete calls", - AliceTranslationKey.callsListDeleteCallsDialogDescription: - "Do you want to delete HTTP calls?", - AliceTranslationKey.callsListSearchHint: "Search HTTP call...", - AliceTranslationKey.callsListSort: "Sort", - AliceTranslationKey.callsListDelete: "Delete", - AliceTranslationKey.callsListStats: "Stats", - AliceTranslationKey.callsListSave: "Save", - AliceTranslationKey.logsEmpty: "There are no logs to show", - AliceTranslationKey.logsError: "Failed to display error", - AliceTranslationKey.logsItemError: "Error:", - AliceTranslationKey.logsItemStackTrace: "Stack trace:", - AliceTranslationKey.logsCopied: "Copied to clipboard.", - AliceTranslationKey.sortDialogTitle: "Select filter", - AliceTranslationKey.sortDialogAscending: 'Ascending', - AliceTranslationKey.sortDialogDescending: "Descending", - AliceTranslationKey.sortDialogAccept: "Accept", - AliceTranslationKey.sortDialogCancel: "Cancel", - AliceTranslationKey.sortDialogTime: "Create time (default)", - AliceTranslationKey.sortDialogResponseTime: "Response time", - AliceTranslationKey.sortDialogResponseCode: "Response code", - AliceTranslationKey.sortDialogResponseSize: "Response size", - AliceTranslationKey.sortDialogEndpoint: "Endpoint", - AliceTranslationKey.statsTitle: "Stats", - AliceTranslationKey.statsTotalRequests: "Total requests:", - AliceTranslationKey.statsPendingRequests: "Pending requests:", - AliceTranslationKey.statsSuccessRequests: "Success requests:", - AliceTranslationKey.statsRedirectionRequests: "Redirection requests:", - AliceTranslationKey.statsErrorRequests: "Error requests:", - AliceTranslationKey.statsBytesSent: "Bytes sent:", - AliceTranslationKey.statsBytesReceived: "Bytes received:", - AliceTranslationKey.statsAverageRequestTime: "Average request time:", - AliceTranslationKey.statsMaxRequestTime: "Max request time:", - AliceTranslationKey.statsMinRequestTime: "Min request time:", - AliceTranslationKey.statsGetRequests: "GET requests:", - AliceTranslationKey.statsPostRequests: "POST requests:", - AliceTranslationKey.statsDeleteRequests: "DELETE requests:", - AliceTranslationKey.statsPutRequests: "PUT requests:", - AliceTranslationKey.statsPatchRequests: "PATCH requests:", - AliceTranslationKey.statsSecuredRequests: "Secured requests:", - AliceTranslationKey.statsUnsecuredRequests: "Unsecured requests:", - AliceTranslationKey.notificationLoading: "Loading:", - AliceTranslationKey.notificationSuccess: "Success:", - AliceTranslationKey.notificationRedirect: "Redirect:", - AliceTranslationKey.notificationError: "Error:", - AliceTranslationKey.notificationTotalRequests: - "Alice (total [callCount] HTTP calls)", - AliceTranslationKey.saveDialogPermissionErrorTitle: "Permission error", - AliceTranslationKey.saveDialogPermissionErrorDescription: - "Permission not granted. Couldn't save logs.", - AliceTranslationKey.saveDialogEmptyErrorTitle: "Call history empty", - AliceTranslationKey.saveDialogEmptyErrorDescription: - "There are no calls to save.", - AliceTranslationKey.saveDialogFileSaveErrorTitle: "Save error", - AliceTranslationKey.saveDialogFileSaveErrorDescription: - "Failed to save http calls to file.", - AliceTranslationKey.saveSuccessTitle: "Logs saved", - AliceTranslationKey.saveSuccessDescription: - "Successfully saved logs in [path].", - AliceTranslationKey.saveSuccessView: "View file", - AliceTranslationKey.saveHeaderTitle: "Alice - HTTP Inspector", - AliceTranslationKey.saveHeaderAppName: "App name:", - AliceTranslationKey.saveHeaderPackage: "Package:", - AliceTranslationKey.saveHeaderVersion: "Version:", - AliceTranslationKey.saveHeaderBuildNumber: "Build number:", - AliceTranslationKey.saveHeaderGenerated: "Generated:", - AliceTranslationKey.saveLogId: "Id:", - AliceTranslationKey.saveLogGeneralData: "General data", - AliceTranslationKey.saveLogServer: "Server:", - AliceTranslationKey.saveLogMethod: "Method:", - AliceTranslationKey.saveLogEndpoint: "Endpoint:", - AliceTranslationKey.saveLogClient: "Client:", - AliceTranslationKey.saveLogDuration: "Duration:", - AliceTranslationKey.saveLogSecured: "Secured connection:", - AliceTranslationKey.saveLogCompleted: "Completed:", - AliceTranslationKey.saveLogRequest: "Request", - AliceTranslationKey.saveLogRequestTime: "Request time:", - AliceTranslationKey.saveLogRequestContentType: "Request content type:", - AliceTranslationKey.saveLogRequestCookies: "Request cookies:", - AliceTranslationKey.saveLogRequestHeaders: "Request headers:", - AliceTranslationKey.saveLogRequestQueryParams: "Request query params:", - AliceTranslationKey.saveLogRequestSize: "Request size:", - AliceTranslationKey.saveLogRequestBody: "Request body:", - AliceTranslationKey.saveLogResponse: "Response", - AliceTranslationKey.saveLogResponseTime: "Response time:", - AliceTranslationKey.saveLogResponseStatus: "Response status:", - AliceTranslationKey.saveLogResponseSize: "Response size:", - AliceTranslationKey.saveLogResponseHeaders: "Response headers:", - AliceTranslationKey.saveLogResponseBody: "Response body:", - AliceTranslationKey.saveLogError: "Error", - AliceTranslationKey.saveLogStackTrace: "Stack trace", - AliceTranslationKey.saveLogCurl: "Curl", - AliceTranslationKey.accept: "Accept", - AliceTranslationKey.parserFailed: "Failed to parse: ", - AliceTranslationKey.unknown: "Unknown", - }); + return AliceTranslationData( + languageCode: "en", + values: { + AliceTranslationKey.alice: "Alice", + AliceTranslationKey.callDetails: "HTTP Call Details", + AliceTranslationKey.emailSubject: "Alice report", + AliceTranslationKey.callDetailsRequest: "Request", + AliceTranslationKey.callDetailsResponse: "Response", + AliceTranslationKey.callDetailsOverview: "Overview", + AliceTranslationKey.callDetailsError: "Error", + AliceTranslationKey.callDetailsEmpty: "Loading data failed", + AliceTranslationKey.callErrorScreenErrorEmpty: "Error is empty", + AliceTranslationKey.callErrorScreenError: "Error:", + AliceTranslationKey.callErrorScreenStacktrace: "Stack trace:", + AliceTranslationKey.callErrorScreenEmpty: "Nothing to display here", + AliceTranslationKey.callOverviewMethod: "Method:", + AliceTranslationKey.callOverviewServer: "Server:", + AliceTranslationKey.callOverviewEndpoint: "Endpoint:", + AliceTranslationKey.callOverviewStarted: "Started:", + AliceTranslationKey.callOverviewFinished: "Finished:", + AliceTranslationKey.callOverviewDuration: "Duration:", + AliceTranslationKey.callOverviewBytesSent: "Bytes sent:", + AliceTranslationKey.callOverviewBytesReceived: "Bytes received:", + AliceTranslationKey.callOverviewClient: "Client:", + AliceTranslationKey.callOverviewSecure: "Secure:", + AliceTranslationKey.callRequestStarted: "Started:", + AliceTranslationKey.callRequestBytesSent: "Bytes sent:", + AliceTranslationKey.callRequestContentType: "Content type:", + AliceTranslationKey.callRequestBody: "Body:", + AliceTranslationKey.callRequestBodyEmpty: "Body is empty", + AliceTranslationKey.callRequestFormDataFields: "Form data fields:", + AliceTranslationKey.callRequestFormDataFiles: "Form files:", + AliceTranslationKey.callRequestHeaders: "Headers:", + AliceTranslationKey.callRequestHeadersEmpty: "Headers are empty", + AliceTranslationKey.callRequestQueryParameters: "Query parameters", + AliceTranslationKey.callRequestQueryParametersEmpty: + "Query parameters are empty", + AliceTranslationKey.callResponseWaitingForResponse: + "Awaiting response...", + AliceTranslationKey.callResponseError: "Error", + AliceTranslationKey.callResponseReceived: "Received:", + AliceTranslationKey.callResponseBytesReceived: "Bytes received:", + AliceTranslationKey.callResponseStatus: "Status:", + AliceTranslationKey.callResponseHeaders: "Headers:", + AliceTranslationKey.callResponseHeadersEmpty: "Headers are empty", + AliceTranslationKey.callResponseBodyImage: "Body: Image", + AliceTranslationKey.callResponseBody: "Body:", + AliceTranslationKey.callResponseTooLargeToShow: "Too large to show", + AliceTranslationKey.callResponseBodyShow: "Show body", + AliceTranslationKey.callResponseLargeBodyShowWarning: + 'Warning! It will take some time to render output.', + AliceTranslationKey.callResponseBodyVideo: 'Body: Video', + AliceTranslationKey.callResponseBodyVideoWebBrowser: + 'Open video in web browser', + AliceTranslationKey.callResponseHeadersUnknown: "Unknown", + AliceTranslationKey.callResponseBodyUnknown: 'Unsupported body. Alice' + ' can render video/image/text body. Response has Content-Type: ' + "[contentType] which can't be handled. If you're feeling lucky you " + "can try button below to try render body as text, but it may fail.", + AliceTranslationKey.callResponseBodyUnknownShow: + "Show unsupported body", + AliceTranslationKey.callsListInspector: "Inspector", + AliceTranslationKey.callsListLogger: "Logger", + AliceTranslationKey.callsListDeleteLogsDialogTitle: "Delete logs", + AliceTranslationKey.callsListDeleteLogsDialogDescription: + "Do you want to clear logs?", + AliceTranslationKey.callsListYes: "Yes", + AliceTranslationKey.callsListNo: "No", + AliceTranslationKey.callsListDeleteCallsDialogTitle: "Delete calls", + AliceTranslationKey.callsListDeleteCallsDialogDescription: + "Do you want to delete HTTP calls?", + AliceTranslationKey.callsListSearchHint: "Search HTTP call...", + AliceTranslationKey.callsListSort: "Sort", + AliceTranslationKey.callsListDelete: "Delete", + AliceTranslationKey.callsListStats: "Stats", + AliceTranslationKey.callsListSave: "Save", + AliceTranslationKey.logsEmpty: "There are no logs to show", + AliceTranslationKey.logsError: "Failed to display error", + AliceTranslationKey.logsItemError: "Error:", + AliceTranslationKey.logsItemStackTrace: "Stack trace:", + AliceTranslationKey.logsCopied: "Copied to clipboard.", + AliceTranslationKey.sortDialogTitle: "Select filter", + AliceTranslationKey.sortDialogAscending: 'Ascending', + AliceTranslationKey.sortDialogDescending: "Descending", + AliceTranslationKey.sortDialogAccept: "Accept", + AliceTranslationKey.sortDialogCancel: "Cancel", + AliceTranslationKey.sortDialogTime: "Create time (default)", + AliceTranslationKey.sortDialogResponseTime: "Response time", + AliceTranslationKey.sortDialogResponseCode: "Response code", + AliceTranslationKey.sortDialogResponseSize: "Response size", + AliceTranslationKey.sortDialogEndpoint: "Endpoint", + AliceTranslationKey.statsTitle: "Stats", + AliceTranslationKey.statsTotalRequests: "Total requests:", + AliceTranslationKey.statsPendingRequests: "Pending requests:", + AliceTranslationKey.statsSuccessRequests: "Success requests:", + AliceTranslationKey.statsRedirectionRequests: "Redirection requests:", + AliceTranslationKey.statsErrorRequests: "Error requests:", + AliceTranslationKey.statsBytesSent: "Bytes sent:", + AliceTranslationKey.statsBytesReceived: "Bytes received:", + AliceTranslationKey.statsAverageRequestTime: "Average request time:", + AliceTranslationKey.statsMaxRequestTime: "Max request time:", + AliceTranslationKey.statsMinRequestTime: "Min request time:", + AliceTranslationKey.statsGetRequests: "GET requests:", + AliceTranslationKey.statsPostRequests: "POST requests:", + AliceTranslationKey.statsDeleteRequests: "DELETE requests:", + AliceTranslationKey.statsPutRequests: "PUT requests:", + AliceTranslationKey.statsPatchRequests: "PATCH requests:", + AliceTranslationKey.statsSecuredRequests: "Secured requests:", + AliceTranslationKey.statsUnsecuredRequests: "Unsecured requests:", + AliceTranslationKey.notificationLoading: "Loading:", + AliceTranslationKey.notificationSuccess: "Success:", + AliceTranslationKey.notificationRedirect: "Redirect:", + AliceTranslationKey.notificationError: "Error:", + AliceTranslationKey.notificationTotalRequests: + "Alice (total [callCount] HTTP calls)", + AliceTranslationKey.saveDialogPermissionErrorTitle: "Permission error", + AliceTranslationKey.saveDialogPermissionErrorDescription: + "Permission not granted. Couldn't save logs.", + AliceTranslationKey.saveDialogEmptyErrorTitle: "Call history empty", + AliceTranslationKey.saveDialogEmptyErrorDescription: + "There are no calls to save.", + AliceTranslationKey.saveDialogFileSaveErrorTitle: "Save error", + AliceTranslationKey.saveDialogFileSaveErrorDescription: + "Failed to save http calls to file.", + AliceTranslationKey.saveSuccessTitle: "Logs saved", + AliceTranslationKey.saveSuccessDescription: + "Successfully saved logs in [path].", + AliceTranslationKey.saveSuccessView: "View file", + AliceTranslationKey.saveHeaderTitle: "Alice - HTTP Inspector", + AliceTranslationKey.saveHeaderAppName: "App name:", + AliceTranslationKey.saveHeaderPackage: "Package:", + AliceTranslationKey.saveHeaderVersion: "Version:", + AliceTranslationKey.saveHeaderBuildNumber: "Build number:", + AliceTranslationKey.saveHeaderGenerated: "Generated:", + AliceTranslationKey.saveLogId: "Id:", + AliceTranslationKey.saveLogGeneralData: "General data", + AliceTranslationKey.saveLogServer: "Server:", + AliceTranslationKey.saveLogMethod: "Method:", + AliceTranslationKey.saveLogEndpoint: "Endpoint:", + AliceTranslationKey.saveLogClient: "Client:", + AliceTranslationKey.saveLogDuration: "Duration:", + AliceTranslationKey.saveLogSecured: "Secured connection:", + AliceTranslationKey.saveLogCompleted: "Completed:", + AliceTranslationKey.saveLogRequest: "Request", + AliceTranslationKey.saveLogRequestTime: "Request time:", + AliceTranslationKey.saveLogRequestContentType: "Request content type:", + AliceTranslationKey.saveLogRequestCookies: "Request cookies:", + AliceTranslationKey.saveLogRequestHeaders: "Request headers:", + AliceTranslationKey.saveLogRequestQueryParams: "Request query params:", + AliceTranslationKey.saveLogRequestSize: "Request size:", + AliceTranslationKey.saveLogRequestBody: "Request body:", + AliceTranslationKey.saveLogResponse: "Response", + AliceTranslationKey.saveLogResponseTime: "Response time:", + AliceTranslationKey.saveLogResponseStatus: "Response status:", + AliceTranslationKey.saveLogResponseSize: "Response size:", + AliceTranslationKey.saveLogResponseHeaders: "Response headers:", + AliceTranslationKey.saveLogResponseBody: "Response body:", + AliceTranslationKey.saveLogError: "Error", + AliceTranslationKey.saveLogStackTrace: "Stack trace", + AliceTranslationKey.saveLogCurl: "Curl", + AliceTranslationKey.accept: "Accept", + AliceTranslationKey.parserFailed: "Failed to parse: ", + AliceTranslationKey.unknown: "Unknown", + }, + ); } /// Builds [AliceTranslationData] for polish language. static AliceTranslationData _buildPlTranslations() { - return AliceTranslationData(languageCode: "pl", values: { - AliceTranslationKey.alice: "Alice", - AliceTranslationKey.callDetails: "Połączenie HTTP - detale", - AliceTranslationKey.emailSubject: "Raport ALice", - AliceTranslationKey.callDetailsRequest: "Żądanie", - AliceTranslationKey.callDetailsResponse: "Odpowiedź", - AliceTranslationKey.callDetailsOverview: "Przegląd", - AliceTranslationKey.callDetailsError: "Błąd", - AliceTranslationKey.callDetailsEmpty: "Błąd ładowania danych", - AliceTranslationKey.callErrorScreenErrorEmpty: "Brak błędów", - AliceTranslationKey.callErrorScreenError: "Błąd:", - AliceTranslationKey.callErrorScreenStacktrace: "Ślad stosu:", - AliceTranslationKey.callErrorScreenEmpty: "Brak danych do wyświetlenia", - AliceTranslationKey.callOverviewMethod: "Metoda:", - AliceTranslationKey.callOverviewServer: "Serwer:", - AliceTranslationKey.callOverviewEndpoint: "Endpoint:", - AliceTranslationKey.callOverviewStarted: "Rozpoczęto:", - AliceTranslationKey.callOverviewFinished: "Zakończono:", - AliceTranslationKey.callOverviewDuration: "Czas trwania:", - AliceTranslationKey.callOverviewBytesSent: "Bajty wysłane:", - AliceTranslationKey.callOverviewBytesReceived: "Bajty odebrane:", - AliceTranslationKey.callOverviewClient: "Klient:", - AliceTranslationKey.callOverviewSecure: "Połączenie zabezpieczone:", - AliceTranslationKey.callRequestStarted: "Ropoczęto:", - AliceTranslationKey.callRequestBytesSent: "Bajty wysłane:", - AliceTranslationKey.callRequestContentType: "Typ zawartości:", - AliceTranslationKey.callRequestBody: "Body:", - AliceTranslationKey.callRequestBodyEmpty: "Body jest puste", - AliceTranslationKey.callRequestFormDataFields: "Pola forumlarza:", - AliceTranslationKey.callRequestFormDataFiles: "Pliki formularza:", - AliceTranslationKey.callRequestHeaders: "Headery:", - AliceTranslationKey.callRequestHeadersEmpty: "Headery są puste", - AliceTranslationKey.callRequestQueryParameters: "Parametry query", - AliceTranslationKey.callRequestQueryParametersEmpty: - "Parametry query są puste", - AliceTranslationKey.callResponseWaitingForResponse: - "Oczekiwanie na odpowiedź...", - AliceTranslationKey.callResponseError: "Błąd", - AliceTranslationKey.callResponseReceived: "Otrzymano:", - AliceTranslationKey.callResponseBytesReceived: "Bajty odebrane:", - AliceTranslationKey.callResponseStatus: "Status:", - AliceTranslationKey.callResponseHeaders: "Headery:", - AliceTranslationKey.callResponseHeadersEmpty: "Headery są puste", - AliceTranslationKey.callResponseBodyImage: "Body: Obraz", - AliceTranslationKey.callResponseBody: "Body:", - AliceTranslationKey.callResponseTooLargeToShow: "Za duże aby pokazać", - AliceTranslationKey.callResponseBodyShow: "Pokaż body", - AliceTranslationKey.callResponseLargeBodyShowWarning: - 'Uwaga! Może zająć trochę czasu, zanim uda się wyrenderować output.', - AliceTranslationKey.callResponseBodyVideo: 'Body: Video', - AliceTranslationKey.callResponseBodyVideoWebBrowser: - 'Otwórz video w przeglądarce', - AliceTranslationKey.callResponseHeadersUnknown: "Nieznane", - AliceTranslationKey.callResponseBodyUnknown: 'Nieznane body. Alice' - ' może renderować video/image/text. Odpowiedź ma typ zawartości:' - "[contentType], który nie może być obsłużony.Jeżeli chcesz, możesz " - "spróbować wyrenderować body jako tekst, ale może to się nie udać.", - AliceTranslationKey.callResponseBodyUnknownShow: - "Pokaż nieobsługiwane body", - AliceTranslationKey.callsListInspector: "Inspektor", - AliceTranslationKey.callsListLogger: "Logger", - AliceTranslationKey.callsListDeleteLogsDialogTitle: "Usuń logi", - AliceTranslationKey.callsListDeleteLogsDialogDescription: - "Czy chcesz usunąc logi?", - AliceTranslationKey.callsListYes: "Tak", - AliceTranslationKey.callsListNo: "Nie", - AliceTranslationKey.callsListDeleteCallsDialogTitle: "Usuń połączenia", - AliceTranslationKey.callsListDeleteCallsDialogDescription: - "Czy chcesz usunąć zapisane połaczenia HTTP?", - AliceTranslationKey.callsListSearchHint: "Szukaj połączenia HTTP...", - AliceTranslationKey.callsListSort: "Sortuj", - AliceTranslationKey.callsListDelete: "Usuń", - AliceTranslationKey.callsListStats: "Statystyki", - AliceTranslationKey.callsListSave: "Zapis", - AliceTranslationKey.logsEmpty: "Brak rezultatów", - AliceTranslationKey.logsError: "Problem z wyświetleniem logów.", - AliceTranslationKey.logsItemError: "Błąd:", - AliceTranslationKey.logsItemStackTrace: "Ślad stosu:", - AliceTranslationKey.logsCopied: "Skopiowano do schowka.", - AliceTranslationKey.sortDialogTitle: "Wybierz filtr", - AliceTranslationKey.sortDialogAscending: 'Rosnąco', - AliceTranslationKey.sortDialogDescending: "Malejąco", - AliceTranslationKey.sortDialogAccept: "Akceptuj", - AliceTranslationKey.sortDialogCancel: "Anuluj", - AliceTranslationKey.sortDialogTime: "Czas utworzenia (domyślnie)", - AliceTranslationKey.sortDialogResponseTime: "Czas odpowiedzi", - AliceTranslationKey.sortDialogResponseCode: "Status odpowiedzi", - AliceTranslationKey.sortDialogResponseSize: "Rozmiar odpowiedzi", - AliceTranslationKey.sortDialogEndpoint: "Endpoint", - AliceTranslationKey.statsTitle: "Statystyki", - AliceTranslationKey.statsTotalRequests: "Razem żądań:", - AliceTranslationKey.statsPendingRequests: "Oczekujące żądania:", - AliceTranslationKey.statsSuccessRequests: "Poprawne żądania:", - AliceTranslationKey.statsRedirectionRequests: "Żądania przekierowania:", - AliceTranslationKey.statsErrorRequests: "Błędne żądania:", - AliceTranslationKey.statsBytesSent: "Bajty wysłane:", - AliceTranslationKey.statsBytesReceived: "Bajty otrzymane:", - AliceTranslationKey.statsAverageRequestTime: "Średni czas żądania:", - AliceTranslationKey.statsMaxRequestTime: "Maksymalny czas żądania:", - AliceTranslationKey.statsMinRequestTime: "Minimalny czas żądania:", - AliceTranslationKey.statsGetRequests: "Żądania GET:", - AliceTranslationKey.statsPostRequests: "Żądania POST:", - AliceTranslationKey.statsDeleteRequests: "Żądania DELETE:", - AliceTranslationKey.statsPutRequests: "Żądania PUT:", - AliceTranslationKey.statsPatchRequests: "Żądania PATCH:", - AliceTranslationKey.statsSecuredRequests: "Żądania zabezpieczone:", - AliceTranslationKey.statsUnsecuredRequests: "Żądania niezabezpieczone:", - AliceTranslationKey.notificationLoading: "Oczekujące:", - AliceTranslationKey.notificationSuccess: "Poprawne:", - AliceTranslationKey.notificationRedirect: "Przekierowanie:", - AliceTranslationKey.notificationError: "Błąd:", - AliceTranslationKey.notificationTotalRequests: - "Alice (razem [callCount] połączeń HTTP)", - AliceTranslationKey.saveDialogPermissionErrorTitle: "Błąd pozwolenia", - AliceTranslationKey.saveDialogPermissionErrorDescription: - "Pozwolenie nieprzyznane. Nie można zapisać logów.", - AliceTranslationKey.saveDialogEmptyErrorTitle: "Pusta historia połaczeń", - AliceTranslationKey.saveDialogEmptyErrorDescription: - "Nie ma połączeń do zapisania.", - AliceTranslationKey.saveDialogFileSaveErrorTitle: "Błąd zapisu", - AliceTranslationKey.saveDialogFileSaveErrorDescription: - "Nie można zapisać danych do pliku.", - AliceTranslationKey.saveSuccessTitle: "Logi zapisane", - AliceTranslationKey.saveSuccessDescription: "Zapisano logi w [path].", - AliceTranslationKey.saveSuccessView: "Otwórz plik", - AliceTranslationKey.saveHeaderTitle: "Alice - Inspektor HTTP", - AliceTranslationKey.saveHeaderAppName: "Nazwa aplikacji:", - AliceTranslationKey.saveHeaderPackage: "Paczka:", - AliceTranslationKey.saveHeaderVersion: "Wersja:", - AliceTranslationKey.saveHeaderBuildNumber: "Numer buildu:", - AliceTranslationKey.saveHeaderGenerated: "Wygenerowano:", - AliceTranslationKey.saveLogId: "Id:", - AliceTranslationKey.saveLogGeneralData: "Ogólne informacje", - AliceTranslationKey.saveLogServer: "Serwer:", - AliceTranslationKey.saveLogMethod: "Metoda:", - AliceTranslationKey.saveLogEndpoint: "Endpoint:", - AliceTranslationKey.saveLogClient: "Klient:", - AliceTranslationKey.saveLogDuration: "Czas trwania:", - AliceTranslationKey.saveLogSecured: "Połączenie zabezpieczone:", - AliceTranslationKey.saveLogCompleted: "Zakończono:", - AliceTranslationKey.saveLogRequest: "Żądanie", - AliceTranslationKey.saveLogRequestTime: "Czas żądania:", - AliceTranslationKey.saveLogRequestContentType: "Typ zawartości żądania:", - AliceTranslationKey.saveLogRequestCookies: "Ciasteczka żądania:", - AliceTranslationKey.saveLogRequestHeaders: "Heady żądania", - AliceTranslationKey.saveLogRequestQueryParams: "Parametry query żądania", - AliceTranslationKey.saveLogRequestSize: "Rozmiar żądania:", - AliceTranslationKey.saveLogRequestBody: "Body żądania:", - AliceTranslationKey.saveLogResponse: "Odpowiedź", - AliceTranslationKey.saveLogResponseTime: "Czas odpowiedzi:", - AliceTranslationKey.saveLogResponseStatus: "Status odpowiedzi:", - AliceTranslationKey.saveLogResponseSize: "Rozmiar odpowiedzi:", - AliceTranslationKey.saveLogResponseHeaders: "Headery odpowiedzi:", - AliceTranslationKey.saveLogResponseBody: "Body odpowiedzi:", - AliceTranslationKey.saveLogError: "Błąd", - AliceTranslationKey.saveLogStackTrace: "Ślad stosu", - AliceTranslationKey.saveLogCurl: "Curl", - AliceTranslationKey.accept: "Akceptuj", - AliceTranslationKey.parserFailed: "Problem z parsowaniem: ", - AliceTranslationKey.unknown: "Nieznane" - }); + return AliceTranslationData( + languageCode: "pl", + values: { + AliceTranslationKey.alice: "Alice", + AliceTranslationKey.callDetails: "Połączenie HTTP - detale", + AliceTranslationKey.emailSubject: "Raport ALice", + AliceTranslationKey.callDetailsRequest: "Żądanie", + AliceTranslationKey.callDetailsResponse: "Odpowiedź", + AliceTranslationKey.callDetailsOverview: "Przegląd", + AliceTranslationKey.callDetailsError: "Błąd", + AliceTranslationKey.callDetailsEmpty: "Błąd ładowania danych", + AliceTranslationKey.callErrorScreenErrorEmpty: "Brak błędów", + AliceTranslationKey.callErrorScreenError: "Błąd:", + AliceTranslationKey.callErrorScreenStacktrace: "Ślad stosu:", + AliceTranslationKey.callErrorScreenEmpty: "Brak danych do wyświetlenia", + AliceTranslationKey.callOverviewMethod: "Metoda:", + AliceTranslationKey.callOverviewServer: "Serwer:", + AliceTranslationKey.callOverviewEndpoint: "Endpoint:", + AliceTranslationKey.callOverviewStarted: "Rozpoczęto:", + AliceTranslationKey.callOverviewFinished: "Zakończono:", + AliceTranslationKey.callOverviewDuration: "Czas trwania:", + AliceTranslationKey.callOverviewBytesSent: "Bajty wysłane:", + AliceTranslationKey.callOverviewBytesReceived: "Bajty odebrane:", + AliceTranslationKey.callOverviewClient: "Klient:", + AliceTranslationKey.callOverviewSecure: "Połączenie zabezpieczone:", + AliceTranslationKey.callRequestStarted: "Ropoczęto:", + AliceTranslationKey.callRequestBytesSent: "Bajty wysłane:", + AliceTranslationKey.callRequestContentType: "Typ zawartości:", + AliceTranslationKey.callRequestBody: "Body:", + AliceTranslationKey.callRequestBodyEmpty: "Body jest puste", + AliceTranslationKey.callRequestFormDataFields: "Pola forumlarza:", + AliceTranslationKey.callRequestFormDataFiles: "Pliki formularza:", + AliceTranslationKey.callRequestHeaders: "Headery:", + AliceTranslationKey.callRequestHeadersEmpty: "Headery są puste", + AliceTranslationKey.callRequestQueryParameters: "Parametry query", + AliceTranslationKey.callRequestQueryParametersEmpty: + "Parametry query są puste", + AliceTranslationKey.callResponseWaitingForResponse: + "Oczekiwanie na odpowiedź...", + AliceTranslationKey.callResponseError: "Błąd", + AliceTranslationKey.callResponseReceived: "Otrzymano:", + AliceTranslationKey.callResponseBytesReceived: "Bajty odebrane:", + AliceTranslationKey.callResponseStatus: "Status:", + AliceTranslationKey.callResponseHeaders: "Headery:", + AliceTranslationKey.callResponseHeadersEmpty: "Headery są puste", + AliceTranslationKey.callResponseBodyImage: "Body: Obraz", + AliceTranslationKey.callResponseBody: "Body:", + AliceTranslationKey.callResponseTooLargeToShow: "Za duże aby pokazać", + AliceTranslationKey.callResponseBodyShow: "Pokaż body", + AliceTranslationKey.callResponseLargeBodyShowWarning: + 'Uwaga! Może zająć trochę czasu, zanim uda się wyrenderować output.', + AliceTranslationKey.callResponseBodyVideo: 'Body: Video', + AliceTranslationKey.callResponseBodyVideoWebBrowser: + 'Otwórz video w przeglądarce', + AliceTranslationKey.callResponseHeadersUnknown: "Nieznane", + AliceTranslationKey.callResponseBodyUnknown: 'Nieznane body. Alice' + ' może renderować video/image/text. Odpowiedź ma typ zawartości:' + "[contentType], który nie może być obsłużony.Jeżeli chcesz, możesz " + "spróbować wyrenderować body jako tekst, ale może to się nie udać.", + AliceTranslationKey.callResponseBodyUnknownShow: + "Pokaż nieobsługiwane body", + AliceTranslationKey.callsListInspector: "Inspektor", + AliceTranslationKey.callsListLogger: "Logger", + AliceTranslationKey.callsListDeleteLogsDialogTitle: "Usuń logi", + AliceTranslationKey.callsListDeleteLogsDialogDescription: + "Czy chcesz usunąc logi?", + AliceTranslationKey.callsListYes: "Tak", + AliceTranslationKey.callsListNo: "Nie", + AliceTranslationKey.callsListDeleteCallsDialogTitle: "Usuń połączenia", + AliceTranslationKey.callsListDeleteCallsDialogDescription: + "Czy chcesz usunąć zapisane połaczenia HTTP?", + AliceTranslationKey.callsListSearchHint: "Szukaj połączenia HTTP...", + AliceTranslationKey.callsListSort: "Sortuj", + AliceTranslationKey.callsListDelete: "Usuń", + AliceTranslationKey.callsListStats: "Statystyki", + AliceTranslationKey.callsListSave: "Zapis", + AliceTranslationKey.logsEmpty: "Brak rezultatów", + AliceTranslationKey.logsError: "Problem z wyświetleniem logów.", + AliceTranslationKey.logsItemError: "Błąd:", + AliceTranslationKey.logsItemStackTrace: "Ślad stosu:", + AliceTranslationKey.logsCopied: "Skopiowano do schowka.", + AliceTranslationKey.sortDialogTitle: "Wybierz filtr", + AliceTranslationKey.sortDialogAscending: 'Rosnąco', + AliceTranslationKey.sortDialogDescending: "Malejąco", + AliceTranslationKey.sortDialogAccept: "Akceptuj", + AliceTranslationKey.sortDialogCancel: "Anuluj", + AliceTranslationKey.sortDialogTime: "Czas utworzenia (domyślnie)", + AliceTranslationKey.sortDialogResponseTime: "Czas odpowiedzi", + AliceTranslationKey.sortDialogResponseCode: "Status odpowiedzi", + AliceTranslationKey.sortDialogResponseSize: "Rozmiar odpowiedzi", + AliceTranslationKey.sortDialogEndpoint: "Endpoint", + AliceTranslationKey.statsTitle: "Statystyki", + AliceTranslationKey.statsTotalRequests: "Razem żądań:", + AliceTranslationKey.statsPendingRequests: "Oczekujące żądania:", + AliceTranslationKey.statsSuccessRequests: "Poprawne żądania:", + AliceTranslationKey.statsRedirectionRequests: "Żądania przekierowania:", + AliceTranslationKey.statsErrorRequests: "Błędne żądania:", + AliceTranslationKey.statsBytesSent: "Bajty wysłane:", + AliceTranslationKey.statsBytesReceived: "Bajty otrzymane:", + AliceTranslationKey.statsAverageRequestTime: "Średni czas żądania:", + AliceTranslationKey.statsMaxRequestTime: "Maksymalny czas żądania:", + AliceTranslationKey.statsMinRequestTime: "Minimalny czas żądania:", + AliceTranslationKey.statsGetRequests: "Żądania GET:", + AliceTranslationKey.statsPostRequests: "Żądania POST:", + AliceTranslationKey.statsDeleteRequests: "Żądania DELETE:", + AliceTranslationKey.statsPutRequests: "Żądania PUT:", + AliceTranslationKey.statsPatchRequests: "Żądania PATCH:", + AliceTranslationKey.statsSecuredRequests: "Żądania zabezpieczone:", + AliceTranslationKey.statsUnsecuredRequests: "Żądania niezabezpieczone:", + AliceTranslationKey.notificationLoading: "Oczekujące:", + AliceTranslationKey.notificationSuccess: "Poprawne:", + AliceTranslationKey.notificationRedirect: "Przekierowanie:", + AliceTranslationKey.notificationError: "Błąd:", + AliceTranslationKey.notificationTotalRequests: + "Alice (razem [callCount] połączeń HTTP)", + AliceTranslationKey.saveDialogPermissionErrorTitle: "Błąd pozwolenia", + AliceTranslationKey.saveDialogPermissionErrorDescription: + "Pozwolenie nieprzyznane. Nie można zapisać logów.", + AliceTranslationKey.saveDialogEmptyErrorTitle: + "Pusta historia połaczeń", + AliceTranslationKey.saveDialogEmptyErrorDescription: + "Nie ma połączeń do zapisania.", + AliceTranslationKey.saveDialogFileSaveErrorTitle: "Błąd zapisu", + AliceTranslationKey.saveDialogFileSaveErrorDescription: + "Nie można zapisać danych do pliku.", + AliceTranslationKey.saveSuccessTitle: "Logi zapisane", + AliceTranslationKey.saveSuccessDescription: "Zapisano logi w [path].", + AliceTranslationKey.saveSuccessView: "Otwórz plik", + AliceTranslationKey.saveHeaderTitle: "Alice - Inspektor HTTP", + AliceTranslationKey.saveHeaderAppName: "Nazwa aplikacji:", + AliceTranslationKey.saveHeaderPackage: "Paczka:", + AliceTranslationKey.saveHeaderVersion: "Wersja:", + AliceTranslationKey.saveHeaderBuildNumber: "Numer buildu:", + AliceTranslationKey.saveHeaderGenerated: "Wygenerowano:", + AliceTranslationKey.saveLogId: "Id:", + AliceTranslationKey.saveLogGeneralData: "Ogólne informacje", + AliceTranslationKey.saveLogServer: "Serwer:", + AliceTranslationKey.saveLogMethod: "Metoda:", + AliceTranslationKey.saveLogEndpoint: "Endpoint:", + AliceTranslationKey.saveLogClient: "Klient:", + AliceTranslationKey.saveLogDuration: "Czas trwania:", + AliceTranslationKey.saveLogSecured: "Połączenie zabezpieczone:", + AliceTranslationKey.saveLogCompleted: "Zakończono:", + AliceTranslationKey.saveLogRequest: "Żądanie", + AliceTranslationKey.saveLogRequestTime: "Czas żądania:", + AliceTranslationKey.saveLogRequestContentType: + "Typ zawartości żądania:", + AliceTranslationKey.saveLogRequestCookies: "Ciasteczka żądania:", + AliceTranslationKey.saveLogRequestHeaders: "Heady żądania", + AliceTranslationKey.saveLogRequestQueryParams: + "Parametry query żądania", + AliceTranslationKey.saveLogRequestSize: "Rozmiar żądania:", + AliceTranslationKey.saveLogRequestBody: "Body żądania:", + AliceTranslationKey.saveLogResponse: "Odpowiedź", + AliceTranslationKey.saveLogResponseTime: "Czas odpowiedzi:", + AliceTranslationKey.saveLogResponseStatus: "Status odpowiedzi:", + AliceTranslationKey.saveLogResponseSize: "Rozmiar odpowiedzi:", + AliceTranslationKey.saveLogResponseHeaders: "Headery odpowiedzi:", + AliceTranslationKey.saveLogResponseBody: "Body odpowiedzi:", + AliceTranslationKey.saveLogError: "Błąd", + AliceTranslationKey.saveLogStackTrace: "Ślad stosu", + AliceTranslationKey.saveLogCurl: "Curl", + AliceTranslationKey.accept: "Akceptuj", + AliceTranslationKey.parserFailed: "Problem z parsowaniem: ", + AliceTranslationKey.unknown: "Nieznane", + }, + ); } /// Returns localized value for specific [languageCode] and [key]. If value diff --git a/packages/alice/lib/helper/alice_export_helper.dart b/packages/alice/lib/helper/alice_export_helper.dart index 5499937e..08419006 100644 --- a/packages/alice/lib/helper/alice_export_helper.dart +++ b/packages/alice/lib/helper/alice_export_helper.dart @@ -93,7 +93,9 @@ class AliceExportHelper { try { if (calls.isEmpty) { return AliceExportResult( - success: false, error: AliceExportResultError.empty); + success: false, + error: AliceExportResultError.empty, + ); } final Directory externalDir = await getApplicationCacheDirectory(); @@ -192,7 +194,8 @@ class AliceExportHelper { if (call.error?.stackTrace != null) { stringBuffer.write( - '${context.i18n(AliceTranslationKey.saveLogStackTrace)}: ${call.error?.stackTrace}\n'); + '${context.i18n(AliceTranslationKey.saveLogStackTrace)}: ${call.error?.stackTrace}\n', + ); } } diff --git a/packages/alice/lib/model/alice_http_call.dart b/packages/alice/lib/model/alice_http_call.dart index 55ca6cd9..adeedec2 100644 --- a/packages/alice/lib/model/alice_http_call.dart +++ b/packages/alice/lib/model/alice_http_call.dart @@ -36,6 +36,6 @@ class AliceHttpCall with EquatableMixin { duration, request, response, - error + error, ]; } diff --git a/packages/alice/lib/ui/call_details/widget/alice_call_error_screen.dart b/packages/alice/lib/ui/call_details/widget/alice_call_error_screen.dart index 4e2fa401..646522f8 100644 --- a/packages/alice/lib/ui/call_details/widget/alice_call_error_screen.dart +++ b/packages/alice/lib/ui/call_details/widget/alice_call_error_screen.dart @@ -28,8 +28,9 @@ class AliceCallErrorScreen extends StatelessWidget { child: ListView( children: [ AliceCallListRow( - name: context.i18n(AliceTranslationKey.callErrorScreenError), - value: errorText), + name: context.i18n(AliceTranslationKey.callErrorScreenError), + value: errorText, + ), if (stackTrace != null) AliceCallExpandableListRow( name: context diff --git a/packages/alice/lib/ui/call_details/widget/alice_call_overview_screen.dart b/packages/alice/lib/ui/call_details/widget/alice_call_overview_screen.dart index a1f8f08d..c53cc3e7 100644 --- a/packages/alice/lib/ui/call_details/widget/alice_call_overview_screen.dart +++ b/packages/alice/lib/ui/call_details/widget/alice_call_overview_screen.dart @@ -57,8 +57,9 @@ class AliceCallOverviewScreen extends StatelessWidget { ), ), AliceCallListRow( - name: context.i18n(AliceTranslationKey.callOverviewClient), - value: call.client), + name: context.i18n(AliceTranslationKey.callOverviewClient), + value: call.client, + ), AliceCallListRow( name: context.i18n(AliceTranslationKey.callOverviewSecure), value: call.secure.toString(), diff --git a/packages/alice/lib/ui/call_details/widget/alice_call_request_screen.dart b/packages/alice/lib/ui/call_details/widget/alice_call_request_screen.dart index 7d10e4fa..7c6321e9 100644 --- a/packages/alice/lib/ui/call_details/widget/alice_call_request_screen.dart +++ b/packages/alice/lib/ui/call_details/widget/alice_call_request_screen.dart @@ -21,47 +21,60 @@ class AliceCallRequestScreen extends StatelessWidget { Widget build(BuildContext context) { final List rows = [ AliceCallListRow( - name: context.i18n(AliceTranslationKey.callRequestStarted), - value: call.request?.time.toString()), + name: context.i18n(AliceTranslationKey.callRequestStarted), + value: call.request?.time.toString(), + ), AliceCallListRow( - name: context.i18n(AliceTranslationKey.callRequestBytesSent), - value: AliceConversionHelper.formatBytes(call.request?.size ?? 0)), + name: context.i18n(AliceTranslationKey.callRequestBytesSent), + value: AliceConversionHelper.formatBytes(call.request?.size ?? 0), + ), AliceCallListRow( - name: context.i18n(AliceTranslationKey.callRequestContentType), - value: AliceParser.getContentType( - context: context, headers: call.request?.headers)), + name: context.i18n(AliceTranslationKey.callRequestContentType), + value: AliceParser.getContentType( + context: context, + headers: call.request?.headers, + ), + ), ]; - rows.add(AliceCallListRow( - name: context.i18n(AliceTranslationKey.callRequestBody), - value: _getBodyContent( - context: context, + rows.add( + AliceCallListRow( + name: context.i18n(AliceTranslationKey.callRequestBody), + value: _getBodyContent( + context: context, + ), ), - )); + ); final List? formDataFields = call.request?.formDataFields; if (formDataFields?.isNotEmpty ?? false) { - rows.add(AliceCallListRow( + rows.add( + AliceCallListRow( name: context.i18n(AliceTranslationKey.callRequestFormDataFields), - value: '')); + value: '', + ), + ); rows.addAll([ for (final AliceFormDataField field in formDataFields!) - AliceCallListRow(name: ' • ${field.name}:', value: field.value) + AliceCallListRow(name: ' • ${field.name}:', value: field.value), ]); } final List? formDataFiles = call.request!.formDataFiles; if (formDataFiles?.isNotEmpty ?? false) { - rows.add(AliceCallListRow( + rows.add( + AliceCallListRow( name: context.i18n(AliceTranslationKey.callRequestFormDataFiles), - value: '')); + value: '', + ), + ); rows.addAll([ for (final AliceFormDataFile file in formDataFiles!) AliceCallListRow( name: ' • ${file.fileName}:', value: '${file.contentType} / ${file.length} B', - ) + ), ]); } @@ -69,27 +82,37 @@ class AliceCallRequestScreen extends StatelessWidget { final String headersContent = headers?.isEmpty ?? true ? context.i18n(AliceTranslationKey.callRequestHeadersEmpty) : ''; - rows.add(AliceCallListRow( + rows.add( + AliceCallListRow( name: context.i18n(AliceTranslationKey.callRequestHeaders), - value: headersContent)); + value: headersContent, + ), + ); rows.addAll([ for (final MapEntry header in headers?.entries ?? []) AliceCallListRow( - name: ' • ${header.key}:', value: header.value.toString()) + name: ' • ${header.key}:', + value: header.value.toString(), + ), ]); final Map? queryParameters = call.request?.queryParameters; final String queryParametersContent = queryParameters?.isEmpty ?? true ? context.i18n(AliceTranslationKey.callRequestQueryParametersEmpty) : ''; - rows.add(AliceCallListRow( + rows.add( + AliceCallListRow( name: context.i18n(AliceTranslationKey.callRequestQueryParameters), - value: queryParametersContent)); + value: queryParametersContent, + ), + ); rows.addAll([ for (final MapEntry queryParam in queryParameters?.entries ?? []) AliceCallListRow( - name: ' • ${queryParam.key}:', value: queryParam.value.toString()) + name: ' • ${queryParam.key}:', + value: queryParam.value.toString(), + ), ]); return Container( @@ -109,7 +132,9 @@ class AliceCallRequestScreen extends StatelessWidget { context: context, body: body, contentType: AliceParser.getContentType( - context: context, headers: call.request?.headers), + context: context, + headers: call.request?.headers, + ), ) : context.i18n(AliceTranslationKey.callRequestBodyEmpty); } diff --git a/packages/alice/lib/ui/call_details/widget/alice_call_response_screen.dart b/packages/alice/lib/ui/call_details/widget/alice_call_response_screen.dart index 366d5965..4692505a 100644 --- a/packages/alice/lib/ui/call_details/widget/alice_call_response_screen.dart +++ b/packages/alice/lib/ui/call_details/widget/alice_call_response_screen.dart @@ -22,11 +22,13 @@ class AliceCallResponseScreen extends StatelessWidget { padding: const EdgeInsets.all(6), child: ScrollConfiguration( behavior: AliceScrollBehavior(), - child: ListView(children: [ - _GeneralDataColumn(call: call), - _HeaderDataColumn(call: call), - _BodyDataColumn(call: call) - ]), + child: ListView( + children: [ + _GeneralDataColumn(call: call), + _HeaderDataColumn(call: call), + _BodyDataColumn(call: call), + ], + ), ), ); } else { @@ -57,8 +59,9 @@ class _GeneralDataColumn extends StatelessWidget { return Column( children: [ AliceCallListRow( - name: context.i18n(AliceTranslationKey.callResponseReceived), - value: call.response?.time.toString()), + name: context.i18n(AliceTranslationKey.callResponseReceived), + value: call.response?.time.toString(), + ), AliceCallListRow( name: context.i18n(AliceTranslationKey.callResponseBytesReceived), value: AliceConversionHelper.formatBytes(call.response?.size ?? 0), @@ -88,13 +91,14 @@ class _HeaderDataColumn extends StatelessWidget { return Column( children: [ AliceCallListRow( - name: context.i18n(AliceTranslationKey.callResponseHeaders), - value: headersContent), + name: context.i18n(AliceTranslationKey.callResponseHeaders), + value: headersContent, + ), for (final MapEntry header in headers?.entries ?? []) AliceCallListRow( name: ' • ${header.key}:', value: header.value.toString(), - ) + ), ], ); } @@ -177,7 +181,9 @@ class _BodyDataColumnState extends State<_BodyDataColumn> { /// Parses headers and returns content type of response. It may return null. String? _getContentTypeOfResponse() { return AliceParser.getContentType( - context: context, headers: call.response?.headers); + context: context, + headers: call.response?.headers, + ); } /// Checks whether response body is large (more than [_largeOutputSize]. @@ -279,28 +285,30 @@ class _LargeTextBody extends StatelessWidget { if (showLargeBody) { return _TextBody(call: call); } else { - return Column(children: [ - AliceCallListRow( - name: context.i18n(AliceTranslationKey.callResponseBody), - value: - '${context.i18n(AliceTranslationKey.callResponseTooLargeToShow)}' - '(${call.response?.body.toString().length ?? 0} B)', - ), - const SizedBox(height: 8), - TextButton( - onPressed: onShowLargeBodyPressed, - child: Text( - context.i18n( - AliceTranslationKey.callResponseBodyShow, + return Column( + children: [ + AliceCallListRow( + name: context.i18n(AliceTranslationKey.callResponseBody), + value: + '${context.i18n(AliceTranslationKey.callResponseTooLargeToShow)}' + '(${call.response?.body.toString().length ?? 0} B)', + ), + const SizedBox(height: 8), + TextButton( + onPressed: onShowLargeBodyPressed, + child: Text( + context.i18n( + AliceTranslationKey.callResponseBodyShow, + ), ), ), - ), - Text( - context.i18n( - AliceTranslationKey.callResponseLargeBodyShowWarning, + Text( + context.i18n( + AliceTranslationKey.callResponseLargeBodyShowWarning, + ), ), - ), - ]); + ], + ); } } } @@ -321,8 +329,9 @@ class _TextBody extends StatelessWidget { AliceParser.getContentType(context: context, headers: headers), ); return AliceCallListRow( - name: context.i18n(AliceTranslationKey.callResponseBody), - value: bodyContent); + name: context.i18n(AliceTranslationKey.callResponseBody), + value: bodyContent, + ); } } @@ -346,8 +355,9 @@ class _VideoBody extends StatelessWidget { ), const SizedBox(height: 8), TextButton( - child: Text(context - .i18n(AliceTranslationKey.callResponseBodyVideoWebBrowser)), + child: Text( + context.i18n(AliceTranslationKey.callResponseBodyVideoWebBrowser), + ), onPressed: () async { await launchUrl(Uri.parse(call.uri)); }, @@ -387,8 +397,9 @@ class _UnknownBody extends StatelessWidget { AliceParser.getContentType(context: context, headers: headers), ); return AliceCallListRow( - name: context.i18n(AliceTranslationKey.callResponseBody), - value: bodyContent); + name: context.i18n(AliceTranslationKey.callResponseBody), + value: bodyContent, + ); } else { return Column( children: [ diff --git a/packages/alice/lib/ui/calls_list/page/alice_calls_list_page.dart b/packages/alice/lib/ui/calls_list/page/alice_calls_list_page.dart index 9f5c53f7..08109757 100644 --- a/packages/alice/lib/ui/calls_list/page/alice_calls_list_page.dart +++ b/packages/alice/lib/ui/calls_list/page/alice_calls_list_page.dart @@ -399,10 +399,12 @@ class _ContextMenuButton extends StatelessWidget { const Padding( padding: EdgeInsets.only(left: 10), ), - Text(_getTitle( - context: context, - itemType: item, - )), + Text( + _getTitle( + context: context, + itemType: item, + ), + ), ], ), ), diff --git a/packages/alice/lib/ui/calls_list/widget/alice_call_list_item_widget.dart b/packages/alice/lib/ui/calls_list/widget/alice_call_list_item_widget.dart index 3a780c8a..76777ae3 100644 --- a/packages/alice/lib/ui/calls_list/widget/alice_call_list_item_widget.dart +++ b/packages/alice/lib/ui/calls_list/widget/alice_call_list_item_widget.dart @@ -174,7 +174,7 @@ class _ResponseStatus extends StatelessWidget { fontSize: 16, color: color, ), - ) + ), ], ), ); diff --git a/packages/alice/lib/ui/calls_list/widget/alice_calls_list_screen.dart b/packages/alice/lib/ui/calls_list/widget/alice_calls_list_screen.dart index 4bd970a6..451c7a1e 100644 --- a/packages/alice/lib/ui/calls_list/widget/alice_calls_list_screen.dart +++ b/packages/alice/lib/ui/calls_list/widget/alice_calls_list_screen.dart @@ -23,42 +23,64 @@ class AliceCallsListScreen extends StatelessWidget { List get _sortedCalls => switch (sortOption) { AliceCallsListSortOption.time => sortAscending ? (calls - ..sort((AliceHttpCall call1, AliceHttpCall call2) => - call1.createdTime.compareTo(call2.createdTime))) + ..sort( + (AliceHttpCall call1, AliceHttpCall call2) => + call1.createdTime.compareTo(call2.createdTime), + )) : (calls - ..sort((AliceHttpCall call1, AliceHttpCall call2) => - call2.createdTime.compareTo(call1.createdTime))), + ..sort( + (AliceHttpCall call1, AliceHttpCall call2) => + call2.createdTime.compareTo(call1.createdTime), + )), AliceCallsListSortOption.responseTime => sortAscending ? (calls ..sort() - ..sort((AliceHttpCall call1, AliceHttpCall call2) => - call1.response?.time.compareTo(call2.response!.time) ?? -1)) + ..sort( + (AliceHttpCall call1, AliceHttpCall call2) => + call1.response?.time.compareTo(call2.response!.time) ?? -1, + )) : (calls - ..sort((AliceHttpCall call1, AliceHttpCall call2) => - call2.response?.time.compareTo(call1.response!.time) ?? -1)), + ..sort( + (AliceHttpCall call1, AliceHttpCall call2) => + call2.response?.time.compareTo(call1.response!.time) ?? -1, + )), AliceCallsListSortOption.responseCode => sortAscending ? (calls - ..sort((AliceHttpCall call1, AliceHttpCall call2) => - call1.response?.status?.compareTo(call2.response!.status!) ?? - -1)) + ..sort( + (AliceHttpCall call1, AliceHttpCall call2) => + call1.response?.status + ?.compareTo(call2.response!.status!) ?? + -1, + )) : (calls - ..sort((AliceHttpCall call1, AliceHttpCall call2) => - call2.response?.status?.compareTo(call1.response!.status!) ?? - -1)), + ..sort( + (AliceHttpCall call1, AliceHttpCall call2) => + call2.response?.status + ?.compareTo(call1.response!.status!) ?? + -1, + )), AliceCallsListSortOption.responseSize => sortAscending ? (calls - ..sort((AliceHttpCall call1, AliceHttpCall call2) => - call1.response?.size.compareTo(call2.response!.size) ?? -1)) + ..sort( + (AliceHttpCall call1, AliceHttpCall call2) => + call1.response?.size.compareTo(call2.response!.size) ?? -1, + )) : (calls - ..sort((AliceHttpCall call1, AliceHttpCall call2) => - call2.response?.size.compareTo(call1.response!.size) ?? -1)), + ..sort( + (AliceHttpCall call1, AliceHttpCall call2) => + call2.response?.size.compareTo(call1.response!.size) ?? -1, + )), AliceCallsListSortOption.endpoint => sortAscending ? (calls - ..sort((AliceHttpCall call1, AliceHttpCall call2) => - call1.endpoint.compareTo(call2.endpoint))) + ..sort( + (AliceHttpCall call1, AliceHttpCall call2) => + call1.endpoint.compareTo(call2.endpoint), + )) : (calls - ..sort((AliceHttpCall call1, AliceHttpCall call2) => - call2.endpoint.compareTo(call1.endpoint))), + ..sort( + (AliceHttpCall call1, AliceHttpCall call2) => + call2.endpoint.compareTo(call1.endpoint), + )), _ => calls, }; diff --git a/packages/alice/lib/ui/calls_list/widget/alice_inspector_screen.dart b/packages/alice/lib/ui/calls_list/widget/alice_inspector_screen.dart index 662a2a4f..1f26cb16 100644 --- a/packages/alice/lib/ui/calls_list/widget/alice_inspector_screen.dart +++ b/packages/alice/lib/ui/calls_list/widget/alice_inspector_screen.dart @@ -42,8 +42,10 @@ class _AliceInspectorScreenState extends State final List calls = snapshot.data ?? []; final String query = widget.queryTextEditingController.text.trim(); if (query.isNotEmpty) { - calls.removeWhere((AliceHttpCall call) => - !call.endpoint.toLowerCase().contains(query.toLowerCase())); + calls.removeWhere( + (AliceHttpCall call) => + !call.endpoint.toLowerCase().contains(query.toLowerCase()), + ); } if (calls.isNotEmpty) { return AliceCallsListScreen( diff --git a/packages/alice/lib/ui/calls_list/widget/alice_log_list_widget.dart b/packages/alice/lib/ui/calls_list/widget/alice_log_list_widget.dart index a6cf9b90..972a6b7c 100644 --- a/packages/alice/lib/ui/calls_list/widget/alice_log_list_widget.dart +++ b/packages/alice/lib/ui/calls_list/widget/alice_log_list_widget.dart @@ -53,7 +53,7 @@ class _AliceLogListWidgetState extends State { final List filteredLogs = [ for (final AliceLog log in logs) - if (log.level.index >= _minLevel.index) log + if (log.level.index >= _minLevel.index) log, ]; return ScrollConfiguration( @@ -97,8 +97,11 @@ class _AliceLogEntryWidget extends StatelessWidget { ), ), TextSpan(text: ' ${log.message}'), - ..._toText(context, context.i18n(AliceTranslationKey.logsItemError), - log.error), + ..._toText( + context, + context.i18n(AliceTranslationKey.logsItemError), + log.error, + ), ..._toText( context, context.i18n(AliceTranslationKey.logsItemStackTrace), diff --git a/packages/alice/lib/ui/common/alice_dialog.dart b/packages/alice/lib/ui/common/alice_dialog.dart index 3c0be6c6..ee2fa9e8 100644 --- a/packages/alice/lib/ui/common/alice_dialog.dart +++ b/packages/alice/lib/ui/common/alice_dialog.dart @@ -43,7 +43,7 @@ class AliceGeneralDialog { Navigator.of(context).pop(); }, child: Text(secondButtonTitle), - ) + ), ], ), ); diff --git a/packages/alice/lib/ui/common/alice_navigation.dart b/packages/alice/lib/ui/common/alice_navigation.dart index 39c85a51..f674a0e7 100644 --- a/packages/alice/lib/ui/common/alice_navigation.dart +++ b/packages/alice/lib/ui/common/alice_navigation.dart @@ -23,7 +23,9 @@ class AliceNavigation { required AliceCore core, }) { return _navigateToPage( - core: core, child: AliceCallDetailsPage(call: call, core: core)); + core: core, + child: AliceCallDetailsPage(call: call, core: core), + ); } /// Navigates to stats page. diff --git a/packages/alice/lib/ui/stats/alice_stats_page.dart b/packages/alice/lib/ui/stats/alice_stats_page.dart index 0ff277e9..cf632a2f 100644 --- a/packages/alice/lib/ui/stats/alice_stats_page.dart +++ b/packages/alice/lib/ui/stats/alice_stats_page.dart @@ -31,21 +31,25 @@ class AliceStatsPage extends StatelessWidget { child: ListView( children: [ AliceStatsRow( - context.i18n(AliceTranslationKey.statsTotalRequests), - '${_getTotalRequests()}'), + context.i18n(AliceTranslationKey.statsTotalRequests), + '${_getTotalRequests()}', + ), AliceStatsRow( - context.i18n(AliceTranslationKey.statsPendingRequests), - '${_getPendingRequests()}'), + context.i18n(AliceTranslationKey.statsPendingRequests), + '${_getPendingRequests()}', + ), AliceStatsRow( - context.i18n(AliceTranslationKey.statsSuccessRequests), - '${_getSuccessRequests()}'), + context.i18n(AliceTranslationKey.statsSuccessRequests), + '${_getSuccessRequests()}', + ), AliceStatsRow( context.i18n(AliceTranslationKey.statsRedirectionRequests), '${_getRedirectionRequests()}', ), AliceStatsRow( - context.i18n(AliceTranslationKey.statsErrorRequests), - '${_getErrorRequests()}'), + context.i18n(AliceTranslationKey.statsErrorRequests), + '${_getErrorRequests()}', + ), AliceStatsRow( context.i18n(AliceTranslationKey.statsBytesSent), AliceConversionHelper.formatBytes(_getBytesSent()), @@ -66,24 +70,34 @@ class AliceStatsPage extends StatelessWidget { context.i18n(AliceTranslationKey.statsMinRequestTime), AliceConversionHelper.formatTime(_getMinRequestTime()), ), - AliceStatsRow(context.i18n(AliceTranslationKey.statsGetRequests), - '${_getRequests('GET')} '), - AliceStatsRow(context.i18n(AliceTranslationKey.statsPostRequests), - '${_getRequests('POST')} '), AliceStatsRow( - context.i18n(AliceTranslationKey.statsDeleteRequests), - '${_getRequests('DELETE')} '), - AliceStatsRow(context.i18n(AliceTranslationKey.statsPutRequests), - '${_getRequests('PUT')} '), + context.i18n(AliceTranslationKey.statsGetRequests), + '${_getRequests('GET')} ', + ), AliceStatsRow( - context.i18n(AliceTranslationKey.statsPatchRequests), - '${_getRequests('PATCH')} '), + context.i18n(AliceTranslationKey.statsPostRequests), + '${_getRequests('POST')} ', + ), + AliceStatsRow( + context.i18n(AliceTranslationKey.statsDeleteRequests), + '${_getRequests('DELETE')} ', + ), AliceStatsRow( - context.i18n(AliceTranslationKey.statsSecuredRequests), - '${_getSecuredRequests()}'), + context.i18n(AliceTranslationKey.statsPutRequests), + '${_getRequests('PUT')} ', + ), AliceStatsRow( - context.i18n(AliceTranslationKey.statsUnsecuredRequests), - '${_getUnsecuredRequests()}'), + context.i18n(AliceTranslationKey.statsPatchRequests), + '${_getRequests('PATCH')} ', + ), + AliceStatsRow( + context.i18n(AliceTranslationKey.statsSecuredRequests), + '${_getSecuredRequests()}', + ), + AliceStatsRow( + context.i18n(AliceTranslationKey.statsUnsecuredRequests), + '${_getUnsecuredRequests()}', + ), ], ), ), @@ -116,10 +130,12 @@ class AliceStatsPage extends StatelessWidget { /// Returns count of error requests. int _getErrorRequests() => _calls - .where((AliceHttpCall call) => - (call.response?.status.gte(400) ?? false) && - (call.response?.status.lt(600) ?? false) || - const [-1, 0].contains(call.response?.status)) + .where( + (AliceHttpCall call) => + (call.response?.status.gte(400) ?? false) && + (call.response?.status.lt(600) ?? false) || + const [-1, 0].contains(call.response?.status), + ) .toList() .length; diff --git a/packages/alice/test/core/alice_memory_storage_test.dart b/packages/alice/test/core/alice_memory_storage_test.dart index e2666106..d61cdb1b 100644 --- a/packages/alice/test/core/alice_memory_storage_test.dart +++ b/packages/alice/test/core/alice_memory_storage_test.dart @@ -16,13 +16,16 @@ void main() { group("AliceMemoryStorage", () { test("should return HTTP call stats", () { - expect(storage.getStats(), ( - total: 0, - successes: 0, - redirects: 0, - errors: 0, - loading: 0, - )); + expect( + storage.getStats(), + ( + total: 0, + successes: 0, + redirects: 0, + errors: 0, + loading: 0, + ), + ); storage .addCall(MockedData.getHttpCallWithResponseStatus(statusCode: 200)); @@ -42,13 +45,16 @@ void main() { storage.addCall(MockedData.getHttpCallWithResponseStatus(statusCode: -1)); storage.addCall(MockedData.getHttpCallWithResponseStatus(statusCode: 0)); - expect(storage.getStats(), ( - total: 10, - successes: 2, - redirects: 2, - errors: 5, - loading: 1, - )); + expect( + storage.getStats(), + ( + total: 10, + successes: 2, + redirects: 2, + errors: 5, + loading: 1, + ), + ); }); test("should save HTTP calls", () { diff --git a/packages/alice/test/helper/alice_export_helper_test.dart b/packages/alice/test/helper/alice_export_helper_test.dart index 0dd346e0..7bb725b0 100644 --- a/packages/alice/test/helper/alice_export_helper_test.dart +++ b/packages/alice/test/helper/alice_export_helper_test.dart @@ -22,7 +22,9 @@ void main() { _setPackageInfo(); final result = await AliceExportHelper.buildFullCallLog( - context: context, call: MockedData.getFilledHttpCall()); + context: context, + call: MockedData.getFilledHttpCall(), + ); _verifyLogLines(result!); }); @@ -33,7 +35,9 @@ void main() { _setDefaultTargetPlatform(); final result = await AliceExportHelper.saveCallsToFile( - context, [MockedData.getFilledHttpCall()]); + context, + [MockedData.getFilledHttpCall()], + ); expect(result.success, true); expect(result.path != null, true); expect(result.error, null); @@ -66,7 +70,9 @@ void main() { _setDefaultTargetPlatform(); final result = await AliceExportHelper.saveCallsToFile( - context, [MockedData.getFilledHttpCall()]); + context, + [MockedData.getFilledHttpCall()], + ); expect(result.success, false); expect(result.path, null); @@ -79,7 +85,9 @@ void main() { _setShare(); final result = await AliceExportHelper.shareCall( - context: context, call: MockedData.getFilledHttpCall()); + context: context, + call: MockedData.getFilledHttpCall(), + ); expect(result.success, true); expect(result.error, null); }); diff --git a/packages/alice/test/utils/alice_parser_test.dart b/packages/alice/test/utils/alice_parser_test.dart index 68e75008..17cd1429 100644 --- a/packages/alice/test/utils/alice_parser_test.dart +++ b/packages/alice/test/utils/alice_parser_test.dart @@ -17,9 +17,10 @@ void main() { test("should parse json body and pretty print it", () { expect( AliceParser.formatBody( - context: context, - body: '{"id": 1, "name": "test}', - contentType: "application/json"), + context: context, + body: '{"id": 1, "name": "test}', + contentType: "application/json", + ), '"{\\"id\\": 1, \\"name\\": \\"test}"', ); }); @@ -46,27 +47,30 @@ void main() { test("should parse application/json content type", () { expect( - AliceParser.getContentType( - context: context, - headers: {'Content-Type': "application/json"}, - ), - "application/json"); + AliceParser.getContentType( + context: context, + headers: {'Content-Type': "application/json"}, + ), + "application/json", + ); expect( - AliceParser.getContentType( - context: context, - headers: {'content-type': "application/json"}, - ), - "application/json"); + AliceParser.getContentType( + context: context, + headers: {'content-type': "application/json"}, + ), + "application/json", + ); }); test("should parse unknown content type", () { expect( - AliceParser.getContentType( - context: context, - headers: {}, - ), - AliceTranslationKey.unknown.toString()); + AliceParser.getContentType( + context: context, + headers: {}, + ), + AliceTranslationKey.unknown.toString(), + ); }); test("should parse headers", () { diff --git a/packages/alice_chopper/CHANGELOG.md b/packages/alice_chopper/CHANGELOG.md index 09ff6f75..2a9c7084 100644 --- a/packages/alice_chopper/CHANGELOG.md +++ b/packages/alice_chopper/CHANGELOG.md @@ -1,4 +1,10 @@ +# 1.0.6 + +* Added lint for trailing commas. +* General refactor of code base. + # 1.0.5 + * Untrack gitignored files. * Updated metadata. * Updated dependencies. diff --git a/packages/alice_chopper/analysis_options.yaml b/packages/alice_chopper/analysis_options.yaml index ae9086b0..bc190a7c 100644 --- a/packages/alice_chopper/analysis_options.yaml +++ b/packages/alice_chopper/analysis_options.yaml @@ -7,4 +7,4 @@ include: package:flutter_lints/flutter.yaml linter: rules: - #library_annotations: false + - require_trailing_commas diff --git a/packages/alice_chopper/lib/alice_chopper_adapter.dart b/packages/alice_chopper/lib/alice_chopper_adapter.dart index 01821ad9..19a21750 100644 --- a/packages/alice_chopper/lib/alice_chopper_adapter.dart +++ b/packages/alice_chopper/lib/alice_chopper_adapter.dart @@ -86,7 +86,7 @@ class AliceChopperAdapter with AliceAdapter implements Interceptor { ..headers = { for (final MapEntry entry in response.headers.entries) - entry.key: entry.value + entry.key: entry.value, }, requestId, ); @@ -103,12 +103,14 @@ class AliceChopperAdapter with AliceAdapter implements Interceptor { /// Log error to Alice log AliceUtils.log(error.toString()); - aliceCore.addLog(AliceLog( - message: error.toString(), - level: DiagnosticLevel.error, - error: error, - stackTrace: stackTrace, - )); + aliceCore.addLog( + AliceLog( + message: error.toString(), + level: DiagnosticLevel.error, + error: error, + stackTrace: stackTrace, + ), + ); /// Add empty response to Alice core aliceCore.addResponse( diff --git a/packages/alice_chopper/pubspec.yaml b/packages/alice_chopper/pubspec.yaml index 7f46e423..c7dda01e 100644 --- a/packages/alice_chopper/pubspec.yaml +++ b/packages/alice_chopper/pubspec.yaml @@ -1,6 +1,6 @@ name: alice_chopper description: "Alice + Chopper integration. It contains plugin for Alice which allows to use Chopper package." -version: 1.0.5 +version: 1.0.6 repository: https://github.com/jhomlala/alice homepage: https://github.com/jhomlala/alice topics: diff --git a/packages/alice_dio/CHANGELOG.md b/packages/alice_dio/CHANGELOG.md index 7c1e8162..aafb1730 100644 --- a/packages/alice_dio/CHANGELOG.md +++ b/packages/alice_dio/CHANGELOG.md @@ -1,5 +1,7 @@ # 1.0.5 * Added tests. +* Added lint for trailing commas. +* General refactor of code base. # 1.0.4 diff --git a/packages/alice_dio/analysis_options.yaml b/packages/alice_dio/analysis_options.yaml index ae9086b0..bc190a7c 100644 --- a/packages/alice_dio/analysis_options.yaml +++ b/packages/alice_dio/analysis_options.yaml @@ -7,4 +7,4 @@ include: package:flutter_lints/flutter.yaml linter: rules: - #library_annotations: false + - require_trailing_commas diff --git a/packages/alice_dio/lib/alice_dio_adapter.dart b/packages/alice_dio/lib/alice_dio_adapter.dart index 14749997..6d34f7d5 100644 --- a/packages/alice_dio/lib/alice_dio_adapter.dart +++ b/packages/alice_dio/lib/alice_dio_adapter.dart @@ -153,11 +153,14 @@ class AliceDioAdapter extends InterceptorsWrapper with AliceAdapter { httpResponse, error.response!.requestOptions.hashCode, ); - aliceCore.addLog(AliceLog( + aliceCore.addLog( + AliceLog( message: error.toString(), level: DiagnosticLevel.error, error: error, - stackTrace: error.stackTrace)); + stackTrace: error.stackTrace, + ), + ); } handler.next(error); } diff --git a/packages/alice_dio/test/alice_dio_adapter_test.dart b/packages/alice_dio/test/alice_dio_adapter_test.dart index e75fc9aa..44f132ba 100644 --- a/packages/alice_dio/test/alice_dio_adapter_test.dart +++ b/packages/alice_dio/test/alice_dio_adapter_test.dart @@ -47,7 +47,7 @@ void main() { 200, '{"result": "ok"}', headers: { - "content-type": ["application/json"] + "content-type": ["application/json"], }, ), headers: {"content-type": "application/json"}, @@ -70,18 +70,19 @@ void main() { final responseMatcher = buildResponseMatcher(checkTime: true); final callMatcher = buildCallMatcher( - checkId: true, - checkTime: true, - secured: true, - loading: true, - client: 'Dio', - method: 'GET', - endpoint: '/json', - server: 'test.com', - uri: 'https://test.com/json', - duration: 0, - request: requestMatcher, - response: responseMatcher); + checkId: true, + checkTime: true, + secured: true, + loading: true, + client: 'Dio', + method: 'GET', + endpoint: '/json', + server: 'test.com', + uri: 'https://test.com/json', + duration: 0, + request: requestMatcher, + response: responseMatcher, + ); verify(() => aliceCore.addCall(any(that: callMatcher))); @@ -94,22 +95,24 @@ void main() { ); verify( - () => aliceCore.addResponse(any(that: nextResponseMatcher), any())); + () => aliceCore.addResponse(any(that: nextResponseMatcher), any()), + ); }); test("should handle POST call with json response", () async { dioAdapter.onPost( - 'https://test.com/json', - (server) => server.reply( - 200, - '{"result": "ok"}', - headers: { - "content-type": ["application/json"] - }, - ), - data: '{"data":"test"}', - headers: {"content-type": "application/json"}, - queryParameters: {"sort": "asc"}); + 'https://test.com/json', + (server) => server.reply( + 200, + '{"result": "ok"}', + headers: { + "content-type": ["application/json"], + }, + ), + data: '{"data":"test"}', + headers: {"content-type": "application/json"}, + queryParameters: {"sort": "asc"}, + ); await dio.post( 'https://test.com/json', @@ -131,18 +134,19 @@ void main() { final responseMatcher = buildResponseMatcher(checkTime: true); final callMatcher = buildCallMatcher( - checkId: true, - checkTime: true, - secured: true, - loading: true, - client: 'Dio', - method: 'POST', - endpoint: '/json', - server: 'test.com', - uri: 'https://test.com/json?sort=asc', - duration: 0, - request: requestMatcher, - response: responseMatcher); + checkId: true, + checkTime: true, + secured: true, + loading: true, + client: 'Dio', + method: 'POST', + endpoint: '/json', + server: 'test.com', + uri: 'https://test.com/json?sort=asc', + duration: 0, + request: requestMatcher, + response: responseMatcher, + ); verify(() => aliceCore.addCall(any(that: callMatcher))); @@ -155,7 +159,8 @@ void main() { ); verify( - () => aliceCore.addResponse(any(that: nextResponseMatcher), any())); + () => aliceCore.addResponse(any(that: nextResponseMatcher), any()), + ); }); test("should handle form data", () async { @@ -166,16 +171,17 @@ void main() { var formData = FormData.fromMap({ 'name': 'Alice', 'surname': 'test', - 'image': MultipartFile.fromFileSync(file.path) + 'image': MultipartFile.fromFileSync(file.path), }); dioAdapter.onPost( - 'https://test.com/form', - (server) => server.reply( - 200, - '{"result": "ok"}', - ), - data: formData); + 'https://test.com/form', + (server) => server.reply( + 200, + '{"result": "ok"}', + ), + data: formData, + ); await dio.post( 'https://test.com/form', @@ -183,31 +189,33 @@ void main() { ); final requestMatcher = buildRequestMatcher( - checkTime: true, - formDataFields: [ - const AliceFormDataField('name', 'Alice'), - const AliceFormDataField('surname', 'test'), - ], - formDataFiles: [ - AliceFormDataFile(name, "application/octet-stream", 0), - ], - body: 'Form data', - headers: {'content-type': 'multipart/form-data'}); + checkTime: true, + formDataFields: [ + const AliceFormDataField('name', 'Alice'), + const AliceFormDataField('surname', 'test'), + ], + formDataFiles: [ + AliceFormDataFile(name, "application/octet-stream", 0), + ], + body: 'Form data', + headers: {'content-type': 'multipart/form-data'}, + ); final responseMatcher = buildResponseMatcher(checkTime: true); final callMatcher = buildCallMatcher( - checkId: true, - checkTime: true, - secured: true, - loading: true, - client: 'Dio', - method: 'POST', - endpoint: '/form', - server: 'test.com', - uri: 'https://test.com/form', - duration: 0, - request: requestMatcher, - response: responseMatcher); + checkId: true, + checkTime: true, + secured: true, + loading: true, + client: 'Dio', + method: 'POST', + endpoint: '/form', + server: 'test.com', + uri: 'https://test.com/form', + duration: 0, + request: requestMatcher, + response: responseMatcher, + ); verify(() => aliceCore.addCall(any(that: callMatcher))); @@ -220,7 +228,8 @@ void main() { ); verify( - () => aliceCore.addResponse(any(that: nextResponseMatcher), any())); + () => aliceCore.addResponse(any(that: nextResponseMatcher), any()), + ); file.deleteSync(); }); }); @@ -252,18 +261,19 @@ void main() { final responseMatcher = buildResponseMatcher(checkTime: true); final callMatcher = buildCallMatcher( - checkId: true, - checkTime: true, - secured: true, - loading: true, - client: 'Dio', - method: 'GET', - endpoint: '/json', - server: 'test.com', - uri: 'https://test.com/json', - duration: 0, - request: requestMatcher, - response: responseMatcher); + checkId: true, + checkTime: true, + secured: true, + loading: true, + client: 'Dio', + method: 'GET', + endpoint: '/json', + server: 'test.com', + uri: 'https://test.com/json', + duration: 0, + request: requestMatcher, + response: responseMatcher, + ); verify(() => aliceCore.addCall(any(that: callMatcher))); @@ -306,18 +316,19 @@ void main() { final responseMatcher = buildResponseMatcher(checkTime: true); final callMatcher = buildCallMatcher( - checkId: true, - checkTime: true, - secured: true, - loading: true, - client: 'Dio', - method: 'GET', - endpoint: '/json', - server: 'test.com', - uri: 'https://test.com/json', - duration: 0, - request: requestMatcher, - response: responseMatcher); + checkId: true, + checkTime: true, + secured: true, + loading: true, + client: 'Dio', + method: 'GET', + endpoint: '/json', + server: 'test.com', + uri: 'https://test.com/json', + duration: 0, + request: requestMatcher, + response: responseMatcher, + ); verify(() => aliceCore.addCall(any(that: callMatcher))); @@ -378,8 +389,9 @@ void main() { (server) => server.throws( 0, DioException( - requestOptions: RequestOptions(), - response: Response(requestOptions: RequestOptions(), data: "{}")), + requestOptions: RequestOptions(), + response: Response(requestOptions: RequestOptions(), data: "{}"), + ), ), headers: {"content-type": "application/json"}, ); diff --git a/packages/alice_http/CHANGELOG.md b/packages/alice_http/CHANGELOG.md index 8ae78f9f..2a25448f 100644 --- a/packages/alice_http/CHANGELOG.md +++ b/packages/alice_http/CHANGELOG.md @@ -1,3 +1,8 @@ +# 1.0.5 + +* Added lint for trailing commas. +* General refactor of code base. + # 1.0.4 * Untracked gitignored files. diff --git a/packages/alice_http/analysis_options.yaml b/packages/alice_http/analysis_options.yaml index ae9086b0..ef738358 100644 --- a/packages/alice_http/analysis_options.yaml +++ b/packages/alice_http/analysis_options.yaml @@ -7,4 +7,4 @@ include: package:flutter_lints/flutter.yaml linter: rules: - #library_annotations: false + - require_trailing_commas diff --git a/packages/alice_http/lib/alice_http_extensions.dart b/packages/alice_http/lib/alice_http_extensions.dart index f3e1660b..8fe436c7 100644 --- a/packages/alice_http/lib/alice_http_extensions.dart +++ b/packages/alice_http/lib/alice_http_extensions.dart @@ -4,8 +4,10 @@ import 'package:http/http.dart'; extension AliceHttpExtensions on Future { /// Intercept http request with alice. This extension method provides /// additional helpful method to intercept https' response. - Future interceptWithAlice(AliceHttpAdapter adapter, - {dynamic body}) async { + Future interceptWithAlice( + AliceHttpAdapter adapter, { + dynamic body, + }) async { final response = await this; adapter.onResponse(response, body: body); return response; diff --git a/packages/alice_http/pubspec.yaml b/packages/alice_http/pubspec.yaml index 9b85b31d..1758e414 100644 --- a/packages/alice_http/pubspec.yaml +++ b/packages/alice_http/pubspec.yaml @@ -1,6 +1,6 @@ name: alice_http description: "Alice + HTTP integration. It contains plugin for Alice which allows to use http package." -version: 1.0.4 +version: 1.0.5 repository: https://github.com/jhomlala/alice homepage: https://github.com/jhomlala/alice topics: diff --git a/packages/alice_http_client/CHANGELOG.md b/packages/alice_http_client/CHANGELOG.md index 8ae78f9f..4b15637b 100644 --- a/packages/alice_http_client/CHANGELOG.md +++ b/packages/alice_http_client/CHANGELOG.md @@ -1,3 +1,9 @@ +# 1.0.5 + +* Added lint for trailing commas. +* General refactor of code base. +* + # 1.0.4 * Untracked gitignored files. diff --git a/packages/alice_http_client/analysis_options.yaml b/packages/alice_http_client/analysis_options.yaml index ae9086b0..ef738358 100644 --- a/packages/alice_http_client/analysis_options.yaml +++ b/packages/alice_http_client/analysis_options.yaml @@ -7,4 +7,4 @@ include: package:flutter_lints/flutter.yaml linter: rules: - #library_annotations: false + - require_trailing_commas diff --git a/packages/alice_http_client/pubspec.yaml b/packages/alice_http_client/pubspec.yaml index 1e8de5bc..c0d59124 100644 --- a/packages/alice_http_client/pubspec.yaml +++ b/packages/alice_http_client/pubspec.yaml @@ -1,6 +1,6 @@ name: alice_http_client description: "Alice + HTTP Client integration. It contains plugin for Alice which allows to use Http Client." -version: 1.0.4 +version: 1.0.5 repository: https://github.com/jhomlala/alice homepage: https://github.com/jhomlala/alice topics: diff --git a/packages/alice_objectbox/CHANGELOG.md b/packages/alice_objectbox/CHANGELOG.md index fb85da39..7254f327 100644 --- a/packages/alice_objectbox/CHANGELOG.md +++ b/packages/alice_objectbox/CHANGELOG.md @@ -1,4 +1,10 @@ +# 1.0.3 + +* Added lint for trailing commas. +* General refactor of code base. + # 1.0.2 + * Fixed issue with invalid count of calls in notification. # 1.0.1 diff --git a/packages/alice_objectbox/analysis_options.yaml b/packages/alice_objectbox/analysis_options.yaml index ae9086b0..bc190a7c 100644 --- a/packages/alice_objectbox/analysis_options.yaml +++ b/packages/alice_objectbox/analysis_options.yaml @@ -7,4 +7,4 @@ include: package:flutter_lints/flutter.yaml linter: rules: - #library_annotations: false + - require_trailing_commas diff --git a/packages/alice_objectbox/lib/alice_objectbox.dart b/packages/alice_objectbox/lib/alice_objectbox.dart index c868d621..b4cba8b9 100644 --- a/packages/alice_objectbox/lib/alice_objectbox.dart +++ b/packages/alice_objectbox/lib/alice_objectbox.dart @@ -119,12 +119,13 @@ class AliceObjectBox implements AliceStorage { .count(), errors: (_store.httpCalls.query() ..link( - CachedAliceHttpCall_.responseRel, - CachedAliceHttpResponse_.status - .greaterOrEqual(400) - .and(CachedAliceHttpResponse_.status.lessThan(600)) - .and(CachedAliceHttpResponse_.status.equals(-1)) - .and(CachedAliceHttpResponse_.status.equals(0)))) + CachedAliceHttpCall_.responseRel, + CachedAliceHttpResponse_.status + .greaterOrEqual(400) + .and(CachedAliceHttpResponse_.status.lessThan(600)) + .and(CachedAliceHttpResponse_.status.equals(-1)) + .and(CachedAliceHttpResponse_.status.equals(0)), + )) .build() .count(), loading: _store.httpCalls diff --git a/packages/alice_objectbox/lib/model/cached_alice_http_call.dart b/packages/alice_objectbox/lib/model/cached_alice_http_call.dart index baa8358a..09049f02 100644 --- a/packages/alice_objectbox/lib/model/cached_alice_http_call.dart +++ b/packages/alice_objectbox/lib/model/cached_alice_http_call.dart @@ -121,7 +121,7 @@ class CachedAliceHttpCall implements AliceHttpCall { duration, request, response, - error + error, ]; @override diff --git a/packages/alice_objectbox/pubspec.yaml b/packages/alice_objectbox/pubspec.yaml index b5ce5c09..61d4a0a5 100644 --- a/packages/alice_objectbox/pubspec.yaml +++ b/packages/alice_objectbox/pubspec.yaml @@ -1,6 +1,6 @@ name: alice_objectbox description: "Alice + ObjectBox integration. It contains a plugin for Alice which stores http requests and responses in an ObjectBox NoSQL database." -version: 1.0.2 +version: 1.0.3 repository: https://github.com/jhomlala/alice homepage: https://github.com/jhomlala/alice topics: diff --git a/packages/alice_test/analysis_options.yaml b/packages/alice_test/analysis_options.yaml index ae9086b0..ef738358 100644 --- a/packages/alice_test/analysis_options.yaml +++ b/packages/alice_test/analysis_options.yaml @@ -7,4 +7,4 @@ include: package:flutter_lints/flutter.yaml linter: rules: - #library_annotations: false + - require_trailing_commas diff --git a/packages/alice_test/lib/matcher/alice_call_matcher.dart b/packages/alice_test/lib/matcher/alice_call_matcher.dart index b8fddac1..f2a9c81b 100644 --- a/packages/alice_test/lib/matcher/alice_call_matcher.dart +++ b/packages/alice_test/lib/matcher/alice_call_matcher.dart @@ -22,8 +22,11 @@ TypeMatcher buildCallMatcher({ matcher = matcher.having((call) => call.id, "id", greaterThan(0)); } if (checkTime == true) { - matcher = matcher.having((call) => call.createdTime.millisecondsSinceEpoch, - "createdTime", greaterThan(0)); + matcher = matcher.having( + (call) => call.createdTime.millisecondsSinceEpoch, + "createdTime", + greaterThan(0), + ); } if (secured != null) { matcher = matcher.having((call) => call.secure, "secure", equals(secured)); diff --git a/packages/alice_test/lib/matcher/alice_error_matcher.dart b/packages/alice_test/lib/matcher/alice_error_matcher.dart index 101d3d5b..0c4a13ed 100644 --- a/packages/alice_test/lib/matcher/alice_error_matcher.dart +++ b/packages/alice_test/lib/matcher/alice_error_matcher.dart @@ -1,8 +1,10 @@ import 'package:alice/model/alice_http_error.dart'; import 'package:test/test.dart'; -TypeMatcher buildErrorMatcher( - {bool? checkError, bool? checkStacktrace}) { +TypeMatcher buildErrorMatcher({ + bool? checkError, + bool? checkStacktrace, +}) { var matcher = const TypeMatcher(); if (checkError == true) { matcher = @@ -10,7 +12,10 @@ TypeMatcher buildErrorMatcher( } if (checkStacktrace == true) { matcher = matcher.having( - (error) => error.stackTrace.toString(), "stackTrace", isNotEmpty); + (error) => error.stackTrace.toString(), + "stackTrace", + isNotEmpty, + ); } return matcher; diff --git a/packages/alice_test/lib/matcher/alice_log_matcher.dart b/packages/alice_test/lib/matcher/alice_log_matcher.dart index 023c50e0..faead55c 100644 --- a/packages/alice_test/lib/matcher/alice_log_matcher.dart +++ b/packages/alice_test/lib/matcher/alice_log_matcher.dart @@ -17,11 +17,17 @@ TypeMatcher buildLogMatcher({ } if (checkStacktrace == true) { matcher = matcher.having( - (log) => log.stackTrace.toString(), "stackTrace", isNotEmpty); + (log) => log.stackTrace.toString(), + "stackTrace", + isNotEmpty, + ); } if (checkTime == true) { matcher = matcher.having( - (log) => log.timestamp.millisecondsSinceEpoch, "timestamp", isPositive); + (log) => log.timestamp.millisecondsSinceEpoch, + "timestamp", + isPositive, + ); } return matcher; } diff --git a/packages/alice_test/lib/matcher/alice_request_matcher.dart b/packages/alice_test/lib/matcher/alice_request_matcher.dart index 4380c916..21cbbb37 100644 --- a/packages/alice_test/lib/matcher/alice_request_matcher.dart +++ b/packages/alice_test/lib/matcher/alice_request_matcher.dart @@ -6,47 +6,67 @@ import 'package:alice_test/matcher/form_data_file_matcher.dart'; import 'package:alice_test/matcher/header_matcher.dart'; import 'package:test/test.dart'; -TypeMatcher buildRequestMatcher( - {bool? checkTime, - Map? headers, - String? contentType, - Map? queryParameters, - dynamic body, - List? formDataFields, - List? formDataFiles}) { +TypeMatcher buildRequestMatcher({ + bool? checkTime, + Map? headers, + String? contentType, + Map? queryParameters, + dynamic body, + List? formDataFields, + List? formDataFiles, +}) { var matcher = const TypeMatcher(); if (checkTime == true) { - matcher = matcher.having((request) => request.time.millisecondsSinceEpoch, - "time", greaterThan(0)); + matcher = matcher.having( + (request) => request.time.millisecondsSinceEpoch, + "time", + greaterThan(0), + ); } if (headers != null) { for (var header in headers.entries) { - matcher = matcher.having((request) { - return request.headers; - }, "header", HeaderMatcher(header)); + matcher = matcher.having( + (request) { + return request.headers; + }, + "header", + HeaderMatcher(header), + ); } } if (contentType != null) { matcher = matcher.having( - (request) => request.contentType, "contentType", equals(contentType)); + (request) => request.contentType, + "contentType", + equals(contentType), + ); } if (queryParameters != null) { - matcher = matcher.having((request) => request.queryParameters, - "queryParameters", equals(queryParameters)); + matcher = matcher.having( + (request) => request.queryParameters, + "queryParameters", + equals(queryParameters), + ); } if (body != null) { matcher = matcher.having((request) => request.body, "body", equals(body)); } if (formDataFields != null) { for (var field in formDataFields) { - matcher = matcher.having((request) => request.formDataFields, - "form data field", FormDataFieldMatcher(field)); + matcher = matcher.having( + (request) => request.formDataFields, + "form data field", + FormDataFieldMatcher(field), + ); } } if (formDataFiles != null) { for (var file in formDataFiles) { - matcher = matcher.having((request) => request.formDataFiles, - "form data file", FormDataFileMatcher(file)); + matcher = matcher.having( + (request) => request.formDataFiles, + "form data file", + FormDataFileMatcher(file), + ); } } diff --git a/packages/alice_test/lib/matcher/alice_response_matcher.dart b/packages/alice_test/lib/matcher/alice_response_matcher.dart index 72eb3185..6f575a72 100644 --- a/packages/alice_test/lib/matcher/alice_response_matcher.dart +++ b/packages/alice_test/lib/matcher/alice_response_matcher.dart @@ -18,18 +18,28 @@ TypeMatcher buildResponseMatcher({ matcher = matcher.having((response) => response.size, "size", equals(size)); } if (checkTime == true) { - matcher = matcher.having((response) => response.time.millisecondsSinceEpoch, - "time", greaterThan(0)); + matcher = matcher.having( + (response) => response.time.millisecondsSinceEpoch, + "time", + greaterThan(0), + ); } if (body != null) { matcher = matcher.having( - (response) => response.body.toString(), "body", equals(body)); + (response) => response.body.toString(), + "body", + equals(body), + ); } if (headers != null) { for (var header in headers.entries) { - matcher = matcher.having((response) { - return response.headers; - }, "header", HeaderMatcher(header)); + matcher = matcher.having( + (response) { + return response.headers; + }, + "header", + HeaderMatcher(header), + ); } } return matcher; diff --git a/packages/alice_test/lib/matcher/form_data_field_matcher.dart b/packages/alice_test/lib/matcher/form_data_field_matcher.dart index 736fcf30..3014df37 100644 --- a/packages/alice_test/lib/matcher/form_data_field_matcher.dart +++ b/packages/alice_test/lib/matcher/form_data_field_matcher.dart @@ -23,8 +23,12 @@ class FormDataFieldMatcher extends Matcher { description.add('contains form field').addDescriptionOf(_expected); @override - Description describeMismatch(Object? item, Description mismatchDescription, - Map matchState, bool verbose) { + Description describeMismatch( + Object? item, + Description mismatchDescription, + Map matchState, + bool verbose, + ) { mismatchDescription .add('does not contain form field') .addDescriptionOf(_expected); diff --git a/packages/alice_test/lib/matcher/form_data_file_matcher.dart b/packages/alice_test/lib/matcher/form_data_file_matcher.dart index 19f10b2a..9ffceed7 100644 --- a/packages/alice_test/lib/matcher/form_data_file_matcher.dart +++ b/packages/alice_test/lib/matcher/form_data_file_matcher.dart @@ -23,8 +23,12 @@ class FormDataFileMatcher extends Matcher { description.add('contains form file').addDescriptionOf(_expected); @override - Description describeMismatch(Object? item, Description mismatchDescription, - Map matchState, bool verbose) { + Description describeMismatch( + Object? item, + Description mismatchDescription, + Map matchState, + bool verbose, + ) { mismatchDescription .add('does not contain form file') .addDescriptionOf(_expected); diff --git a/packages/alice_test/lib/matcher/header_matcher.dart b/packages/alice_test/lib/matcher/header_matcher.dart index 4b48c8d4..78b92f17 100644 --- a/packages/alice_test/lib/matcher/header_matcher.dart +++ b/packages/alice_test/lib/matcher/header_matcher.dart @@ -19,8 +19,12 @@ class HeaderMatcher extends Matcher { description.add('contains header').addDescriptionOf(_expected); @override - Description describeMismatch(Object? item, Description mismatchDescription, - Map matchState, bool verbose) { + Description describeMismatch( + Object? item, + Description mismatchDescription, + Map matchState, + bool verbose, + ) { mismatchDescription .add('does not contain header') .addDescriptionOf(_expected);