diff --git a/.flutter-plugins b/.flutter-plugins deleted file mode 100644 index 7043e25..0000000 --- a/.flutter-plugins +++ /dev/null @@ -1,2 +0,0 @@ -# This is a generated file; do not edit or check into version control. -connectivity_plus=/home/saif/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.3/ diff --git a/.flutter-plugins-dependencies b/.flutter-plugins-dependencies deleted file mode 100644 index 0143ae3..0000000 --- a/.flutter-plugins-dependencies +++ /dev/null @@ -1 +0,0 @@ -{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"connectivity_plus","path":"/home/saif/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.3/","native_build":true,"dependencies":[]}],"android":[{"name":"connectivity_plus","path":"/home/saif/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.3/","native_build":true,"dependencies":[]}],"macos":[{"name":"connectivity_plus","path":"/home/saif/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.3/","native_build":true,"dependencies":[]}],"linux":[{"name":"connectivity_plus","path":"/home/saif/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.3/","native_build":false,"dependencies":[]}],"windows":[{"name":"connectivity_plus","path":"/home/saif/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.3/","native_build":true,"dependencies":[]}],"web":[{"name":"connectivity_plus","path":"/home/saif/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.3/","dependencies":[]}]},"dependencyGraph":[{"name":"connectivity_plus","dependencies":[]}],"date_created":"2025-03-21 11:24:51.253806","version":"3.24.5","swift_package_manager_enabled":false} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 1fdb3eb..4f39ad5 100644 --- a/.gitignore +++ b/.gitignore @@ -27,4 +27,6 @@ **/doc/api/ .dart_tool/ .packages +.flutter-plugins +.flutter-plugins-dependencies build/ diff --git a/CHANGELOG.md b/CHANGELOG.md index 1cc2fee..6f4a92c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 2.2.0 + +- fixed missing return type lint on `JsonSerializer.addParser` flagged by pub.dev static analysis +- updated dio, built_value, connectivity_plus, get_it, and flutter_lints to latest versions +- raised minimum supported SDK to Dart 3.2 / Flutter 3.7 (required by connectivity_plus 7.x) + ## 2.1.8 - code refactoring for cleaner code diff --git a/example/android/gradle.properties b/example/android/gradle.properties index 2597170..4147ba3 100644 --- a/example/android/gradle.properties +++ b/example/android/gradle.properties @@ -1,3 +1,7 @@ org.gradle.jvmargs=-Xmx4G -XX:MaxMetaspaceSize=2G -XX:+HeapDumpOnOutOfMemoryError android.useAndroidX=true android.enableJetifier=true +# This builtInKotlin flag was added automatically by Flutter migrator +android.builtInKotlin=false +# This newDsl flag was added automatically by Flutter migrator +android.newDsl=false diff --git a/example/android/gradle/wrapper/gradle-wrapper.properties b/example/android/gradle/wrapper/gradle-wrapper.properties index 7bb2df6..6514f91 100644 --- a/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/example/android/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-all.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip diff --git a/example/android/settings.gradle b/example/android/settings.gradle index b9e43bd..b59926f 100644 --- a/example/android/settings.gradle +++ b/example/android/settings.gradle @@ -18,8 +18,8 @@ pluginManagement { plugins { id "dev.flutter.flutter-plugin-loader" version "1.0.0" - id "com.android.application" version "8.1.0" apply false - id "org.jetbrains.kotlin.android" version "1.8.22" apply false + id "com.android.application" version "8.12.1" apply false + id "org.jetbrains.kotlin.android" version "2.2.20" apply false } include ":app" diff --git a/example/ios/Flutter/AppFrameworkInfo.plist b/example/ios/Flutter/AppFrameworkInfo.plist index 7c56964..391a902 100644 --- a/example/ios/Flutter/AppFrameworkInfo.plist +++ b/example/ios/Flutter/AppFrameworkInfo.plist @@ -20,7 +20,5 @@ ???? CFBundleVersion 1.0 - MinimumOSVersion - 12.0 diff --git a/example/ios/Podfile b/example/ios/Podfile index d97f17e..e51a31d 100644 --- a/example/ios/Podfile +++ b/example/ios/Podfile @@ -1,5 +1,5 @@ # Uncomment this line to define a global platform for your project -# platform :ios, '12.0' +# platform :ios, '13.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj index fea0de2..0244fc7 100644 --- a/example/ios/Runner.xcodeproj/project.pbxproj +++ b/example/ios/Runner.xcodeproj/project.pbxproj @@ -10,6 +10,8 @@ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; + 4950CD74091C4DA2D29BCEAB /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6AD80412A1CD482A2F2DC280 /* Pods_Runner.framework */; }; + 6DFDC6629C4604F07F32C497 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2E6075B2AFB1C8D646FCAC21 /* Pods_RunnerTests.framework */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; @@ -40,11 +42,18 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 0C8C316B8E971E4455970AEC /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 282725E7DE671C3090013069 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; + 2E6075B2AFB1C8D646FCAC21 /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; 331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 378C64260721786DD6B8FE6A /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 457EBD1412467F3BFF86F412 /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = ""; }; + 6830BFF28BC7D32438EE00C1 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; + 6AD80412A1CD482A2F2DC280 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; @@ -55,13 +64,23 @@ 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 9AA10FBF19BCC46FF984ACCC /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ + 8F7A51426B7272A7A45CBECC /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 6DFDC6629C4604F07F32C497 /* Pods_RunnerTests.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 97C146EB1CF9000F007C117D /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 4950CD74091C4DA2D29BCEAB /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -94,6 +113,8 @@ 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, 331C8082294A63A400263BE5 /* RunnerTests */, + 9A8A08B55F5AE535E7DFC29C /* Pods */, + EC773E9733592F724A143D64 /* Frameworks */, ); sourceTree = ""; }; @@ -121,6 +142,29 @@ path = Runner; sourceTree = ""; }; + 9A8A08B55F5AE535E7DFC29C /* Pods */ = { + isa = PBXGroup; + children = ( + 6830BFF28BC7D32438EE00C1 /* Pods-Runner.debug.xcconfig */, + 282725E7DE671C3090013069 /* Pods-Runner.release.xcconfig */, + 0C8C316B8E971E4455970AEC /* Pods-Runner.profile.xcconfig */, + 378C64260721786DD6B8FE6A /* Pods-RunnerTests.debug.xcconfig */, + 457EBD1412467F3BFF86F412 /* Pods-RunnerTests.release.xcconfig */, + 9AA10FBF19BCC46FF984ACCC /* Pods-RunnerTests.profile.xcconfig */, + ); + name = Pods; + path = Pods; + sourceTree = ""; + }; + EC773E9733592F724A143D64 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 6AD80412A1CD482A2F2DC280 /* Pods_Runner.framework */, + 2E6075B2AFB1C8D646FCAC21 /* Pods_RunnerTests.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -128,8 +172,10 @@ isa = PBXNativeTarget; buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; buildPhases = ( + C5232AAA3965D96C3FD6523F /* [CP] Check Pods Manifest.lock */, 331C807D294A63A400263BE5 /* Sources */, 331C807F294A63A400263BE5 /* Resources */, + 8F7A51426B7272A7A45CBECC /* Frameworks */, ); buildRules = ( ); @@ -145,12 +191,14 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( + D9A09AEBAC2FEC2E40DE7544 /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + 0FC7F596FC3D1AE0A0FE5C20 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -222,6 +270,23 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ + 0FC7F596FC3D1AE0A0FE5C20 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; alwaysOutOfDate = 1; @@ -253,6 +318,50 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; }; + C5232AAA3965D96C3FD6523F /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-RunnerTests-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + D9A09AEBAC2FEC2E40DE7544 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -346,7 +455,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -379,6 +488,7 @@ }; 331C8088294A63A400263BE5 /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 378C64260721786DD6B8FE6A /* Pods-RunnerTests.debug.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; @@ -396,6 +506,7 @@ }; 331C8089294A63A400263BE5 /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 457EBD1412467F3BFF86F412 /* Pods-RunnerTests.release.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; @@ -411,6 +522,7 @@ }; 331C808A294A63A400263BE5 /* Profile */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 9AA10FBF19BCC46FF984ACCC /* Pods-RunnerTests.profile.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; @@ -473,7 +585,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -524,7 +636,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; diff --git a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 8e3ca5d..e3773d4 100644 --- a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -26,6 +26,7 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit" shouldUseLaunchSchemeArgsEnv = "YES"> diff --git a/example/ios/Runner.xcworkspace/contents.xcworkspacedata b/example/ios/Runner.xcworkspace/contents.xcworkspacedata index 1d526a1..21a3cc1 100644 --- a/example/ios/Runner.xcworkspace/contents.xcworkspacedata +++ b/example/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -4,4 +4,7 @@ + + diff --git a/example/ios/Runner/AppDelegate.swift b/example/ios/Runner/AppDelegate.swift index 6266644..c30b367 100644 --- a/example/ios/Runner/AppDelegate.swift +++ b/example/ios/Runner/AppDelegate.swift @@ -2,12 +2,15 @@ import Flutter import UIKit @main -@objc class AppDelegate: FlutterAppDelegate { +@objc class AppDelegate: FlutterAppDelegate, FlutterImplicitEngineDelegate { override func application( _ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? ) -> Bool { - GeneratedPluginRegistrant.register(with: self) return super.application(application, didFinishLaunchingWithOptions: launchOptions) } + + func didInitializeImplicitFlutterEngine(_ engineBridge: FlutterImplicitEngineBridge) { + GeneratedPluginRegistrant.register(with: engineBridge.pluginRegistry) + } } diff --git a/example/ios/Runner/Info.plist b/example/ios/Runner/Info.plist index 5458fc4..3ef4d0d 100644 --- a/example/ios/Runner/Info.plist +++ b/example/ios/Runner/Info.plist @@ -2,6 +2,8 @@ + CADisableMinimumFrameDurationOnPhone + CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleDisplayName @@ -24,6 +26,29 @@ $(FLUTTER_BUILD_NUMBER) LSRequiresIPhoneOS + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneClassName + UIWindowScene + UISceneConfigurationName + flutter + UISceneDelegateClassName + FlutterSceneDelegate + UISceneStoryboardFile + Main + + + + + UIApplicationSupportsIndirectInputEvents + UILaunchStoryboardName LaunchScreen UIMainStoryboardFile @@ -41,9 +66,5 @@ UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight - CADisableMinimumFrameDurationOnPhone - - UIApplicationSupportsIndirectInputEvents - diff --git a/example/lib/common/constants.dart b/example/lib/common/constants.dart index 4d6932d..ac30f2a 100644 --- a/example/lib/common/constants.dart +++ b/example/lib/common/constants.dart @@ -1,3 +1,3 @@ class Constants { - static get BASE_URL => "https://jsonplaceholder.typicode.com"; + static String get baseUrl => "https://jsonplaceholder.typicode.com"; } diff --git a/example/lib/core/di.dart b/example/lib/core/di.dart index 43cc0c3..dac9912 100644 --- a/example/lib/core/di.dart +++ b/example/lib/core/di.dart @@ -21,7 +21,7 @@ void setupLocator() { di.registerSingleton( Dio( BaseOptions( - baseUrl: Constants.BASE_URL, + baseUrl: Constants.baseUrl, connectTimeout: const Duration(milliseconds: 3000), receiveTimeout: const Duration(milliseconds: 3000), sendTimeout: const Duration(milliseconds: 3000), diff --git a/example/lib/core/utils/exception/error_converter.dart b/example/lib/core/utils/exception/error_converter.dart index b9cbb97..abeddb8 100644 --- a/example/lib/core/utils/exception/error_converter.dart +++ b/example/lib/core/utils/exception/error_converter.dart @@ -20,6 +20,9 @@ class DioErrorToApiErrorConverter implements NetworkErrorConverter { return BaseError(ErrorCode.sendTimeout, "Receive timeout occurred."); case DioExceptionType.sendTimeout: return BaseError(ErrorCode.sendTimeout, "Send timeout occurred."); + case DioExceptionType.transformTimeout: + return BaseError( + ErrorCode.sendTimeout, "Transform timeout occurred."); case DioExceptionType.unknown: return BaseError(ErrorCode.noInternet, "No internet connection."); case DioExceptionType.badResponse: diff --git a/example/lib/presentation/view/main_screen.dart b/example/lib/presentation/view/main_screen.dart index c9076a4..bfe5938 100644 --- a/example/lib/presentation/view/main_screen.dart +++ b/example/lib/presentation/view/main_screen.dart @@ -36,7 +36,7 @@ class _MainScreenState extends State { /// The SnackBar informs the user whether they are currently online or offline. /// It only shows the SnackBar if the widget is currently mounted in the /// widget tree. - _showSnackBar(bool isConnected) { + void _showSnackBar(bool isConnected) { if (mounted) { ScaffoldMessenger.of(context).showSnackBar( SnackBar( diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 79d5650..09b4d96 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -34,11 +34,11 @@ dependencies: # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.8 - dio: ^5.8.0+1 + dio: ^5.10.0 dartz: ^0.10.1 - flutter_bloc: ^8.1.3 - bloc: ^8.1.2 - get_it: + flutter_bloc: ^9.1.1 + bloc: ^9.2.1 + get_it: ^9.2.1 equatable: ^2.0.5 viva_network_kit: path: ../ @@ -52,7 +52,7 @@ dev_dependencies: # activated in the `analysis_options.yaml` file located at the root of your # package. See that file for information about deactivating specific lint # rules and activating additional ones. - flutter_lints: ^5.0.0 + flutter_lints: ^6.0.0 # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec diff --git a/lib/src/dio_network_call_executor.dart b/lib/src/dio_network_call_executor.dart index 6fdfb7a..96be827 100644 --- a/lib/src/dio_network_call_executor.dart +++ b/lib/src/dio_network_call_executor.dart @@ -92,9 +92,9 @@ class DioNetworkCallExecutor { options.baseUrl = dio.options.baseUrl; } - final Response _result = await dio.fetch(options); + final Response response = await dio.fetch(options); final result = - dioSerializer.convertResponse(_result); + dioSerializer.convertResponse(response); return Right(result); } on Exception catch (e) { return Left(errorConverter.convert(e)); @@ -139,14 +139,14 @@ class DioNetworkCallExecutor { errorCode: 'no_internet_connection'))); } - final Response _result = await dio.get( + final Response response = await dio.get( path, queryParameters: queryParameters, options: options, ); final result = - dioSerializer.convertResponse(_result); + dioSerializer.convertResponse(response); return Right(result); } on Exception catch (e) { return Left(errorConverter.convert(e)); @@ -190,11 +190,11 @@ class DioNetworkCallExecutor { errorCode: 'no_internet_connection'))); } - final Response _result = await dio.post(path, + final Response response = await dio.post(path, queryParameters: queryParameters, data: body, options: options); final result = - dioSerializer.convertResponse(_result); + dioSerializer.convertResponse(response); return Right(result); } on Exception catch (e) { return Left(errorConverter.convert(e)); @@ -224,11 +224,11 @@ class DioNetworkCallExecutor { errorCode: 'no_internet_connection'))); } - final Response _result = await dio.put(path, + final Response response = await dio.put(path, queryParameters: queryParameters, data: body, options: options); final result = - dioSerializer.convertResponse(_result); + dioSerializer.convertResponse(response); return Right(result); } on Exception catch (e) { return Left(errorConverter.convert(e)); @@ -274,11 +274,11 @@ class DioNetworkCallExecutor { errorCode: 'no_internet_connection'))); } - final Response _result = await dio.delete(path, + final Response response = await dio.delete(path, queryParameters: queryParameters, data: body, options: options); final result = - dioSerializer.convertResponse(_result); + dioSerializer.convertResponse(response); return Right(result); } on Exception catch (e) { return Left(errorConverter.convert(e)); @@ -308,11 +308,11 @@ class DioNetworkCallExecutor { errorCode: 'no_internet_connection'))); } - final Response _result = await dio.patch(path, + final Response response = await dio.patch(path, queryParameters: queryParameters, data: body, options: options); final result = - dioSerializer.convertResponse(_result); + dioSerializer.convertResponse(response); return Right(result); } on Exception catch (e) { return Left(errorConverter.convert(e)); diff --git a/lib/src/dio_simple_serializer.dart b/lib/src/dio_simple_serializer.dart index 201ce04..05a640e 100644 --- a/lib/src/dio_simple_serializer.dart +++ b/lib/src/dio_simple_serializer.dart @@ -9,9 +9,9 @@ abstract class Serializable { typedef JsonParser = T Function(Map); class JsonSerializer implements DioSerializer { - Map jsonParserMap = {}; + Map> jsonParserMap = {}; - addParser(JsonParser jsonParser) { + void addParser(JsonParser jsonParser) { jsonParserMap[SingleItemType] = jsonParser; } diff --git a/lib/viva_network_kit.dart b/lib/viva_network_kit.dart index fba6448..963836b 100644 --- a/lib/viva_network_kit.dart +++ b/lib/viva_network_kit.dart @@ -1,5 +1,3 @@ -library viva_network_kit; - export 'package:connectivity_plus/connectivity_plus.dart'; export 'src/connection_error.dart'; diff --git a/pubspec.yaml b/pubspec.yaml index fc1bd1a..458a825 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,29 +1,29 @@ name: viva_network_kit description: A lightweight and developer-friendly network manager for Flutter, built on Dio, with automatic connectivity checks before every API request. -version: 2.1.8 +version: 2.2.0 homepage: https://vivasoftltd.com/ repository: https://github.com/vivasoft-ltd/flutter-network-kit issue_tracker: https://github.com/vivasoft-ltd/flutter-network-kit/issues environment: - sdk: ">=2.17.0 <4.0.0" - flutter: ">=2.8.0" + sdk: ">=3.2.0 <4.0.0" + flutter: ">=3.7.0" dependencies: flutter: sdk: flutter - dio: ^5.8.0+1 + dio: ^5.10.0 dartz: ^0.10.1 - built_value: ^8.9.5 - connectivity_plus: ^6.1.3 - get_it: ^8.0.3 + built_value: ^8.12.6 + connectivity_plus: ^7.2.0 + get_it: ^9.2.1 built_collection: ^5.1.1 dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^5.0.0 + flutter_lints: ^6.0.0 flutter: diff --git a/test/flutter_network_lib.dart b/test/flutter_network_lib.dart index ee9468a..ab73b3a 100644 --- a/test/flutter_network_lib.dart +++ b/test/flutter_network_lib.dart @@ -1,3 +1 @@ -import 'package:flutter_test/flutter_test.dart'; - void main() {}