diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index e774e33..84438f5 100755 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -152,7 +152,6 @@ 2337DF983062679D03D5B21B /* Pods-RunnerTests.release.xcconfig */, 4175C67EA418E1EC91AB925F /* Pods-RunnerTests.profile.xcconfig */, ); - name = Pods; path = Pods; sourceTree = ""; }; @@ -468,6 +467,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = 6FB62SU8KL; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -646,6 +646,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = 6FB62SU8KL; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -668,6 +669,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = 6FB62SU8KL; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( diff --git a/lib/utils/custom_image_picker.dart b/lib/utils/custom_image_picker.dart index 65c3a19..4c9668e 100644 --- a/lib/utils/custom_image_picker.dart +++ b/lib/utils/custom_image_picker.dart @@ -11,8 +11,10 @@ class CustomImagePicker { /// Pick Image From Gallery Future getImageFromGallery() async { - var galleryImage = - await ImagePicker().pickImage(source: ImageSource.gallery); + var galleryImage = await ImagePicker().pickImage( + source: ImageSource.gallery, + imageQuality: 50, + ); if (galleryImage != null) { pickedImage.value = cropImage(File(galleryImage.path)); @@ -24,7 +26,10 @@ class CustomImagePicker { /// Pick Image From Camera Future getImageFromCamera() async { - var cameraImage = await ImagePicker().pickImage(source: ImageSource.camera); + var cameraImage = await ImagePicker().pickImage( + source: ImageSource.camera, + imageQuality: 50, + ); if (cameraImage != null) { //pickedImage.value = cropImage(File(galleryImage.path)); "If we want to use cropped image " @@ -46,7 +51,7 @@ class CustomImagePicker { CropAspectRatioPreset.ratio16x9 ], cropStyle: CropStyle.circle, - compressQuality: 100, + compressQuality: 50, compressFormat: ImageCompressFormat.png, uiSettings: [ AndroidUiSettings( diff --git a/lib/utils/web_socket_manager.dart b/lib/utils/web_socket_manager.dart index 570bd93..2b333ad 100644 --- a/lib/utils/web_socket_manager.dart +++ b/lib/utils/web_socket_manager.dart @@ -9,29 +9,37 @@ class WebSocketManager { late WebSocketChannel _channel; late WebSocket _webSocket; RxString receivedMessage = "".obs; // This full response comes from websocket - RxInt totalClaps = + RxInt yourJsonKeyValue = 0.obs; // collecting any particular value from socket response Future connectWebSocket() async { - const String url = 'your-websocket-url'; - try { - _webSocket = await WebSocket.connect(url); - _channel = IOWebSocketChannel(_webSocket); + List urls = [ + 'your-websocket-url', // socket url 1 + 'your-websocket-url', // socket url 2 + ]; + for (var url in urls) { + try { + _webSocket = await WebSocket.connect(url); + _channel = IOWebSocketChannel(_webSocket); - _channel.stream.listen((message) { - _parseReceivedMessage(message); // your particular value - receivedMessage.value = message; // main response - }); - } catch (e) { - Logger().e('WebSocket connection failed: $e'); + _channel.stream.listen((message) { + _parseReceivedMessage(message); // your particular value + receivedMessage.value = message; // main response + }); + Logger().i('WebSocket connection established in: $url'); + } catch (e) { + Logger().e('WebSocket connection failed: $e'); + } } } // Decoding main socket response to get particular value void _parseReceivedMessage(String message) { + Logger().d('Received message: $message'); final Map data = jsonDecode(message); - if (data.containsKey('total_claps')) { - totalClaps.value = data['total_claps']; + if (data.containsKey('json_key')) { + yourJsonKeyValue.value = data['json_key']; + Logger().d(yourJsonKeyValue.value); } }