From a4ecd7e6cc4c665d0ef800a670cf5f4516a140d7 Mon Sep 17 00:00:00 2001 From: Clasherzz Date: Wed, 18 Dec 2024 21:27:02 +0530 Subject: [PATCH 01/14] added no ssl client --- .../lib/services/no_ssl_http_service.dart | 125 ++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 packages/apidash_core/lib/services/no_ssl_http_service.dart diff --git a/packages/apidash_core/lib/services/no_ssl_http_service.dart b/packages/apidash_core/lib/services/no_ssl_http_service.dart new file mode 100644 index 00000000..08f90764 --- /dev/null +++ b/packages/apidash_core/lib/services/no_ssl_http_service.dart @@ -0,0 +1,125 @@ +import 'dart:async'; +import 'dart:convert'; +import 'dart:io'; +import 'package:http/http.dart' as http; +import 'package:http/io_client.dart'; +import 'package:seed/seed.dart'; +import '../consts.dart'; +import '../models/models.dart'; +import '../utils/utils.dart'; +import 'http_client_manager.dart'; + +typedef HttpResponse = http.Response; + +/// Create a custom `HttpClient` with SSL verification disabled. +http.Client createHttpClientWithNoSSL() { + var ioClient = HttpClient() + ..badCertificateCallback = + (X509Certificate cert, String host, int port) => true; + return IOClient(ioClient); +} + +Future<(HttpResponse?, Duration?, String?)> request( + String requestId, + HttpRequestModel requestModel, { + SupportedUriSchemes defaultUriScheme = kDefaultUriScheme, + bool bypassSSL = false, +}) async { + final clientManager = HttpClientManager(); + final client = bypassSSL + ? createHttpClientWithNoSSL() // Use SSL-bypassing client if specified + : clientManager.createClient(requestId); + + (Uri?, String?) uriRec = getValidRequestUri( + requestModel.url, + requestModel.enabledParams, + defaultUriScheme: defaultUriScheme, + ); + if (uriRec.$1 != null) { + Uri requestUrl = uriRec.$1!; + Map headers = requestModel.enabledHeadersMap; + HttpResponse response; + String? body; + try { + Stopwatch stopwatch = Stopwatch()..start(); + var isMultiPartRequest = + requestModel.bodyContentType == ContentType.formdata; + + if (kMethodsWithBody.contains(requestModel.method)) { + var requestBody = requestModel.body; + if (requestBody != null && !isMultiPartRequest) { + var contentLength = utf8.encode(requestBody).length; + if (contentLength > 0) { + body = requestBody; + headers[HttpHeaders.contentLengthHeader] = contentLength.toString(); + if (!requestModel.hasContentTypeHeader) { + headers[HttpHeaders.contentTypeHeader] = + requestModel.bodyContentType.header; + } + } + } + if (isMultiPartRequest) { + var multiPartRequest = http.MultipartRequest( + requestModel.method.name.toUpperCase(), + requestUrl, + ); + multiPartRequest.headers.addAll(headers); + for (var formData in requestModel.formDataList) { + if (formData.type == FormDataType.text) { + multiPartRequest.fields.addAll({formData.name: formData.value}); + } else { + multiPartRequest.files.add( + await http.MultipartFile.fromPath( + formData.name, + formData.value, + ), + ); + } + } + http.StreamedResponse multiPartResponse = + await multiPartRequest.send(); + stopwatch.stop(); + http.Response convertedMultiPartResponse = + await http.Response.fromStream(multiPartResponse); + return (convertedMultiPartResponse, stopwatch.elapsed, null); + } + } + + switch (requestModel.method) { + case HTTPVerb.get: + response = await client.get(requestUrl, headers: headers); + break; + case HTTPVerb.head: + response = await client.head(requestUrl, headers: headers); + break; + case HTTPVerb.post: + response = + await client.post(requestUrl, headers: headers, body: body); + break; + case HTTPVerb.put: + response = await client.put(requestUrl, headers: headers, body: body); + break; + case HTTPVerb.patch: + response = + await client.patch(requestUrl, headers: headers, body: body); + break; + case HTTPVerb.delete: + response = + await client.delete(requestUrl, headers: headers, body: body); + break; + } + stopwatch.stop(); + return (response, stopwatch.elapsed, null); + } catch (e) { + if (clientManager.wasRequestCancelled(requestId)) { + return (null, null, kMsgRequestCancelled); + } + return (null, null, e.toString()); + } finally { + if (!bypassSSL) clientManager.closeClient(requestId); + client.close(); // Always close the client + } + } else { + return (null, null, uriRec.$2); + } +} From 42941bb737bfd748ce247c22380ce0737294b21f Mon Sep 17 00:00:00 2001 From: Clasherzz Date: Wed, 18 Dec 2024 21:44:54 +0530 Subject: [PATCH 02/14] changed Settings Model --- lib/models/settings_model.dart | 10 ++++ lib/screens/settings_page.dart | 10 ++++ pubspec.lock | 88 +++++++++++++++++----------------- 3 files changed, 64 insertions(+), 44 deletions(-) diff --git a/lib/models/settings_model.dart b/lib/models/settings_model.dart index b2f443ca..1a227cd0 100644 --- a/lib/models/settings_model.dart +++ b/lib/models/settings_model.dart @@ -6,6 +6,7 @@ import 'package:apidash/consts.dart'; class SettingsModel { const SettingsModel({ this.isDark = false, + this.isSSLDisabled =false, this.alwaysShowCollectionPaneScrollbar = true, this.size, this.offset, @@ -19,6 +20,7 @@ class SettingsModel { }); final bool isDark; + final bool isSSLDisabled; final bool alwaysShowCollectionPaneScrollbar; final Size? size; final Offset? offset; @@ -32,6 +34,7 @@ class SettingsModel { SettingsModel copyWith({ bool? isDark, + bool? isSSLDisabled, bool? alwaysShowCollectionPaneScrollbar, Size? size, Offset? offset, @@ -45,6 +48,7 @@ class SettingsModel { }) { return SettingsModel( isDark: isDark ?? this.isDark, + isSSLDisabled: isSSLDisabled ?? this.isSSLDisabled, alwaysShowCollectionPaneScrollbar: alwaysShowCollectionPaneScrollbar ?? this.alwaysShowCollectionPaneScrollbar, size: size ?? this.size, @@ -65,6 +69,7 @@ class SettingsModel { }) { return SettingsModel( isDark: isDark, + isSSLDisabled: isSSLDisabled, alwaysShowCollectionPaneScrollbar: alwaysShowCollectionPaneScrollbar, size: size, defaultUriScheme: defaultUriScheme, @@ -80,6 +85,7 @@ class SettingsModel { factory SettingsModel.fromJson(Map data) { final isDark = data["isDark"] as bool?; + final isSSLDisabled = data["isSSLDisabled"] as bool?; final alwaysShowCollectionPaneScrollbar = data["alwaysShowCollectionPaneScrollbar"] as bool?; final width = data["width"] as double?; @@ -133,6 +139,7 @@ class SettingsModel { return sm.copyWith( isDark: isDark, + isSSLDisabled: isSSLDisabled, alwaysShowCollectionPaneScrollbar: alwaysShowCollectionPaneScrollbar, size: size, offset: offset, @@ -150,6 +157,7 @@ class SettingsModel { Map toJson() { return { "isDark": isDark, + "isSSLDisabled":isSSLDisabled, "alwaysShowCollectionPaneScrollbar": alwaysShowCollectionPaneScrollbar, "width": size?.width, "height": size?.height, @@ -175,6 +183,7 @@ class SettingsModel { return other is SettingsModel && other.runtimeType == runtimeType && other.isDark == isDark && + other.isSSLDisabled == isSSLDisabled && other.alwaysShowCollectionPaneScrollbar == alwaysShowCollectionPaneScrollbar && other.size == size && @@ -193,6 +202,7 @@ class SettingsModel { return Object.hash( runtimeType, isDark, + isSSLDisabled, alwaysShowCollectionPaneScrollbar, size, offset, diff --git a/lib/screens/settings_page.dart b/lib/screens/settings_page.dart index 74890a7f..fd6a5e64 100644 --- a/lib/screens/settings_page.dart +++ b/lib/screens/settings_page.dart @@ -39,6 +39,16 @@ class SettingsPage extends ConsumerWidget { child: ListView( shrinkWrap: true, children: [ + SwitchListTile( + hoverColor: kColorTransparent, + title: const Text('Disabling SSL verification'), + subtitle: Text( + 'Current selection: ${settings.isDark ? "Dark Mode" : "Light mode"}'), + value: settings.isDark, + onChanged: (bool? value) { + ref.read(settingsProvider.notifier).update(isDark: value); + }, + ), SwitchListTile( hoverColor: kColorTransparent, title: const Text('Switch Theme Mode'), diff --git a/pubspec.lock b/pubspec.lock index 986829c5..ccb55781 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,23 +5,23 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - sha256: f256b0c0ba6c7577c15e2e4e114755640a875e885099367bf6e012b19314c834 + sha256: "16e298750b6d0af7ce8a3ba7c18c69c3785d11b15ec83f6dcd0ad2a0009b3cab" url: "https://pub.dev" source: hosted - version: "72.0.0" + version: "76.0.0" _macros: dependency: transitive description: dart source: sdk - version: "0.3.2" + version: "0.3.3" analyzer: dependency: transitive description: name: analyzer - sha256: b652861553cd3990d8ed361f7979dc6d7053a9ac8843fa73820ab68ce5410139 + sha256: "1f14db053a8c23e260789e9b0980fa27f2680dd640932cae5e1137cce0e46e1e" url: "https://pub.dev" source: hosted - version: "6.7.0" + version: "6.11.0" ansi_styles: dependency: transitive description: @@ -72,10 +72,10 @@ packages: dependency: transitive description: name: async - sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63 url: "https://pub.dev" source: hosted - version: "2.11.0" + version: "2.12.0" audio_session: dependency: transitive description: @@ -104,10 +104,10 @@ packages: dependency: transitive description: name: boolean_selector - sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea" url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" build: dependency: transitive description: @@ -224,10 +224,10 @@ packages: dependency: transitive description: name: clock - sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.1.2" code_builder: dependency: "direct main" description: @@ -240,10 +240,10 @@ packages: dependency: transitive description: name: collection - sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a + sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf url: "https://pub.dev" source: hosted - version: "1.18.0" + version: "1.19.0" conventional_commit: dependency: transitive description: @@ -375,10 +375,10 @@ packages: dependency: transitive description: name: fake_async - sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + sha256: "6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc" url: "https://pub.dev" source: hosted - version: "1.3.1" + version: "1.3.2" ffi: dependency: transitive description: @@ -391,10 +391,10 @@ packages: dependency: transitive description: name: file - sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" + sha256: a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4 url: "https://pub.dev" source: hosted - version: "7.0.0" + version: "7.0.1" file_selector: dependency: "direct main" description: @@ -876,18 +876,18 @@ packages: dependency: transitive description: name: leak_tracker - sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05" + sha256: c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec url: "https://pub.dev" source: hosted - version: "10.0.5" + version: "10.0.8" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806" + sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573 url: "https://pub.dev" source: hosted - version: "3.0.5" + version: "3.0.9" leak_tracker_testing: dependency: transitive description: @@ -924,10 +924,10 @@ packages: dependency: transitive description: name: macros - sha256: "0acaed5d6b7eab89f63350bccd82119e6c602df0f391260d0e32b5e23db79536" + sha256: "1d9e801cd66f7ea3663c45fc708450db1fa57f988142c64289142c9b7ee80656" url: "https://pub.dev" source: hosted - version: "0.1.2-main.4" + version: "0.1.3-main.0" markdown: dependency: "direct main" description: @@ -1069,10 +1069,10 @@ packages: dependency: "direct main" description: name: path - sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" + sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5" url: "https://pub.dev" source: hosted - version: "1.9.0" + version: "1.9.1" path_parsing: dependency: transitive description: @@ -1157,10 +1157,10 @@ packages: dependency: transitive description: name: platform - sha256: "9b71283fc13df574056616011fb138fd3b793ea47cc509c189a6c3fa5f8a1a65" + sha256: "5d6b1b0036a5f331ebc77c850ebc8506cbc1e9416c27e59b439f917a902a4984" url: "https://pub.dev" source: hosted - version: "3.1.5" + version: "3.1.6" plugin_platform_interface: dependency: transitive description: @@ -1221,10 +1221,10 @@ packages: dependency: transitive description: name: process - sha256: "21e54fd2faf1b5bdd5102afd25012184a6793927648ea81eea80552ac9405b32" + sha256: "107d8be718f120bbba9dcd1e95e3bd325b1b4a4f07db64154635ba03f2567a0d" url: "https://pub.dev" source: hosted - version: "5.0.2" + version: "5.0.3" prompts: dependency: transitive description: @@ -1429,7 +1429,7 @@ packages: dependency: transitive description: flutter source: sdk - version: "0.0.99" + version: "0.0.0" source_gen: dependency: transitive description: @@ -1490,10 +1490,10 @@ packages: dependency: transitive description: name: stack_trace - sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377" url: "https://pub.dev" source: hosted - version: "1.11.1" + version: "1.12.0" state_notifier: dependency: transitive description: @@ -1522,10 +1522,10 @@ packages: dependency: transitive description: name: string_scanner - sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + sha256: "0bd04f5bb74fcd6ff0606a888a30e917af9bd52820b178eaa464beb11dca84b6" url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.4.0" sync_http: dependency: transitive description: @@ -1546,26 +1546,26 @@ packages: dependency: "direct dev" description: name: test - sha256: "7ee44229615f8f642b68120165ae4c2a75fe77ae2065b1e55ae4711f6cf0899e" + sha256: "713a8789d62f3233c46b4a90b174737b2c04cb6ae4500f2aa8b1be8f03f5e67f" url: "https://pub.dev" source: hosted - version: "1.25.7" + version: "1.25.8" test_api: dependency: transitive description: name: test_api - sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb" + sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c" url: "https://pub.dev" source: hosted - version: "0.7.2" + version: "0.7.3" test_core: dependency: transitive description: name: test_core - sha256: "55ea5a652e38a1dfb32943a7973f3681a60f872f8c3a05a14664ad54ef9c6696" + sha256: "12391302411737c176b0b5d6491f466b0dd56d4763e347b6714efbaa74d7953d" url: "https://pub.dev" source: hosted - version: "0.6.4" + version: "0.6.5" textwrap: dependency: transitive description: @@ -1762,10 +1762,10 @@ packages: dependency: transitive description: name: vm_service - sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d" + sha256: "0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14" url: "https://pub.dev" source: hosted - version: "14.2.5" + version: "14.3.1" watcher: dependency: transitive description: @@ -1794,10 +1794,10 @@ packages: dependency: transitive description: name: webdriver - sha256: "003d7da9519e1e5f329422b36c4dcdf18d7d2978d1ba099ea4e45ba490ed845e" + sha256: "3d773670966f02a646319410766d3b5e1037efb7f07cc68f844d5e06cd4d61c8" url: "https://pub.dev" source: hosted - version: "3.0.3" + version: "3.0.4" webkit_inspection_protocol: dependency: transitive description: From c416932efd624e379982b95cd901c8551f40ee08 Mon Sep 17 00:00:00 2001 From: Clasherzz Date: Wed, 18 Dec 2024 22:36:30 +0530 Subject: [PATCH 03/14] edited collection_provider --- lib/providers/collection_providers.dart | 14 ++++++++++++-- lib/providers/settings_providers.dart | 2 ++ lib/screens/settings_page.dart | 6 +++--- .../lib/services/no_ssl_http_service.dart | 5 +++-- packages/apidash_core/lib/services/services.dart | 1 + 5 files changed, 21 insertions(+), 7 deletions(-) diff --git a/lib/providers/collection_providers.dart b/lib/providers/collection_providers.dart index 091d3332..1816137a 100644 --- a/lib/providers/collection_providers.dart +++ b/lib/providers/collection_providers.dart @@ -1,4 +1,5 @@ import 'package:apidash_core/apidash_core.dart'; +//import 'package:apidash_core/services/no_ssl_http_service.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:apidash/consts.dart'; import 'providers.dart'; @@ -273,12 +274,21 @@ class CollectionStateNotifier sendingTime: DateTime.now(), ); state = map; - - (HttpResponse?, Duration?, String?)? responseRec = await request( + late (HttpResponse?, Duration?, String?)? responseRec; + if(!ref.watch(settingsProvider).isSSLDisabled){ + responseRec = await request( requestId, substitutedHttpRequestModel, defaultUriScheme: defaultUriScheme, ); + }else{ + responseRec = await noSSLrequest( + requestId, + substitutedHttpRequestModel, + defaultUriScheme: defaultUriScheme, + ); + + } late final RequestModel newRequestModel; if (responseRec.$1 == null) { diff --git a/lib/providers/settings_providers.dart b/lib/providers/settings_providers.dart index f6b4392f..0fb9ab7d 100644 --- a/lib/providers/settings_providers.dart +++ b/lib/providers/settings_providers.dart @@ -22,6 +22,7 @@ class ThemeStateNotifier extends StateNotifier { Future update({ bool? isDark, + bool? isSSLDisabled, bool? alwaysShowCollectionPaneScrollbar, Size? size, Offset? offset, @@ -35,6 +36,7 @@ class ThemeStateNotifier extends StateNotifier { }) async { state = state.copyWith( isDark: isDark, + isSSLDisabled: isSSLDisabled, alwaysShowCollectionPaneScrollbar: alwaysShowCollectionPaneScrollbar, size: size, offset: offset, diff --git a/lib/screens/settings_page.dart b/lib/screens/settings_page.dart index fd6a5e64..043f891b 100644 --- a/lib/screens/settings_page.dart +++ b/lib/screens/settings_page.dart @@ -43,10 +43,10 @@ class SettingsPage extends ConsumerWidget { hoverColor: kColorTransparent, title: const Text('Disabling SSL verification'), subtitle: Text( - 'Current selection: ${settings.isDark ? "Dark Mode" : "Light mode"}'), - value: settings.isDark, + 'Current selection: ${settings.isSSLDisabled ? "SSL Verification Disabled" : "SSL Verification Enabled"}'), + value: settings.isSSLDisabled, onChanged: (bool? value) { - ref.read(settingsProvider.notifier).update(isDark: value); + ref.read(settingsProvider.notifier).update(isSSLDisabled: value); }, ), SwitchListTile( diff --git a/packages/apidash_core/lib/services/no_ssl_http_service.dart b/packages/apidash_core/lib/services/no_ssl_http_service.dart index 08f90764..fa7af858 100644 --- a/packages/apidash_core/lib/services/no_ssl_http_service.dart +++ b/packages/apidash_core/lib/services/no_ssl_http_service.dart @@ -8,8 +8,9 @@ import '../consts.dart'; import '../models/models.dart'; import '../utils/utils.dart'; import 'http_client_manager.dart'; +import 'http_service.dart'; + -typedef HttpResponse = http.Response; /// Create a custom `HttpClient` with SSL verification disabled. http.Client createHttpClientWithNoSSL() { @@ -19,7 +20,7 @@ http.Client createHttpClientWithNoSSL() { return IOClient(ioClient); } -Future<(HttpResponse?, Duration?, String?)> request( +Future<(HttpResponse?, Duration?, String?)> noSSLrequest( String requestId, HttpRequestModel requestModel, { SupportedUriSchemes defaultUriScheme = kDefaultUriScheme, diff --git a/packages/apidash_core/lib/services/services.dart b/packages/apidash_core/lib/services/services.dart index d155e9c7..fc2ca6e7 100644 --- a/packages/apidash_core/lib/services/services.dart +++ b/packages/apidash_core/lib/services/services.dart @@ -1,2 +1,3 @@ export 'http_client_manager.dart'; export 'http_service.dart'; +export 'no_ssl_http_service.dart'; From 157ecf220c0893a0ecb9cd7920b1c7cd47412f46 Mon Sep 17 00:00:00 2001 From: Clasherzz Date: Thu, 19 Dec 2024 09:50:33 +0530 Subject: [PATCH 04/14] last minute code refactoring --- lib/providers/collection_providers.dart | 21 +-- .../lib/services/http_client_manager.dart | 7 +- .../lib/services/http_service.dart | 7 +- .../lib/services/no_ssl_http_service.dart | 126 ------------------ .../apidash_core/lib/services/services.dart | 2 +- .../lib/utils/http_request_utils.dart | 12 ++ 6 files changed, 30 insertions(+), 145 deletions(-) delete mode 100644 packages/apidash_core/lib/services/no_ssl_http_service.dart diff --git a/lib/providers/collection_providers.dart b/lib/providers/collection_providers.dart index 1816137a..4c731ee3 100644 --- a/lib/providers/collection_providers.dart +++ b/lib/providers/collection_providers.dart @@ -274,21 +274,14 @@ class CollectionStateNotifier sendingTime: DateTime.now(), ); state = map; - late (HttpResponse?, Duration?, String?)? responseRec; - if(!ref.watch(settingsProvider).isSSLDisabled){ - responseRec = await request( - requestId, - substitutedHttpRequestModel, - defaultUriScheme: defaultUriScheme, - ); - }else{ - responseRec = await noSSLrequest( - requestId, - substitutedHttpRequestModel, - defaultUriScheme: defaultUriScheme, - ); - } + bool noSSL = ref.read(settingsProvider).isSSLDisabled; + (HttpResponse?, Duration?, String?)? responseRec = await request( + requestId, + substitutedHttpRequestModel, + defaultUriScheme: defaultUriScheme, + noSSL: noSSL + ); late final RequestModel newRequestModel; if (responseRec.$1 == null) { diff --git a/packages/apidash_core/lib/services/http_client_manager.dart b/packages/apidash_core/lib/services/http_client_manager.dart index fb2ea1ac..6761895d 100644 --- a/packages/apidash_core/lib/services/http_client_manager.dart +++ b/packages/apidash_core/lib/services/http_client_manager.dart @@ -1,3 +1,4 @@ +import 'package:apidash_core/utils/http_request_utils.dart'; import 'package:http/http.dart' as http; import 'dart:collection'; @@ -13,12 +14,14 @@ class HttpClientManager { HttpClientManager._internal(); - http.Client createClient(String requestId) { - final client = http.Client(); + http.Client createClient(String requestId,{bool noSSL = false}) { + final client = noSSL ? createHttpClientWithNoSSL() :http.Client(); _clients[requestId] = client; return client; } + + void cancelRequest(String? requestId) { if (requestId != null && _clients.containsKey(requestId)) { _clients[requestId]?.close(); diff --git a/packages/apidash_core/lib/services/http_service.dart b/packages/apidash_core/lib/services/http_service.dart index e0936db8..27d3729d 100644 --- a/packages/apidash_core/lib/services/http_service.dart +++ b/packages/apidash_core/lib/services/http_service.dart @@ -9,20 +9,21 @@ import '../utils/utils.dart'; import 'http_client_manager.dart'; typedef HttpResponse = http.Response; - Future<(HttpResponse?, Duration?, String?)> request( String requestId, HttpRequestModel requestModel, { SupportedUriSchemes defaultUriScheme = kDefaultUriScheme, + bool noSSL = false, // Add a parameter to specify SSL-bypass }) async { final clientManager = HttpClientManager(); - final client = clientManager.createClient(requestId); + final client = clientManager.createClient(requestId, noSSL: noSSL); (Uri?, String?) uriRec = getValidRequestUri( requestModel.url, requestModel.enabledParams, defaultUriScheme: defaultUriScheme, ); + if (uriRec.$1 != null) { Uri requestUrl = uriRec.$1!; Map headers = requestModel.enabledHeadersMap; @@ -32,6 +33,7 @@ Future<(HttpResponse?, Duration?, String?)> request( Stopwatch stopwatch = Stopwatch()..start(); var isMultiPartRequest = requestModel.bodyContentType == ContentType.formdata; + if (kMethodsWithBody.contains(requestModel.method)) { var requestBody = requestModel.body; if (requestBody != null && !isMultiPartRequest) { @@ -71,6 +73,7 @@ Future<(HttpResponse?, Duration?, String?)> request( return (convertedMultiPartResponse, stopwatch.elapsed, null); } } + switch (requestModel.method) { case HTTPVerb.get: response = await client.get(requestUrl, headers: headers); diff --git a/packages/apidash_core/lib/services/no_ssl_http_service.dart b/packages/apidash_core/lib/services/no_ssl_http_service.dart deleted file mode 100644 index fa7af858..00000000 --- a/packages/apidash_core/lib/services/no_ssl_http_service.dart +++ /dev/null @@ -1,126 +0,0 @@ -import 'dart:async'; -import 'dart:convert'; -import 'dart:io'; -import 'package:http/http.dart' as http; -import 'package:http/io_client.dart'; -import 'package:seed/seed.dart'; -import '../consts.dart'; -import '../models/models.dart'; -import '../utils/utils.dart'; -import 'http_client_manager.dart'; -import 'http_service.dart'; - - - -/// Create a custom `HttpClient` with SSL verification disabled. -http.Client createHttpClientWithNoSSL() { - var ioClient = HttpClient() - ..badCertificateCallback = - (X509Certificate cert, String host, int port) => true; - return IOClient(ioClient); -} - -Future<(HttpResponse?, Duration?, String?)> noSSLrequest( - String requestId, - HttpRequestModel requestModel, { - SupportedUriSchemes defaultUriScheme = kDefaultUriScheme, - bool bypassSSL = false, -}) async { - final clientManager = HttpClientManager(); - final client = bypassSSL - ? createHttpClientWithNoSSL() // Use SSL-bypassing client if specified - : clientManager.createClient(requestId); - - (Uri?, String?) uriRec = getValidRequestUri( - requestModel.url, - requestModel.enabledParams, - defaultUriScheme: defaultUriScheme, - ); - if (uriRec.$1 != null) { - Uri requestUrl = uriRec.$1!; - Map headers = requestModel.enabledHeadersMap; - HttpResponse response; - String? body; - try { - Stopwatch stopwatch = Stopwatch()..start(); - var isMultiPartRequest = - requestModel.bodyContentType == ContentType.formdata; - - if (kMethodsWithBody.contains(requestModel.method)) { - var requestBody = requestModel.body; - if (requestBody != null && !isMultiPartRequest) { - var contentLength = utf8.encode(requestBody).length; - if (contentLength > 0) { - body = requestBody; - headers[HttpHeaders.contentLengthHeader] = contentLength.toString(); - if (!requestModel.hasContentTypeHeader) { - headers[HttpHeaders.contentTypeHeader] = - requestModel.bodyContentType.header; - } - } - } - if (isMultiPartRequest) { - var multiPartRequest = http.MultipartRequest( - requestModel.method.name.toUpperCase(), - requestUrl, - ); - multiPartRequest.headers.addAll(headers); - for (var formData in requestModel.formDataList) { - if (formData.type == FormDataType.text) { - multiPartRequest.fields.addAll({formData.name: formData.value}); - } else { - multiPartRequest.files.add( - await http.MultipartFile.fromPath( - formData.name, - formData.value, - ), - ); - } - } - http.StreamedResponse multiPartResponse = - await multiPartRequest.send(); - stopwatch.stop(); - http.Response convertedMultiPartResponse = - await http.Response.fromStream(multiPartResponse); - return (convertedMultiPartResponse, stopwatch.elapsed, null); - } - } - - switch (requestModel.method) { - case HTTPVerb.get: - response = await client.get(requestUrl, headers: headers); - break; - case HTTPVerb.head: - response = await client.head(requestUrl, headers: headers); - break; - case HTTPVerb.post: - response = - await client.post(requestUrl, headers: headers, body: body); - break; - case HTTPVerb.put: - response = await client.put(requestUrl, headers: headers, body: body); - break; - case HTTPVerb.patch: - response = - await client.patch(requestUrl, headers: headers, body: body); - break; - case HTTPVerb.delete: - response = - await client.delete(requestUrl, headers: headers, body: body); - break; - } - stopwatch.stop(); - return (response, stopwatch.elapsed, null); - } catch (e) { - if (clientManager.wasRequestCancelled(requestId)) { - return (null, null, kMsgRequestCancelled); - } - return (null, null, e.toString()); - } finally { - if (!bypassSSL) clientManager.closeClient(requestId); - client.close(); // Always close the client - } - } else { - return (null, null, uriRec.$2); - } -} diff --git a/packages/apidash_core/lib/services/services.dart b/packages/apidash_core/lib/services/services.dart index fc2ca6e7..fa82eac4 100644 --- a/packages/apidash_core/lib/services/services.dart +++ b/packages/apidash_core/lib/services/services.dart @@ -1,3 +1,3 @@ export 'http_client_manager.dart'; export 'http_service.dart'; -export 'no_ssl_http_service.dart'; + diff --git a/packages/apidash_core/lib/utils/http_request_utils.dart b/packages/apidash_core/lib/utils/http_request_utils.dart index 2e1daea5..7935ccc3 100644 --- a/packages/apidash_core/lib/utils/http_request_utils.dart +++ b/packages/apidash_core/lib/utils/http_request_utils.dart @@ -1,6 +1,18 @@ +import 'dart:io'; + import 'package:collection/collection.dart'; +import 'package:http/http.dart' as http; +import 'package:http/io_client.dart'; import 'package:seed/seed.dart'; + +http.Client createHttpClientWithNoSSL() { + var ioClient = HttpClient() + ..badCertificateCallback = + (X509Certificate cert, String host, int port) => true; + return IOClient(ioClient); +} + Map? rowsToMap( List? kvRows, { bool isHeader = false, From 80e464d388afe93bd42e7de2316cbb6d70b8142f Mon Sep 17 00:00:00 2001 From: Clasherzz Date: Fri, 20 Dec 2024 15:44:13 +0530 Subject: [PATCH 05/14] edited the printing part due to error --- lib/widgets/previewer.dart | 32 +-- pubspec.lock | 410 ++++++++++++++++++++----------------- pubspec.yaml | 2 +- 3 files changed, 238 insertions(+), 206 deletions(-) diff --git a/lib/widgets/previewer.dart b/lib/widgets/previewer.dart index 36b9ce62..bec10ba8 100644 --- a/lib/widgets/previewer.dart +++ b/lib/widgets/previewer.dart @@ -3,7 +3,7 @@ import 'package:apidash_core/apidash_core.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:jinja/jinja.dart' as jj; -import 'package:printing/printing.dart'; +//import 'package:printing/printing.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:vector_graphics_compiler/vector_graphics_compiler.dart'; import 'error_message.dart'; @@ -79,21 +79,21 @@ class _PreviewerState extends State { }, ); } - if (widget.type == kTypeApplication && widget.subtype == kSubTypePdf) { - return PdfPreview( - build: (_) => widget.bytes, - useActions: false, - onError: (context, error) { - return ErrorMessage( - message: errorTemplate.render({ - "showRaw": false, - "showContentType": false, - "type": kSubTypePdf, - }), - ); - }, - ); - } + // if (widget.type == kTypeApplication && widget.subtype == kSubTypePdf) { + // return PdfPreview( + // build: (_) => widget.bytes, + // useActions: false, + // onError: (context, error) { + // return ErrorMessage( + // message: errorTemplate.render({ + // "showRaw": false, + // "showContentType": false, + // "type": kSubTypePdf, + // }), + // ); + // }, + // ); + // } if (widget.type == kTypeAudio) { return Uint8AudioPlayer( bytes: widget.bytes, diff --git a/pubspec.lock b/pubspec.lock index ccb55781..b2ab0baf 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -64,10 +64,10 @@ packages: dependency: transitive description: name: args - sha256: "7cf60b9f0cc88203c5a190b4cd62a99feea42759a7fa695010eb5de1c0b2252a" + sha256: bf9f5caeea8d8fe6721a9c358dd8a5c1947b27f1cfaa18b39c301273594919e6 url: "https://pub.dev" source: hosted - version: "2.5.0" + version: "2.6.0" async: dependency: transitive description: @@ -80,10 +80,10 @@ packages: dependency: transitive description: name: audio_session - sha256: "343e83bc7809fbda2591a49e525d6b63213ade10c76f15813be9aed6657b3261" + sha256: b2a26ba8b7efa1790d6460e82971fde3e398cfbe2295df9dea22f3499d2c12a7 url: "https://pub.dev" source: hosted - version: "0.1.21" + version: "0.1.23" barcode: dependency: transitive description: @@ -96,10 +96,10 @@ packages: dependency: transitive description: name: bidi - sha256: "1a7d0c696324b2089f72e7671fd1f1f64fef44c980f3cebc84e803967c597b63" + sha256: "9a712c7ddf708f7c41b1923aa83648a3ed44cfd75b04f72d598c45e5be287f9d" url: "https://pub.dev" source: hosted - version: "2.0.10" + version: "2.0.12" boolean_selector: dependency: transitive description: @@ -112,50 +112,50 @@ packages: dependency: transitive description: name: build - sha256: "80184af8b6cb3e5c1c4ec6d8544d27711700bc3e6d2efad04238c7b5290889f0" + sha256: cef23f1eda9b57566c81e2133d196f8e3df48f244b317368d65c5943d91148f0 url: "https://pub.dev" source: hosted - version: "2.4.1" + version: "2.4.2" build_config: dependency: transitive description: name: build_config - sha256: bf80fcfb46a29945b423bd9aad884590fb1dc69b330a4d4700cac476af1708d1 + sha256: "4ae2de3e1e67ea270081eaee972e1bd8f027d459f249e0f1186730784c2e7e33" url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.1.2" build_daemon: dependency: transitive description: name: build_daemon - sha256: "79b2aef6ac2ed00046867ed354c88778c9c0f029df8a20fe10b5436826721ef9" + sha256: "294a2edaf4814a378725bfe6358210196f5ea37af89ecd81bfa32960113d4948" url: "https://pub.dev" source: hosted - version: "4.0.2" + version: "4.0.3" build_resolvers: dependency: transitive description: name: build_resolvers - sha256: "339086358431fa15d7eca8b6a36e5d783728cf025e559b834f4609a1fcfb7b0a" + sha256: "99d3980049739a985cf9b21f30881f46db3ebc62c5b8d5e60e27440876b1ba1e" url: "https://pub.dev" source: hosted - version: "2.4.2" + version: "2.4.3" build_runner: dependency: "direct dev" description: name: build_runner - sha256: dd09dd4e2b078992f42aac7f1a622f01882a8492fef08486b27ddde929c19f04 + sha256: "74691599a5bc750dc96a6b4bfd48f7d9d66453eab04c7f4063134800d6a5c573" url: "https://pub.dev" source: hosted - version: "2.4.12" + version: "2.4.14" build_runner_core: dependency: transitive description: name: build_runner_core - sha256: e3c79f69a64bdfcd8a776a3c28db4eb6e3fb5356d013ae5eb2e52007706d5dbe + sha256: "22e3aa1c80e0ada3722fe5b63fd43d9c8990759d0a2cf489c8c5d7b2bdebc021" url: "https://pub.dev" source: hosted - version: "7.3.1" + version: "8.0.0" built_collection: dependency: transitive description: @@ -168,10 +168,10 @@ packages: dependency: transitive description: name: built_value - sha256: c7913a9737ee4007efedaffc968c049fd0f3d0e49109e778edc10de9426005cb + sha256: "28a712df2576b63c6c005c465989a348604960c0958d28be5303ba9baa841ac2" url: "https://pub.dev" source: hosted - version: "8.9.2" + version: "8.9.3" characters: dependency: transitive description: @@ -184,10 +184,10 @@ packages: dependency: transitive description: name: charcode - sha256: fb98c0f6d12c920a02ee2d998da788bca066ca5f148492b7085ee23372b12306 + sha256: fb0f1107cac15a5ea6ef0a6ef71a807b9e4267c713bb93e00e92d737cc8dbd8a url: "https://pub.dev" source: hosted - version: "1.3.1" + version: "1.4.0" checked_yaml: dependency: transitive description: @@ -216,10 +216,10 @@ packages: dependency: transitive description: name: cli_util - sha256: c05b7406fdabc7a49a3929d4af76bcaccbbffcbcdcf185b082e1ae07da323d19 + sha256: ff6785f7e9e3c38ac98b2fb035701789de90154024a75b6cb926445e83197d1c url: "https://pub.dev" source: hosted - version: "0.4.1" + version: "0.4.2" clock: dependency: transitive description: @@ -232,10 +232,10 @@ packages: dependency: "direct main" description: name: code_builder - sha256: f692079e25e7869c14132d39f223f8eec9830eb76131925143b2129c4bb01b37 + sha256: "0ec10bf4a89e4c613960bf1e8b42c64127021740fb21640c29c909826a5eea3e" url: "https://pub.dev" source: hosted - version: "4.10.0" + version: "4.10.1" collection: dependency: transitive description: @@ -256,18 +256,18 @@ packages: dependency: transitive description: name: convert - sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592" + sha256: b30acd5944035672bc15c6b7a8b47d773e41e2f17de064350988c5d02adb1c68 url: "https://pub.dev" source: hosted - version: "3.1.1" + version: "3.1.2" coverage: dependency: transitive description: name: coverage - sha256: "576aaab8b1abdd452e0f656c3e73da9ead9d7880e15bdc494189d9c1a1baf0db" + sha256: e3493833ea012784c740e341952298f1cc77f1f01b1bbc3eb4eecf6984fb7f43 url: "https://pub.dev" source: hosted - version: "1.9.0" + version: "1.11.1" cross_file: dependency: transitive description: @@ -280,18 +280,18 @@ packages: dependency: transitive description: name: crypto - sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab + sha256: "1e445881f28f22d6140f181e07737b22f1e099a5e1ff94b0af2f9e4a463f4855" url: "https://pub.dev" source: hosted - version: "3.0.3" + version: "3.0.6" csslib: dependency: transitive description: name: csslib - sha256: "706b5707578e0c1b4b7550f64078f0a0f19dec3f50a178ffae7006b0a9ca58fb" + sha256: "09bad715f418841f976c77db72d5398dc1253c21fb9c0c7f0b0b985860b2d58e" url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "1.0.2" csv: dependency: "direct main" description: @@ -327,10 +327,10 @@ packages: dependency: "direct main" description: name: data_table_2 - sha256: f02ec9b24f44420816a87370ff4f4e533e15b274f6267e4c9a88a585ad1a0473 + sha256: "5a540a7b64809eb46b3809c67fc6faa29ca217864341294df66b1f0eb040c20e" url: "https://pub.dev" source: hosted - version: "2.5.15" + version: "2.5.18" desktop_drop: dependency: "direct main" description: @@ -343,10 +343,10 @@ packages: dependency: transitive description: name: equatable - sha256: c2b87cb7756efdf69892005af546c56c0b5037f54d2a88269b4f347a505e3ca2 + sha256: "567c64b3cb4cf82397aac55f4f0cbd3ca20d77c6c03bedbc4ceaddc08904aef7" url: "https://pub.dev" source: hosted - version: "2.0.5" + version: "2.0.7" eventify: dependency: transitive description: @@ -359,18 +359,18 @@ packages: dependency: "direct main" description: name: extended_text_field - sha256: d3f3f8d37e516f0e805b4a41283833f86fc10fecc83abe51d7223ec9a64e136a + sha256: "3996195c117c6beb734026a7bc0ba80d7e4e84e4edd4728caa544d8209ab4d7d" url: "https://pub.dev" source: hosted - version: "16.0.0" + version: "16.0.2" extended_text_library: dependency: transitive description: name: extended_text_library - sha256: "55d09098ec56fab0d9a8a68950ca0bbf2efa1327937f7cec6af6dfa066234829" + sha256: "13d99f8a10ead472d5e2cf4770d3d047203fe5054b152e9eb5dc692a71befbba" url: "https://pub.dev" source: hosted - version: "12.0.0" + version: "12.0.1" fake_async: dependency: transitive description: @@ -383,10 +383,10 @@ packages: dependency: transitive description: name: ffi - sha256: "493f37e7df1804778ff3a53bd691d8692ddf69702cf4c1c1096a2e41b4779e21" + sha256: "16ed7b077ef01ad6170a3d0c57caa4a112a38d7a2ed5602e0aca9ca6f3d98da6" url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.3" file: dependency: transitive description: @@ -407,34 +407,34 @@ packages: dependency: transitive description: name: file_selector_android - sha256: d1e8655c1a4850a900a0cfaed55fdd273881d53a4bb78e4736dc170a0b17db78 + sha256: "98ac58e878b05ea2fdb204e7f4fc4978d90406c9881874f901428e01d3b18fbc" url: "https://pub.dev" source: hosted - version: "0.5.1+5" + version: "0.5.1+12" file_selector_ios: dependency: transitive description: name: file_selector_ios - sha256: "38ebf91ecbcfa89a9639a0854ccaed8ab370c75678938eebca7d34184296f0bb" + sha256: "94b98ad950b8d40d96fee8fa88640c2e4bd8afcdd4817993bd04e20310f45420" url: "https://pub.dev" source: hosted - version: "0.5.3" + version: "0.5.3+1" file_selector_linux: dependency: transitive description: name: file_selector_linux - sha256: "045d372bf19b02aeb69cacf8b4009555fb5f6f0b7ad8016e5f46dd1387ddd492" + sha256: "54cbbd957e1156d29548c7d9b9ec0c0ebb6de0a90452198683a7d23aed617a33" url: "https://pub.dev" source: hosted - version: "0.9.2+1" + version: "0.9.3+2" file_selector_macos: dependency: transitive description: name: file_selector_macos - sha256: f42eacb83b318e183b1ae24eead1373ab1334084404c8c16e0354f9a3e55d385 + sha256: "271ab9986df0c135d45c3cdb6bd0faa5db6f4976d3e4b437cf7d0f258d941bfc" url: "https://pub.dev" source: hosted - version: "0.9.4" + version: "0.9.4+2" file_selector_platform_interface: dependency: transitive description: @@ -455,18 +455,18 @@ packages: dependency: transitive description: name: file_selector_windows - sha256: "2ad726953f6e8affbc4df8dc78b77c3b4a060967a291e528ef72ae846c60fb69" + sha256: "8f5d2f6590d51ecd9179ba39c64f722edc15226cc93dcc8698466ad36a4a85a4" url: "https://pub.dev" source: hosted - version: "0.9.3+2" + version: "0.9.3+3" fixnum: dependency: transitive description: name: fixnum - sha256: "25517a4deb0c03aa0f32fd12db525856438902d9c16536311e76cdc57b31d7d1" + sha256: b6dc7065e46c974bc7c5f143080a6764ec7a4be6da1285ececdc37be96de53be url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.1.1" flex_color_scheme: dependency: "direct main" description: @@ -569,18 +569,18 @@ packages: dependency: "direct main" description: name: flutter_markdown - sha256: a23c41ee57573e62fc2190a1f36a0480c4d90bde3a8a8d7126e5d5992fb53fb7 + sha256: "255b00afa1a7bad19727da6a7780cf3db6c3c12e68d302d85e0ff1fdf173db9e" url: "https://pub.dev" source: hosted - version: "0.7.3+1" + version: "0.7.4+3" flutter_native_splash: dependency: "direct dev" description: name: flutter_native_splash - sha256: aa06fec78de2190f3db4319dd60fdc8d12b2626e93ef9828633928c2dcaea840 + sha256: "1152ab0067ca5a2ebeb862fe0a762057202cceb22b7e62692dcbabf6483891bb" url: "https://pub.dev" source: hosted - version: "2.4.1" + version: "2.4.3" flutter_portal: dependency: "direct main" description: @@ -593,18 +593,18 @@ packages: dependency: "direct main" description: name: flutter_riverpod - sha256: "0f1974eff5bbe774bf1d870e406fc6f29e3d6f1c46bd9c58e7172ff68a785d7d" + sha256: "9532ee6db4a943a1ed8383072a2e3eeda041db5657cdf6d2acecf3c21ecbe7e1" url: "https://pub.dev" source: hosted - version: "2.5.1" + version: "2.6.1" flutter_svg: dependency: "direct main" description: name: flutter_svg - sha256: "7b4ca6cf3304575fe9c8ec64813c8d02ee41d2afe60bcfe0678bcb5375d596a2" + sha256: "54900a1a1243f3c4a5506d853a2b5c2dbc38d5f27e52a52618a8054401431123" url: "https://pub.dev" source: hosted - version: "2.0.10+1" + version: "2.0.16" flutter_test: dependency: "direct dev" description: flutter @@ -712,18 +712,18 @@ packages: dependency: "direct main" description: name: hooks_riverpod - sha256: "97266a91c994951a06ef0ff3a1c7fb261e52ec7f74e87f0614ea0b7411b859b2" + sha256: "70bba33cfc5670c84b796e6929c54b8bc5be7d0fe15bb28c2560500b9ad06966" url: "https://pub.dev" source: hosted - version: "2.5.2" + version: "2.6.1" html: dependency: transitive description: name: html - sha256: "3a7812d5bcd2894edf53dfaf8cd640876cf6cef50a8f238745c8b8120ea74d3a" + sha256: "1fc58edeaec4307368c60d59b7e15b9d658b57d7f3125098b6294153c75337ec" url: "https://pub.dev" source: hosted - version: "0.15.4" + version: "0.15.5" html_unescape: dependency: transitive description: @@ -744,26 +744,26 @@ packages: dependency: transitive description: name: http_multi_server - sha256: "97486f20f9c2f7be8f514851703d0119c3596d14ea63227af6f7a481ef2b2f8b" + sha256: aa6199f908078bb1c5efb8d8638d4ae191aac11b311132c3ef48ce352fb52ef8 url: "https://pub.dev" source: hosted - version: "3.2.1" + version: "3.2.2" http_parser: dependency: transitive description: name: http_parser - sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + sha256: "76d306a1c3afb33fe82e2bbacad62a61f409b5634c915fceb0d799de1a913360" url: "https://pub.dev" source: hosted - version: "4.0.2" + version: "4.1.1" image: dependency: transitive description: name: image - sha256: "2237616a36c0d69aef7549ab439b833fb7f9fb9fc861af2cc9ac3eedddd69ca8" + sha256: f31d52537dc417fdcde36088fdf11d191026fd5e4fae742491ebd40e5a8bea7d url: "https://pub.dev" source: hosted - version: "4.2.0" + version: "4.3.0" integration_test: dependency: "direct dev" description: flutter @@ -781,10 +781,10 @@ packages: dependency: transitive description: name: io - sha256: "2ec25704aba361659e10e3e5f5d672068d332fc8ac516421d483a11e5cbd061e" + sha256: dfd5a80599cf0165756e3181807ed3e77daf6dd4137caaad72d0b7931597650b url: "https://pub.dev" source: hosted - version: "1.0.4" + version: "1.0.5" jinja: dependency: "direct main" description: @@ -820,10 +820,10 @@ packages: dependency: "direct dev" description: name: json_serializable - sha256: ea1432d167339ea9b5bb153f0571d0039607a873d6e04e0117af043f14a1fd4b + sha256: c2fcb3920cf2b6ae6845954186420fca40bc0a8abcc84903b7801f17d7050d7c url: "https://pub.dev" source: hosted - version: "6.8.0" + version: "6.9.0" json_text_field: dependency: "direct main" description: @@ -836,10 +836,10 @@ packages: dependency: "direct main" description: name: just_audio - sha256: d8e8aaf417d33e345299c17f6457f72bd4ba0c549dc34607abb5183a354edc4d + sha256: a49e7120b95600bd357f37a2bb04cd1e88252f7cdea8f3368803779b925b1049 url: "https://pub.dev" source: hosted - version: "0.9.40" + version: "0.9.42" just_audio_mpv: dependency: "direct main" description: @@ -860,18 +860,18 @@ packages: dependency: transitive description: name: just_audio_web - sha256: "0edb481ad4aa1ff38f8c40f1a3576013c3420bf6669b686fe661627d49bc606c" + sha256: "9a98035b8b24b40749507687520ec5ab404e291d2b0937823ff45d92cb18d448" url: "https://pub.dev" source: hosted - version: "0.4.11" + version: "0.4.13" just_audio_windows: dependency: "direct main" description: name: just_audio_windows - sha256: "48ab2dec79cf6097550602fe07b1a644f341450e138dc8fdc23e42ce0ed2d928" + sha256: b1ba5305d841c0e3883644e20fc11aaa23f28cfdd43ec20236d1e119a402ef29 url: "https://pub.dev" source: hosted - version: "0.2.1" + version: "0.2.2" leak_tracker: dependency: transitive description: @@ -908,18 +908,18 @@ packages: dependency: transitive description: name: logging - sha256: "623a88c9594aa774443aa3eb2d41807a48486b5613e67599fb4c41c0ad47c340" + sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61 url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.3.0" lottie: dependency: "direct main" description: name: lottie - sha256: "6a24ade5d3d918c306bb1c21a6b9a04aab0489d51a2582522eea820b4093b62b" + sha256: fa39707f36786707b01eca7626d2c16c32aa603b3f3a146518518458847dc127 url: "https://pub.dev" source: hosted - version: "3.1.2" + version: "3.2.0" macros: dependency: transitive description: @@ -972,10 +972,10 @@ packages: dependency: transitive description: name: mime - sha256: "2e123074287cc9fd6c09de8336dae606d1ddb88d9ac47358826db698c176a1f2" + sha256: "41a20518f0cb1256669420fdba0cd90d21561e560ac240f26ef8322e45bb7ed6" url: "https://pub.dev" source: hosted - version: "1.0.5" + version: "2.0.0" mime_dart: dependency: "direct main" description: @@ -996,10 +996,10 @@ packages: dependency: "direct main" description: name: multi_split_view - sha256: "30548c5e4cc6f24d5d4ca784dc5dff80d599ef1f704b1565819eb88a74f0eb62" + sha256: "99c02f128e7423818d13b8f2e01e3027e953b35508019dcee214791bd0525db5" url: "https://pub.dev" source: hosted - version: "3.5.0" + version: "3.6.0" multi_trigger_autocomplete: dependency: "direct main" description: @@ -1045,26 +1045,26 @@ packages: dependency: transitive description: name: package_config - sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd" + sha256: "92d4488434b520a62570293fbd33bb556c7d49230791c1b4bbd973baf6d2dc67" url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" package_info_plus: dependency: "direct main" description: name: package_info_plus - sha256: a75164ade98cb7d24cfd0a13c6408927c6b217fa60dee5a7ff5c116a58f28918 + sha256: "70c421fe9d9cc1a9a7f3b05ae56befd469fe4f8daa3b484823141a55442d858d" url: "https://pub.dev" source: hosted - version: "8.0.2" + version: "8.1.2" package_info_plus_platform_interface: dependency: transitive description: name: package_info_plus_platform_interface - sha256: ac1f4a4847f1ade8e6a87d1f39f5d7c67490738642e2542f559ec38c37489a66 + sha256: a5ef9986efc7bf772f2696183a3992615baa76c1ffb1189318dd8803778fb05b url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.0.2" path: dependency: "direct main" description: @@ -1077,34 +1077,34 @@ packages: dependency: transitive description: name: path_parsing - sha256: e3e67b1629e6f7e8100b367d3db6ba6af4b1f0bb80f64db18ef1fbabd2fa9ccf + sha256: "883402936929eac138ee0a45da5b0f2c80f89913e6dc3bf77eb65b84b409c6ca" url: "https://pub.dev" source: hosted - version: "1.0.1" + version: "1.1.0" path_provider: dependency: "direct main" description: name: path_provider - sha256: fec0d61223fba3154d87759e3cc27fe2c8dc498f6386c6d6fc80d1afdd1bf378 + sha256: "50c5dd5b6e1aaf6fb3a78b33f6aa3afca52bf903a8a5298f53101fdaee55bbcd" url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.1.5" path_provider_android: dependency: transitive description: name: path_provider_android - sha256: "490539678396d4c3c0b06efdaab75ae60675c3e0c66f72bc04c2e2c1e0e2abeb" + sha256: "4adf4fd5423ec60a29506c76581bc05854c55e3a0b72d35bb28d661c9686edf2" url: "https://pub.dev" source: hosted - version: "2.2.9" + version: "2.2.15" path_provider_foundation: dependency: transitive description: name: path_provider_foundation - sha256: f234384a3fdd67f989b4d54a5d73ca2a6c422fa55ae694381ae0f4375cd1ea16 + sha256: "4843174df4d288f5e29185bd6e72a6fbdf5a4a4602717eed565497429f179942" url: "https://pub.dev" source: hosted - version: "2.4.0" + version: "2.4.1" path_provider_linux: dependency: transitive description: @@ -1133,10 +1133,10 @@ packages: dependency: transitive description: name: pdf - sha256: "81d5522bddc1ef5c28e8f0ee40b71708761753c163e0c93a40df56fd515ea0f0" + sha256: "05df53f8791587402493ac97b9869d3824eccbc77d97855f4545cf72df3cae07" url: "https://pub.dev" source: hosted - version: "3.11.0" + version: "3.11.1" pdf_widget_wrapper: dependency: "direct overridden" description: @@ -1209,14 +1209,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.5.1" - printing: - dependency: "direct main" - description: - name: printing - sha256: b535d177fc6e8f8908e19b0ff5c1d4a87e3c4d0bf675e05aa2562af1b7853906 - url: "https://pub.dev" - source: hosted - version: "5.13.4" process: dependency: transitive description: @@ -1245,10 +1237,10 @@ packages: dependency: transitive description: name: pub_semver - sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c" + sha256: "7b3cfbf654f3edd0c6298ecd5be782ce997ddf0e00531b9464b55245185bbbbd" url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.1.5" pub_updater: dependency: transitive description: @@ -1293,10 +1285,10 @@ packages: dependency: "direct main" description: name: riverpod - sha256: f21b32ffd26a36555e501b04f4a5dca43ed59e16343f1a30c13632b2351dfa4d + sha256: "59062512288d3056b2321804332a13ffdd1bf16df70dcc8e506e411280a72959" url: "https://pub.dev" source: hosted - version: "2.5.1" + version: "2.6.1" rxdart: dependency: transitive description: @@ -1309,10 +1301,42 @@ packages: dependency: transitive description: name: screen_retriever - sha256: "6ee02c8a1158e6dae7ca430da79436e3b1c9563c8cf02f524af997c201ac2b90" + sha256: "570dbc8e4f70bac451e0efc9c9bb19fa2d6799a11e6ef04f946d7886d2e23d0c" url: "https://pub.dev" source: hosted - version: "0.1.9" + version: "0.2.0" + screen_retriever_linux: + dependency: transitive + description: + name: screen_retriever_linux + sha256: f7f8120c92ef0784e58491ab664d01efda79a922b025ff286e29aa123ea3dd18 + url: "https://pub.dev" + source: hosted + version: "0.2.0" + screen_retriever_macos: + dependency: transitive + description: + name: screen_retriever_macos + sha256: "71f956e65c97315dd661d71f828708bd97b6d358e776f1a30d5aa7d22d78a149" + url: "https://pub.dev" + source: hosted + version: "0.2.0" + screen_retriever_platform_interface: + dependency: transitive + description: + name: screen_retriever_platform_interface + sha256: ee197f4581ff0d5608587819af40490748e1e39e648d7680ecf95c05197240c0 + url: "https://pub.dev" + source: hosted + version: "0.2.0" + screen_retriever_windows: + dependency: transitive + description: + name: screen_retriever_windows + sha256: "449ee257f03ca98a57288ee526a301a430a344a161f9202b4fcc38576716fe13" + url: "https://pub.dev" + source: hosted + version: "0.2.0" scrollable_positioned_list: dependency: "direct main" description: @@ -1333,26 +1357,26 @@ packages: dependency: "direct main" description: name: shared_preferences - sha256: "746e5369a43170c25816cc472ee016d3a66bc13fcf430c0bc41ad7b4b2922051" + sha256: "3c7e73920c694a436afaf65ab60ce3453d91f84208d761fbd83fc21182134d93" url: "https://pub.dev" source: hosted - version: "2.3.2" + version: "2.3.4" shared_preferences_android: dependency: transitive description: name: shared_preferences_android - sha256: "480ba4345773f56acda9abf5f50bd966f581dac5d514e5fc4a18c62976bbba7e" + sha256: "02a7d8a9ef346c9af715811b01fbd8e27845ad2c41148eefd31321471b41863d" url: "https://pub.dev" source: hosted - version: "2.3.2" + version: "2.4.0" shared_preferences_foundation: dependency: transitive description: name: shared_preferences_foundation - sha256: c4b35f6cb8f63c147312c054ce7c2254c8066745125264f0c88739c417fc9d9f + sha256: "6a52cfcdaeac77cad8c97b539ff688ccfc458c007b4db12be584fbe5c0e49e03" url: "https://pub.dev" source: hosted - version: "2.5.2" + version: "2.5.4" shared_preferences_linux: dependency: transitive description: @@ -1389,10 +1413,10 @@ packages: dependency: transitive description: name: shelf - sha256: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4 + sha256: e7dd780a7ffb623c57850b33f43309312fc863fb6aa3d276a754bb299839ef12 url: "https://pub.dev" source: hosted - version: "1.4.1" + version: "1.4.2" shelf_packages_handler: dependency: transitive description: @@ -1405,18 +1429,18 @@ packages: dependency: transitive description: name: shelf_static - sha256: a41d3f53c4adf0f57480578c1d61d90342cd617de7fc8077b1304643c2d85c1e + sha256: c87c3875f91262785dade62d135760c2c69cb217ac759485334c5857ad89f6e3 url: "https://pub.dev" source: hosted - version: "1.1.2" + version: "1.1.3" shelf_web_socket: dependency: transitive description: name: shelf_web_socket - sha256: "9ca081be41c60190ebcb4766b2486a7d50261db7bd0f5d9615f2d653637a84c1" + sha256: cc36c297b52866d203dbf9332263c94becc2fe0ceaa9681d07b6ef9807023b67 url: "https://pub.dev" source: hosted - version: "1.0.4" + version: "2.0.1" shlex: dependency: transitive description: @@ -1442,26 +1466,26 @@ packages: dependency: transitive description: name: source_helper - sha256: "6adebc0006c37dd63fe05bca0a929b99f06402fc95aa35bf36d67f5c06de01fd" + sha256: "86d247119aedce8e63f4751bd9626fc9613255935558447569ad42f9f5b48b3c" url: "https://pub.dev" source: hosted - version: "1.3.4" + version: "1.3.5" source_map_stack_trace: dependency: transitive description: name: source_map_stack_trace - sha256: "84cf769ad83aa6bb61e0aa5a18e53aea683395f196a6f39c4c881fb90ed4f7ae" + sha256: c0713a43e323c3302c2abe2a1cc89aa057a387101ebd280371d6a6c9fa68516b url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" source_maps: dependency: transitive description: name: source_maps - sha256: "708b3f6b97248e5781f493b765c3337db11c5d2c81c3094f10904bfa8004c703" + sha256: "190222579a448b03896e0ca6eca5998fa810fda630c1d65e2f78b3f638f54812" url: "https://pub.dev" source: hosted - version: "0.10.12" + version: "0.10.13" source_span: dependency: transitive description: @@ -1514,10 +1538,10 @@ packages: dependency: transitive description: name: stream_transform - sha256: "14a00e794c7c11aa145a170587321aedce29769c08d7f58b1d141da75e3b1c6f" + sha256: ad47125e588cfd37a9a7f86c7d6356dde8dfe89d071d293f80ca9e9273a33871 url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" string_scanner: dependency: transitive description: @@ -1578,26 +1602,26 @@ packages: dependency: transitive description: name: time - sha256: ad8e018a6c9db36cb917a031853a1aae49467a93e0d464683e029537d848c221 + sha256: "370572cf5d1e58adcb3e354c47515da3f7469dac3a95b447117e728e7be6f461" url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.1.5" timing: dependency: transitive description: name: timing - sha256: "70a3b636575d4163c477e6de42f247a23b315ae20e86442bebe32d3cabf61c32" + sha256: "62ee18aca144e4a9f29d212f5a4c6a053be252b895ab14b5821996cff4ed90fe" url: "https://pub.dev" source: hosted - version: "1.0.1" + version: "1.0.2" typed_data: dependency: transitive description: name: typed_data - sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c + sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 url: "https://pub.dev" source: hosted - version: "1.3.2" + version: "1.4.0" universal_io: dependency: transitive description: @@ -1618,42 +1642,42 @@ packages: dependency: "direct main" description: name: url_launcher - sha256: "21b704ce5fa560ea9f3b525b43601c678728ba46725bab9b01187b4831377ed3" + sha256: "9d06212b1362abc2f0f0d78e6f09f726608c74e3b9462e8368bb03314aa8d603" url: "https://pub.dev" source: hosted - version: "6.3.0" + version: "6.3.1" url_launcher_android: dependency: transitive description: name: url_launcher_android - sha256: "94d8ad05f44c6d4e2ffe5567ab4d741b82d62e3c8e288cc1fcea45965edf47c9" + sha256: "6fc2f56536ee873eeb867ad176ae15f304ccccc357848b351f6f0d8d4a40d193" url: "https://pub.dev" source: hosted - version: "6.3.8" + version: "6.3.14" url_launcher_ios: dependency: transitive description: name: url_launcher_ios - sha256: e43b677296fadce447e987a2f519dcf5f6d1e527dc35d01ffab4fff5b8a7063e + sha256: "16a513b6c12bb419304e72ea0ae2ab4fed569920d1c7cb850263fe3acc824626" url: "https://pub.dev" source: hosted - version: "6.3.1" + version: "6.3.2" url_launcher_linux: dependency: transitive description: name: url_launcher_linux - sha256: ab360eb661f8879369acac07b6bb3ff09d9471155357da8443fd5d3cf7363811 + sha256: "4e9ba368772369e3e08f231d2301b4ef72b9ff87c31192ef471b380ef29a4935" url: "https://pub.dev" source: hosted - version: "3.1.1" + version: "3.2.1" url_launcher_macos: dependency: transitive description: name: url_launcher_macos - sha256: "9a1a42d5d2d95400c795b2914c36fdcb525870c752569438e4ebb09a2b5d90de" + sha256: "17ba2000b847f334f16626a574c702b196723af2a289e7a93ffcb79acff855c2" url: "https://pub.dev" source: hosted - version: "3.2.0" + version: "3.2.2" url_launcher_platform_interface: dependency: transitive description: @@ -1674,42 +1698,42 @@ packages: dependency: transitive description: name: url_launcher_windows - sha256: "49c10f879746271804767cb45551ec5592cdab00ee105c06dddde1a98f73b185" + sha256: "44cf3aabcedde30f2dba119a9dea3b0f2672fbe6fa96e85536251d678216b3c4" url: "https://pub.dev" source: hosted - version: "3.1.2" + version: "3.1.3" uuid: dependency: "direct main" description: name: uuid - sha256: f33d6bb662f0e4f79dcd7ada2e6170f3b3a2530c28fc41f49a411ddedd576a77 + sha256: a5be9ef6618a7ac1e964353ef476418026db906c4facdedaa299b7a2e71690ff url: "https://pub.dev" source: hosted - version: "4.5.0" + version: "4.5.1" vector_graphics: dependency: transitive description: name: vector_graphics - sha256: "32c3c684e02f9bc0afb0ae0aa653337a2fe022e8ab064bcd7ffda27a74e288e3" + sha256: "27d5fefe86fb9aace4a9f8375b56b3c292b64d8c04510df230f849850d912cb7" url: "https://pub.dev" source: hosted - version: "1.1.11+1" + version: "1.1.15" vector_graphics_codec: dependency: transitive description: name: vector_graphics_codec - sha256: c86987475f162fadff579e7320c7ddda04cd2fdeffbe1129227a85d9ac9e03da + sha256: "2430b973a4ca3c4dbc9999b62b8c719a160100dcbae5c819bae0cacce32c9cdb" url: "https://pub.dev" source: hosted - version: "1.1.11+1" + version: "1.1.12" vector_graphics_compiler: dependency: "direct main" description: name: vector_graphics_compiler - sha256: "12faff3f73b1741a36ca7e31b292ddeb629af819ca9efe9953b70bd63fc8cd81" + sha256: "1b4b9e706a10294258727674a340ae0d6e64a7231980f9f9a3d12e4b42407aad" url: "https://pub.dev" source: hosted - version: "1.1.11+1" + version: "1.1.16" vector_math: dependency: transitive description: @@ -1722,42 +1746,42 @@ packages: dependency: "direct main" description: name: video_player - sha256: e30df0d226c4ef82e2c150ebf6834b3522cf3f654d8e2f9419d376cdc071425d + sha256: "4a8c3492d734f7c39c2588a3206707a05ee80cef52e8c7f3b2078d430c84bc17" url: "https://pub.dev" source: hosted - version: "2.9.1" + version: "2.9.2" video_player_android: dependency: transitive description: name: video_player_android - sha256: "4de50df9ee786f5891d3281e1e633d7b142ef1acf47392592eb91cba5d355849" + sha256: "391e092ba4abe2f93b3e625bd6b6a6ec7d7414279462c1c0ee42b5ab8d0a0898" url: "https://pub.dev" source: hosted - version: "2.6.0" + version: "2.7.16" video_player_avfoundation: dependency: transitive description: name: video_player_avfoundation - sha256: d1e9a824f2b324000dc8fb2dcb2a3285b6c1c7c487521c63306cc5b394f68a7c + sha256: "33224c19775fd244be2d6e3dbd8e1826ab162877bd61123bf71890772119a2b7" url: "https://pub.dev" source: hosted - version: "2.6.1" + version: "2.6.5" video_player_platform_interface: dependency: "direct main" description: name: video_player_platform_interface - sha256: "236454725fafcacf98f0f39af0d7c7ab2ce84762e3b63f2cbb3ef9a7e0550bc6" + sha256: "229d7642ccd9f3dc4aba169609dd6b5f3f443bb4cc15b82f7785fcada5af9bbb" url: "https://pub.dev" source: hosted - version: "6.2.2" + version: "6.2.3" video_player_web: dependency: transitive description: name: video_player_web - sha256: "6dcdd298136523eaf7dfc31abaf0dfba9aa8a8dbc96670e87e9d42b6f2caf774" + sha256: "881b375a934d8ebf868c7fb1423b2bfaa393a0a265fa3f733079a86536064a10" url: "https://pub.dev" source: hosted - version: "2.3.2" + version: "2.3.3" vm_service: dependency: transitive description: @@ -1770,10 +1794,10 @@ packages: dependency: transitive description: name: watcher - sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8" + sha256: "69da27e49efa56a15f8afe8f4438c4ec02eff0a117df1b22ea4aad194fe1c104" url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.1.1" web: dependency: "direct overridden" description: @@ -1782,14 +1806,22 @@ packages: url: "https://pub.dev" source: hosted version: "0.5.1" + web_socket: + dependency: transitive + description: + name: web_socket + sha256: "3c12d96c0c9a4eec095246debcea7b86c0324f22df69893d538fcc6f1b8cce83" + url: "https://pub.dev" + source: hosted + version: "0.1.6" web_socket_channel: dependency: transitive description: name: web_socket_channel - sha256: "58c6666b342a38816b2e7e50ed0f1e261959630becd4c879c4f26bfa14aa5a42" + sha256: "9f187088ed104edd8662ca07af4b124465893caf063ba29758f97af57e61da8f" url: "https://pub.dev" source: hosted - version: "2.4.5" + version: "3.0.1" webdriver: dependency: transitive description: @@ -1810,18 +1842,18 @@ packages: dependency: transitive description: name: win32 - sha256: "015002c060f1ae9f41a818f2d5640389cc05283e368be19dc8d77cecb43c40c9" + sha256: "8b338d4486ab3fbc0ba0db9f9b4f5239b6697fcee427939a40e720cbb9ee0a69" url: "https://pub.dev" source: hosted - version: "5.5.3" + version: "5.9.0" window_manager: dependency: "direct main" description: name: window_manager - sha256: ab8b2a7f97543d3db2b506c9d875e637149d48ee0c6a5cb5f5fd6e0dac463792 + sha256: "732896e1416297c63c9e3fb95aea72d0355f61390263982a47fd519169dc5059" url: "https://pub.dev" source: hosted - version: "0.4.2" + version: "0.4.3" window_size: dependency: "direct main" description: @@ -1835,10 +1867,10 @@ packages: dependency: transitive description: name: xdg_directories - sha256: faea9dee56b520b55a566385b84f2e8de55e7496104adada9962e0bd11bcff1d + sha256: "7a3f37b05d989967cdddcbb571f1ea834867ae2faa29725fd085180e0883aa15" url: "https://pub.dev" source: hosted - version: "1.0.4" + version: "1.1.0" xml: dependency: transitive description: @@ -1864,5 +1896,5 @@ packages: source: hosted version: "2.2.1" sdks: - dart: ">=3.5.3 <3.999.0" + dart: ">=3.6.0 <3.999.0" flutter: ">=3.24.2" diff --git a/pubspec.yaml b/pubspec.yaml index 9e2b7b8e..8cf93847 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -54,7 +54,7 @@ dependencies: package_info_plus: ^8.0.2 path: ^1.8.3 path_provider: ^2.1.2 - printing: ^5.13.4 + # printing: ^5.13.4 provider: ^6.1.2 riverpod: ^2.5.1 scrollable_positioned_list: ^0.3.8 From 79ce7d3811c16528cb64081e67b21f4663eeb825 Mon Sep 17 00:00:00 2001 From: Clasherzz Date: Fri, 20 Dec 2024 19:14:19 +0530 Subject: [PATCH 06/14] disabled ssl bypass for web --- lib/consts.dart | 1 + lib/screens/settings_page.dart | 23 +++++++------ lib/widgets/previewer.dart | 32 +++++++++---------- .../lib/services/http_client_manager.dart | 4 ++- 4 files changed, 33 insertions(+), 27 deletions(-) diff --git a/lib/consts.dart b/lib/consts.dart index 3162cea6..ff9c3c6f 100644 --- a/lib/consts.dart +++ b/lib/consts.dart @@ -14,6 +14,7 @@ const kAssetSendingLottie = "assets/sending.json"; const kAssetSavingLottie = "assets/saving.json"; const kAssetSavedLottie = "assets/completed.json"; +final kIsBrowser = kIsWeb; final kIsMacOS = !kIsWeb && Platform.isMacOS; final kIsWindows = !kIsWeb && Platform.isWindows; final kIsLinux = !kIsWeb && Platform.isLinux; diff --git a/lib/screens/settings_page.dart b/lib/screens/settings_page.dart index 043f891b..9ce22387 100644 --- a/lib/screens/settings_page.dart +++ b/lib/screens/settings_page.dart @@ -39,16 +39,19 @@ class SettingsPage extends ConsumerWidget { child: ListView( shrinkWrap: true, children: [ - SwitchListTile( - hoverColor: kColorTransparent, - title: const Text('Disabling SSL verification'), - subtitle: Text( - 'Current selection: ${settings.isSSLDisabled ? "SSL Verification Disabled" : "SSL Verification Enabled"}'), - value: settings.isSSLDisabled, - onChanged: (bool? value) { - ref.read(settingsProvider.notifier).update(isSSLDisabled: value); - }, - ), + + !kIsBrowser ?SwitchListTile( + hoverColor: kColorTransparent, + title: const Text('Disabling SSL verification'), + subtitle: Text( + 'Current selection: ${settings.isSSLDisabled ? "SSL Verification Disabled" : "SSL Verification Enabled"}', + ), + value: settings.isSSLDisabled, + onChanged: (bool? value) { + ref.read(settingsProvider.notifier).update(isSSLDisabled: value ?? false); + }, + ) :const SizedBox.shrink(), + SwitchListTile( hoverColor: kColorTransparent, title: const Text('Switch Theme Mode'), diff --git a/lib/widgets/previewer.dart b/lib/widgets/previewer.dart index bec10ba8..36b9ce62 100644 --- a/lib/widgets/previewer.dart +++ b/lib/widgets/previewer.dart @@ -3,7 +3,7 @@ import 'package:apidash_core/apidash_core.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:jinja/jinja.dart' as jj; -//import 'package:printing/printing.dart'; +import 'package:printing/printing.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:vector_graphics_compiler/vector_graphics_compiler.dart'; import 'error_message.dart'; @@ -79,21 +79,21 @@ class _PreviewerState extends State { }, ); } - // if (widget.type == kTypeApplication && widget.subtype == kSubTypePdf) { - // return PdfPreview( - // build: (_) => widget.bytes, - // useActions: false, - // onError: (context, error) { - // return ErrorMessage( - // message: errorTemplate.render({ - // "showRaw": false, - // "showContentType": false, - // "type": kSubTypePdf, - // }), - // ); - // }, - // ); - // } + if (widget.type == kTypeApplication && widget.subtype == kSubTypePdf) { + return PdfPreview( + build: (_) => widget.bytes, + useActions: false, + onError: (context, error) { + return ErrorMessage( + message: errorTemplate.render({ + "showRaw": false, + "showContentType": false, + "type": kSubTypePdf, + }), + ); + }, + ); + } if (widget.type == kTypeAudio) { return Uint8AudioPlayer( bytes: widget.bytes, diff --git a/packages/apidash_core/lib/services/http_client_manager.dart b/packages/apidash_core/lib/services/http_client_manager.dart index 6761895d..e16d503b 100644 --- a/packages/apidash_core/lib/services/http_client_manager.dart +++ b/packages/apidash_core/lib/services/http_client_manager.dart @@ -1,6 +1,8 @@ import 'package:apidash_core/utils/http_request_utils.dart'; +import 'package:flutter/foundation.dart'; import 'package:http/http.dart' as http; import 'dart:collection'; +import ''; class HttpClientManager { static final HttpClientManager _instance = HttpClientManager._internal(); @@ -15,7 +17,7 @@ class HttpClientManager { HttpClientManager._internal(); http.Client createClient(String requestId,{bool noSSL = false}) { - final client = noSSL ? createHttpClientWithNoSSL() :http.Client(); + final client = noSSL && !kIsWeb ? createHttpClientWithNoSSL() :http.Client(); _clients[requestId] = client; return client; } From cf96992267c7889a2392180196ab9de658c3ac4b Mon Sep 17 00:00:00 2001 From: Clasherzz Date: Fri, 20 Dec 2024 19:20:11 +0530 Subject: [PATCH 07/14] small mistake --- pubspec.lock | 8 ++++++++ pubspec.yaml | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/pubspec.lock b/pubspec.lock index b2ab0baf..4b894b90 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1209,6 +1209,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.5.1" + printing: + dependency: "direct main" + description: + name: printing + sha256: b535d177fc6e8f8908e19b0ff5c1d4a87e3c4d0bf675e05aa2562af1b7853906 + url: "https://pub.dev" + source: hosted + version: "5.13.4" process: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 8cf93847..9e2b7b8e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -54,7 +54,7 @@ dependencies: package_info_plus: ^8.0.2 path: ^1.8.3 path_provider: ^2.1.2 - # printing: ^5.13.4 + printing: ^5.13.4 provider: ^6.1.2 riverpod: ^2.5.1 scrollable_positioned_list: ^0.3.8 From 8fbf8908f56f4bc7c496a412e01c9bcdccc67c89 Mon Sep 17 00:00:00 2001 From: Clasherzz Date: Fri, 20 Dec 2024 21:43:50 +0530 Subject: [PATCH 08/14] removed redundacy --- lib/consts.dart | 2 +- lib/screens/settings_page.dart | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/consts.dart b/lib/consts.dart index ff9c3c6f..e5a77d18 100644 --- a/lib/consts.dart +++ b/lib/consts.dart @@ -14,7 +14,7 @@ const kAssetSendingLottie = "assets/sending.json"; const kAssetSavingLottie = "assets/saving.json"; const kAssetSavedLottie = "assets/completed.json"; -final kIsBrowser = kIsWeb; + final kIsMacOS = !kIsWeb && Platform.isMacOS; final kIsWindows = !kIsWeb && Platform.isWindows; final kIsLinux = !kIsWeb && Platform.isLinux; diff --git a/lib/screens/settings_page.dart b/lib/screens/settings_page.dart index 9ce22387..1c6c2eb8 100644 --- a/lib/screens/settings_page.dart +++ b/lib/screens/settings_page.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:apidash_design_system/apidash_design_system.dart'; +import 'package:flutter/foundation.dart'; import '../providers/providers.dart'; import '../services/services.dart'; import '../utils/utils.dart'; @@ -40,7 +41,7 @@ class SettingsPage extends ConsumerWidget { shrinkWrap: true, children: [ - !kIsBrowser ?SwitchListTile( + !kIsWeb ?SwitchListTile( hoverColor: kColorTransparent, title: const Text('Disabling SSL verification'), subtitle: Text( From 1df49bd727f379cc0ed41d96a2e89dd2fef0a952 Mon Sep 17 00:00:00 2001 From: Ashita Prasad Date: Sat, 21 Dec 2024 10:19:34 +0530 Subject: [PATCH 09/14] Refactor --- lib/consts.dart | 1 - lib/providers/collection_providers.dart | 5 ++-- lib/screens/settings_page.dart | 26 ++++++++++--------- .../lib/services/http_client_manager.dart | 23 +++++++++++----- .../lib/services/http_service.dart | 4 +-- .../apidash_core/lib/services/services.dart | 1 - .../lib/utils/http_request_utils.dart | 12 --------- 7 files changed, 34 insertions(+), 38 deletions(-) diff --git a/lib/consts.dart b/lib/consts.dart index e5a77d18..3162cea6 100644 --- a/lib/consts.dart +++ b/lib/consts.dart @@ -14,7 +14,6 @@ const kAssetSendingLottie = "assets/sending.json"; const kAssetSavingLottie = "assets/saving.json"; const kAssetSavedLottie = "assets/completed.json"; - final kIsMacOS = !kIsWeb && Platform.isMacOS; final kIsWindows = !kIsWeb && Platform.isWindows; final kIsLinux = !kIsWeb && Platform.isLinux; diff --git a/lib/providers/collection_providers.dart b/lib/providers/collection_providers.dart index 4c731ee3..ee20f99f 100644 --- a/lib/providers/collection_providers.dart +++ b/lib/providers/collection_providers.dart @@ -1,5 +1,4 @@ import 'package:apidash_core/apidash_core.dart'; -//import 'package:apidash_core/services/no_ssl_http_service.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:apidash/consts.dart'; import 'providers.dart'; @@ -276,11 +275,11 @@ class CollectionStateNotifier state = map; bool noSSL = ref.read(settingsProvider).isSSLDisabled; - (HttpResponse?, Duration?, String?)? responseRec = await request( + (HttpResponse?, Duration?, String?)? responseRec = await request( requestId, substitutedHttpRequestModel, defaultUriScheme: defaultUriScheme, - noSSL: noSSL + noSSL: noSSL, ); late final RequestModel newRequestModel; diff --git a/lib/screens/settings_page.dart b/lib/screens/settings_page.dart index 1c6c2eb8..279d6f69 100644 --- a/lib/screens/settings_page.dart +++ b/lib/screens/settings_page.dart @@ -1,7 +1,7 @@ +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:apidash_design_system/apidash_design_system.dart'; -import 'package:flutter/foundation.dart'; import '../providers/providers.dart'; import '../services/services.dart'; import '../utils/utils.dart'; @@ -25,9 +25,9 @@ class SettingsPage extends ConsumerWidget { child: kIsDesktop ? Text("Settings", style: Theme.of(context).textTheme.headlineLarge) - : const SizedBox.shrink(), + : kSizedBoxEmpty, ) - : const SizedBox.shrink(), + : kSizedBoxEmpty, kIsDesktop ? const Padding( padding: kPh20, @@ -35,24 +35,26 @@ class SettingsPage extends ConsumerWidget { height: 1, ), ) - : const SizedBox.shrink(), + : kSizedBoxEmpty, Expanded( child: ListView( shrinkWrap: true, children: [ - - !kIsWeb ?SwitchListTile( + !kIsWeb + ? SwitchListTile( hoverColor: kColorTransparent, - title: const Text('Disabling SSL verification'), + title: const Text('Disable SSL verification'), subtitle: Text( - 'Current selection: ${settings.isSSLDisabled ? "SSL Verification Disabled" : "SSL Verification Enabled"}', - ), + 'Current selection: ${settings.isSSLDisabled ? "SSL Verification Disabled" : "SSL Verification Enabled"}', + ), value: settings.isSSLDisabled, onChanged: (bool? value) { - ref.read(settingsProvider.notifier).update(isSSLDisabled: value ?? false); + ref + .read(settingsProvider.notifier) + .update(isSSLDisabled: value ?? false); }, - ) :const SizedBox.shrink(), - + ) + : kSizedBoxEmpty, SwitchListTile( hoverColor: kColorTransparent, title: const Text('Switch Theme Mode'), diff --git a/packages/apidash_core/lib/services/http_client_manager.dart b/packages/apidash_core/lib/services/http_client_manager.dart index e16d503b..bec23214 100644 --- a/packages/apidash_core/lib/services/http_client_manager.dart +++ b/packages/apidash_core/lib/services/http_client_manager.dart @@ -1,8 +1,15 @@ -import 'package:apidash_core/utils/http_request_utils.dart'; +import 'dart:io'; +import 'dart:collection'; import 'package:flutter/foundation.dart'; import 'package:http/http.dart' as http; -import 'dart:collection'; -import ''; +import 'package:http/io_client.dart'; + +http.Client createHttpClientWithNoSSL() { + var ioClient = HttpClient() + ..badCertificateCallback = + (X509Certificate cert, String host, int port) => true; + return IOClient(ioClient); +} class HttpClientManager { static final HttpClientManager _instance = HttpClientManager._internal(); @@ -16,14 +23,16 @@ class HttpClientManager { HttpClientManager._internal(); - http.Client createClient(String requestId,{bool noSSL = false}) { - final client = noSSL && !kIsWeb ? createHttpClientWithNoSSL() :http.Client(); + http.Client createClient( + String requestId, { + bool noSSL = false, + }) { + final client = + (noSSL && !kIsWeb) ? createHttpClientWithNoSSL() : http.Client(); _clients[requestId] = client; return client; } - - void cancelRequest(String? requestId) { if (requestId != null && _clients.containsKey(requestId)) { _clients[requestId]?.close(); diff --git a/packages/apidash_core/lib/services/http_service.dart b/packages/apidash_core/lib/services/http_service.dart index 27d3729d..2fb6aa7a 100644 --- a/packages/apidash_core/lib/services/http_service.dart +++ b/packages/apidash_core/lib/services/http_service.dart @@ -9,11 +9,12 @@ import '../utils/utils.dart'; import 'http_client_manager.dart'; typedef HttpResponse = http.Response; + Future<(HttpResponse?, Duration?, String?)> request( String requestId, HttpRequestModel requestModel, { SupportedUriSchemes defaultUriScheme = kDefaultUriScheme, - bool noSSL = false, // Add a parameter to specify SSL-bypass + bool noSSL = false, }) async { final clientManager = HttpClientManager(); final client = clientManager.createClient(requestId, noSSL: noSSL); @@ -73,7 +74,6 @@ Future<(HttpResponse?, Duration?, String?)> request( return (convertedMultiPartResponse, stopwatch.elapsed, null); } } - switch (requestModel.method) { case HTTPVerb.get: response = await client.get(requestUrl, headers: headers); diff --git a/packages/apidash_core/lib/services/services.dart b/packages/apidash_core/lib/services/services.dart index fa82eac4..d155e9c7 100644 --- a/packages/apidash_core/lib/services/services.dart +++ b/packages/apidash_core/lib/services/services.dart @@ -1,3 +1,2 @@ export 'http_client_manager.dart'; export 'http_service.dart'; - diff --git a/packages/apidash_core/lib/utils/http_request_utils.dart b/packages/apidash_core/lib/utils/http_request_utils.dart index 7935ccc3..2e1daea5 100644 --- a/packages/apidash_core/lib/utils/http_request_utils.dart +++ b/packages/apidash_core/lib/utils/http_request_utils.dart @@ -1,18 +1,6 @@ -import 'dart:io'; - import 'package:collection/collection.dart'; -import 'package:http/http.dart' as http; -import 'package:http/io_client.dart'; import 'package:seed/seed.dart'; - -http.Client createHttpClientWithNoSSL() { - var ioClient = HttpClient() - ..badCertificateCallback = - (X509Certificate cert, String host, int port) => true; - return IOClient(ioClient); -} - Map? rowsToMap( List? kvRows, { bool isHeader = false, From 21f8e34212197173436102fcc298ee0d54325f05 Mon Sep 17 00:00:00 2001 From: Ashita Prasad Date: Sat, 21 Dec 2024 17:30:12 +0530 Subject: [PATCH 10/14] Re-arrange settings --- lib/screens/settings_page.dart | 58 +++++++++++++++++----------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/lib/screens/settings_page.dart b/lib/screens/settings_page.dart index 279d6f69..eb4b6008 100644 --- a/lib/screens/settings_page.dart +++ b/lib/screens/settings_page.dart @@ -40,21 +40,6 @@ class SettingsPage extends ConsumerWidget { child: ListView( shrinkWrap: true, children: [ - !kIsWeb - ? SwitchListTile( - hoverColor: kColorTransparent, - title: const Text('Disable SSL verification'), - subtitle: Text( - 'Current selection: ${settings.isSSLDisabled ? "SSL Verification Disabled" : "SSL Verification Enabled"}', - ), - value: settings.isSSLDisabled, - onChanged: (bool? value) { - ref - .read(settingsProvider.notifier) - .update(isSSLDisabled: value ?? false); - }, - ) - : kSizedBoxEmpty, SwitchListTile( hoverColor: kColorTransparent, title: const Text('Switch Theme Mode'), @@ -91,6 +76,21 @@ class SettingsPage extends ConsumerWidget { }, ), ), + !kIsWeb + ? SwitchListTile( + hoverColor: kColorTransparent, + title: const Text('Disable SSL verification'), + subtitle: Text( + 'Current selection: ${settings.isSSLDisabled ? "SSL Verification Disabled" : "SSL Verification Enabled"}', + ), + value: settings.isSSLDisabled, + onChanged: (bool? value) { + ref + .read(settingsProvider.notifier) + .update(isSSLDisabled: value ?? false); + }, + ) + : kSizedBoxEmpty, ListTile( hoverColor: kColorTransparent, title: const Text('Default Code Generator'), @@ -125,6 +125,20 @@ class SettingsPage extends ConsumerWidget { .update(promptBeforeClosing: value); }, ), + ListTile( + hoverColor: kColorTransparent, + title: const Text('History Retention Period'), + subtitle: Text( + 'Your request history will be retained${settings.historyRetentionPeriod == HistoryRetentionPeriod.forever ? "" : " for"} ${settings.historyRetentionPeriod.label}'), + trailing: HistoryRetentionPopupMenu( + value: settings.historyRetentionPeriod, + onChanged: (value) { + ref + .read(settingsProvider.notifier) + .update(historyRetentionPeriod: value); + }, + ), + ), ListTile( hoverColor: kColorTransparent, title: const Text('Export Data'), @@ -144,20 +158,6 @@ class SettingsPage extends ConsumerWidget { ), ), ), - ListTile( - hoverColor: kColorTransparent, - title: const Text('History Retention Period'), - subtitle: Text( - 'Your request history will be retained${settings.historyRetentionPeriod == HistoryRetentionPeriod.forever ? "" : " for"} ${settings.historyRetentionPeriod.label}'), - trailing: HistoryRetentionPopupMenu( - value: settings.historyRetentionPeriod, - onChanged: (value) { - ref - .read(settingsProvider.notifier) - .update(historyRetentionPeriod: value); - }, - ), - ), ListTile( hoverColor: kColorTransparent, title: const Text('Clear Data'), From 4ba44b728f2d67a5286619e4f6dbec8dcba72d71 Mon Sep 17 00:00:00 2001 From: Ashita Prasad Date: Sat, 21 Dec 2024 17:37:21 +0530 Subject: [PATCH 11/14] refactor --- lib/models/settings_model.dart | 22 +++++++++++----------- lib/providers/settings_providers.dart | 4 ++-- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/models/settings_model.dart b/lib/models/settings_model.dart index 1a227cd0..74bc2ff9 100644 --- a/lib/models/settings_model.dart +++ b/lib/models/settings_model.dart @@ -6,7 +6,6 @@ import 'package:apidash/consts.dart'; class SettingsModel { const SettingsModel({ this.isDark = false, - this.isSSLDisabled =false, this.alwaysShowCollectionPaneScrollbar = true, this.size, this.offset, @@ -17,10 +16,10 @@ class SettingsModel { this.activeEnvironmentId, this.historyRetentionPeriod = HistoryRetentionPeriod.oneWeek, this.workspaceFolderPath, + this.isSSLDisabled = false, }); final bool isDark; - final bool isSSLDisabled; final bool alwaysShowCollectionPaneScrollbar; final Size? size; final Offset? offset; @@ -31,10 +30,10 @@ class SettingsModel { final String? activeEnvironmentId; final HistoryRetentionPeriod historyRetentionPeriod; final String? workspaceFolderPath; + final bool isSSLDisabled; SettingsModel copyWith({ bool? isDark, - bool? isSSLDisabled, bool? alwaysShowCollectionPaneScrollbar, Size? size, Offset? offset, @@ -45,10 +44,10 @@ class SettingsModel { String? activeEnvironmentId, HistoryRetentionPeriod? historyRetentionPeriod, String? workspaceFolderPath, + bool? isSSLDisabled, }) { return SettingsModel( isDark: isDark ?? this.isDark, - isSSLDisabled: isSSLDisabled ?? this.isSSLDisabled, alwaysShowCollectionPaneScrollbar: alwaysShowCollectionPaneScrollbar ?? this.alwaysShowCollectionPaneScrollbar, size: size ?? this.size, @@ -61,6 +60,7 @@ class SettingsModel { historyRetentionPeriod: historyRetentionPeriod ?? this.historyRetentionPeriod, workspaceFolderPath: workspaceFolderPath ?? this.workspaceFolderPath, + isSSLDisabled: isSSLDisabled ?? this.isSSLDisabled, ); } @@ -69,7 +69,6 @@ class SettingsModel { }) { return SettingsModel( isDark: isDark, - isSSLDisabled: isSSLDisabled, alwaysShowCollectionPaneScrollbar: alwaysShowCollectionPaneScrollbar, size: size, defaultUriScheme: defaultUriScheme, @@ -80,12 +79,12 @@ class SettingsModel { activeEnvironmentId: activeEnvironmentId, historyRetentionPeriod: historyRetentionPeriod, workspaceFolderPath: workspaceFolderPath, + isSSLDisabled: isSSLDisabled, ); } factory SettingsModel.fromJson(Map data) { final isDark = data["isDark"] as bool?; - final isSSLDisabled = data["isSSLDisabled"] as bool?; final alwaysShowCollectionPaneScrollbar = data["alwaysShowCollectionPaneScrollbar"] as bool?; final width = data["width"] as double?; @@ -134,12 +133,12 @@ class SettingsModel { } } final workspaceFolderPath = data["workspaceFolderPath"] as String?; + final isSSLDisabled = data["isSSLDisabled"] as bool?; const sm = SettingsModel(); return sm.copyWith( isDark: isDark, - isSSLDisabled: isSSLDisabled, alwaysShowCollectionPaneScrollbar: alwaysShowCollectionPaneScrollbar, size: size, offset: offset, @@ -151,13 +150,13 @@ class SettingsModel { historyRetentionPeriod: historyRetentionPeriod ?? HistoryRetentionPeriod.oneWeek, workspaceFolderPath: workspaceFolderPath, + isSSLDisabled: isSSLDisabled, ); } Map toJson() { return { "isDark": isDark, - "isSSLDisabled":isSSLDisabled, "alwaysShowCollectionPaneScrollbar": alwaysShowCollectionPaneScrollbar, "width": size?.width, "height": size?.height, @@ -170,6 +169,7 @@ class SettingsModel { "activeEnvironmentId": activeEnvironmentId, "historyRetentionPeriod": historyRetentionPeriod.name, "workspaceFolderPath": workspaceFolderPath, + "isSSLDisabled": isSSLDisabled, }; } @@ -183,7 +183,6 @@ class SettingsModel { return other is SettingsModel && other.runtimeType == runtimeType && other.isDark == isDark && - other.isSSLDisabled == isSSLDisabled && other.alwaysShowCollectionPaneScrollbar == alwaysShowCollectionPaneScrollbar && other.size == size && @@ -194,7 +193,8 @@ class SettingsModel { other.promptBeforeClosing == promptBeforeClosing && other.activeEnvironmentId == activeEnvironmentId && other.historyRetentionPeriod == historyRetentionPeriod && - other.workspaceFolderPath == workspaceFolderPath; + other.workspaceFolderPath == workspaceFolderPath && + other.isSSLDisabled == isSSLDisabled; } @override @@ -202,7 +202,6 @@ class SettingsModel { return Object.hash( runtimeType, isDark, - isSSLDisabled, alwaysShowCollectionPaneScrollbar, size, offset, @@ -213,6 +212,7 @@ class SettingsModel { activeEnvironmentId, historyRetentionPeriod, workspaceFolderPath, + isSSLDisabled, ); } } diff --git a/lib/providers/settings_providers.dart b/lib/providers/settings_providers.dart index 0fb9ab7d..6b64343a 100644 --- a/lib/providers/settings_providers.dart +++ b/lib/providers/settings_providers.dart @@ -22,7 +22,6 @@ class ThemeStateNotifier extends StateNotifier { Future update({ bool? isDark, - bool? isSSLDisabled, bool? alwaysShowCollectionPaneScrollbar, Size? size, Offset? offset, @@ -33,10 +32,10 @@ class ThemeStateNotifier extends StateNotifier { String? activeEnvironmentId, HistoryRetentionPeriod? historyRetentionPeriod, String? workspaceFolderPath, + bool? isSSLDisabled, }) async { state = state.copyWith( isDark: isDark, - isSSLDisabled: isSSLDisabled, alwaysShowCollectionPaneScrollbar: alwaysShowCollectionPaneScrollbar, size: size, offset: offset, @@ -47,6 +46,7 @@ class ThemeStateNotifier extends StateNotifier { activeEnvironmentId: activeEnvironmentId, historyRetentionPeriod: historyRetentionPeriod, workspaceFolderPath: workspaceFolderPath, + isSSLDisabled: isSSLDisabled, ); await setSettingsToSharedPrefs(state); } From 416f1cb2e23d1cf7a91d881f479591317ca8a528 Mon Sep 17 00:00:00 2001 From: Ashita Prasad Date: Sat, 21 Dec 2024 17:38:43 +0530 Subject: [PATCH 12/14] Update pubspec.lock --- pubspec.lock | 122 +++++++++++++++++++++++++-------------------------- 1 file changed, 61 insertions(+), 61 deletions(-) diff --git a/pubspec.lock b/pubspec.lock index 4b894b90..e5a34f75 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,23 +5,23 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - sha256: "16e298750b6d0af7ce8a3ba7c18c69c3785d11b15ec83f6dcd0ad2a0009b3cab" + sha256: f256b0c0ba6c7577c15e2e4e114755640a875e885099367bf6e012b19314c834 url: "https://pub.dev" source: hosted - version: "76.0.0" + version: "72.0.0" _macros: dependency: transitive description: dart source: sdk - version: "0.3.3" + version: "0.3.2" analyzer: dependency: transitive description: name: analyzer - sha256: "1f14db053a8c23e260789e9b0980fa27f2680dd640932cae5e1137cce0e46e1e" + sha256: b652861553cd3990d8ed361f7979dc6d7053a9ac8843fa73820ab68ce5410139 url: "https://pub.dev" source: hosted - version: "6.11.0" + version: "6.7.0" ansi_styles: dependency: transitive description: @@ -72,10 +72,10 @@ packages: dependency: transitive description: name: async - sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63 + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" url: "https://pub.dev" source: hosted - version: "2.12.0" + version: "2.11.0" audio_session: dependency: transitive description: @@ -104,58 +104,58 @@ packages: dependency: transitive description: name: boolean_selector - sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea" + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.1" build: dependency: transitive description: name: build - sha256: cef23f1eda9b57566c81e2133d196f8e3df48f244b317368d65c5943d91148f0 + sha256: "80184af8b6cb3e5c1c4ec6d8544d27711700bc3e6d2efad04238c7b5290889f0" url: "https://pub.dev" source: hosted - version: "2.4.2" + version: "2.4.1" build_config: dependency: transitive description: name: build_config - sha256: "4ae2de3e1e67ea270081eaee972e1bd8f027d459f249e0f1186730784c2e7e33" + sha256: bf80fcfb46a29945b423bd9aad884590fb1dc69b330a4d4700cac476af1708d1 url: "https://pub.dev" source: hosted - version: "1.1.2" + version: "1.1.1" build_daemon: dependency: transitive description: name: build_daemon - sha256: "294a2edaf4814a378725bfe6358210196f5ea37af89ecd81bfa32960113d4948" + sha256: "79b2aef6ac2ed00046867ed354c88778c9c0f029df8a20fe10b5436826721ef9" url: "https://pub.dev" source: hosted - version: "4.0.3" + version: "4.0.2" build_resolvers: dependency: transitive description: name: build_resolvers - sha256: "99d3980049739a985cf9b21f30881f46db3ebc62c5b8d5e60e27440876b1ba1e" + sha256: "339086358431fa15d7eca8b6a36e5d783728cf025e559b834f4609a1fcfb7b0a" url: "https://pub.dev" source: hosted - version: "2.4.3" + version: "2.4.2" build_runner: dependency: "direct dev" description: name: build_runner - sha256: "74691599a5bc750dc96a6b4bfd48f7d9d66453eab04c7f4063134800d6a5c573" + sha256: "028819cfb90051c6b5440c7e574d1896f8037e3c96cf17aaeb054c9311cfbf4d" url: "https://pub.dev" source: hosted - version: "2.4.14" + version: "2.4.13" build_runner_core: dependency: transitive description: name: build_runner_core - sha256: "22e3aa1c80e0ada3722fe5b63fd43d9c8990759d0a2cf489c8c5d7b2bdebc021" + sha256: f8126682b87a7282a339b871298cc12009cb67109cfa1614d6436fb0289193e0 url: "https://pub.dev" source: hosted - version: "8.0.0" + version: "7.3.2" built_collection: dependency: transitive description: @@ -224,10 +224,10 @@ packages: dependency: transitive description: name: clock - sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf url: "https://pub.dev" source: hosted - version: "1.1.2" + version: "1.1.1" code_builder: dependency: "direct main" description: @@ -240,10 +240,10 @@ packages: dependency: transitive description: name: collection - sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a url: "https://pub.dev" source: hosted - version: "1.19.0" + version: "1.18.0" conventional_commit: dependency: transitive description: @@ -375,10 +375,10 @@ packages: dependency: transitive description: name: fake_async - sha256: "6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc" + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" url: "https://pub.dev" source: hosted - version: "1.3.2" + version: "1.3.1" ffi: dependency: transitive description: @@ -391,10 +391,10 @@ packages: dependency: transitive description: name: file - sha256: a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4 + sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" url: "https://pub.dev" source: hosted - version: "7.0.1" + version: "7.0.0" file_selector: dependency: "direct main" description: @@ -752,10 +752,10 @@ packages: dependency: transitive description: name: http_parser - sha256: "76d306a1c3afb33fe82e2bbacad62a61f409b5634c915fceb0d799de1a913360" + sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" url: "https://pub.dev" source: hosted - version: "4.1.1" + version: "4.0.2" image: dependency: transitive description: @@ -876,18 +876,18 @@ packages: dependency: transitive description: name: leak_tracker - sha256: c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec + sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05" url: "https://pub.dev" source: hosted - version: "10.0.8" + version: "10.0.5" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573 + sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806" url: "https://pub.dev" source: hosted - version: "3.0.9" + version: "3.0.5" leak_tracker_testing: dependency: transitive description: @@ -924,10 +924,10 @@ packages: dependency: transitive description: name: macros - sha256: "1d9e801cd66f7ea3663c45fc708450db1fa57f988142c64289142c9b7ee80656" + sha256: "0acaed5d6b7eab89f63350bccd82119e6c602df0f391260d0e32b5e23db79536" url: "https://pub.dev" source: hosted - version: "0.1.3-main.0" + version: "0.1.2-main.4" markdown: dependency: "direct main" description: @@ -1069,10 +1069,10 @@ packages: dependency: "direct main" description: name: path - sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5" + sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.9.0" path_parsing: dependency: transitive description: @@ -1157,10 +1157,10 @@ packages: dependency: transitive description: name: platform - sha256: "5d6b1b0036a5f331ebc77c850ebc8506cbc1e9416c27e59b439f917a902a4984" + sha256: "9b71283fc13df574056616011fb138fd3b793ea47cc509c189a6c3fa5f8a1a65" url: "https://pub.dev" source: hosted - version: "3.1.6" + version: "3.1.5" plugin_platform_interface: dependency: transitive description: @@ -1221,10 +1221,10 @@ packages: dependency: transitive description: name: process - sha256: "107d8be718f120bbba9dcd1e95e3bd325b1b4a4f07db64154635ba03f2567a0d" + sha256: "21e54fd2faf1b5bdd5102afd25012184a6793927648ea81eea80552ac9405b32" url: "https://pub.dev" source: hosted - version: "5.0.3" + version: "5.0.2" prompts: dependency: transitive description: @@ -1421,10 +1421,10 @@ packages: dependency: transitive description: name: shelf - sha256: e7dd780a7ffb623c57850b33f43309312fc863fb6aa3d276a754bb299839ef12 + sha256: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4 url: "https://pub.dev" source: hosted - version: "1.4.2" + version: "1.4.1" shelf_packages_handler: dependency: transitive description: @@ -1461,7 +1461,7 @@ packages: dependency: transitive description: flutter source: sdk - version: "0.0.0" + version: "0.0.99" source_gen: dependency: transitive description: @@ -1522,10 +1522,10 @@ packages: dependency: transitive description: name: stack_trace - sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377" + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" url: "https://pub.dev" source: hosted - version: "1.12.0" + version: "1.11.1" state_notifier: dependency: transitive description: @@ -1554,10 +1554,10 @@ packages: dependency: transitive description: name: string_scanner - sha256: "0bd04f5bb74fcd6ff0606a888a30e917af9bd52820b178eaa464beb11dca84b6" + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" url: "https://pub.dev" source: hosted - version: "1.4.0" + version: "1.2.0" sync_http: dependency: transitive description: @@ -1578,26 +1578,26 @@ packages: dependency: "direct dev" description: name: test - sha256: "713a8789d62f3233c46b4a90b174737b2c04cb6ae4500f2aa8b1be8f03f5e67f" + sha256: "7ee44229615f8f642b68120165ae4c2a75fe77ae2065b1e55ae4711f6cf0899e" url: "https://pub.dev" source: hosted - version: "1.25.8" + version: "1.25.7" test_api: dependency: transitive description: name: test_api - sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c" + sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb" url: "https://pub.dev" source: hosted - version: "0.7.3" + version: "0.7.2" test_core: dependency: transitive description: name: test_core - sha256: "12391302411737c176b0b5d6491f466b0dd56d4763e347b6714efbaa74d7953d" + sha256: "55ea5a652e38a1dfb32943a7973f3681a60f872f8c3a05a14664ad54ef9c6696" url: "https://pub.dev" source: hosted - version: "0.6.5" + version: "0.6.4" textwrap: dependency: transitive description: @@ -1794,10 +1794,10 @@ packages: dependency: transitive description: name: vm_service - sha256: "0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14" + sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d" url: "https://pub.dev" source: hosted - version: "14.3.1" + version: "14.2.5" watcher: dependency: transitive description: @@ -1834,10 +1834,10 @@ packages: dependency: transitive description: name: webdriver - sha256: "3d773670966f02a646319410766d3b5e1037efb7f07cc68f844d5e06cd4d61c8" + sha256: "003d7da9519e1e5f329422b36c4dcdf18d7d2978d1ba099ea4e45ba490ed845e" url: "https://pub.dev" source: hosted - version: "3.0.4" + version: "3.0.3" webkit_inspection_protocol: dependency: transitive description: @@ -1904,5 +1904,5 @@ packages: source: hosted version: "2.2.1" sdks: - dart: ">=3.6.0 <3.999.0" + dart: ">=3.5.3 <3.999.0" flutter: ">=3.24.2" From 774f6c1ef2dfe540f35382e4217b06ad8b465c8f Mon Sep 17 00:00:00 2001 From: Ashita Prasad Date: Sat, 21 Dec 2024 17:51:18 +0530 Subject: [PATCH 13/14] modify pub --- pubspec.lock | 4 ++-- pubspec.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pubspec.lock b/pubspec.lock index e5a34f75..18f3630a 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -327,10 +327,10 @@ packages: dependency: "direct main" description: name: data_table_2 - sha256: "5a540a7b64809eb46b3809c67fc6faa29ca217864341294df66b1f0eb040c20e" + sha256: "3b4ffb66ab20f238bf5f89af37e3bedfc9bef456c1fe24a79487ec1864574c84" url: "https://pub.dev" source: hosted - version: "2.5.18" + version: "2.5.16" desktop_drop: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index 9e2b7b8e..ae8348cb 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -18,7 +18,7 @@ dependencies: csv: ^6.0.0 curl_parser: path: packages/curl_parser - data_table_2: ^2.5.15 + data_table_2: 2.5.16 dart_style: ^2.3.7 desktop_drop: ^0.4.4 extended_text_field: ^16.0.0 From bd78c536091ceb3c8af541f20f296be1d4c67df7 Mon Sep 17 00:00:00 2001 From: Ashita Prasad Date: Sat, 21 Dec 2024 17:51:33 +0530 Subject: [PATCH 14/14] Fix tests for SettingsModel --- test/models/settings_model_test.dart | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/models/settings_model_test.dart b/test/models/settings_model_test.dart index bb24de2b..1928fd0e 100644 --- a/test/models/settings_model_test.dart +++ b/test/models/settings_model_test.dart @@ -17,6 +17,7 @@ void main() { activeEnvironmentId: null, historyRetentionPeriod: HistoryRetentionPeriod.oneWeek, workspaceFolderPath: null, + isSSLDisabled: true, ); test('Testing toJson()', () { @@ -34,6 +35,7 @@ void main() { "activeEnvironmentId": null, "historyRetentionPeriod": "oneWeek", "workspaceFolderPath": null, + "isSSLDisabled": true, }; expect(sm.toJson(), expectedResult); }); @@ -53,6 +55,7 @@ void main() { "activeEnvironmentId": null, "historyRetentionPeriod": "oneWeek", "workspaceFolderPath": null, + "isSSLDisabled": true, }; expect(SettingsModel.fromJson(input), sm); }); @@ -69,11 +72,13 @@ void main() { promptBeforeClosing: true, activeEnvironmentId: null, historyRetentionPeriod: HistoryRetentionPeriod.oneWeek, + isSSLDisabled: false, ); expect( sm.copyWith( isDark: true, saveResponses: false, + isSSLDisabled: false, ), expectedResult); }); @@ -92,7 +97,8 @@ void main() { "promptBeforeClosing": true, "activeEnvironmentId": null, "historyRetentionPeriod": "oneWeek", - "workspaceFolderPath": null + "workspaceFolderPath": null, + "isSSLDisabled": true }'''; expect(sm.toString(), expectedResult); });