diff --git a/assets/images/png/5e8479cea3a89ec07bf1089a2b0efeec.png b/assets/images/png/5e8479cea3a89ec07bf1089a2b0efeec.png new file mode 100644 index 0000000..60bb8ba Binary files /dev/null and b/assets/images/png/5e8479cea3a89ec07bf1089a2b0efeec.png differ diff --git a/assets/images/png/Black33.png b/assets/images/png/Black33.png new file mode 100644 index 0000000..62f1547 Binary files /dev/null and b/assets/images/png/Black33.png differ diff --git a/assets/images/png/Connected world-amico 1.png b/assets/images/png/Connected world-amico 1.png new file mode 100644 index 0000000..f5b8583 Binary files /dev/null and b/assets/images/png/Connected world-amico 1.png differ diff --git a/assets/images/png/Group 1000004149.png b/assets/images/png/Group 1000004149.png new file mode 100644 index 0000000..855035d Binary files /dev/null and b/assets/images/png/Group 1000004149.png differ diff --git a/assets/images/png/Group 1000004385.png b/assets/images/png/Group 1000004385.png new file mode 100644 index 0000000..a046e4a Binary files /dev/null and b/assets/images/png/Group 1000004385.png differ diff --git a/assets/images/png/Group 1000004420.png b/assets/images/png/Group 1000004420.png new file mode 100644 index 0000000..7e9e4ea Binary files /dev/null and b/assets/images/png/Group 1000004420.png differ diff --git a/assets/images/png/LightGray.png b/assets/images/png/LightGray.png new file mode 100644 index 0000000..196732b Binary files /dev/null and b/assets/images/png/LightGray.png differ diff --git a/assets/images/png/LightGray22.png b/assets/images/png/LightGray22.png new file mode 100644 index 0000000..196732b Binary files /dev/null and b/assets/images/png/LightGray22.png differ diff --git a/assets/images/png/Organizing projects-pana 1.png b/assets/images/png/Organizing projects-pana 1.png new file mode 100644 index 0000000..7aa5da6 Binary files /dev/null and b/assets/images/png/Organizing projects-pana 1.png differ diff --git a/assets/images/png/PinnedIcon.png b/assets/images/png/PinnedIcon.png new file mode 100644 index 0000000..8813bc3 Binary files /dev/null and b/assets/images/png/PinnedIcon.png differ diff --git a/assets/images/png/Vector 8.png b/assets/images/png/Vector 8.png new file mode 100644 index 0000000..4abcecd Binary files /dev/null and b/assets/images/png/Vector 8.png differ diff --git a/assets/images/png/add 1.png b/assets/images/png/add 1.png new file mode 100644 index 0000000..babf94f Binary files /dev/null and b/assets/images/png/add 1.png differ diff --git a/assets/images/png/background.png b/assets/images/png/background.png new file mode 100644 index 0000000..3e27684 Binary files /dev/null and b/assets/images/png/background.png differ diff --git a/assets/images/png/correct 1.png b/assets/images/png/correct 1.png new file mode 100644 index 0000000..77e4704 Binary files /dev/null and b/assets/images/png/correct 1.png differ diff --git a/assets/images/png/downarrow.png b/assets/images/png/downarrow.png new file mode 100644 index 0000000..3c2e011 Binary files /dev/null and b/assets/images/png/downarrow.png differ diff --git a/assets/images/png/ion_add.png b/assets/images/png/ion_add.png new file mode 100644 index 0000000..9f926cb Binary files /dev/null and b/assets/images/png/ion_add.png differ diff --git a/assets/images/png/leave group.png b/assets/images/png/leave group.png new file mode 100644 index 0000000..62f1547 Binary files /dev/null and b/assets/images/png/leave group.png differ diff --git a/assets/images/png/postSaved.png b/assets/images/png/postSaved.png new file mode 100644 index 0000000..3cef09f Binary files /dev/null and b/assets/images/png/postSaved.png differ diff --git a/assets/images/png/sidemenu/price-tag 1.png b/assets/images/png/sidemenu/price-tag 1.png new file mode 100644 index 0000000..3f094bc Binary files /dev/null and b/assets/images/png/sidemenu/price-tag 1.png differ diff --git a/assets/images/png/sidemenu/rightarrow.png b/assets/images/png/sidemenu/rightarrow.png new file mode 100644 index 0000000..1c703a3 Binary files /dev/null and b/assets/images/png/sidemenu/rightarrow.png differ diff --git a/assets/images/png/uparrow.png b/assets/images/png/uparrow.png new file mode 100644 index 0000000..adec464 Binary files /dev/null and b/assets/images/png/uparrow.png differ diff --git a/assets/images/png/x-circle.png b/assets/images/png/x-circle.png new file mode 100644 index 0000000..166bf0c Binary files /dev/null and b/assets/images/png/x-circle.png differ diff --git a/assets/images/svg/add 1.svg b/assets/images/svg/add 1.svg new file mode 100644 index 0000000..8b79a3f --- /dev/null +++ b/assets/images/svg/add 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/devtools_options.yaml b/devtools_options.yaml new file mode 100644 index 0000000..7e7e7f6 --- /dev/null +++ b/devtools_options.yaml @@ -0,0 +1 @@ +extensions: diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 10c2c59..2bd5b2c 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -64,7 +64,7 @@ PODS: - firebase_core (2.32.0): - Firebase/CoreOnly (= 10.25.0) - Flutter - - FirebaseAppCheckInterop (10.28.0) + - FirebaseAppCheckInterop (10.29.0) - FirebaseAuth (10.25.0): - FirebaseAppCheckInterop (~> 10.17) - FirebaseCore (~> 10.0) @@ -76,12 +76,14 @@ PODS: - FirebaseCoreInternal (~> 10.0) - GoogleUtilities/Environment (~> 7.12) - GoogleUtilities/Logger (~> 7.12) - - FirebaseCoreInternal (10.28.0): + - FirebaseCoreInternal (10.29.0): - "GoogleUtilities/NSData+zlib (~> 7.8)" - Flutter (1.0.0) - flutter_facebook_auth (6.0.4): - FBSDKLoginKit (~> 16.3.1) - Flutter + - flutter_keyboard_visibility (0.0.1): + - Flutter - fluttertoast (0.0.2): - Flutter - Toast @@ -130,10 +132,10 @@ PODS: - GTMAppAuth (4.1.1): - AppAuth/Core (~> 1.7) - GTMSessionFetcher/Core (< 4.0, >= 3.3) - - GTMSessionFetcher (3.4.1): - - GTMSessionFetcher/Full (= 3.4.1) - - GTMSessionFetcher/Core (3.4.1) - - GTMSessionFetcher/Full (3.4.1): + - GTMSessionFetcher (3.5.0): + - GTMSessionFetcher/Full (= 3.5.0) + - GTMSessionFetcher/Core (3.5.0) + - GTMSessionFetcher/Full (3.5.0): - GTMSessionFetcher/Core - image_cropper (0.0.4): - Flutter @@ -149,9 +151,9 @@ PODS: - Flutter - PromisesObjC (2.4.0) - RecaptchaInterop (100.0.0) - - SDWebImage (5.19.2): - - SDWebImage/Core (= 5.19.2) - - SDWebImage/Core (5.19.2) + - SDWebImage (5.19.4): + - SDWebImage/Core (= 5.19.4) + - SDWebImage/Core (5.19.4) - shared_preferences_foundation (0.0.1): - Flutter - FlutterMacOS @@ -169,6 +171,7 @@ DEPENDENCIES: - firebase_core (from `.symlinks/plugins/firebase_core/ios`) - Flutter (from `Flutter`) - flutter_facebook_auth (from `.symlinks/plugins/flutter_facebook_auth/ios`) + - flutter_keyboard_visibility (from `.symlinks/plugins/flutter_keyboard_visibility/ios`) - fluttertoast (from `.symlinks/plugins/fluttertoast/ios`) - geolocator_apple (from `.symlinks/plugins/geolocator_apple/ios`) - google_maps_flutter_ios (from `.symlinks/plugins/google_maps_flutter_ios/ios`) @@ -222,6 +225,8 @@ EXTERNAL SOURCES: :path: Flutter flutter_facebook_auth: :path: ".symlinks/plugins/flutter_facebook_auth/ios" + flutter_keyboard_visibility: + :path: ".symlinks/plugins/flutter_keyboard_visibility/ios" fluttertoast: :path: ".symlinks/plugins/fluttertoast/ios" geolocator_apple: @@ -259,12 +264,13 @@ SPEC CHECKSUMS: Firebase: 0312a2352584f782ea56f66d91606891d4607f06 firebase_auth: 5719ddc9f654b813405899480e84971bd8e61235 firebase_core: a626d00494efa398e7c54f25f1454a64c8abf197 - FirebaseAppCheckInterop: 5315f40293191bfec04b2cfab0215760e441540a + FirebaseAppCheckInterop: 6a1757cfd4067d8e00fccd14fcc1b8fd78cfac07 FirebaseAuth: c0f93dcc570c9da2bffb576969d793e95c344fbb FirebaseCore: 7ec4d0484817f12c3373955bc87762d96842d483 - FirebaseCoreInternal: 58d07f1362fddeb0feb6a857d1d1d1c5e558e698 + FirebaseCoreInternal: df84dd300b561c27d5571684f389bf60b0a5c934 Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 flutter_facebook_auth: c8700ab1770f3d8e5e7456220e4f3bbcdb831454 + flutter_keyboard_visibility: 0339d06371254c3eb25eeb90ba8d17dca8f9c069 fluttertoast: 9f2f8e81bb5ce18facb9748d7855bf5a756fe3db geolocator_apple: 6cbaf322953988e009e5ecb481f07efece75c450 google_maps_flutter_ios: d1318b4ff711612cab16862d7a87e31a7403d458 @@ -273,7 +279,7 @@ SPEC CHECKSUMS: GoogleSignIn: d4281ab6cf21542b1cfaff85c191f230b399d2db GoogleUtilities: ea963c370a38a8069cc5f7ba4ca849a60b6d7d15 GTMAppAuth: f69bd07d68cd3b766125f7e072c45d7340dea0de - GTMSessionFetcher: 8000756fc1c19d2e5697b90311f7832d2e33f6cd + GTMSessionFetcher: 5aea5ba6bd522a239e236100971f10cb71b96ab6 image_cropper: 2c150b3d63f4feaad31054d20381ddac0a460e63 image_gallery_saver: cb43cc43141711190510e92c460eb1655cd343cb image_picker_ios: 99dfe1854b4fa34d0364e74a78448a0151025425 @@ -281,7 +287,7 @@ SPEC CHECKSUMS: permission_handler_apple: 9878588469a2b0d0fc1e048d9f43605f92e6cec2 PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47 RecaptchaInterop: 7d1a4a01a6b2cb1610a47ef3f85f0c411434cb21 - SDWebImage: dfe95b2466a9823cf9f0c6d01217c06550d7b29a + SDWebImage: 066c47b573f408f18caa467d71deace7c0f8280d shared_preferences_foundation: b4c3b4cddf1c21f02770737f147a3f5da9d39695 sign_in_with_apple: f3bf75217ea4c2c8b91823f225d70230119b8440 SwiftyGif: 706c60cf65fa2bc5ee0313beece843c8eb8194d4 diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 5d60154..bc384cd 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -8,13 +8,13 @@ /* Begin PBXBuildFile section */ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; - 2105BA461347F33698D3FD7B /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DC7FC30109CCD5376F6BFA0F /* Pods_Runner.framework */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 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 */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 9FD3FE5A0194B5B2D8202DCF /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = D4274500C33C54346ECA2D49 /* GoogleService-Info.plist */; }; + CA23128F3D22F12344F34510 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2E6D63EEFD9353D7ADC2CB4D /* Pods_Runner.framework */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -31,16 +31,17 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 01A8D59FC22474B9D47BC82F /* 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 = ""; }; + 2E6D63EEFD9353D7ADC2CB4D /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 355191DC29CD1712AAFF95EF /* 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 = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; - 3E093EFD052120EBB5EFE242 /* 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 = ""; }; + 4145FC1F69369273F821F424 /* 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 = ""; }; 5210D9302C4006FC0040021E /* Runner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Runner.entitlements; sourceTree = ""; }; 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 = ""; }; + 7A2724068B1177B4942EB08B /* 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 = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; - 8DA153E7FEAC51D97681DB93 /* 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 = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -49,7 +50,6 @@ 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 = ""; }; D4274500C33C54346ECA2D49 /* GoogleService-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; name = "GoogleService-Info.plist"; path = "Runner/GoogleService-Info.plist"; sourceTree = ""; }; - DC7FC30109CCD5376F6BFA0F /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -57,7 +57,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 2105BA461347F33698D3FD7B /* Pods_Runner.framework in Frameworks */, + CA23128F3D22F12344F34510 /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -67,9 +67,9 @@ 01448FBCAC46C16EC8BC1181 /* Pods */ = { isa = PBXGroup; children = ( - 8DA153E7FEAC51D97681DB93 /* Pods-Runner.debug.xcconfig */, - 3E093EFD052120EBB5EFE242 /* Pods-Runner.release.xcconfig */, - 01A8D59FC22474B9D47BC82F /* Pods-Runner.profile.xcconfig */, + 355191DC29CD1712AAFF95EF /* Pods-Runner.debug.xcconfig */, + 7A2724068B1177B4942EB08B /* Pods-Runner.release.xcconfig */, + 4145FC1F69369273F821F424 /* Pods-Runner.profile.xcconfig */, ); path = Pods; sourceTree = ""; @@ -92,8 +92,8 @@ 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, 01448FBCAC46C16EC8BC1181 /* Pods */, - DE8E73CF7AB07643531FB23E /* Frameworks */, D4274500C33C54346ECA2D49 /* GoogleService-Info.plist */, + F4C62E65C792A2B03ABD303E /* Frameworks */, ); sourceTree = ""; }; @@ -121,10 +121,10 @@ path = Runner; sourceTree = ""; }; - DE8E73CF7AB07643531FB23E /* Frameworks */ = { + F4C62E65C792A2B03ABD303E /* Frameworks */ = { isa = PBXGroup; children = ( - DC7FC30109CCD5376F6BFA0F /* Pods_Runner.framework */, + 2E6D63EEFD9353D7ADC2CB4D /* Pods_Runner.framework */, ); name = Frameworks; sourceTree = ""; @@ -136,23 +136,21 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( - 2427B225240D99C3274E4E9F /* [CP] Check Pods Manifest.lock */, + 30BAD3BCCCA511EDA8157430 /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - 193E6ECF33FCE0798A403773 /* [CP] Embed Pods Frameworks */, - A1A5C179E86574032091061E /* [CP] Copy Pods Resources */, + 4343791398B77D1A11F261A2 /* [CP] Embed Pods Frameworks */, + 57523D9CD6B060C3BF6C72B7 /* [CP] Copy Pods Resources */, ); buildRules = ( ); dependencies = ( ); name = Runner; - packageProductDependencies = ( - ); productName = Runner; productReference = 97C146EE1CF9000F007C117D /* Runner.app */; productType = "com.apple.product-type.application"; @@ -181,8 +179,6 @@ Base, ); mainGroup = 97C146E51CF9000F007C117D; - packageReferences = ( - ); productRefGroup = 97C146EF1CF9000F007C117D /* Products */; projectDirPath = ""; projectRoot = ""; @@ -208,24 +204,7 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 193E6ECF33FCE0798A403773 /* [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; - }; - 2427B225240D99C3274E4E9F /* [CP] Check Pods Manifest.lock */ = { + 30BAD3BCCCA511EDA8157430 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -263,22 +242,24 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; }; - 9740EEB61CF901F6004384FC /* Run Script */ = { + 4343791398B77D1A11F261A2 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; - alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); - inputPaths = ( + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); - name = "Run Script"; - outputPaths = ( + 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 = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + showEnvVarsInLog = 0; }; - A1A5C179E86574032091061E /* [CP] Copy Pods Resources */ = { + 57523D9CD6B060C3BF6C72B7 /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -295,6 +276,21 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; showEnvVarsInLog = 0; }; + 9740EEB61CF901F6004384FC /* Run Script */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Run Script"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; + }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ diff --git a/lib/Common/ApiRepositoy.dart b/lib/Common/ApiRepositoy.dart new file mode 100644 index 0000000..a34f525 --- /dev/null +++ b/lib/Common/ApiRepositoy.dart @@ -0,0 +1,18 @@ +// import 'package:get/get.dart'; +// import 'package:flutter/material.dart'; +// import 'package:async/async.dart'; +// import 'package:regroup/Main_Screens/Community_HomePage/PostDetailScreen/ViewModel/CommentsRepository.dart'; +// class ApiRepository extends GetxController { +// Future> fetchMultipleAPIs() async { +// FutureGroup futureGroup = FutureGroup(); +// // PostDetail +// futureGroup.add(CommentsRepository().getAllComments()); + + +// // Close the group (no more futures can be added) +// futureGroup.close(); + +// // Wait for all futures to complete +// return await futureGroup.future; +// } +// } diff --git a/lib/Common/CommonGlassmorphism.dart b/lib/Common/CommonGlassmorphism.dart index 1054f77..d10d9d3 100644 --- a/lib/Common/CommonGlassmorphism.dart +++ b/lib/Common/CommonGlassmorphism.dart @@ -12,10 +12,7 @@ Widget commonGlassContainer({ double opacity2 = 0.05, Color borderColor = const Color(0xff434A53), }) { - return - - - GlassmorphicContainer( + return GlassmorphicContainer( width: width, height: height, borderRadius: borderradius, @@ -85,7 +82,7 @@ Widget commonGlassContainerblue({ Widget commonGlassUIBlue({ required double width, - required double height, + required double? height, required Widget customWidget, // required double border, double mainOpacity = 1, @@ -116,7 +113,7 @@ Widget commonGlassUIBlue({ Widget commonGlassUI({ required double width, - required double height, + required double? height, // required double border, double mainOpacity = 1, double opacity1 = 0.04, @@ -150,7 +147,7 @@ Widget commonGlassUI({ Widget commonContainer({ required double width, - required double height, + required double? height, // required double border, // double mainOpacity = 1, double opacity1 = 0.04, diff --git a/lib/Common/CommonWidget.dart b/lib/Common/CommonWidget.dart index 3ad8a7e..6d6c8d2 100644 --- a/lib/Common/CommonWidget.dart +++ b/lib/Common/CommonWidget.dart @@ -22,7 +22,7 @@ class TextInputField extends StatefulWidget { class _TextInputFieldState extends State { @override Widget build(BuildContext context) { - return Container( + return SizedBox( width: double.infinity, height: 46.h, child: TextFormField( @@ -185,7 +185,8 @@ Future showCustomTimePicker(BuildContext context, onSurface: Colors.white, ), textTheme: Theme.of(context).textTheme.copyWith( - titleLarge: const TextStyle(color: Colors.blue), // Change the title color + titleLarge: + const TextStyle(color: Colors.blue), // Change the title color ), textButtonTheme: TextButtonThemeData( style: TextButton.styleFrom( @@ -247,7 +248,8 @@ Widget stackContainers({ width: 30, decoration: BoxDecoration( shape: BoxShape.circle, - border: Border.all(color: const Color(0xFF2C3742), width: 1), + border: Border.all( + color: const Color(0xFF2C3742), width: 1), ), child: CircleAvatar( foregroundImage: AssetImage(containerImages[index]), @@ -272,7 +274,7 @@ Widget stackContainersGroups({ const maxImagesToShow = 3; // Calculate the number of images to show and the remaining count - final remainingCount = containerImages.length - maxImagesToShow; + // final remainingCount = containerImages.length - maxImagesToShow; final imagesToShow = containerImages.take(maxImagesToShow).toList(); return Row( @@ -280,27 +282,34 @@ Widget stackContainersGroups({ Stack( clipBehavior: Clip.none, children: [ - Container( - height: 30, - width: 30, - decoration: BoxDecoration( - shape: BoxShape.circle, - color: const Color(0xFFD90B2E), - border: Border.all(color: const Color(0xFF2C3742), width: 1), - ), - child: Center( - child: Text( - remainingCount > 0 ? '+$remainingCount' : '', - style: const TextStyle( - color: Colors.white, - fontWeight: FontWeight.w400, - fontSize: 8, + containerImages.length > maxImagesToShow + ? Container( + height: 30.h, + width: 30.w, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: const Color(0xFFD90B2E), + border: + Border.all(color: const Color(0xFF2C3742), width: 1), + ), + child: Center( + child: Text( + // remainingCount > 0 ? '+$remainingCount' : '', + number, + style: const TextStyle( + color: Colors.white, + fontWeight: FontWeight.w400, + fontSize: 8, + ), + ), + ), + ) + : SizedBox( + height: 30.h, + width: 30.w, ), - ), - ), - ), Positioned( - left: 22.w, + left: containerImages.length > maxImagesToShow ? 22.w : 0.w, child: SizedBox( height: 30, width: 30 * maxImagesToShow.toDouble(), @@ -314,7 +323,8 @@ Widget stackContainersGroups({ width: 30, decoration: BoxDecoration( shape: BoxShape.circle, - border: Border.all(color: const Color(0xFF2C3742), width: 1), + border: Border.all( + color: const Color(0xFF2C3742), width: 1), ), child: CircleAvatar( backgroundImage: NetworkImage(imagesToShow[index]), @@ -395,7 +405,8 @@ Widget stackReaction({ 1, ], ), - border: Border.all(color: const Color(0xFF1E3A46), width: 1.71)), + border: Border.all( + color: const Color(0xFF1E3A46), width: 1.71)), child: Center( child: Image.asset( containerImages[index], diff --git a/lib/Common/ConvertServerDateToUserDate.dart b/lib/Common/ConvertServerDateToUserDate.dart new file mode 100644 index 0000000..537c5a6 --- /dev/null +++ b/lib/Common/ConvertServerDateToUserDate.dart @@ -0,0 +1,36 @@ +class ConvertServerDateToUserDate { + + convertServerDateToReadableFormate(String? createAtstring) { + + if (createAtstring == null || createAtstring.isEmpty) { + createAtstring = DateTime.now().toIso8601String(); + } + String? timeAgo; + + try { + DateTime postDateTime = DateTime.parse(createAtstring); + DateTime now = DateTime.now(); + Duration difference = now.difference(postDateTime); + if (difference.inDays > 365) { + timeAgo = '${(difference.inDays / 365).floor()} years ago'; + } else if (difference.inDays > 30) { + timeAgo = '${(difference.inDays / 30).floor()} months ago'; + } else if (difference.inDays > 7) { + timeAgo = '${(difference.inDays / 7).floor()} weeks ago'; + } else if (difference.inDays > 0) { + timeAgo = '${difference.inDays} days ago'; + } else if (difference.inHours > 0) { + timeAgo = '${difference.inHours} hours ago'; + } else if (difference.inMinutes > 0) { + timeAgo = '${difference.inMinutes} minutes ago'; + } else { + timeAgo = '${difference.inSeconds} seconds ago'; + } + print("Time ago: $timeAgo"); + return timeAgo; + } catch (e) { + print("Error parsing date: $e"); + String timeAgo = 'Unknown'; + } + } +} \ No newline at end of file diff --git a/lib/Common/ReactionIcons.dart b/lib/Common/ReactionIcons.dart new file mode 100644 index 0000000..c842601 --- /dev/null +++ b/lib/Common/ReactionIcons.dart @@ -0,0 +1,12 @@ +import 'package:flutter/material.dart'; + +class ReactionActions extends StatelessWidget { + const ReactionActions({super.key}); + + @override + Widget build(BuildContext context) { + return const Placeholder(); + } + + +} \ No newline at end of file diff --git a/lib/Common/api_urls.dart b/lib/Common/api_urls.dart index 11613b9..05db8dd 100644 --- a/lib/Common/api_urls.dart +++ b/lib/Common/api_urls.dart @@ -84,6 +84,38 @@ class ApiUrls { static const getmyjoinedgroups = "${baseUrl}my-joined-groups"; + static const getmycommunity = "${baseUrl}fetch-my-communities"; + + static const getcommunitydetail = "${baseUrl}fetch-community-all-details"; + + static const getComPostdetail = "${baseUrl}fetch-community-all-posts"; + + static const postleavecommunity = "${baseUrl}leave-community"; + + static const postmutenotification = "${baseUrl}mute-unmute-community"; + + + + + static const getrequestedcommunity = + "${baseUrl}fetch-joining-request-for-community"; + + static const getInvitecommunity = "${baseUrl}fetch-all-invite"; + + static const postnewinterest = "${baseUrl}store-tags"; + + static const postacceptreject = "${baseUrl}accept-reject-tag"; + + + static const getinterests = "${baseUrl}list-of-tags-and-requested-tags"; + + + static const postcancelrequest = "${baseUrl}cancel-request-of-community"; + + static const postacceptinvite = "${baseUrl}accept-invite-to-join-community"; + + static const postrejectinvite = "${baseUrl}reject-invite-to-join-community"; + static const getusercertificates = "${baseUrl}my-certificates"; static const postnotification = "${baseUrl}update-notification-settings"; @@ -91,14 +123,17 @@ class ApiUrls { static const getblockuser = "${baseUrl}fetch-blocked-profile"; static const postblockuser = "${baseUrl}block-profile"; + static const getlatestpost = "${baseUrl}fetch-latest-post"; + static const getpopularpost = "${baseUrl}fetch-popular-post"; + + static const getfeedpost = "${baseUrl}fetch-post"; + static const tagcommunityuser = "${baseUrl}fetch-communities-tags-to-pin"; // Individual static const posteditprofile = "${baseUrl}update-profile"; static const geteditprofile = "${baseUrl}fetch-profile"; static const getinterestlist = "${baseUrl}fetch-interests"; - - // Business static const posteditprofilebusiness = "${baseUrl}update-business-profile"; static const geteditprofilebusiness = "${baseUrl}fetch-business-profile"; @@ -112,4 +147,55 @@ class ApiUrls { static const getGuestfollowers = "${baseUrl}get-guest-user-followers"; static const getGuestfollowing = "${baseUrl}get-guest-user-following"; + + //community + static const getpostcommunitylist = "${baseUrl}fetch-communities-with-tags"; + static const getpopulartagscommunity = "${baseUrl}fetch-popular-tags"; + + static const postnewtags = "${baseUrl}store-tags"; + static const postupload = "${baseUrl}store-post"; + static const postlike = "${baseUrl}fetch-like-list"; + + static const getuserpinlist = "${baseUrl}fetch-pinned-detail"; + + static const postusertag = "${baseUrl}pin-unpin"; + + //comments + static const getComments = "${baseUrl}fetch-comment-with-replied-comment"; + static const storeComments = "${baseUrl}store-comment"; + static const storeRepliesOnComments = "${baseUrl}reply-on-comment"; + static const deleteComments = "${baseUrl}delete-comment"; + static const deleteRepliesComments = "${baseUrl}delete-reply-on-comment"; + + static const getLikeicons = "${baseUrl}fetch-like-icons"; + + static const postLike = "${baseUrl}like-post"; + + static const getTagsdetails = "${baseUrl}fetch-post-by-tag"; + + static const postusersave = "${baseUrl}save-post"; + static const getpostdetail = "${baseUrl}fetch-single-post"; + + static const getpopularTagsdetails = "${baseUrl}fetch-popular-post"; + + static const postcreatecommunity = "${baseUrl}create-community"; + + static const getcommunityaddgroups = "${baseUrl}fetch-groups-to-add"; + + static const getcommunitygroups = "${baseUrl}fetch-community-all-groups"; + + static const getcommunitymembers = "${baseUrl}fetch-community-all-members"; + + static const geteditcommunity = "${baseUrl}edit-community"; + + static const posteditcommunity = "${baseUrl}update-community"; + + static const getactivitieslist = "${baseUrl}get_activity"; + + static const getcommunitymanagegroups = "${baseUrl}fetch-community-all-groups-list"; + + static const postremovegroupscommunity = "${baseUrl}remove-groups-from-community"; + + static const postmanageaddgroupscommunity = "${baseUrl}add-groups-in-community"; + } diff --git a/lib/Common/controller/MainController.dart b/lib/Common/controller/MainController.dart index 32c64e1..c6c63da 100644 --- a/lib/Common/controller/MainController.dart +++ b/lib/Common/controller/MainController.dart @@ -1,12 +1,10 @@ import 'package:get/get.dart'; +import 'package:regroup/Main_Screens/CalenderTab/CalenderTab.dart'; +import 'package:regroup/Main_Screens/Chats/View/chatsmainscreen.dart'; +import 'package:regroup/Main_Screens/Community_HomePage/Community.dart'; +import 'package:regroup/Main_Screens/GroupTab/View/GroupTab.dart'; +import 'package:regroup/Main_Screens/ProfileTab/EditProfile/View/ProfileTab.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/CalenderTab/CalenderTab.dart'; - -import 'package:regroup/Feed%20Module/Main_Screens/Chats/View/chatsmainscreen.dart'; - -import 'package:regroup/Feed%20Module/Main_Screens/Community/Community.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/GroupTab/View/GroupTab.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/EditProfile/View/ProfileTab.dart'; class MainController extends GetxController { var selectedIndex = 0.obs; diff --git a/lib/Common/controller/MainScreen.dart b/lib/Common/controller/MainScreen.dart index 43a7e9d..c14ddc3 100644 --- a/lib/Common/controller/MainScreen.dart +++ b/lib/Common/controller/MainScreen.dart @@ -2,11 +2,24 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:get/get.dart'; import 'package:regroup/Common/controller/MainController.dart'; +import 'package:regroup/Main_Screens/ProfileTab/EditProfile/ViewModel/InterestApiList.dart'; final MainController mainController = Get.put(MainController()); - -class MainScreen extends StatelessWidget { +class MainScreen extends StatefulWidget { const MainScreen({super.key}); + + @override + State createState() => _MainScreenState(); +} + +class _MainScreenState extends State { + @override + void initState() { + InterestListApi().getinterestlistApi(); + + super.initState(); + } + @override Widget build(BuildContext context) { return Obx(() { diff --git a/lib/Common/controller/NormalPostCard.dart b/lib/Common/controller/NormalPostCard.dart new file mode 100644 index 0000000..9e90134 --- /dev/null +++ b/lib/Common/controller/NormalPostCard.dart @@ -0,0 +1,686 @@ +import 'dart:developer'; + +import 'package:cached_network_image/cached_network_image.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_reaction_button/flutter_reaction_button.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:regroup/Common/CommonGlassmorphism.dart'; +import 'package:regroup/Common/CommonWidget.dart'; +import 'package:regroup/Common/base_manager.dart'; +import 'package:regroup/Main_Screens/Community/Model/CommonDatumObjModel.dart'; +import 'package:regroup/Main_Screens/Community/Model/fetchicons.dart'; +import 'package:regroup/Main_Screens/Community/ViewModel/postmethod.dart'; +import 'package:regroup/Main_Screens/Community_HomePage/view_model/CountersHelper.dart'; +import 'package:regroup/Main_Screens/Community_HomePage/view_model/communitypostmethod.dart'; +import 'package:regroup/Utils/Common/sized_box.dart'; +import 'package:regroup/Utils/dialogs.dart'; +import 'package:regroup/Utils/texts.dart'; +import 'package:regroup/resources/routes/route_name.dart'; +import 'package:regroup/sidemenu/view_model/postmethod.dart'; + +class NormalCardTile extends StatefulWidget { + List tags; + String? createAt; + CommonDatumObjModelData commonObj; + String forWhichTab; + List reactions; + Map selectedReactions; + bool? coachbool; + bool showCommentButton; + int currentIndex; + NormalCardTile( + {Key? key, + required this.tags, + this.createAt, + required this.forWhichTab, + required this.commonObj, + required this.reactions, + required this.selectedReactions, + required this.currentIndex, + this.showCommentButton = true, + this.coachbool}) + : super(key: key); + + @override + _NormalCardTileState createState() => _NormalCardTileState(); +} + +class _NormalCardTileState extends State { + RxString mainImage = 'assets/images/png/uiw_like-o.png'.obs; + final CountersHelper countersHelper = Get.find(); + int saveCount = 0; + _handleReactionChange(Reaction? reaction) async { + if (widget.selectedReactions[widget.commonObj.id] != null && + reaction?.value == + widget.selectedReactions[widget.commonObj.id]!.id.toString() || + reaction?.value == null) { + // User tapped on the currently selected reaction, so remove it + + //api call for dislike + + await LikeUploaddata( + widget.selectedReactions[widget.commonObj.id]?.id, + widget.commonObj.id!, + ); + setState(() { + widget.selectedReactions[widget.commonObj.id!] = null; + //decrement gloally + countersHelper.likesCounterPopular[widget.currentIndex]--; + log("global value ${countersHelper.likesCounterPopular[widget.currentIndex]}"); + }); + } else { + // User selected a new reaction + var newSelectedReaction = widget.reactions.firstWhere( + (r) => r.id.toString() == reaction?.value, + orElse: () => widget.reactions.first, // Default reaction if not found + ); + await _handleReactionChangeApiCall( + newSelectedReaction, widget.commonObj.id!); + } + } + + Future _handleReactionChangeApiCall( + ReactionData? reaction, int postId) async { + setState(() { + widget.selectedReactions[postId] = + reaction; // Set the selected reaction for this post + + if (countersHelper.likesCounterPopular[widget.currentIndex] <= + widget.commonObj.totalReactionCount!) { + countersHelper.likesCounterPopular[widget.currentIndex]++; + } + }); + + await LikeUploaddata( + reaction?.id, + postId, + ); + } + + LikeUploaddata(int? likeIconId, int? postid) async { + Map updata = { + "manage_posts_xid": postid, + "like_icons_xid": likeIconId ?? '', + }; + final data = await CommunitypostMethod().postLikepost(updata); + if (data.status == ResponseStatus.SUCCESS) { + // return utils.showToast(data.message); + } else { + return utils.showToast(data.message); + } + } + + void updateImage(String reaction) { + switch (reaction) { + case 'like': + mainImage.value = 'assets/images/png/f7_hand-thumbsup.png'; + break; + case 'heart': + mainImage.value = 'assets/images/png/heart 2.png'; + break; + case 'party': + mainImage.value = 'assets/images/png/party-popper 2.png'; + break; + default: + // Handle any other cases or do nothing + break; + } + } + + saveunsavepost(int popularpostid) async { + // utils.loader(); + Map updata = { + "manage_posts_xid": popularpostid, + }; + final data = await Communitypostmethod().postUserSave(updata); + if (data.status == ResponseStatus.SUCCESS) { + if (countersHelper.saveButtonPopular[widget.currentIndex] == false) { + countersHelper.savePostCounterPopular[widget.currentIndex]++; + } else { + countersHelper.savePostCounterPopular[widget.currentIndex]--; + } + countersHelper.saveButtonPopular[widget.currentIndex] = + !countersHelper.saveButtonPopular[widget.currentIndex]; + return utils.showToast(data.message); + } else { + return utils.showToast(data.message); + } + } + + pinunpinUser(int userid) async { + Map updata = { + "pin_iam_principal_xid": userid, + }; + final data = await SidebarTags().postUserpin(updata); + if (data.status == ResponseStatus.SUCCESS) { + countersHelper.pinButtonPopular[widget.currentIndex] = + !countersHelper.pinButtonPopular[widget.currentIndex]; + countersHelper.updateFeedsPage.value = + !countersHelper.updateFeedsPage.value; + return utils.showToast(data.message); + } else { + return utils.showToast(data.message); + } + } + + @override + void initState() { + super.initState(); + } + + @override + Widget build(BuildContext context) { + var imgUrl = widget.commonObj.image! + .split( + "https://regroup.betadelivery.com/storage/app/public/uploads/post_image/") + .last; + + return ConstrainedBox( + constraints: BoxConstraints(minHeight: Get.width < 400 ? 750 : 770), + child: commonGlassUI( + width: double.infinity, + height: 600.h, + mainOpacity: 1, + borderRadius: BorderRadius.circular(1), + customWidget: Column( + children: [ + sizedBoxHeight(25.h), + Padding( + padding: EdgeInsets.symmetric(horizontal: 16.w), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + CircleAvatar( + backgroundImage: + widget.commonObj.iamPrincipal?.profilePhoto != null + ? NetworkImage(widget.commonObj.iamPrincipal! + .profilePhoto!) as ImageProvider + : const AssetImage( + 'assets/images/default_profile.png') + as ImageProvider, + radius: 25.r, + ), + sizedBoxWidth(12.w), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + text16w400_FCFCFC( + widget.commonObj.iamPrincipal!.fullName ?? + "Regroup"), + sizedBoxWidth(10.w), + widget.coachbool == true + ? Container( + width: 75.w, + height: 25.h, + decoration: BoxDecoration( + border: Border.all( + color: const Color(0xFFD90B2E), + width: 1.w, + ), + borderRadius: BorderRadius.circular(5.r), + ), + child: Center( + child: text12w400_FCFCFC("Coach")), + ) + : const SizedBox(), + ], + ), + sizedBoxHeight(5.h), + Row( + children: [ + Image.asset( + 'assets/images/png/community 1 (traced).png', + height: 14.w, + width: 14.w, + ), + sizedBoxWidth(7.w), + text12w400_FCFCFC( + widget.commonObj.community!.communityName ?? + ""), + sizedBoxWidth(7.w), + Icon( + Icons.circle, + color: const Color(0xFFFCFCFC), + size: 4.sp, + ), + sizedBoxWidth(6.w), + text12w400_FCFCFC(widget.createAt!), + ], + ) + ], + ), + const Spacer(), + PopupMenuButton( + surfaceTintColor: const Color(0xFF222935), + constraints: BoxConstraints.tightFor(width: 176.w), + offset: const Offset(0, 50), + color: const Color(0xFF222935), + tooltip: "", + itemBuilder: (BuildContext context) => [ + PopupMenuItem( + onTap: () {}, + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 12.w), + child: Row( + children: [ + Text( + 'Report Post', + style: TextStyle( + fontSize: 16.sp, + color: Colors.white, + fontWeight: FontWeight.w800, + fontFamily: "Nunito Sans", + ), + ), + const Spacer(), + Image.asset( + "assets/images/png/Vector (5).png", + height: 15.h, + width: 15.w, + ) + ], + ), + ), + ), + const PopupMenuDivider(), + PopupMenuItem( + onTap: () {}, + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 12.w), + child: Row( + children: [ + Text( + 'Share post', + style: TextStyle( + fontSize: 16.sp, + color: Colors.white, + fontWeight: FontWeight.w800, + fontFamily: "Nunito Sans", + ), + ), + const Spacer(), + Image.asset( + "assets/images/png/share.png", + height: 20.h, + width: 20.w, + ) + ], + ), + ), + ), + const PopupMenuDivider(), + PopupMenuItem( + onTap: () { + pinunpinUser(widget.commonObj.iamPrincipal!.id!); + }, + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 12.w), + child: Row( + children: [ + countersHelper + .pinButtonPopular[widget.currentIndex] + ? Text( + 'Unpin', + style: TextStyle( + fontSize: 16.sp, + color: Colors.white, + fontWeight: FontWeight.w800, + fontFamily: "Nunito Sans", + ), + ) + : Text( + 'Pin', + style: TextStyle( + fontSize: 16.sp, + color: Colors.white, + fontWeight: FontWeight.w800, + fontFamily: "Nunito Sans", + ), + ), + const Spacer(), + countersHelper + .pinButtonPopular[widget.currentIndex] + ? Image.asset( + "assets/images/png/PinnedIcon.png", + height: 25.h, + width: 25.w, + ) + : Image.asset( + "assets/images/png/f7_pin-fill (2).png", + height: 25.h, + width: 25.w, + ) + ], + ), + ), + ), + ], + child: Image.asset( + 'assets/images/png/Group 1000004071.png', + width: 16.w, + height: 18.h, + ), + ), + sizedBoxWidth(5.w) + ], + ), + ), + sizedBoxHeight(20.h), + GestureDetector( + onTap: () async { + if (widget.showCommentButton) { + bool result = await Get.toNamed(RouteName.postdetailsScreen, + arguments: { + 'postId': widget.commonObj.id, + 'tagsList': widget.tags, + 'created_at': widget.createAt, + 'commonObj': widget.commonObj, + 'fromWhichTab': widget.forWhichTab, + 'reactions': widget.reactions, + 'selectedReactions': widget.selectedReactions, + 'currentIndex': widget.currentIndex + }); + if (result) { + setState(() {}); + } + } + }, + child: SizedBox( + height: 360, + width: double.infinity, + child: Image.network( + widget.commonObj.image!, + fit: BoxFit.cover, + errorBuilder: (context, error, stackTrace) { + return const Center( + child: Icon(Icons.error), + ); + }, + ), + ), + ), + sizedBoxHeight(20.h), + Padding( + padding: EdgeInsets.symmetric(horizontal: 16.w), + child: Column(children: [ + SizedBox( + height: 30.h, + width: double.infinity, + child: ListView.builder( + scrollDirection: Axis.horizontal, + shrinkWrap: true, + itemCount: widget.tags.length, + itemBuilder: (context, index) { + var manageTag = widget.tags[index]; + return Padding( + padding: EdgeInsets.only(right: 12.w), + child: GestureDetector( + onTap: () { + Get.toNamed(RouteName.tagdetailscreen, + arguments: { + 'tagid': manageTag.id, + 'tagname': manageTag.name, + 'ispinnedtag': manageTag.isPinned, + }); + }, + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + commonContainer( + width: 130.w, + height: 30.h, + borderRadius: BorderRadius.circular(30.r), + borderColor: const Color(0xFFD90B2E), + opacity1: 0.04, + opacity2: 0.05, + customWidget: Padding( + padding: + EdgeInsets.symmetric(horizontal: 10.w), + child: Center( + child: text14w400_FCFCFC( + '#${manageTag.name}', + ), + ), + ), + ), + ], + ), + ), + ); + }, + ), + ), + sizedBoxHeight(20.h), + SizedBox( + width: double.infinity, + child: Text( + widget.commonObj.caption ?? "", + style: TextStyle( + fontSize: 16.sp, + color: Colors.white, + fontFamily: "Nunito Sans", + ), + maxLines: 2, // Set the maximum number of lines + overflow: TextOverflow + .ellipsis, // Truncate the text with an ellipsis + ), + ), + // sizedBoxHeight(20.h), + Row(children: [ + Obx( + () => InkWell( + onTap: () { + Get.toNamed(RouteName.reactionview, arguments: { + 'postId': widget.commonObj.id, + }); + }, + child: stackReaction( + number: countersHelper + .likesCounterPopular[widget.currentIndex] + .toString(), + containerImages: [ + 'assets/images/png/f7_hand-thumbsup.png', + 'assets/images/png/heart 2.png', + 'assets/images/png/party-popper 2.png' + ]), + ), + ), + const Spacer(), + commonContainer( + width: 30.w, + height: 30.h, + borderColor: const Color(0xFF434A53), + borderwidth: 0.43, + opacity1: 0.2, + opacity2: 0.2, + boxShape: BoxShape.circle, + customWidget: Center( + child: Image.asset( + 'assets/images/png/Frame 1000004088.png', + height: 13.h, + width: 13.w, + ), + ), + ), + sizedBoxWidth(12.w), + Obx( + () => text14w400_FCFCFC(countersHelper + .commentsCounterPopular[widget.currentIndex] + .toString()), + ), + sizedBoxWidth(20.w), + commonContainer( + width: 30.w, + height: 30.h, + borderColor: const Color(0xFF434A53), + borderwidth: 0.43, + opacity1: 0.2, + opacity2: 0.2, + boxShape: BoxShape.circle, + customWidget: Center( + child: Image.asset( + 'assets/images/png/Vector (1).png', + height: 12.h, + width: 12.w, + ), + ), + ), + sizedBoxWidth(12.w), + Obx( + () => text14w400_FCFCFC(countersHelper + .savePostCounterPopular[widget.currentIndex] + .toString()), + ), + ]), + sizedBoxHeight(12.h), + commonDivider(), + sizedBoxHeight(12.h), + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + ReactionButton( + onReactionChanged: (reaction) async { + _handleReactionChange(reaction); + }, + reactions: widget.reactions + .map((reaction) => Reaction( + value: reaction.id.toString(), + previewIcon: Image.network(reaction.image, + width: 24, + height: 24, + fit: BoxFit.cover), + icon: Image.network(reaction.image, + width: 24, + height: 24, + fit: BoxFit.cover), + )) + .toList(), + selectedReaction: widget.selectedReactions[ + widget.commonObj.id] != + null + ? Reaction( + value: widget + .selectedReactions[widget.commonObj.id]! + .id + .toString(), + icon: Image.network( + widget + .selectedReactions[ + widget.commonObj.id]! + .image, + width: 24, + height: 24, + fit: BoxFit.cover, + ), + ) + : null, + boxColor: Colors.white, + boxElevation: 9, + boxRadius: 30, + itemsSpacing: 20, + itemScale: 0.3, + itemSize: const Size(30, 30), + boxPadding: const EdgeInsets.all(8), + boxAnimationDuration: + const Duration(milliseconds: 200), + itemAnimationDuration: + const Duration(milliseconds: 500), + hoverDuration: const Duration(milliseconds: 700), + child: widget.selectedReactions[ + widget.commonObj.id] != + null + ? Image.network( + widget + .selectedReactions[widget.commonObj.id]! + .image, + width: 24, + height: 24, + fit: BoxFit.cover, + ) + : Image.asset( + 'assets/images/png/uiw_like-o.png', + width: 24, + height: 24, + fit: BoxFit.cover, + ), + ), + sizedBoxHeight(8.h), + text11w400_FCFCFC('Like'), + ], + ), + widget.showCommentButton + ? GestureDetector( + onTap: () async { + bool result = await Get.toNamed( + RouteName.postdetailsScreen, + arguments: { + 'postId': widget.commonObj.id, + 'tagsList': widget.tags, + 'created_at': widget.createAt, + 'commonObj': widget.commonObj, + 'fromWhichTab': widget.forWhichTab, + 'reactions': widget.reactions, + 'selectedReactions': + widget.selectedReactions, + 'currentIndex': widget.currentIndex + }); + if (result) { + setState(() {}); + } + }, + child: Column( + children: [ + Image.asset( + 'assets/images/png/Frame 1000004088.png', + height: 19.h, + width: 19.w, + ), + sizedBoxHeight(8.h), + text11w400_FCFCFC('Comment') + ], + ), + ) + : SizedBox(), + Obx( + () => Column( + //here + children: [ + GestureDetector( + onTap: () async => + await saveunsavepost(widget.commonObj.id!), + child: countersHelper + .saveButtonPopular[widget.currentIndex] + ? Image.asset( + 'assets/images/png/postSaved.png', + height: 19.h, + width: 19.w, + ) + : Image.asset( + 'assets/images/png/Frame 1000004089.png', + height: 19.h, + width: 19.w, + ), + ), + sizedBoxHeight(8.h), + text11w400_FCFCFC('Save') + ], + ), + ), + ], + ), + sizedBoxHeight(12.h), + commonDivider(), + sizedBoxHeight(12.h), + ]), + ), + ], + )), + ); + } +} diff --git a/lib/Common/controller/data/network/network_api.dart b/lib/Common/controller/data/network/network_api.dart index dfee1ad..8491eae 100644 --- a/lib/Common/controller/data/network/network_api.dart +++ b/lib/Common/controller/data/network/network_api.dart @@ -6,6 +6,8 @@ import 'package:flutter/foundation.dart'; import 'package:get/get.dart' hide Response; import 'package:regroup/Global.dart'; import 'package:regroup/Common/base_manager.dart'; +import 'package:regroup/Utils/dialogs.dart'; +import 'package:regroup/resources/routes/route_name.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:http/http.dart' as http; @@ -16,9 +18,8 @@ class NetworkApiServices { Dio dio = Dio(); final controllerEntryPoint = Get.put(EntryPointController()); - String basicAuth = 'Basic ' + - base64.encode( - utf8.encode('RegroupUserName:71%@L%es^bUX94`J9XT*@bh,._WWM{\$%^^&&')); + String basicAuth = + 'Basic ${base64.encode(utf8.encode('RegroupUserName:71%@L%es^bUX94`J9XT*@bh,._WWM{\$%^^&&'))}'; Future getApi(String url, {bool optionalpar = false}) async { if (kDebugMode) { @@ -27,7 +28,6 @@ class NetworkApiServices { Response response; SharedPreferences prefs = await SharedPreferences.getInstance(); token = prefs.getString('access-token'); - print("url is $url"); log(token.toString()); try { @@ -52,7 +52,40 @@ class NetworkApiServices { ), ); } on Exception catch (e) { - log(e.toString()); + // log(e.toString()); + if (e is DioException) { + log(e.response.toString()); + if (e.response == null) { + return ResponseData( + 'Oops something Went Wrong, Please try again!', + ResponseStatus.FAILED, + ); + } + if (e.response!.statusCode == 401) { + if (e.response!.data['message'] == 'Invalid token') { + // prefs.remove('access-token'); + // await prefs.clear(); + // Get.offNamed(RouteName.loginScreen); + utils.showToast('Please login again'); + } else { + return ResponseData( + 'Oops something Went Wrong, Please try again!', + ResponseStatus.FAILED, + ); + } + } + if (e.response!.statusCode == 403) { + if (e.response!.data['message'] is List) { + return ResponseData( + e.response!.data['message'][0]!, ResponseStatus.FAILED, + data: e.response!.data); + } else { + return ResponseData( + e.response!.data['message'], ResponseStatus.FAILED, + data: e.response!.data); + } + } + } return ResponseData( 'Oops something Went Wrong', ResponseStatus.FAILED); } @@ -190,20 +223,39 @@ class NetworkApiServices { ); } if (e.response!.statusCode == 401) { - prefs.remove('token'); - prefs.remove('refreshToken'); + if (e.response!.data['message'] == 'Invalid token') { + prefs.remove('access-token'); + await prefs.clear(); + Get.offNamed(RouteName.loginScreen); + utils.showToast('Please login again'); + } else { + return ResponseData( + 'Oops something Went Wrong, Please try again!', + ResponseStatus.FAILED, + ); + } // Get.toNamed(RouteName.login); - return ResponseData( - 'Oops something Went Wrong, Please try again!', - ResponseStatus.FAILED, - ); + // return ResponseData( + // 'Oops something Went Wrong, Please try again!', + // ResponseStatus.FAILED, + // ); } if (e.response!.statusCode == 403) { if (e.response!.data['message'] is List) { return ResponseData( e.response!.data['message'][0]!, ResponseStatus.FAILED, data: e.response!.data); - } else { + } + // else if (e.response!.data['message'] + // // ['name'] is List + // ) { + // return ResponseData( + // // e.response!.data['message']['name'][0]!, ResponseStatus.FAILED, + // e.response!.data['message'], ResponseStatus.FAILED, + + // data: e.response!.data); + // } + else { return ResponseData( e.response!.data['message'], ResponseStatus.FAILED, data: e.response!.data); diff --git a/lib/Feed Module/Main_Screens/Community/Community.dart b/lib/Feed Module/Main_Screens/Community/Community.dart deleted file mode 100644 index 72961d5..0000000 --- a/lib/Feed Module/Main_Screens/Community/Community.dart +++ /dev/null @@ -1,1544 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_reaction_button/flutter_reaction_button.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; -import 'package:glassmorphism_ui/glassmorphism_ui.dart'; -import 'package:regroup/Common/CommonBottomNavigationBar.dart'; -import 'package:regroup/Common/CommonGlassmorphism.dart'; -import 'package:regroup/Common/CommonTabBar.dart'; -import 'package:regroup/Common/CommonWidget.dart'; -import 'package:regroup/Common/controller/MainScreen.dart'; -import 'package:regroup/Feed%20Module/sidemenu/sidemenu.dart'; -import 'package:regroup/Utils/Common/sized_box.dart'; -import 'package:regroup/Utils/texts.dart'; -import 'package:regroup/resources/routes/route_name.dart'; - -class CommunityScreen extends StatefulWidget { - const CommunityScreen({super.key}); - - @override - State createState() => _CommunityScreenState(); -} - -final List titles = [ - 'Race', - 'Swimming', - 'Events', - 'Swimming', - 'Events', -]; - -class _CommunityScreenState extends State { - final GlobalKey _scaffoldKey1 = GlobalKey(); - @override - Widget build(BuildContext context) { - return Scaffold( - resizeToAvoidBottomInset: false, - key: _scaffoldKey1, - backgroundColor: const Color(0xFF222935), - // drawerEnableOpenDragGesture: false, - drawer: SizedBox(width: 300.w, child: const SideMenu()), - extendBody: true, - appBar: AppBar( - scrolledUnderElevation: 0.0, - backgroundColor: const Color(0xff222935), - elevation: 0, - automaticallyImplyLeading: false, - titleSpacing: 0, - leading: InkWell( - onTap: () { - _scaffoldKey1.currentState?.openDrawer(); - }, - child: Center( - child: Image.asset( - 'assets/images/png/menu.png', - height: 15.h, - width: 20.w, - ), - ), - ), - title: Image.asset( - 'assets/images/png/Group.png', - width: 26.w, - height: 25.h, - ), - actions: [ - GestureDetector( - onTap: () { - Get.toNamed(RouteName.explorescreen); - }, - child: Image.asset( - 'assets/images/png/ion_search-outline.png', - height: 25.h, - width: 25.w, - ), - ), - sizedBoxWidth(10.w), - GestureDetector( - onTap: () { - Get.toNamed(RouteName.notificaationpage); - }, - child: Image.asset( - 'assets/images/png/Frame 9.png', - height: 25.h, - width: 25.w, - ), - ), - sizedBoxWidth(16.w), - ], - ), - body: Stack(clipBehavior: Clip.none, children: [ - Container( - decoration: const BoxDecoration( - image: DecorationImage( - fit: BoxFit.fill, - image: AssetImage( - 'assets/images/png/HomeScreenBackground.png', - ))), - ), - Padding( - padding: const EdgeInsets.symmetric(vertical: 16), - child: Column(children: [ - Expanded( - child: DefaultTabController( - length: 3, - // initialIndex: selectedIndex.value, - child: Column( - children: [ - const CommonTabBar(tabs: [ - Tab( - text: 'Feed', - ), - Tab( - text: 'Popular', - ), - Tab( - text: 'Latest', - ), - ]), - Expanded( - child: TabBarView( - children: [ - feedTab(), - popularTab(), - latestTab(), - ], - ), - ), - sizedBoxHeight(90.h) - ], - ), - ), - ), - ])) - ]), - floatingActionButton: Container( - height: 55.h, - width: 55.w, - decoration: const BoxDecoration( - shape: BoxShape.circle, - boxShadow: [ - BoxShadow( - color: Color(0x40000000), // Hex color with 40% opacity - offset: Offset(0, 6), - blurRadius: 8, - ), - ], - ), - child: FloatingActionButton( - onPressed: () { - Get.toNamed(RouteName.postscreen); - }, - backgroundColor: const Color(0xFFD90B2E), - autofocus: true, - shape: const CircleBorder(), - child: Image.asset( - "assets/images/png/iconamoon_edit-thin.png", - height: 30.h, - width: 30.w, - ), - ), - ), - - bottomNavigationBar: bottomnavigationbar(mainController), - ); - } -} - -Widget feedTab() { - List feedTabData = [ - { - "profileImg": "assets/images/png/Ellipse 43.png", - "title": "Edward Hackket", - "mainImg": "assets/images/png/Rectangle 24.png", - "containerTitle": ['Cycle', 'Marathon', 'Events', 'Marathon', 'Events'], - }, - { - "profileImg": "assets/images/png/Ellipse 52.png", - "title": "Ryan Dorwat", - "mainImg": "assets/images/png/Rectangle 25.png", - "containerTitle": [ - 'Football', - 'Teams player', - 'Events', - 'Marathon', - 'Events' - ], - }, - { - "profileImg": "assets/images/png/Ellipse 52.png", - "title": "Ryan Dorwat", - "mainImg": "assets/images/png/Rectangle 25.png", - "containerTitle": [ - 'Football', - 'Teams player', - 'Events', - 'Marathon', - 'Events' - ], - }, - { - "profileImg": "assets/images/png/Ellipse 52.png", - "title": "Ryan Dorwat", - "mainImg": "assets/images/png/Rectangle 25.png", - "containerTitle": [ - 'Football', - 'Teams player', - 'Events', - 'Marathon', - 'Events' - ], - }, - ]; - - return Column(children: [ - sizedBoxHeight(16.h), - Expanded( - child: ListView.builder( - shrinkWrap: true, - itemCount: feedTabData.length, - itemBuilder: (context, index) { - if (index == 1) { - return announcecardtile( - profileImg: 'assets/images/png/Ellipse 48.png', - title: 'Jocelyn Dokidis', - mainImg: 'assets/images/png/Rectangle 46.png', - containerTitle: [ - 'Race', - 'Swimming', - 'Events', - 'Marathon', - 'Events' - ]); - } else { - return Column( - children: [ - normalcardtile2( - profileImg: feedTabData[index]["profileImg"], - title: feedTabData[index]["title"], - mainImg: feedTabData[index]["mainImg"], - containerTitle: feedTabData[index]["containerTitle"]), - sizedBoxHeight(20.h) - ], - ); - } - }, - ), - ), - // normalcardtile2( - // profileImg: 'assets/images/png/Ellipse 43.png', - // title: 'Edward Hackket', - // mainImg: 'assets/images/png/Rectangle 24.png', - // containerTitle: ['Cycle', 'Marathon', 'Events', 'Marathon', 'Events']), - // sizedBoxHeight(20.h), - // announcecardtile( - // profileImg: 'assets/images/png/Ellipse 48.png', - // title: 'Jocelyn Dokidis', - // mainImg: 'assets/images/png/Rectangle 46.png', - // containerTitle: ['Race', 'Swimming', 'Events', 'Marathon', 'Events']), - // sizedBoxHeight(20.h), - // normalcardtile2( - // profileImg: 'assets/images/png/Ellipse 52.png', - // title: 'Ryan Dorwat', - // mainImg: 'assets/images/png/Rectangle 25.png', - // containerTitle: [ - // 'Football', - // 'Teams player', - // 'Events', - // 'Marathon', - // 'Events' - // ]), - // sizedBoxHeight(20.h), - ]); -} - -Widget normalcardtile2({ - required String profileImg, - required String title, - required String mainImg, - required List containerTitle, -}) { - var mainImage = 'assets/images/png/uiw_like-o.png'.obs; - void updateImage(String reaction) { - if (reaction == 'like') { - mainImage.value = 'assets/images/png/f7_hand-thumbsup.png'; - } else if (reaction == 'heart') { - mainImage.value = 'assets/images/png/heart 2.png'; - } else if (reaction == 'party') { - mainImage.value = 'assets/images/png/party-popper 2.png'; - } - } - - return commonGlassUI( - width: double.infinity, - height: 570.h, - mainOpacity: 1, - borderRadius: BorderRadius.circular(1), - customWidget: Column( - children: [ - sizedBoxHeight(25.h), - Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - CircleAvatar( - foregroundImage: AssetImage(profileImg), - radius: 25.r, - ), - sizedBoxWidth(12.w), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - text16w400_FCFCFC(title), - sizedBoxHeight(5.h), - Row( - children: [ - Image.asset( - 'assets/images/png/community 1 (traced).png', - height: 14.w, - width: 14.w, - ), - sizedBoxWidth(7.w), - text12w400_FCFCFC('Active alliance network'), - sizedBoxWidth(7.w), - Icon( - Icons.circle, - color: const Color(0xFFFCFCFC), - size: 4.sp, - ), - sizedBoxWidth(6.w), - text12w400_FCFCFC('1 Hour ago'), - ], - ) - ], - ), - const Spacer(), - PopupMenuButton( - surfaceTintColor: const Color(0xFF222935), - constraints: BoxConstraints.tightFor(width: 176.w), - offset: const Offset(0, 50), - color: const Color(0xFF222935), - tooltip: "", - itemBuilder: (BuildContext context) => [ - PopupMenuItem( - onTap: () {}, - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 12.w), - child: Row( - children: [ - Text( - 'Report Post', - style: TextStyle( - fontSize: 16.sp, - color: Colors.white, - fontWeight: FontWeight.w800, - fontFamily: "Nunito Sans", - ), - ), - const Spacer(), - Image.asset( - "assets/images/png/Vector (5).png", - height: 15.h, - width: 15.w, - ) - ], - ), - ), - ), - const PopupMenuDivider(), - PopupMenuItem( - onTap: () {}, - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 12.w), - child: Row( - children: [ - Text( - 'Share post', - style: TextStyle( - fontSize: 16.sp, - color: Colors.white, - fontWeight: FontWeight.w800, - fontFamily: "Nunito Sans", - ), - ), - const Spacer(), - Image.asset( - "assets/images/png/share.png", - height: 20.h, - width: 20.w, - ) - ], - ), - ), - ), - const PopupMenuDivider(), - PopupMenuItem( - onTap: () {}, - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 12.w), - child: Row( - children: [ - Text( - 'Pin', - style: TextStyle( - fontSize: 16.sp, - color: Colors.white, - fontWeight: FontWeight.w800, - fontFamily: "Nunito Sans", - ), - ), - const Spacer(), - Image.asset( - "assets/images/png/f7_pin-fill (2).png", - height: 25.h, - width: 25.w, - ) - ], - ), - ), - ), - ], - child: Image.asset( - 'assets/images/png/Group 1000004071.png', - width: 16.w, - height: 18.h, - ), - ), - sizedBoxWidth(5.w) - ], - ), - ), - sizedBoxHeight(20.h), - GestureDetector( - onTap: () { - Get.toNamed(RouteName.postdetailsScreen); - }, - child: Container( - height: 163.h, - width: double.infinity, - child: Image.asset( - mainImg, - fit: BoxFit.cover, - ), - )), - sizedBoxHeight(20.h), - Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), - child: Column(children: [ - SizedBox( - height: 30.h, - child: ListView.builder( - scrollDirection: Axis.horizontal, - shrinkWrap: true, - itemCount: containerTitle.length, - itemBuilder: (context, index) { - return Padding( - padding: EdgeInsets.only(right: 12.w), - child: GestureDetector( - onTap: () { - Get.toNamed(RouteName.cyclescreen); - }, - child: containertile2( - text: ("#${containerTitle[index]}"))), - ); - }, - ), - ), - sizedBoxHeight(20.h), - text16w400_FCFCFC( - "Lorem Ipsum has been the industry's standard dummy text ever since the 1500s . . ."), - Row(children: [ - InkWell( - onTap: () { - Get.toNamed(RouteName.reactionview); - }, - child: stackReaction(number: '20', containerImages: [ - 'assets/images/png/f7_hand-thumbsup.png', - 'assets/images/png/heart 2.png', - 'assets/images/png/party-popper 2.png' - ]), - ), - const Spacer(), - commonContainer( - width: 30.w, - height: 30.h, - borderColor: const Color(0xFF434A53), - borderwidth: 0.43, - opacity1: 0.2, - opacity2: 0.2, - boxShape: BoxShape.circle, - customWidget: Center( - child: Image.asset( - 'assets/images/png/Frame 1000004088.png', - height: 13.h, - width: 13.w, - ), - ), - ), - sizedBoxWidth(12.w), - text14w400_FCFCFC('20'), - sizedBoxWidth(20.w), - commonContainer( - width: 30.w, - height: 30.h, - borderColor: const Color(0xFF434A53), - borderwidth: 0.43, - opacity1: 0.2, - opacity2: 0.2, - boxShape: BoxShape.circle, - customWidget: Center( - child: Image.asset( - 'assets/images/png/Vector (1).png', - height: 12.h, - width: 12.w, - ), - ), - ), - sizedBoxWidth(12.w), - text14w400_FCFCFC('10'), - ]), - sizedBoxHeight(12.h), - commonDivider(), - sizedBoxHeight(12.h), - Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Obx(() { - return ReactionButton( - onReactionChanged: (reaction) { - updateImage(reaction?.value ?? 'like'); - debugPrint('Selected value: ${reaction?.value}'); - }, - reactions: ?>[ - Reaction( - value: 'like', - previewIcon: _buildReactionsPreviewIcon( - 'assets/images/png/f7_hand-thumbsup.png'), - icon: _buildReactionsIcon( - 'assets/images/png/f7_hand-thumbsup.png', - ), - ), - Reaction( - value: 'heart', - previewIcon: _buildReactionsPreviewIcon( - 'assets/images/png/heart 2.png'), - icon: _buildReactionsIcon( - 'assets/images/png/heart 2.png'), - ), - Reaction( - value: 'party', - previewIcon: _buildReactionsPreviewIcon( - 'assets/images/png/party-popper 2.png'), - icon: _buildReactionsIcon( - 'assets/images/png/party-popper 2.png'), - ), - ], - selectedReaction: Reaction( - value: 'like', - icon: _buildReactionsIcon( - 'assets/images/png/f7_hand-thumbs.png'), - ), - boxColor: Colors.white, - boxElevation: 2, - boxRadius: 30, - itemsSpacing: 8, - itemScale: 0.4, - itemSize: const Size(45, 45), - boxPadding: const EdgeInsets.all(8), - boxAnimationDuration: - const Duration(milliseconds: 200), - itemAnimationDuration: - const Duration(milliseconds: 500), - hoverDuration: const Duration(milliseconds: 700), - // toggle: false, - direction: ReactionsBoxAlignment.rtl, - - child: _buildReactionsIcon(mainImage.value), - ); - }) - ], - ), - GestureDetector( - onTap: () { - Get.toNamed(RouteName.postdetailsScreen); - }, - child: Column( - children: [ - Image.asset( - 'assets/images/png/Frame 1000004088.png', - height: 19.h, - width: 19.w, - ), - sizedBoxHeight(8.h), - text11w400_FCFCFC('Comment') - ], - ), - ), - Column( - children: [ - Image.asset( - 'assets/images/png/Frame 1000004089.png', - height: 19.h, - width: 19.w, - ), - sizedBoxHeight(8.h), - text11w400_FCFCFC('Save') - ], - ) - ], - ), - sizedBoxHeight(12.h), - commonDivider(), - sizedBoxHeight(12.h), - ]), - ), - ], - )); -} - -Widget normalcardtile({ - required String profileImg, - required String title, - required String mainImg, - required List containerTitle, -}) { - var mainImage = 'assets/images/png/uiw_like-o.png'.obs; - void updateImage(String reaction) { - if (reaction == 'like') { - mainImage.value = 'assets/images/png/f7_hand-thumbsup.png'; - } else if (reaction == 'heart') { - mainImage.value = 'assets/images/png/heart 2.png'; - } else if (reaction == 'party') { - mainImage.value = 'assets/images/png/party-popper 2.png'; - } - } - - return commonGlassContainer( - width: double.infinity, - height: 570.h, - border: 0, - borderradius: 1, - customWidget: Column( - children: [ - sizedBoxHeight(25.h), - Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - CircleAvatar( - foregroundImage: AssetImage(profileImg), - radius: 25.r, - ), - sizedBoxWidth(12.w), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - text16w400_FCFCFC(title), - sizedBoxHeight(5.h), - Row( - children: [ - Image.asset( - 'assets/images/png/community 1 (traced).png', - height: 14.w, - width: 14.w, - ), - sizedBoxWidth(7.w), - text12w400_FCFCFC('Active alliance network'), - sizedBoxWidth(7.w), - Icon( - Icons.circle, - color: const Color(0xFFFCFCFC), - size: 4.sp, - ), - sizedBoxWidth(6.w), - text12w400_FCFCFC('1 Hour ago'), - ], - ) - ], - ), - const Spacer(), - PopupMenuButton( - surfaceTintColor: const Color(0xFF222935), - constraints: BoxConstraints.tightFor(width: 176.w), - offset: const Offset(0, 50), - color: const Color(0xFF222935), - tooltip: "", - itemBuilder: (BuildContext context) => [ - PopupMenuItem( - onTap: () {}, - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 12.w), - child: Row( - children: [ - Text( - 'Report Post', - style: TextStyle( - fontSize: 16.sp, - color: Colors.white, - fontWeight: FontWeight.w800, - fontFamily: "Nunito Sans", - ), - ), - const Spacer(), - Image.asset( - "assets/images/png/Vector (5).png", - height: 15.h, - width: 15.w, - ) - ], - ), - ), - ), - const PopupMenuDivider(), - PopupMenuItem( - onTap: () {}, - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 12.w), - child: Row( - children: [ - Text( - 'Share post', - style: TextStyle( - fontSize: 16.sp, - color: Colors.white, - fontWeight: FontWeight.w800, - fontFamily: "Nunito Sans", - ), - ), - const Spacer(), - Image.asset( - "assets/images/png/share.png", - height: 20.h, - width: 20.w, - ) - ], - ), - ), - ), - const PopupMenuDivider(), - PopupMenuItem( - onTap: () {}, - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 12.w), - child: Row( - children: [ - Text( - 'Pin', - style: TextStyle( - fontSize: 16.sp, - color: Colors.white, - fontWeight: FontWeight.w800, - fontFamily: "Nunito Sans", - ), - ), - const Spacer(), - Image.asset( - "assets/images/png/f7_pin-fill (2).png", - height: 25.h, - width: 25.w, - ) - ], - ), - ), - ), - ], - child: Image.asset( - 'assets/images/png/Group 1000004071.png', - width: 16.w, - height: 18.h, - ), - ), - sizedBoxWidth(5.w) - ], - ), - ), - sizedBoxHeight(20.h), - GestureDetector( - onTap: () { - Get.toNamed(RouteName.postdetailsScreen); - }, - child: Container( - height: 163.h, - width: double.infinity, - child: Image.asset( - mainImg, - fit: BoxFit.cover, - ), - )), - sizedBoxHeight(20.h), - Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), - child: Column(children: [ - SizedBox( - height: 30.h, - child: ListView.builder( - scrollDirection: Axis.horizontal, - shrinkWrap: true, - itemCount: containerTitle.length, - itemBuilder: (context, index) { - return Padding( - padding: EdgeInsets.only(right: 12.w), - child: GestureDetector( - onTap: () { - Get.toNamed(RouteName.cyclescreen); - }, - child: containertile( - text: ("#${containerTitle[index]}"))), - ); - }, - ), - ), - sizedBoxHeight(20.h), - text16w400_FCFCFC( - "Lorem Ipsum has been the industry's standard dummy text ever since the 1500s . . ."), - Row(children: [ - InkWell( - onTap: () { - Get.toNamed(RouteName.reactionview); - }, - child: stackReaction(number: '20', containerImages: [ - 'assets/images/png/f7_hand-thumbsup.png', - 'assets/images/png/heart 2.png', - 'assets/images/png/party-popper 2.png' - ]), - ), - const Spacer(), - commonGlassContainer( - border: 0.43, - width: 30.w, - height: 30.h, - opacity1: 0.05, - opacity2: 0.06, - borderradius: 100, - customWidget: Center( - child: Image.asset( - 'assets/images/png/Frame 1000004088.png', - height: 13.h, - width: 13.w, - ), - ), - ), - sizedBoxWidth(12.w), - text14w400_FCFCFC('20'), - sizedBoxWidth(20.w), - commonGlassContainer( - border: 0.43, - width: 30.w, - height: 30.h, - borderradius: 100, - opacity1: 0.05, - opacity2: 0.06, - customWidget: Center( - child: Image.asset( - 'assets/images/png/Vector (1).png', - height: 12.h, - width: 12.w, - ), - ), - ), - sizedBoxWidth(12.w), - text14w400_FCFCFC('10'), - ]), - sizedBoxHeight(12.h), - commonDivider(), - sizedBoxHeight(12.h), - Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Obx(() { - return ReactionButton( - onReactionChanged: (reaction) { - updateImage(reaction?.value ?? 'like'); - debugPrint('Selected value: ${reaction?.value}'); - }, - reactions: ?>[ - Reaction( - value: 'like', - previewIcon: _buildReactionsPreviewIcon( - 'assets/images/png/f7_hand-thumbsup.png'), - icon: _buildReactionsIcon( - 'assets/images/png/f7_hand-thumbsup.png', - ), - ), - Reaction( - value: 'heart', - previewIcon: _buildReactionsPreviewIcon( - 'assets/images/png/heart 2.png'), - icon: _buildReactionsIcon( - 'assets/images/png/heart 2.png'), - ), - Reaction( - value: 'party', - previewIcon: _buildReactionsPreviewIcon( - 'assets/images/png/party-popper 2.png'), - icon: _buildReactionsIcon( - 'assets/images/png/party-popper 2.png'), - ), - ], - selectedReaction: Reaction( - value: 'like', - icon: _buildReactionsIcon( - 'assets/images/png/f7_hand-thumbs.png'), - ), - boxColor: Colors.white, - boxElevation: 2, - boxRadius: 30, - itemsSpacing: 8, - itemScale: 0.4, - itemSize: const Size(45, 45), - boxPadding: const EdgeInsets.all(8), - boxAnimationDuration: - const Duration(milliseconds: 200), - itemAnimationDuration: - const Duration(milliseconds: 500), - hoverDuration: const Duration(milliseconds: 700), - // toggle: false, - direction: ReactionsBoxAlignment.rtl, - - child: _buildReactionsIcon(mainImage.value), - ); - }) - ], - ), - GestureDetector( - onTap: () { - Get.toNamed(RouteName.postdetailsScreen); - }, - child: Column( - children: [ - Image.asset( - 'assets/images/png/Frame 1000004088.png', - height: 19.h, - width: 19.w, - ), - sizedBoxHeight(8.h), - text11w400_FCFCFC('Comment') - ], - ), - ), - Column( - children: [ - Image.asset( - 'assets/images/png/Frame 1000004089.png', - height: 19.h, - width: 19.w, - ), - sizedBoxHeight(8.h), - text11w400_FCFCFC('Save') - ], - ) - ], - ), - sizedBoxHeight(12.h), - commonDivider(), - sizedBoxHeight(12.h), - ]), - ), - ], - )); -} - -Widget announcecardtile({ - required String profileImg, - required String title, - required String mainImg, - required List containerTitle, -}) { - var mainImage = 'assets/images/png/uiw_like-o.png'.obs; - void updateImage(String reaction) { - if (reaction == 'like') { - mainImage.value = 'assets/images/png/f7_hand-thumbsup.png'; - } else if (reaction == 'heart') { - mainImage.value = 'assets/images/png/heart 2.png'; - } else if (reaction == 'party') { - mainImage.value = 'assets/images/png/party-popper 2.png'; - } - } - -// MediaQuery.of(context).size.height - return Column( - children: [ - commonGlassUIBlue( - width: double.infinity, - height: 610.h, - borderRadius: BorderRadius.circular(1), - customWidget: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - sizedBoxHeight(25.h), - Padding( - padding: EdgeInsets.only(left: 16.w), - child: text16w700_FCFCFC("#Announcement"), - ), - sizedBoxHeight(25.h), - Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - CircleAvatar( - foregroundImage: AssetImage(profileImg), - radius: 25.r, - ), - sizedBoxWidth(12.w), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - text16w400_FCFCFC(title), - sizedBoxHeight(5.h), - Row( - children: [ - Image.asset( - 'assets/images/png/community 1 (traced).png', - height: 14.w, - width: 14.w, - ), - sizedBoxWidth(7.w), - text12w400_FCFCFC('Active alliance network'), - sizedBoxWidth(7.w), - Icon( - Icons.circle, - color: const Color(0xFFFCFCFC), - size: 4.sp, - ), - sizedBoxWidth(6.w), - text12w400_FCFCFC('1 Hour ago'), - ], - ) - ], - ), - const Spacer(), - PopupMenuButton( - surfaceTintColor: const Color(0xFF222935), - constraints: BoxConstraints.tightFor(width: 176.w), - offset: const Offset(0, 50), - color: const Color(0xFF222935), - tooltip: "", - itemBuilder: (BuildContext context) => [ - PopupMenuItem( - onTap: () {}, - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 12.w), - child: Row( - children: [ - Text( - 'Report Post', - style: TextStyle( - fontSize: 16.sp, - color: Colors.white, - fontWeight: FontWeight.w800, - fontFamily: "Nunito Sans", - ), - ), - const Spacer(), - Image.asset( - "assets/images/png/Vector (5).png", - height: 15.h, - width: 15.w, - ) - ], - ), - ), - ), - const PopupMenuDivider(), - PopupMenuItem( - onTap: () {}, - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 12.w), - child: Row( - children: [ - Text( - 'Share post', - style: TextStyle( - fontSize: 16.sp, - color: Colors.white, - fontWeight: FontWeight.w800, - fontFamily: "Nunito Sans", - ), - ), - const Spacer(), - Image.asset( - "assets/images/png/share.png", - height: 20.h, - width: 20.w, - ) - ], - ), - ), - ), - const PopupMenuDivider(), - PopupMenuItem( - onTap: () {}, - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 12.w), - child: Row( - children: [ - Text( - 'Pin', - style: TextStyle( - fontSize: 16.sp, - color: Colors.white, - fontWeight: FontWeight.w800, - fontFamily: "Nunito Sans", - ), - ), - const Spacer(), - Image.asset( - "assets/images/png/f7_pin-fill (2).png", - height: 25.h, - width: 25.w, - ) - ], - ), - ), - ), - ], - child: Image.asset( - 'assets/images/png/Group 1000004071.png', - width: 16.w, - height: 18.h, - ), - ), - sizedBoxWidth(5.w) - ], - ), - ), - sizedBoxHeight(20.h), - GestureDetector( - onTap: () { - // Get.toNamed(RouteName.postdetailsScreen); - }, - child: SizedBox( - height: 163.h, - width: double.infinity, - child: Image.asset( - mainImg, - fit: BoxFit.cover, - ), - )), - sizedBoxHeight(20.h), - Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), - child: Column(children: [ - SizedBox( - height: 30.h, - child: ListView.builder( - scrollDirection: Axis.horizontal, - shrinkWrap: true, - itemCount: containerTitle.length, - itemBuilder: (context, index) { - return Padding( - padding: EdgeInsets.only(right: 12.w), - child: GestureDetector( - onTap: () { - // Get.toNamed(RouteName.cyclescreen); - }, - child: - containertile2(text: containerTitle[index])), - ); - }, - ), - ), - sizedBoxHeight(20.h), - text16w400_FCFCFC( - "Lorem Ipsum has been the industry's standard dummy text ever since the 1500s . . ."), - Row(children: [ - InkWell( - onTap: () { - // Get.toNamed(RouteName.reactionview); - }, - child: stackReaction(number: '20', containerImages: [ - 'assets/images/png/f7_hand-thumbsup.png', - 'assets/images/png/heart 2.png', - 'assets/images/png/party-popper 2.png' - ]), - ), - const Spacer(), - commonContainer( - width: 30.w, - height: 30.h, - borderColor: const Color(0xFF434A53), - borderwidth: 0.43, - opacity1: 0.2, - opacity2: 0.2, - boxShape: BoxShape.circle, - customWidget: Center( - child: Image.asset( - 'assets/images/png/Frame 1000004088.png', - height: 13.h, - width: 13.w, - ), - ), - ), - sizedBoxWidth(12.w), - text14w400_FCFCFC('20'), - sizedBoxWidth(20.w), - commonContainer( - width: 30.w, - height: 30.h, - borderColor: const Color(0xFF434A53), - borderwidth: 0.43, - opacity1: 0.2, - opacity2: 0.2, - boxShape: BoxShape.circle, - customWidget: Center( - child: Image.asset( - 'assets/images/png/Vector (1).png', - height: 12.h, - width: 12.w, - ), - ), - ), - sizedBoxWidth(12.w), - text14w400_FCFCFC('10'), - ]), - sizedBoxHeight(12.h), - commonDivider(), - sizedBoxHeight(12.h), - Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Obx(() { - return ReactionButton( - onReactionChanged: (reaction) { - updateImage(reaction?.value ?? 'like'); - debugPrint( - 'Selected value: ${reaction?.value}'); - }, - reactions: ?>[ - Reaction( - value: 'like', - previewIcon: _buildReactionsPreviewIcon( - 'assets/images/png/f7_hand-thumbsup.png'), - icon: _buildReactionsIcon( - 'assets/images/png/f7_hand-thumbsup.png'), - ), - Reaction( - value: 'heart', - previewIcon: _buildReactionsPreviewIcon( - 'assets/images/png/heart 2.png'), - icon: _buildReactionsIcon( - 'assets/images/png/heart 2.png'), - ), - Reaction( - value: 'party', - previewIcon: _buildReactionsPreviewIcon( - 'assets/images/png/party-popper 2.png'), - icon: _buildReactionsIcon( - 'assets/images/png/party-popper 2.png'), - ), - ], - selectedReaction: Reaction( - value: 'like', - icon: _buildReactionsIcon( - 'assets/images/png/f7_hand-thumbsup.png'), - ), - boxColor: Colors.white, - boxElevation: 9, - boxRadius: 30, - itemsSpacing: 8, - itemScale: 0.4, - itemSize: const Size(45, 45), - boxPadding: const EdgeInsets.all(8), - boxAnimationDuration: - const Duration(milliseconds: 200), - itemAnimationDuration: - const Duration(milliseconds: 500), - hoverDuration: const Duration(milliseconds: 700), - // toggle: false, - - child: _buildReactionsIcon(mainImage.value), - ); - }) - ], - ), - GestureDetector( - onTap: () { - // Get.toNamed(RouteName.postdetailsScreen); - }, - child: Column( - children: [ - Image.asset( - 'assets/images/png/Frame 1000004088.png', - height: 19.h, - width: 19.w, - ), - sizedBoxHeight(8.h), - text11w400_FCFCFC('Comment') - ], - ), - ), - Column( - children: [ - Image.asset( - 'assets/images/png/Frame 1000004089.png', - height: 19.h, - width: 19.w, - ), - sizedBoxHeight(8.h), - text11w400_FCFCFC('Save') - ], - ) - ], - ), - sizedBoxHeight(12.h), - commonDivider(), - sizedBoxHeight(12.h), - ]), - ), - ], - )), - sizedBoxHeight(20.h), - ], - ); -} - -Widget _buildReactionsPreviewIcon(String assetPath) { - return Padding( - padding: const EdgeInsets.all(8.0), - child: Image.asset( - assetPath, - height: 40.h, - width: 40.w, - ), - ); -} - -Widget _buildReactionsIcon(String assetPath) { - return Column( - children: [ - Image.asset( - assetPath, - height: 19.h, - width: 19.w, - ), - sizedBoxHeight(8.h), - text11w400_FCFCFC('Like') - ], - ); -} - -Widget containertile({required String text}) { - return commonGlassContainer( - border: 1, - width: 130.w, - height: 30.h, - borderradius: 30.r, - borderColor: const Color(0xFFD90B2E), - customWidget: Padding( - padding: EdgeInsets.symmetric(horizontal: 10.w), - child: Center(child: text14w400_FCFCFC(text)), - )); -} - -Widget containertile2({required String text}) { - return commonContainer( - width: 130.w, - height: 30.h, - borderRadius: BorderRadius.circular(30.r), - borderColor: const Color(0xFFD90B2E), - opacity1: 0.04, - opacity2: 0.05, - customWidget: Padding( - padding: EdgeInsets.symmetric(horizontal: 10.w), - child: Center(child: text14w400_FCFCFC(text)), - )); -} - -Widget popularTab() { - List popularTabData = [ - { - "profileImg": "assets/images/png/Ellipse 43.png", - "title": "Edward Hackket", - "mainImg": "assets/images/png/Rectangle 24.png", - "containerTitle": ['Cycle', 'Marathon', 'Events', 'Marathon', 'Events'], - }, - { - "profileImg": "assets/images/png/Ellipse 52.png", - "title": "Ryan Dorwat", - "mainImg": "assets/images/png/Rectangle 25.png", - "containerTitle": [ - 'Football', - 'Teams player', - 'Events', - 'Marathon', - 'Events' - ], - }, - { - "profileImg": "assets/images/png/Ellipse 52.png", - "title": "Ryan Dorwat", - "mainImg": "assets/images/png/Rectangle 25.png", - "containerTitle": [ - 'Football', - 'Teams player', - 'Events', - 'Marathon', - 'Events' - ], - }, - { - "profileImg": "assets/images/png/Ellipse 52.png", - "title": "Ryan Dorwat", - "mainImg": "assets/images/png/Rectangle 25.png", - "containerTitle": [ - 'Football', - 'Teams player', - 'Events', - 'Marathon', - 'Events' - ], - }, - ]; - - return Column( - children: [ - sizedBoxHeight(20.h), - Expanded( - child: ListView.builder( - shrinkWrap: true, - itemCount: popularTabData.length, - itemBuilder: (context, index) { - return Column( - children: [ - normalcardtile2( - profileImg: popularTabData[index]["profileImg"], - title: popularTabData[index]["title"], - mainImg: popularTabData[index]["mainImg"], - containerTitle: popularTabData[index]["containerTitle"]), - sizedBoxHeight(20.h) - ], - ); - }, - ), - ), - ], - ); -} - -Widget latestTab() { - List latestTabData = [ - { - "profileImg": "assets/images/png/Ellipse 43.png", - "title": "Edward Hackket", - "mainImg": "assets/images/png/Rectangle 24.png", - "containerTitle": ['Cycle', 'Marathon', 'Events', 'Marathon', 'Events'], - }, - { - "profileImg": "assets/images/png/Ellipse 52.png", - "title": "Ryan Dorwat", - "mainImg": "assets/images/png/Rectangle 25.png", - "containerTitle": [ - 'Football', - 'Teams player', - 'Events', - 'Marathon', - 'Events' - ], - }, - { - "profileImg": "assets/images/png/Ellipse 52.png", - "title": "Ryan Dorwat", - "mainImg": "assets/images/png/Rectangle 25.png", - "containerTitle": [ - 'Football', - 'Teams player', - 'Events', - 'Marathon', - 'Events' - ], - }, - { - "profileImg": "assets/images/png/Ellipse 52.png", - "title": "Ryan Dorwat", - "mainImg": "assets/images/png/Rectangle 25.png", - "containerTitle": [ - 'Football', - 'Teams player', - 'Events', - 'Marathon', - 'Events' - ], - }, - ]; - - return Column(children: [ - sizedBoxHeight(16.h), - Expanded( - child: ListView.builder( - shrinkWrap: true, - itemCount: latestTabData.length, - itemBuilder: (context, index) { - if (index == 1) { - return announcecardtile( - profileImg: 'assets/images/png/Ellipse 48.png', - title: 'Jocelyn Dokidis', - mainImg: 'assets/images/png/Rectangle 46.png', - containerTitle: [ - 'Race', - 'Swimming', - 'Events', - 'Marathon', - 'Events' - ]); - } else { - return Column( - children: [ - normalcardtile2( - profileImg: latestTabData[index]["profileImg"], - title: latestTabData[index]["title"], - mainImg: latestTabData[index]["mainImg"], - containerTitle: latestTabData[index]["containerTitle"]), - sizedBoxHeight(20.h) - ], - ); - } - }, - ), - ), - - // normalcardtile2( - // profileImg: 'assets/images/png/Ellipse 43.png', - // title: 'Edward Hackket', - // mainImg: 'assets/images/png/Rectangle 24.png', - // containerTitle: ['Cycle', 'Marathon', 'Events', 'Marathon', 'Events']), - // sizedBoxHeight(20.h), - // announcecardtile( - // profileImg: 'assets/images/png/Ellipse 48.png', - // title: 'Jocelyn Dokidis', - // mainImg: 'assets/images/png/Rectangle 46.png', - // containerTitle: ['Race', 'Swimming', 'Events', 'Marathon', 'Events']), - // sizedBoxHeight(20.h), - ]); -} diff --git a/lib/Feed Module/Main_Screens/Community/CycleScreen.dart b/lib/Feed Module/Main_Screens/Community/CycleScreen.dart deleted file mode 100644 index 799e14e..0000000 --- a/lib/Feed Module/Main_Screens/Community/CycleScreen.dart +++ /dev/null @@ -1,487 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_reaction_button/flutter_reaction_button.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; -import 'package:regroup/Common/CommonGlassmorphism.dart'; -import 'package:regroup/Common/CommonTabBar.dart'; -import 'package:regroup/Common/CommonWidget.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/Community/Community.dart'; -import 'package:regroup/Utils/Common/CommonAppbar.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; -import 'package:regroup/Utils/Common/sized_box.dart'; -import 'package:regroup/Utils/texts.dart'; -import 'package:regroup/resources/routes/route_name.dart'; - -class CycleScreen extends StatefulWidget { - const CycleScreen({super.key}); - - @override - State createState() => _CycleScreenState(); -} - -class _CycleScreenState extends State { - @override - Widget build(BuildContext context) { - return Scaffold( - backgroundColor: const Color(0xFF222935), - extendBody: true, - resizeToAvoidBottomInset: false, - appBar: CommonAppbar( - titleTxt: "Cycle", - customActionWidget: Image.asset( - "assets/images/png/sidemenu/f7_pin-fill.png", - height: 26.h, - width: 26.w, - )), - body: Stack(children: [ - Container( - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage("assets/images/png/Ellipse 1496.png"), - fit: BoxFit.fill)), - ), Column(children: [ - sizedBoxHeight(10.h), - DefaultTabController( - length: 2, - // initialIndex: selectedIndex.value, - child: Column( - children: [ - const CommonTabBar(tabs: [ - Tab( - text: 'Popular', - ), - Tab( - text: 'Latest', - ), - ]), - SizedBox( - height: 670.h, - child: TabBarView( - children: [ - cyclepopularTab(), - cyclelatestTab(), - ], - ), - ), - ], - )) - ]) - ])); - } -} - -Widget cyclepopularTab() { - return SingleChildScrollView( - child: Column(children: [ - sizedBoxHeight(20.h), - normalcardtile( - profileImg: 'assets/images/png/Ellipse 52.png', - title: 'Ryan Dorwat', - mainImg: 'assets/images/png/img322.png', - containerTitle: [ - 'Football', - 'Teams player', - 'Events', - 'Marathon', - 'Events' - ]), - sizedBoxHeight(30.h), - normalcardtile( - profileImg: 'assets/images/png/Ellipse 43.png', - title: 'Edward Hackket', - mainImg: 'assets/images/png/Rectangle 24.png', - containerTitle: [ - 'Cycle', - 'Marathon', - 'Events', - 'Marathon', - 'Events' - ]), - ]), - ); -} - -Widget cyclelatestTab() { - return SingleChildScrollView( - child: Column(children: [ - sizedBoxHeight(20.h), - normalcardtile( - profileImg: 'assets/images/png/Ellipse 43.png', - title: 'Edward Hackket', - mainImg: 'assets/images/png/Rectangle 24.png', - containerTitle: [ - 'Cycle', - 'Marathon', - 'Events', - 'Marathon', - 'Events' - ]), - ]), - ); -} - -Widget normalcardtile({ - required String profileImg, - required String title, - required String mainImg, - required List containerTitle, -}) { - var mainImage = 'assets/images/png/uiw_like-o.png'.obs; - void updateImage(String reaction) { - if (reaction == 'like') { - mainImage.value = 'assets/images/png/f7_hand-thumbsup.png'; - } else if (reaction == 'heart') { - mainImage.value = 'assets/images/png/heart 2.png'; - } else if (reaction == 'party') { - mainImage.value = 'assets/images/png/party-popper 2.png'; - } - } - - return commonGlassContainer( - width: double.infinity, - height: 570.h, - border: 0, - borderradius: 1, - customWidget: Column( - children: [ - sizedBoxHeight(25.h), - Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - CircleAvatar( - foregroundImage: AssetImage(profileImg), - radius: 25.r, - ), - sizedBoxWidth(12.w), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - text16w400_FCFCFC(title), - sizedBoxHeight(5.h), - Row( - children: [ - Image.asset( - 'assets/images/png/community 1 (traced).png', - height: 14.w, - width: 14.w, - ), - sizedBoxWidth(7.w), - text12w400_FCFCFC('Active alliance network'), - sizedBoxWidth(7.w), - Icon( - Icons.circle, - color: const Color(0xFFFCFCFC), - size: 4.sp, - ), - sizedBoxWidth(6.w), - text12w400_FCFCFC('1 Hour ago'), - ], - ) - ], - ), - const Spacer(), - PopupMenuButton( - surfaceTintColor: const Color(0xFF222935), - constraints: BoxConstraints.tightFor(width: 176.w), - offset: const Offset(0, 50), - color: const Color(0xFF222935), - tooltip: "", - itemBuilder: (BuildContext context) => [ - PopupMenuItem( - onTap: () {}, - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 12.w), - child: Row( - children: [ - Text( - 'Report Post', - style: TextStyle( - fontSize: 16.sp, - color: Colors.white, - fontWeight: FontWeight.w800, - fontFamily: "Nunito Sans", - ), - ), - const Spacer(), - Image.asset( - "assets/images/png/Vector (5).png", - height: 15.h, - width: 15.w, - ) - ], - ), - ), - ), - const PopupMenuDivider(), - PopupMenuItem( - onTap: () {}, - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 12.w), - child: Row( - children: [ - Text( - 'Share post', - style: TextStyle( - fontSize: 16.sp, - color: Colors.white, - fontWeight: FontWeight.w800, - fontFamily: "Nunito Sans", - ), - ), - const Spacer(), - Image.asset( - "assets/images/png/share.png", - height: 20.h, - width: 20.w, - ) - ], - ), - ), - ), - const PopupMenuDivider(), - PopupMenuItem( - onTap: () {}, - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 12.w), - child: Row( - children: [ - Text( - 'Pin', - style: TextStyle( - fontSize: 16.sp, - color: Colors.white, - fontWeight: FontWeight.w800, - fontFamily: "Nunito Sans", - ), - ), - const Spacer(), - Image.asset( - "assets/images/png/f7_pin-fill (2).png", - height: 25.h, - width: 25.w, - ) - ], - ), - ), - ), - ], - child: Image.asset( - 'assets/images/png/Group 1000004071.png', - width: 16.w, - height: 18.h, - ), - ), - sizedBoxWidth(5.w) - ], - ), - ), - sizedBoxHeight(20.h), - GestureDetector( - onTap: () { - Get.toNamed(RouteName.postdetailsScreen); - }, - child: SizedBox( - height: 163.h, - width: double.infinity, - child: Image.asset( - mainImg, - fit: BoxFit.cover, - ), - )), - sizedBoxHeight(20.h), - Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), - child: Column(children: [ - SizedBox( - height: 30.h, - child: ListView.builder( - scrollDirection: Axis.horizontal, - shrinkWrap: true, - itemCount: containerTitle.length, - itemBuilder: (context, index) { - return Padding( - padding: EdgeInsets.only(right: 12.w), - child: GestureDetector( - onTap: () { - Get.toNamed(RouteName.cyclescreen); - }, - child: containertile(text: containerTitle[index])), - ); - }, - ), - ), - sizedBoxHeight(20.h), - text16w400_FCFCFC( - "Lorem Ipsum has been the industry's standard dummy text ever since the 1500s . . ."), - Row(children: [ - InkWell( - onTap: () { - Get.toNamed(RouteName.reactionview); - }, - child: stackReaction(number: '20', containerImages: [ - 'assets/images/png/f7_hand-thumbsup.png', - 'assets/images/png/heart 2.png', - 'assets/images/png/party-popper 2.png' - ]), - ), - const Spacer(), - commonGlassContainer( - border: 0.43, - width: 30.w, - height: 30.h, - opacity1: 0.05, - opacity2: 0.06, - borderradius: 100, - customWidget: Center( - child: Image.asset( - 'assets/images/png/Frame 1000004088.png', - height: 13.h, - width: 13.w, - ), - ), - ), - sizedBoxWidth(12.w), - text14w400_FCFCFC('20'), - sizedBoxWidth(20.w), - commonGlassContainer( - border: 0.43, - width: 30.w, - height: 30.h, - borderradius: 100, - opacity1: 0.05, - opacity2: 0.06, - customWidget: Center( - child: Image.asset( - 'assets/images/png/Vector (1).png', - height: 12.h, - width: 12.w, - ), - ), - ), - sizedBoxWidth(12.w), - text14w400_FCFCFC('10'), - ]), - sizedBoxHeight(12.h), - commonDivider(), - sizedBoxHeight(12.h), - Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Obx(() { - return ReactionButton( - onReactionChanged: (reaction) { - updateImage(reaction?.value ?? 'like'); - debugPrint('Selected value: ${reaction?.value}'); - }, - reactions: ?>[ - Reaction( - value: 'like', - previewIcon: _buildReactionsPreviewIcon( - 'assets/images/png/f7_hand-thumbsup.png'), - icon: _buildReactionsIcon( - 'assets/images/png/f7_hand-thumbsup.png'), - ), - Reaction( - value: 'heart', - previewIcon: _buildReactionsPreviewIcon( - 'assets/images/png/heart 2.png'), - icon: _buildReactionsIcon( - 'assets/images/png/heart 2.png'), - ), - Reaction( - value: 'party', - previewIcon: _buildReactionsPreviewIcon( - 'assets/images/png/party-popper 2.png'), - icon: _buildReactionsIcon( - 'assets/images/png/party-popper 2.png'), - ), - ], - selectedReaction: Reaction( - value: 'like', - icon: _buildReactionsIcon( - 'assets/images/png/f7_hand-thumbsup.png'), - ), - boxColor: Colors.white, - boxElevation: 9, - boxRadius: 30, - itemsSpacing: 8, - itemScale: 0.4, - itemSize: const Size(45, 45), - boxPadding: const EdgeInsets.all(8), - boxAnimationDuration: const Duration(milliseconds: 200), - itemAnimationDuration: const Duration(milliseconds: 500), - hoverDuration: const Duration(milliseconds: 700), - // toggle: false, - - child: _buildReactionsIcon(mainImage.value), - ); - }) - ], - ), - GestureDetector( - onTap: () { - Get.toNamed(RouteName.postdetailsScreen); - }, - child: Column( - children: [ - Image.asset( - 'assets/images/png/Frame 1000004088.png', - height: 19.h, - width: 19.w, - ), - sizedBoxHeight(8.h), - text11w400_FCFCFC('Comment') - ], - ), - ), - Column( - children: [ - Image.asset( - 'assets/images/png/Frame 1000004089.png', - height: 19.h, - width: 19.w, - ), - sizedBoxHeight(8.h), - text11w400_FCFCFC('Save') - ], - ) - ], - ), - sizedBoxHeight(12.h), - commonDivider(), - sizedBoxHeight(12.h), - ]), - ), - ], - )); -} - -Widget _buildReactionsPreviewIcon(String assetPath) { - return Padding( - padding: const EdgeInsets.all(8.0), - child: Image.asset( - assetPath, - height: 40.h, - width: 40.w, - ), - ); -} - -Widget _buildReactionsIcon(String assetPath) { - return Column( - children: [ - Image.asset( - assetPath, - height: 19.h, - width: 19.w, - ), - sizedBoxHeight(8.h), - text11w400_FCFCFC('Like') - ], - ); -} diff --git a/lib/Feed Module/Main_Screens/Community/Model/communitylistModel.dart b/lib/Feed Module/Main_Screens/Community/Model/communitylistModel.dart new file mode 100644 index 0000000..e0a2596 --- /dev/null +++ b/lib/Feed Module/Main_Screens/Community/Model/communitylistModel.dart @@ -0,0 +1,83 @@ +class CommunityListModel { + String? status; + int? statusCode; + String? message; + List? data; + + CommunityListModel({this.status, this.statusCode, this.message, this.data}); + + CommunityListModel.fromJson(Map json) { + status = json['status']; + statusCode = json['status_code']; + message = json['message']; + if (json['data'] != null) { + data = []; + json['data'].forEach((v) { + data!.add(new Data.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = new Map(); + data['status'] = this.status; + data['status_code'] = this.statusCode; + data['message'] = this.message; + if (this.data != null) { + data['data'] = this.data!.map((v) => v.toJson()).toList(); + } + return data; + } +} + +class Data { + int? id; + int? iamPrincipalXid; + int? manageCommunityXid; + Community? community; + + Data( + {this.id, this.iamPrincipalXid, this.manageCommunityXid, this.community}); + + Data.fromJson(Map json) { + id = json['id']; + iamPrincipalXid = json['iam_principal_xid']; + manageCommunityXid = json['manage_community_xid']; + community = json['community'] != null + ? new Community.fromJson(json['community']) + : null; + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['iam_principal_xid'] = this.iamPrincipalXid; + data['manage_community_xid'] = this.manageCommunityXid; + if (this.community != null) { + data['community'] = this.community!.toJson(); + } + return data; + } +} + +class Community { + int? id; + String? communityName; + String? communityProfilePhoto; + + Community({this.id, this.communityName, this.communityProfilePhoto}); + + Community.fromJson(Map json) { + id = json['id']; + communityName = json['community_name']; + communityProfilePhoto = json['community_profile_photo']; + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['community_name'] = this.communityName; + data['community_profile_photo'] = this.communityProfilePhoto; + return data; + } +} diff --git a/lib/Feed Module/Main_Screens/Community/Model/populartagsListModel.dart b/lib/Feed Module/Main_Screens/Community/Model/populartagsListModel.dart new file mode 100644 index 0000000..48c5c79 --- /dev/null +++ b/lib/Feed Module/Main_Screens/Community/Model/populartagsListModel.dart @@ -0,0 +1,53 @@ +class PopulartagsListModel { + String? status; + int? statusCode; + String? message; + List? data; + + PopulartagsListModel({this.status, this.statusCode, this.message, this.data}); + + PopulartagsListModel.fromJson(Map json) { + status = json['status']; + statusCode = json['status_code']; + message = json['message']; + if (json['data'] != null) { + data = []; + json['data'].forEach((v) { + data!.add(new Data.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = new Map(); + data['status'] = this.status; + data['status_code'] = this.statusCode; + data['message'] = this.message; + if (this.data != null) { + data['data'] = this.data!.map((v) => v.toJson()).toList(); + } + return data; + } +} + +class Data { + int? id; + String? name; + int? tagPopularity; + + Data({this.id, this.name, this.tagPopularity}); + + Data.fromJson(Map json) { + id = json['id']; + name = json['name']; + tagPopularity = json['tag_popularity']; + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['name'] = this.name; + data['tag_popularity'] = this.tagPopularity; + return data; + } +} diff --git a/lib/Feed Module/Main_Screens/Community/Model/tagsmainModel.dart b/lib/Feed Module/Main_Screens/Community/Model/tagsmainModel.dart new file mode 100644 index 0000000..a80f350 --- /dev/null +++ b/lib/Feed Module/Main_Screens/Community/Model/tagsmainModel.dart @@ -0,0 +1,53 @@ +class TagsMainModel { + String? status; + int? statusCode; + String? message; + List? data; + + TagsMainModel({this.status, this.statusCode, this.message, this.data}); + + TagsMainModel.fromJson(Map json) { + status = json['status']; + statusCode = json['status_code']; + message = json['message']; + if (json['data'] != null) { + data = []; + json['data'].forEach((v) { + data!.add(new Data.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = new Map(); + data['status'] = this.status; + data['status_code'] = this.statusCode; + data['message'] = this.message; + if (this.data != null) { + data['data'] = this.data!.map((v) => v.toJson()).toList(); + } + return data; + } +} + +class Data { + int? id; + String? name; + int? tagPopularity; + + Data({this.id, this.name, this.tagPopularity}); + + Data.fromJson(Map json) { + id = json['id']; + name = json['name']; + tagPopularity = json['tag_popularity']; + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['name'] = this.name; + data['tag_popularity'] = this.tagPopularity; + return data; + } +} diff --git a/lib/Feed Module/Main_Screens/Community/PostDetailScreen/View/PostDetailScreen.dart b/lib/Feed Module/Main_Screens/Community/PostDetailScreen/View/PostDetailScreen.dart deleted file mode 100644 index d028ed2..0000000 --- a/lib/Feed Module/Main_Screens/Community/PostDetailScreen/View/PostDetailScreen.dart +++ /dev/null @@ -1,491 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_reaction_button/flutter_reaction_button.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; -import 'package:regroup/Common/CommonGlassmorphism.dart'; -import 'package:regroup/Common/CommonWidget.dart'; -import 'package:regroup/Utils/Common/CommonAppbar.dart'; -import 'package:regroup/Utils/Common/CustomTextformfield.dart'; -import 'package:regroup/Utils/Common/sized_box.dart'; -import 'package:regroup/Utils/texts.dart'; -import 'package:regroup/resources/routes/route_name.dart'; - -class PostDetailsScreen extends StatefulWidget { - const PostDetailsScreen({super.key}); - - @override - State createState() => _PostDetailsScreenState(); -} - -class _PostDetailsScreenState extends State { - @override - Widget build(BuildContext context) { - return Scaffold( - resizeToAvoidBottomInset: false, - backgroundColor: const Color(0xFF222935), - extendBody: true, - appBar: const CommonAppbar( - titleTxt: "Post", - ), - body: Stack(children: [ - Container( - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage("assets/images/png/Ellipse 1496.png"), - fit: BoxFit.fill)), - ), - SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - postCards( - profileImg: 'assets/images/png/Ellipse 52.png', - title: 'Ryan Dorwat', - mainImg: 'assets/images/png/Rectangle 25.png', - containerTitle: [ - 'Football', - 'Marathon', - 'Events', - 'Marathon', - 'Events' - ]), - sizedBoxHeight(35.h), - Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), - child: Column(children: [ - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - CircleAvatar( - radius: 20.r, - foregroundImage: const AssetImage( - "assets/images/png/Ellipse 48.png", - ), - ), - sizedBoxWidth(15.w), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - text12w400_FCFCFC_blur("Roger Saris"), - text14w400_FCFCFC( - "Lorem Ipsum has been the industry's standard dummy text 😍"), - text10w400_FCFCFC_blur("Reply. . . ") - ], - ), - ), - ], - ), - sizedBoxHeight(50.h), - Align( - alignment: Alignment.bottomCenter, - child: Padding( - padding: const EdgeInsets.only(top: 15, bottom: 15), - child: Row( - children: [ - Expanded( - child: CustomTextFormField( - hintText: "Add comment", - suffixIcon: SizedBox( - height: 20.h, - width: 25.w, - child: Center( - child: Image.asset( - "assets/images/png/iconoir_send.png", - height: 20.h, - width: 25.w, - ), - ), - ), - ), - ) - ], - ), - )), - sizedBoxHeight(85.h) - ])) - ])) - ])); - } - - Widget postCards({ - required String profileImg, - required String title, - required String mainImg, - required List containerTitle, - }) { - var mainImage = 'assets/images/png/uiw_like-o.png'.obs; - void updateImage(String reaction) { - if (reaction == 'like') { - mainImage.value = 'assets/images/png/f7_hand-thumbsup.png'; - } else if (reaction == 'heart') { - mainImage.value = 'assets/images/png/heart 2.png'; - } else if (reaction == 'party') { - mainImage.value = 'assets/images/png/party-popper 2.png'; - } - } - - return commonGlassContainer( - width: double.infinity, - height: 570.h, - border: 0, - borderradius: 0, - customWidget: Column( - children: [ - sizedBoxHeight(25.h), - Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - CircleAvatar( - foregroundImage: AssetImage(profileImg), - radius: 25.r, - ), - sizedBoxWidth(12.w), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - text16w400_FCFCFC(title), - const Spacer(), - commonGlassContainer( - width: 72.w, - height: 26.h, - borderradius: 5.r, - borderColor: const Color(0xFFD90B2E), - customWidget: - Center(child: text14400white("Follow")), - border: 1), - sizedBoxWidth(6.w), - PopupMenuButton( - surfaceTintColor: const Color(0xFF222935), - constraints: - BoxConstraints.tightFor(width: 176.w), - offset: const Offset(0, 50), - color: const Color(0xFF222935), - tooltip: "", - itemBuilder: (BuildContext context) => - [ - PopupMenuItem( - onTap: () {}, - child: Padding( - padding: - EdgeInsets.symmetric(horizontal: 12.w), - child: Row( - children: [ - Text( - 'Report Post', - style: TextStyle( - fontSize: 16.sp, - color: Colors.white, - fontWeight: FontWeight.w800, - fontFamily: "Nunito Sans", - ), - ), - const Spacer(), - Image.asset( - "assets/images/png/Vector (5).png", - height: 15.h, - width: 15.w, - ) - ], - ), - ), - ), - const PopupMenuDivider(), - PopupMenuItem( - onTap: () {}, - child: Padding( - padding: - EdgeInsets.symmetric(horizontal: 12.w), - child: Row( - children: [ - Text( - 'Share post', - style: TextStyle( - fontSize: 16.sp, - color: Colors.white, - fontWeight: FontWeight.w800, - fontFamily: "Nunito Sans", - ), - ), - const Spacer(), - Image.asset( - "assets/images/png/share.png", - height: 20.h, - width: 20.w, - ) - ], - ), - ), - ), - const PopupMenuDivider(), - PopupMenuItem( - onTap: () {}, - child: Padding( - padding: - EdgeInsets.symmetric(horizontal: 12.w), - child: Row( - children: [ - Text( - 'Pin', - style: TextStyle( - fontSize: 16.sp, - color: Colors.white, - fontWeight: FontWeight.w800, - fontFamily: "Nunito Sans", - ), - ), - const Spacer(), - Image.asset( - "assets/images/png/f7_pin-fill (2).png", - height: 25.h, - width: 25.w, - ) - ], - ), - ), - ), - ], - child: Image.asset( - 'assets/images/png/Group 1000004071.png', - width: 16.w, - height: 18.h, - ), - ), - ], - ), - sizedBoxHeight(5.h), - Row( - children: [ - Image.asset( - 'assets/images/png/community 1 (traced).png', - height: 14.w, - width: 14.w, - ), - sizedBoxWidth(7.w), - text12w400_FCFCFC('Active alliance network'), - sizedBoxWidth(7.w), - Icon( - Icons.circle, - color: const Color(0xFFFCFCFC), - size: 4.sp, - ), - sizedBoxWidth(6.w), - text12w400_FCFCFC('1 Hour ago'), - ], - ) - ], - ), - ), - ], - ), - ), - sizedBoxHeight(20.h), - GestureDetector( - onTap: () { - Get.toNamed(RouteName.postdetailsScreen); - }, - child: SizedBox( - height: 163.h, - width: double.infinity, - child: Image.asset( - mainImg, - fit: BoxFit.cover, - ), - )), - sizedBoxHeight(20.h), - Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), - child: Column(children: [ - SizedBox( - height: 30.h, - child: ListView.builder( - scrollDirection: Axis.horizontal, - shrinkWrap: true, - itemCount: containerTitle.length, - itemBuilder: (context, index) { - return Padding( - padding: EdgeInsets.only(right: 12.w), - child: GestureDetector( - onTap: () { - Get.toNamed(RouteName.cyclescreen); - }, - child: containertile(text: containerTitle[index])), - ); - }, - ), - ), - sizedBoxHeight(20.h), - text16w400_FCFCFC( - "Lorem Ipsum has been the industry's standard dummy text ever since the 1500s . . ."), - Row(children: [ - stackReaction(number: '20', containerImages: [ - 'assets/images/png/f7_hand-thumbsup.png', - 'assets/images/png/heart 2.png', - 'assets/images/png/party-popper 2.png' - ]), - const Spacer(), - commonGlassContainer( - border: 0.9, - width: 30.w, - height: 30.h, - borderradius: 100, - customWidget: Center( - child: Image.asset( - 'assets/images/png/Frame 1000004088.png', - height: 13.h, - width: 13.w, - ), - ), - ), - sizedBoxWidth(12.w), - text14w400_FCFCFC('20'), - sizedBoxWidth(20.w), - commonGlassContainer( - border: 0.9, - width: 30.w, - height: 30.h, - borderradius: 100, - customWidget: Center( - child: Image.asset( - 'assets/images/png/Vector (1).png', - height: 12.h, - width: 12.w, - ), - ), - ), - sizedBoxWidth(12.w), - text14w400_FCFCFC('10'), - ]), - sizedBoxHeight(12.h), - commonDivider(), - sizedBoxHeight(12.h), - Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Obx(() { - return ReactionButton( - onReactionChanged: (reaction) { - updateImage(reaction?.value ?? 'like'); - debugPrint( - 'Selected value: ${reaction?.value}'); - }, - reactions: ?>[ - Reaction( - value: 'like', - previewIcon: _buildReactionsPreviewIcon( - 'assets/images/png/f7_hand-thumbsup.png'), - icon: _buildReactionsIcon( - 'assets/images/png/f7_hand-thumbsup.png'), - ), - Reaction( - value: 'heart', - previewIcon: _buildReactionsPreviewIcon( - 'assets/images/png/heart 2.png'), - icon: _buildReactionsIcon( - 'assets/images/png/heart 2.png'), - ), - Reaction( - value: 'party', - previewIcon: _buildReactionsPreviewIcon( - 'assets/images/png/party-popper 2.png'), - icon: _buildReactionsIcon( - 'assets/images/png/party-popper 2.png'), - ), - ], - selectedReaction: Reaction( - value: 'like', - icon: _buildReactionsIcon( - 'assets/images/png/f7_hand-thumbsup.png'), - ), - boxColor: Colors.white, - boxElevation: 9, - boxRadius: 30, - itemsSpacing: 8, - itemScale: 0.4, - itemSize: const Size(45, 45), - boxPadding: const EdgeInsets.all(8), - boxAnimationDuration: - const Duration(milliseconds: 200), - itemAnimationDuration: - const Duration(milliseconds: 500), - hoverDuration: const Duration(milliseconds: 700), - // toggle: false, - - child: _buildReactionsIcon(mainImage.value), - ); - }) - ], - ), - ], - ), - Column( - children: [ - Image.asset( - 'assets/images/png/Frame 1000004089.png', - height: 19.h, - width: 19.w, - ), - sizedBoxHeight(8.h), - text11w400_FCFCFC('Save') - ], - ) - ], - ), - sizedBoxHeight(12.h), - commonDivider(), - sizedBoxHeight(12.h), - ]), - ), - ], - )); - } - - Widget containertile({required String text}) { - return commonGlassContainer( - border: 0.9, - width: 100.w, - height: 30.h, - borderradius: 30.r, - borderColor: const Color(0xFFD90B2E), - customWidget: Padding( - padding: EdgeInsets.symmetric(horizontal: 10.w), - child: Center(child: text14w400_FCFCFC(text)), - )); - } - - Widget _buildReactionsPreviewIcon(String assetPath) { - return Padding( - padding: const EdgeInsets.all(8.0), - child: Image.asset( - assetPath, - height: 40.h, - width: 40.w, - ), - ); - } - - Widget _buildReactionsIcon(String assetPath) { - return Column( - children: [ - Image.asset( - assetPath, - height: 19.h, - width: 19.w, - ), - sizedBoxHeight(8.h), - text11w400_FCFCFC('Like') - ], - ); - } -} diff --git a/lib/Feed Module/Main_Screens/Community/PostDetailScreen/View/ReactionView.dart b/lib/Feed Module/Main_Screens/Community/PostDetailScreen/View/ReactionView.dart deleted file mode 100644 index 56c4680..0000000 --- a/lib/Feed Module/Main_Screens/Community/PostDetailScreen/View/ReactionView.dart +++ /dev/null @@ -1,316 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:regroup/Common/CommonGlassmorphism.dart'; -import 'package:regroup/Common/CommonTabBar.dart'; -import 'package:regroup/Common/CommonWidget.dart'; -import 'package:regroup/Utils/Common/CommonAppbar.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; -import 'package:regroup/Utils/Common/sized_box.dart'; -import 'package:regroup/Utils/texts.dart'; - -class ReactionView extends StatefulWidget { - const ReactionView({super.key}); - - @override - State createState() => _ReactionViewState(); -} - -class _ReactionViewState extends State { - List allTabData = [ - { - "imagePath": "assets/images/png/cimg1.png", - "reactionimg": "assets/images/png/f7_hand-thumbsup.png", - "title": "Edward Hackket" - }, - { - "imagePath": "assets/images/png/cimg2.png", - "reactionimg": "assets/images/png/heart 2.png", - "title": "Dulce Vaccaro" - }, - { - "imagePath": "assets/images/png/cimg3.png", - "reactionimg": "assets/images/png/party-popper 2.png", - "title": "Edward Hackket" - }, - { - "imagePath": "assets/images/png/cimg4.png", - "reactionimg": "assets/images/png/f7_hand-thumbsup.png", - "title": "Dulce Vaccaro" - }, - { - "imagePath": "assets/images/png/Rectangle 65.png", - "reactionimg": "assets/images/png/heart 2.png", - "title": "Edward Hackket" - }, - { - "imagePath": "assets/images/png/Ellipse 43.png", - "reactionimg": "assets/images/png/party-popper 2.png", - "title": "Dulce Vaccaro" - }, - { - "imagePath": "assets/images/png/cimg4.png", - "reactionimg": "assets/images/png/f7_hand-thumbsup.png", - "title": "Dulce Vaccaro" - }, - { - "imagePath": "assets/images/png/cimg3.png", - "reactionimg": "assets/images/png/party-popper 2.png", - "title": "Edward Hackket" - }, - { - "imagePath": "assets/images/png/cimg4.png", - "reactionimg": "assets/images/png/f7_hand-thumbsup.png", - "title": "Dulce Vaccaro" - }, - ]; - - @override - Widget build(BuildContext context) { - return Scaffold( - backgroundColor: const Color(0xFF222935), - extendBody: true, - appBar: const CommonAppbar( - titleTxt: "Post", - ), - resizeToAvoidBottomInset: false, - body: Stack(children: [ - Container( - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage("assets/images/png/Ellipse 1496.png"), - fit: BoxFit.fill)), - ), Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - sizedBoxHeight(10.h), - Expanded( - child: DefaultTabController( - length: 4, - // initialIndex: selectedIndex.value, - child: Column(children: [ - CommonTabBar(tabs: [ - const Tab( - text: 'All', - ), - Tab( - child: Row(children: [ - commonGlassContainer( - borderColor: const Color(0xFF1E3A46), - opacity1: 0.05, - opacity2: 0.06, - width: 30.w, - height: 30.h, - borderradius: 100, - customWidget: Center( - child: Image.asset( - "assets/images/png/f7_hand-thumbsup.png", - height: 17.h, - width: 17.w, - ), - ), - border: 1.71), - const Spacer(), - text14400white("110K"), - ]), - ), - Tab( - child: Row(children: [ - commonGlassContainer( - borderColor: const Color(0xFF1E3A46), - opacity1: 0.05, - opacity2: 0.06, - width: 30.w, - height: 30.h, - borderradius: 100, - customWidget: Center( - child: Image.asset( - "assets/images/png/heart 2.png", - height: 17.h, - width: 17.w, - ), - ), - border: 1.71), - const Spacer(), - text14400white("9.7K"), - ]), - ), - Tab( - child: Row(children: [ - commonGlassContainer( - borderColor: const Color(0xFF1E3A46), - opacity1: 0.05, - opacity2: 0.06, - width: 30.w, - height: 30.h, - borderradius: 100, - customWidget: Center( - child: Image.asset( - "assets/images/png/party-popper 2.png", - height: 17.h, - width: 17.w, - ), - ), - border: 1.71), - const Spacer(), - text14400white("7.4K"), - ]), - ), - ]), - Expanded( - child: TabBarView( - children: [ - allTab(), - likeTab(), - favouriteTab(), - partyTab(), - ], - ), - ), - sizedBoxHeight(20.h) - ])), - ) - ]) - ])); - } - - Widget allTab() { - return Column( - children: [ - sizedBoxHeight(20.h), - Expanded( - child: ListView.builder( - itemCount: allTabData.length, - shrinkWrap: true, - itemBuilder: (context, index) { - return Column( - children: [ - commonReaction( - imagePath: allTabData[index]["imagePath"], - reactionimg: allTabData[index]["reactionimg"], - title: allTabData[index]["title"]), - if (allTabData.length - 1 != index) commonDivider(), - ], - ); - }, - ), - ) - ], - ); - } - - Widget likeTab() { - return Column( - children: [ - sizedBoxHeight(20.h), - Expanded( - child: ListView.builder( - itemCount: allTabData.length, - shrinkWrap: true, - itemBuilder: (context, index) { - return Column( - children: [ - commonReaction( - imagePath: allTabData[index]["imagePath"], - reactionimg: allTabData[index]["reactionimg"], - title: allTabData[index]["title"]), - if (allTabData.length - 1 != index) commonDivider(), - ], - ); - }, - ), - ) - ], - ); - } - - Widget favouriteTab() { - return Column( - children: [ - sizedBoxHeight(20.h), - Expanded( - child: ListView.builder( - itemCount: allTabData.length, - shrinkWrap: true, - itemBuilder: (context, index) { - return Column( - children: [ - commonReaction( - imagePath: allTabData[index]["imagePath"], - reactionimg: allTabData[index]["reactionimg"], - title: allTabData[index]["title"]), - if (allTabData.length - 1 != index) commonDivider(), - ], - ); - }, - ), - ) - ], - ); - } - - Widget partyTab() { - return Column( - children: [ - sizedBoxHeight(20.h), - Expanded( - child: ListView.builder( - itemCount: allTabData.length, - shrinkWrap: true, - itemBuilder: (context, index) { - return Column( - children: [ - commonReaction( - imagePath: allTabData[index]["imagePath"], - reactionimg: allTabData[index]["reactionimg"], - title: allTabData[index]["title"]), - if (allTabData.length - 1 != index) commonDivider(), - ], - ); - }, - ), - ) - ], - ); - } - - Widget commonReaction( - {required String imagePath, - required String reactionimg, - required String title}) { - return Padding( - padding: EdgeInsets.symmetric(horizontal: 25.w, vertical: 18.h), - child: Row( - children: [ - Stack(children: [ - CircleAvatar( - radius: 25.r, - backgroundImage: AssetImage(imagePath), - ), - Positioned( - bottom: 0, - right: 0, - child: Container( - height: 22.h, - width: 22.w, - decoration: BoxDecoration( - shape: BoxShape.circle, - color: const Color(0xFF1E3A46), - border: Border.all( - color: const Color(0xFFFCFCFC).withOpacity(0.18), - width: 0.6)), - child: Center( - child: Image.asset( - reactionimg, - height: 12.h, - width: 12.w, - ), - ), - )), - ]), - sizedBoxWidth(10.w), - text17400white(title), - ], - ), - ); - } -} diff --git a/lib/Feed Module/Main_Screens/Community/PostScreen.dart b/lib/Feed Module/Main_Screens/Community/PostScreen.dart deleted file mode 100644 index bd8b154..0000000 --- a/lib/Feed Module/Main_Screens/Community/PostScreen.dart +++ /dev/null @@ -1,355 +0,0 @@ -import 'dart:io'; - -import 'package:dotted_border/dotted_border.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; -import 'package:regroup/Common/CommonButton.dart'; - -import 'package:regroup/Common/CommonGlassmorphism.dart'; -import 'package:regroup/Utils/Common/CommonAppbar.dart'; -import 'package:regroup/Utils/Common/CommonDropdown.dart'; -import 'package:regroup/Utils/Common/CustomTextformfield.dart'; -import 'package:regroup/Utils/Common/ImageUpload.dart'; - -import 'package:regroup/Utils/Common/sized_box.dart'; -import 'package:regroup/Utils/texts.dart'; -import 'package:regroup/resources/routes/route_name.dart'; -import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart'; - -class PostScreen extends StatefulWidget { - const PostScreen({super.key}); - - @override - State createState() => _PostScreenState(); -} - -class _PostScreenState extends State { - List bannerPath = []; - bool isbannerAdded = false; - var selectedContainerIndices = {}.obs; - - void toggleSelectedIndex(int index) { - if (selectedContainerIndices.contains(index)) { - selectedContainerIndices.remove(index); - } else { - selectedContainerIndices.add(index); - } - } - - @override - Widget build(BuildContext context) { - return Scaffold( - backgroundColor: const Color(0xFF222935), - extendBody: true, - resizeToAvoidBottomInset: false, - appBar: const CommonAppbar( - titleTxt: "Create a post", - ), - body: Stack(children: [ - Container( - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage("assets/images/png/Ellipse 1496.png"), - fit: BoxFit.fill)), - ), - Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), - child: SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - sizedBoxHeight(20.h), - - text16w400_FCFCFC("Caption"), - - sizedBoxHeight(18.h), - CustomTextFormField2( - maxlines: 3, - ), - sizedBoxHeight(25.h), - text16w400_FCFCFC("Media"), - sizedBoxHeight(18.h), - GestureDetector( - onTap: () { - ImageUploadBottomSheet().showModal( - context, - false, - (result) { - var file = File(result); - - bannerPath.add(file); - isbannerAdded = true; - setState(() {}); - }, - ); - }, - child: DottedBorder( - strokeWidth: 1, - dashPattern: const [7, 4], - borderType: BorderType.RRect, - radius: Radius.circular(14.r), - color: const Color(0xFF434A53), - child: commonGlassUI( - width: double.infinity, - height: 130.h, - borderRadius: BorderRadius.circular(10.r), - borderColor: Colors.transparent, - customWidget: bannerPath.isNotEmpty && isbannerAdded - ? Stack(children: [ - Image.file( - bannerPath[0]!, - fit: BoxFit.cover, - width: double.infinity, - ), - Positioned( - right: 5, - bottom: 5, - child: GestureDetector( - onTap: () { - bannerPath.clear(); - isbannerAdded = false; - setState(() {}); - }, - child: Container( - width: 27, - height: 27, - decoration: ShapeDecoration( - color: const Color(0xFF7E7E7E), - shape: RoundedRectangleBorder( - borderRadius: - BorderRadius.circular( - 5)), - ), - child: const Icon( - Icons.delete_outline_outlined, - color: Colors.white, - ))), - ), - ]) - : Padding( - padding: - EdgeInsets.symmetric(vertical: 16.h), - child: Column( - children: [ - Image.asset( - "assets/images/png/bi_download.png", - height: 36.h, - width: 36.w, - ), - sizedBoxHeight(10.h), - text14w400_FCFCFC("Upload image"), - sizedBoxHeight(8.h), - text8w400_8A8A8A( - "Allowed file extensions: jpg, png, gif Max file size: 10 MB"), - ], - ), - )), - ), - ), - sizedBoxHeight(25.h), - text16w400_FCFCFC("Tags"), - sizedBoxHeight(18.h), - CustomDropDownTag1( - header: "Enter tags", - title: "Enter tags", - listData: const [ - "#Race", - "#Swimming", - "#Cycle", - "#Swimming", - "#Race" - ], - rowData: const [ - "23,233 Recently use tags", - "15,123 Recently use tags", - "15,123 Recently use tags", - "15,123 Available tags", - "15,123 Available tags" - ], - onItemSelected: (p0) {}, - leadingImage: const SizedBox()), - // CustomTextFormField( - // suffixIcon: Container( - // height: 20.h, - // width: 20.w, - // child: Center( - // child: Image.asset( - // "assets/images/png/Frame 58575.png", - // height: 20.h, - // width: 20.w, - // fit: BoxFit.cover, - // ), - // ), - // )), - sizedBoxHeight(25.h), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - containerTile(text: "# Race", index: 0), - containerTile(text: "# Swimming", index: 1), - containerTile(text: "# Cycle", index: 2), - ], - ), - sizedBoxHeight(16.h), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - containerTile(text: "# Race", index: 3), - containerTile(text: "# Swimming", index: 4), - containerTile(text: "# Cycle", index: 5), - ], - ), - sizedBoxHeight(30.h), - text16w400_FCFCFC("CTA Title"), - sizedBoxHeight(18.h), - CustomTextFormField( - // validationMessage: "Enter a CTA Title", - validator: (val) { - if (val == null || val.isEmpty) { - return 'Enter a CTA Title'; - } - return null; - }, - inputFormatters: [ - LengthLimitingTextInputFormatter(20), - RemoveEmojiInputFormatter() - ], - ), - sizedBoxHeight(25.h), - text16w400_FCFCFC("Post as"), - sizedBoxHeight(18.h), - CustomDropDownRadio( - header: "", - title: "", - listData: const ['Individual', 'Anonymous'], - onItemSelected: (p0) {}, - leadingImage: const SizedBox()), - // CommonDropdownradioBtn( - // hint: '', items: ['Individual', 'Anonymous']), - - sizedBoxHeight(25.h), - text16w400_FCFCFC("Post in"), - sizedBoxHeight(18.h), - CustomDropDownCheckBox( - header: "", - title: "", - listData: const [ - 'Active alliance network', - 'Fitfam federation', - 'The athletic town', - 'Football fever' - ], - onItemSelected: (p0) {}, - images: const [ - 'assets/images/png/Rectangle 65.png', - 'assets/images/png/Rectangle 66.png', - 'assets/images/png/Rectangle 60.png', - 'assets/images/png/Rectangle 68.png' - ], - leadingImage: const SizedBox()), - // CommonDropdownCheckbox( - // hint: '', - // items: [ - // 'Active alliance network', - // 'Fitfam federation', - // 'The athletic town', - // 'Football fever' - // ], - // images: [ - // 'assets/images/png/Rectangle 65.png', - // 'assets/images/png/Rectangle 66.png', - // 'assets/images/png/Rectangle 60.png', - // 'assets/images/png/Rectangle 68.png' - // ], - // ), - sizedBoxHeight(40.h), - CommonBtn( - text: 'Submit post', - onTap: () { - successBottomsheet(); - }, - ), - - sizedBoxHeight(150.h), - ]), - ), - ), - ])); - } - - void successBottomsheet() { - Get.bottomSheet(Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(14.r), - color: const Color(0xFF222935)), - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 30.w), - child: Column(mainAxisSize: MainAxisSize.min, children: [ - sizedBoxHeight(20.h), - Image.asset( - 'assets/images/png/Frame 1000004082.png', - width: 199.w, - height: 158.h, - ), - sizedBoxHeight(20.h), - text18w500Center_FCFCFC( - 'Your post has been succesfully uploaded'), - sizedBoxHeight(20.h), - InkWell( - onTap: () { - Get.toNamed(RouteName.mainscreen); - }, - child: Container( - height: 35.h, - width: 216.w, - decoration: BoxDecoration( - border: Border.all(color: const Color(0xFF434A53), width: 1), - gradient: const LinearGradient( - begin: Alignment.topLeft, - end: Alignment.bottomRight, - colors: [ - Color.fromRGBO(255, 255, 255, 0.054), - Color.fromRGBO(255, 255, 255, 0.072), - ], - stops: [0.0233, 1.0], - transform: GradientRotation(271.14 * - (3.141592653589793 / - 180)), // Converting degrees to radians - ), - borderRadius: BorderRadius.circular(30.r), - ), - child: Center(child: text14w400_FCFCFC('Check out')), - ), - ), - sizedBoxHeight(40.h) - ])))); - } - - Widget containerTile({ - required String text, - required int index, - }) { - return Obx(() { - return GestureDetector( - onTap: () { - toggleSelectedIndex(index); - }, - child: Container( - height: 35, - decoration: BoxDecoration( - color: selectedContainerIndices.contains(index) - ? const Color(0xFFD90B2E).withOpacity(0.4) - : const Color(0xFFFFFFFF).withOpacity(0.2), - borderRadius: BorderRadius.circular(30), - border: Border.all(color: const Color(0xFFD90B2E), width: 1)), - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 20), - child: Center(child: text14w400_FCFCFC(text)), - ), - ), - ); - }); - } -} diff --git a/lib/Feed Module/Main_Screens/Community/view_model/getApi.dart b/lib/Feed Module/Main_Screens/Community/view_model/getApi.dart new file mode 100644 index 0000000..318df56 --- /dev/null +++ b/lib/Feed Module/Main_Screens/Community/view_model/getApi.dart @@ -0,0 +1,13 @@ +import 'dart:async'; + +import 'package:regroup/Common/base_manager.dart'; +import 'package:regroup/Common/controller/data/network/network_api.dart'; + +// FollowersModel? communitytagssobj; + + +class Communitygetmethod { + getTagsdata(id) {} + + +} \ No newline at end of file diff --git a/lib/Feed Module/Main_Screens/Community/view_model/postApi.dart b/lib/Feed Module/Main_Screens/Community/view_model/postApi.dart new file mode 100644 index 0000000..3c268ba --- /dev/null +++ b/lib/Feed Module/Main_Screens/Community/view_model/postApi.dart @@ -0,0 +1,29 @@ +import 'package:regroup/Common/api_urls.dart'; +import 'package:regroup/Common/base_manager.dart'; +import 'package:regroup/Common/controller/data/network/network_api.dart'; + +class Communitypostmethod { + Communitypostmethod(); + + Future> postCreatedTag(updata) async { + print("updata is $updata"); + final response = await NetworkApiServices().postApi( + updata, + ApiUrls.postnewtags, + ); + print("response is ${response.data}"); + print("response message is ${response.message}"); + return response; + } + + Future> postUpload(updata) async { + print("updata is $updata"); + final response = await NetworkApiServices().postApi( + updata, + ApiUrls.postupload, + ); + print("response is ${response.data}"); + print("response message is ${response.message}"); + return response; + } +} \ No newline at end of file diff --git a/lib/Feed Module/Main_Screens/Community/view_model/postinList.dart b/lib/Feed Module/Main_Screens/Community/view_model/postinList.dart new file mode 100644 index 0000000..1380772 --- /dev/null +++ b/lib/Feed Module/Main_Screens/Community/view_model/postinList.dart @@ -0,0 +1,51 @@ +import 'package:regroup/Common/api_urls.dart'; +import 'package:regroup/Common/base_manager.dart'; +import 'package:regroup/Common/controller/data/network/network_api.dart'; +import 'package:regroup/Feed%20Module/Main_Screens/Community/Model/communitylistModel.dart'; +import 'package:regroup/Feed%20Module/Main_Screens/Community/Model/populartagsListModel.dart'; + +class CommunityLsitApi { + CommunityLsitApi(); + var data = ""; + Future> getPostinList() async { + final response = await NetworkApiServices().getApi( + ApiUrls.getpostcommunitylist, + ); + + if (response.status == ResponseStatus.SUCCESS) { + Map responseData = + Map.from(response.data); + if (responseData['status'] == "success") { + print("success"); + CommunityListModel communitylistobj = + CommunityListModel.fromJson(responseData); + } else { + // return ResponseData( + // responseData['message'], ResponseStatus.FAILED); + } + } + return response; + } + + Future> getPopulartagsList(updata) async { + final response = await NetworkApiServices().getApi( + 'https://regroup.betadelivery.com/api/v1/fetch-popular-tags?manage_community_xid=$updata&name='); + // '${ApiUrls.getpopulartagscommunity}?manage_community_xid=$updata&name=', + + // ); + + if (response.status == ResponseStatus.SUCCESS) { + Map responseData = + Map.from(response.data); + if (responseData['status'] == "success") { + print("success"); + PopulartagsListModel populartagslistobj = + PopulartagsListModel.fromJson(responseData); + } else { + // return ResponseData( + // responseData['message'], ResponseStatus.FAILED); + } + } + return response; + } +} diff --git a/lib/Feed Module/Main_Screens/ProfileTab/EditProfile/View/EditProfile.dart b/lib/Feed Module/Main_Screens/ProfileTab/EditProfile/View/EditProfile.dart deleted file mode 100644 index 66a275f..0000000 --- a/lib/Feed Module/Main_Screens/ProfileTab/EditProfile/View/EditProfile.dart +++ /dev/null @@ -1,940 +0,0 @@ -import 'dart:developer'; -import 'dart:io'; - -import 'package:dio/dio.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart' hide MultipartFile, FormData; -import 'package:regroup/Common/CommonButton.dart'; -import 'package:regroup/Common/CommonWidget.dart'; -import 'package:regroup/Common/base_manager.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/EditProfile/View/picturecontroller/indiprofileimagecontroller.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/EditProfile/ViewModel/EditProfileApi.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/EditProfile/ViewModel/InterestApiList.dart'; -import 'package:regroup/Utils/Common/CommonDropdown.dart'; -import 'package:regroup/Utils/Common/CustomTextformfield.dart'; -import 'package:regroup/Utils/Common/CommonAppbar.dart'; -import 'package:regroup/Utils/Common/ImageUpload.dart'; -import 'package:regroup/Utils/Common/sized_box.dart'; -import 'package:regroup/Utils/dialogs.dart'; -import 'package:regroup/Utils/texts.dart'; -import 'package:path/path.dart' as path; -import 'package:regroup/resources/routes/route_name.dart'; - -class EditProfile extends StatefulWidget { - const EditProfile({super.key}); - - @override - State createState() => _EditProfileState(); -} - -//location in normal profile individual api - -class _EditProfileState extends State { - TextEditingController fullNameController = TextEditingController(); - TextEditingController userNameController = TextEditingController(); - TextEditingController dateController = TextEditingController(); - TextEditingController locationController = TextEditingController(); - TextEditingController aboutController = TextEditingController(); - TextEditingController positionController = TextEditingController(); - TextEditingController trainingScoresController = TextEditingController(); - TextEditingController heightController = TextEditingController(); - TextEditingController weightController = TextEditingController(); - TextEditingController battingAvgController = TextEditingController(); - - String profilePicture = ""; - bool isImageAdded = false; - - bool isOnce = true; - late Future myfuture; - - convertFileToMultiPart1(String? file) async { - return await MultipartFile.fromFile( - file!, - filename: path.basename(file), - ); - } - - String extractFileName1(String filePath) { - return path.basename(filePath); - } - - String _selectedgenderType = ''; - - void _onItemSelected(String value) { - setState(() { - _selectedgenderType = value; - }); - } - - List selectedinterestid = []; - RxBool isloading = true.obs; - - void getCatIdFromName(List selectedInterests) { - selectedinterestid.clear(); - for (var name in selectedInterests) { - for (var i = 0; i < interestlistobj!.data!.length; i++) { - if (name == interestlistobj!.data![i].name) { - selectedinterestid.add(interestlistobj!.data![i].id!); - break; - } - } - } - } - - @override - void initState() { - myfuture = EditProfileApi() - .getEditProfileIndividual() - .then((value) => {setValues()}); - - super.initState(); - } - - setValues() async { - if (isOnce) { - fullNameController.text = getEditProfileIndi!.data!.fullName ?? ''; - userNameController.text = getEditProfileIndi!.data!.userName ?? ''; - dateController.text = getEditProfileIndi!.data!.dateOfBirth ?? ''; - - _selectedgenderType = getEditProfileIndi!.data!.gender ?? ''; - locationController.text = getEditProfileIndi!.data!.location ?? ''; - - locationController.text = getEditProfileIndi!.data!.about ?? ''; - aboutController.text = getEditProfileIndi!.data!.about ?? ''; - positionController.text = - getEditProfileIndi!.data!.position ?? 'Lorem lpsum'; - - trainingScoresController.text = - getEditProfileIndi!.data!.trainingScores ?? '50'; - - heightController.text = getEditProfileIndi!.data!.height ?? '6 feet'; - weightController.text = getEditProfileIndi!.data!.weight ?? '70kg'; - battingAvgController.text = - getEditProfileIndi!.data!.battingAverage ?? '372'; - - isOnce = false; - setState(() {}); - } - } - - void saveEditProfileInd() async { - utils.loader(); - - FormData? updata; - - var imageFile; - - String abilitiesIds = selectedinterestid.toString(); - print("Interests String: $abilitiesIds"); - - if (editProfileImage.usserprofilePicPath.value.isNotEmpty) { - imageFile = await MultipartFile.fromFile( - editProfileImage.usserprofilePicPath.value, - filename: path.basename(profilePicture), - ); - print(imageFile.toString()); - } - - - updata = FormData.fromMap({ - // "email_address": "priyanka14@yopmail.com", - "full_name": fullNameController.text, - "profile_image": - editProfileImage.usserprofilePicPath.isNotEmpty ? imageFile : null, - // profilePicture.isNotEmpty - // ? await convertFileToMultiPart1(profilePicture) - // : null, - // "profile_image": "ghjkk.png", - - "user_name": userNameController.text, - "date_of_birth": dateController.text, - "gender": _selectedgenderType, - // "interest": "selectedSportsIds", - "interest": - // '[1,2,3,4]', - abilitiesIds, - "about": aboutController.text, - "position": positionController.text, - "training_scores": trainingScoresController.text, - "height": heightController.text, - "weight": weightController.text, - "batting_average": battingAvgController.text, - "address_line1": battingAvgController.text, - }); - log(updata.toString()); - print(imageFile.toString()); - - final data = await EditProfileApi().postEditProfileIndividual(updata); - if (data.status == ResponseStatus.SUCCESS) { - Get.back(); - Get.toNamed(RouteName.mainscreen, arguments: 4); - } else { - Get.back(); - // btnController.reset(); - Get.snackbar( - "Error!", - data.data['message'], - duration: const Duration(seconds: 2), - colorText: Colors.white, - backgroundColor: Colors.red, - margin: const EdgeInsets.all(8), - snackStyle: SnackStyle.FLOATING, - snackPosition: SnackPosition.BOTTOM, - ); - // _controller.isTextFieldEnabled.value = true; - } - } - - final UserIndiProfileImageController editProfileImage = - Get.put(UserIndiProfileImageController()); - - @override - Widget build(BuildContext context) { - return GestureDetector( - onTap: () => FocusManager.instance.primaryFocus?.unfocus(), - child: Scaffold( - backgroundColor: const Color(0xFF222935), - extendBody: true, - appBar: const CommonAppbar( - titleTxt: "", - ), - body: FutureBuilder( - future: myfuture, - builder: (ctx, snapshot) { - if (snapshot.connectionState == ConnectionState.waiting) { - return const Center( - child: CircularProgressIndicator( - color: Colors.blue, - ), - ); - } - - if (snapshot.hasError) { - return Center( - child: Text( - '${snapshot.error} occurred', - style: TextStyle(fontSize: 18.spMin), - ), - ); - } - - if (snapshot.connectionState == ConnectionState.done && - snapshot.hasData) { - print("Data fetched-->"); - return Stack(children: [ - Container( - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage( - "assets/images/png/Ellipse 1496.png"), - fit: BoxFit.fill)), - ), - SingleChildScrollView( - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 16), - child: Column(children: [ - sizedBoxHeight(25.h), - Stack( - children: [ - Obx( - () => editProfileImage - .usserprofilePicPath.value != - '' - ? ClipOval( - child: SizedBox.fromSize( - size: Size.fromRadius(50.r), - child: editProfileImage - .usserprofilePicPath - .value != - '' - ? Image( - // File(profilePicture), - image: FileImage( - File( - editProfileImage - .usserprofilePicPath - .value, - ), - ), - fit: BoxFit.cover, - width: double.infinity, - errorBuilder: - (BuildContext - context, - Object - exception, - StackTrace? - stackTrace) { - return CircleAvatar( - backgroundImage: - const AssetImage( - "assets/images/png/cimg3.png"), - radius: 50.r, - ); - }, - ) - : Image.asset( - 'assets/images/png/cimg3.png')), - ) - : ClipOval( - child: SizedBox.fromSize( - size: Size.fromRadius(60.r), - child: getEditProfileIndi!.data! - .profilePhoto != - null - ? ClipOval( - child: - SizedBox.fromSize( - size: Size.fromRadius( - 25.r), - child: CircleAvatar( - backgroundImage: - NetworkImage( - getEditProfileIndi! - .data! - .profilePhoto!), - radius: 25.r, - ), - ), - ) - : Image.asset( - "assets/images/blank-profile-picture-973460_1280.png")), - ), - ), - Positioned( - bottom: 0, - right: 0, - child: InkWell( - onTap: () { - ImageUploadBottomSheet().showModal( - context, - true, - (result) { - // var filenameresult = - // extractFileName1(result); - editProfileImage - .usserprofilePicPath - .value = result; - - var filenameresult = - extractFileName1(result); - print( - "File name is $filenameresult"); - - profilePicture = result; - isImageAdded = true; - setState(() {}); - }, - ); - }, - child: Container( - height: 35.h, - width: 35.w, - decoration: const BoxDecoration( - shape: BoxShape.circle, - color: Color(0xFFD90B2E)), - child: Center( - child: Image.asset( - "assets/images/png/cameraicon2.png", - height: 19.h, - width: 19.w, - ), - ), - ), - )) - ], - ), - sizedBoxHeight(15.h), - text16400white("Edit profile picture"), - sizedBoxHeight(20.h), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - text16400white("Full name"), - sizedBoxHeight(16.h), - CustomTextFormField( - textEditingController: fullNameController, - leadingIcon: Container( - width: 18.w, - height: 17.h, - child: Center( - child: Image.asset( - "assets/images/png/Frame 24.png", - width: 18.w, - height: 17.h, - ), - ), - ), - hintText: "Edward Hackett", - ), - sizedBoxHeight(20.h), - text16400white("User name"), - sizedBoxHeight(16.h), - CustomTextFormField( - textEditingController: userNameController, - leadingIcon: Container( - width: 18.w, - height: 17.h, - child: Center( - child: Image.asset( - "assets/images/png/Frame 24.png", - width: 18.w, - height: 17.h, - ), - ), - ), - hintText: "edward_01", - ), - sizedBoxHeight(20.h), - text16400white("Date of birth"), - sizedBoxHeight(16.h), - GestureDetector( - onTap: () => - datePicker(context, dateController), - child: AbsorbPointer( - child: CustomTextFormField( - leadingIcon: Container( - width: 18.0, - height: 17.0, - child: Center( - child: Image.asset( - "assets/images/png/calender.png", - width: 18.0, - height: 17.0, - ), - ), - ), - hintText: "12-04-2024", - textEditingController: dateController, - ), - ), - ), - - sizedBoxHeight(20.h), - text16400white("Gender"), - sizedBoxHeight(16.h), - CustomDropDownRadio( - initialSelectedValue: _selectedgenderType, - header: _selectedgenderType ?? "Male", - title: "", - showOtherOption: true, - listData: const [ - "Male", - "Female", - "Prefer not to say" - ], - onItemSelected: _onItemSelected, - leadingImage: Image.asset( - "assets/images/png/Vector ws.png", - width: 18.w, - height: 17.h, - ), - ), - sizedBoxHeight(25.h), - Row( - children: [ - text16400white("Location"), - sizedBoxWidth(6.w), - Image.asset( - "assets/images/png/octicon_question-24.png", - height: 16.h, - width: 16.w, - ) - ], - ), - sizedBoxHeight(16.h), - CustomTextFormField( - textEditingController: locationController, - leadingIcon: Container( - width: 18.w, - height: 17.h, - child: Center( - child: Image.asset( - "assets/images/png/Group 58645.png", - width: 18.w, - height: 17.h, - ), - ), - ), - hintText: - "Elm street london, United Kingdom", - ), - sizedBoxHeight(20.h), - Row( - children: [ - text16400white("Interests"), - sizedBoxWidth(6.w), - Image.asset( - "assets/images/png/octicon_question-24.png", - height: 16.h, - width: 16.w, - ) - ], - ), - sizedBoxHeight(16.h), - - //Obx(() { - //return - CustomDropDownChexkBox( - header: 'Select interest', - title: "", - listData: listofInterests, - onItemSelected: getCatIdFromName, - leadingImage: Image.asset( - "assets/images/png/Vector (4).png", - width: 18.w, - height: 17.h, - ), - // showOtherOption: true, - initiallySelected: listofUserInterests, - ), - // }), - - sizedBoxHeight(20.h), - text16400white("About"), - sizedBoxHeight(16.h), - CustomTextFormField2( - textEditingController: aboutController, - hintText: - "Lorem Ipsum has been the industry's standard dummy text ever since the 1500s. Lorem Ipsum has been the industry's standard", - maxlines: 3, - ), - // sizedBoxHeight(20.h), - - text16400white("Position"), - sizedBoxHeight(16.h), - CustomTextFormField( - textEditingController: positionController, - hintText: "Lorem Ipsum", - ), - sizedBoxHeight(20.h), - text16400white("Training Scores"), - sizedBoxHeight(16.h), - CustomTextFormField( - textEditingController: - trainingScoresController, - hintText: "50", - ), - sizedBoxHeight(20.h), - text16400white("Height"), - sizedBoxHeight(16.h), - CustomTextFormField( - textEditingController: heightController, - hintText: "6 feet", - ), - sizedBoxHeight(20.h), - text16400white("Weight"), - sizedBoxHeight(16.h), - CustomTextFormField( - textEditingController: weightController, - hintText: "70kg", - ), - sizedBoxHeight(20.h), - text16400white("Batting Average"), - sizedBoxHeight(16.h), - CustomTextFormField( - textEditingController: battingAvgController, - hintText: "372", - ), - sizedBoxHeight(20.h), - sizedBoxHeight(60.h), - CommonBtn( - text: "Save", - onTap: () { - if (fullNameController.text.isBlank! || - userNameController.text.isBlank! || - dateController.text.isBlank! || - locationController.text.isBlank! || - aboutController.text.isBlank! || - positionController.text.isBlank! || - trainingScoresController - .text.isBlank! || - heightController.text.isBlank! || - weightController.text.isBlank! || - battingAvgController.text.isBlank!) { - Get.snackbar( - 'Error', - 'Please fill missing details', - snackPosition: SnackPosition.BOTTOM, - backgroundColor: Colors.red, - colorText: Colors.white, - ); - } - // else if (profilePicture == "") { - // utils.showToast( - // 'Upload edit profile picture!'); - // } - else { - print(selectedinterestid.toString()); - saveEditProfileInd(); - } - }, - ), - sizedBoxHeight(60.h), - ], - ) - ]))) - ]); - } - return Container(); - })), - ); - - // FutureBuilder( - // future: myfuture, - // builder: (ctx, snapshot) { - // if (snapshot.connectionState == ConnectionState.waiting) { - // return const Center( - // child: CircularProgressIndicator( - // color: Colors.blue, - // ), - // ); - // } - - // if (snapshot.hasError) { - // return Center( - // child: Text( - // '${snapshot.error} occurred', - // style: TextStyle(fontSize: 18.spMin), - // ), - // ); - // } - - // if (snapshot.connectionState == ConnectionState.done && - // snapshot.hasData) { - // print("Data fetched-->"); - // return Stack(children: [ - // Container( - // decoration: const BoxDecoration( - // image: DecorationImage( - // image: AssetImage( - // "assets/images/png/Ellipse 1496.png"), - // fit: BoxFit.fill)), - // ), - // SingleChildScrollView( - // child: Padding( - // padding: const EdgeInsets.symmetric(horizontal: 16), - // child: Column(children: [ - // sizedBoxHeight(25.h), - // Stack( - // children: [ - // profilePicture != "" && isImageAdded - // ? ClipOval( - // child: SizedBox.fromSize( - // size: Size.fromRadius(50.r), - // child: Image.file( - // File(profilePicture), - // fit: BoxFit.cover, - // width: double.infinity, - // errorBuilder: (BuildContext context, - // Object exception, - // StackTrace? stackTrace) { - // return CircleAvatar( - // backgroundImage: const AssetImage( - // "assets/images/png/cimg3.png"), - // radius: 50.r, - // ); - // }, - // ), - // ), - // ) - // : getEditProfileIndi?.data?.profilePhoto != - // null && - // getEditProfileIndi! - // .data!.profilePhoto!.isNotEmpty - // ? Container( - // width: 100.w, - // height: 100.h, - // decoration: ShapeDecoration( - // image: DecorationImage( - // image: NetworkImage( - // getEditProfileIndi! - // .data!.profilePhoto!, - // ), - // fit: BoxFit.cover, - // // onError: (error, stackTrace) { - // // // Fallback to default image in case of error - // // return const AssetImage("assets/images/png/cimg3.png"); - // // }, - // ), - // shape: const OvalBorder(), - // ), - // ) - // : CircleAvatar( - // backgroundImage: const AssetImage( - // "assets/images/png/cimg3.png"), - // radius: 50.r, - // ), - // Positioned( - // bottom: 0, - // right: 0, - // child: InkWell( - // onTap: () { - // ImageUploadBottomSheet().showModal( - // context, - // true, - // (result) { - // var filenameresult = - // extractFileName1(result); - - // profilePicture = result; - // isImageAdded = true; - // setState(() {}); - // }, - // ); - // }, - // child: Container( - // height: 35.h, - // width: 35.w, - // decoration: const BoxDecoration( - // shape: BoxShape.circle, - // color: Color(0xFFD90B2E)), - // child: Center( - // child: Image.asset( - // "assets/images/png/cameraicon2.png", - // height: 19.h, - // width: 19.w, - // ), - // ), - // ), - // )) - // ], - // ), - // sizedBoxHeight(15.h), - // text16400white("Edit profile picture"), - // sizedBoxHeight(20.h), - // Column( - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // text16400white("Full name"), - // sizedBoxHeight(16.h), - // CustomTextFormField( - // textEditingController: fullNameController, - // leadingIcon: Container( - // width: 18.w, - // height: 17.h, - // child: Center( - // child: Image.asset( - // "assets/images/png/Frame 24.png", - // width: 18.w, - // height: 17.h, - // ), - // ), - // ), - // hintText: "Edward Hackett", - // ), - // sizedBoxHeight(20.h), - // text16400white("User name"), - // sizedBoxHeight(16.h), - // CustomTextFormField( - // textEditingController: userNameController, - // leadingIcon: Container( - // width: 18.w, - // height: 17.h, - // child: Center( - // child: Image.asset( - // "assets/images/png/Frame 24.png", - // width: 18.w, - // height: 17.h, - // ), - // ), - // ), - // hintText: "edward_01", - // ), - // sizedBoxHeight(20.h), - // text16400white("Date of birth"), - // sizedBoxHeight(16.h), - // GestureDetector( - // onTap: () => - // datePicker(context, dateController), - // child: AbsorbPointer( - // child: CustomTextFormField( - // leadingIcon: Container( - // width: 18.0, - // height: 17.0, - // child: Center( - // child: Image.asset( - // "assets/images/png/calender.png", - // width: 18.0, - // height: 17.0, - // ), - // ), - // ), - // hintText: "12-04-2024", - // textEditingController: dateController, - // ), - // ), - // ), - - // sizedBoxHeight(20.h), - // text16400white("Gender"), - // sizedBoxHeight(16.h), - // CustomDropDownRadio( - // initialSelectedValue: _selectedgenderType, - // header: _selectedgenderType ?? "Male", - // title: "", - // showOtherOption: true, - // listData: [ - // "Male", - // "Female", - // "Prefer not to say" - // ], - // onItemSelected: _onItemSelected, - // leadingImage: Image.asset( - // "assets/images/png/Vector ws.png", - // width: 18.w, - // height: 17.h, - // ), - // ), - // sizedBoxHeight(25.h), - // Row( - // children: [ - // text16400white("Location"), - // sizedBoxWidth(6.w), - // Image.asset( - // "assets/images/png/octicon_question-24.png", - // height: 16.h, - // width: 16.w, - // ) - // ], - // ), - // sizedBoxHeight(16.h), - // CustomTextFormField( - // textEditingController: locationController, - // leadingIcon: Container( - // width: 18.w, - // height: 17.h, - // child: Center( - // child: Image.asset( - // "assets/images/png/Group 58645.png", - // width: 18.w, - // height: 17.h, - // ), - // ), - // ), - // hintText: "Elm street london, United Kingdom", - // ), - // sizedBoxHeight(20.h), - // Row( - // children: [ - // text16400white("Interests"), - // sizedBoxWidth(6.w), - // Image.asset( - // "assets/images/png/octicon_question-24.png", - // height: 16.h, - // width: 16.w, - // ) - // ], - // ), - // sizedBoxHeight(16.h), - // // CustomDropDownChexkBox( - // // header: _selectedsportType ?? - // // "Rowing, Rugby, Swimming", - // // title: "", - // // listData: [ - // // "Rowing", - // // "Cycling", - // // "Running", - // // "Swimming", - // // "Triathlon", - // // "Hiking", - // // "Football", - // // "Rugby" - // // ], - // // onItemSelected: _onSportSelected, - // // leadingImage: Image.asset( - // // "assets/images/png/Vector (4).png", - // // width: 18.w, - // // height: 17.h, - // // ), - // // showOtherOption: true, - // // initiallySelected: _selectedSports, - // // ), - // // CustomDropDownRadio( - // // showOtherOption: true, - // // header: _selectedsportType ?? - // // "Rowing, Rugby, Swimming", - // // title: "", - // // listData: [ - // // "Rowing", - // // "Cycling", - // // "Running", - // // "Swimming", - // // "Triathlon", - // // "Hiking", - // // "Football", - // // "Rugby" - // // ], - // // onItemSelected: _onSportSelected, - // // leadingImage: Image.asset( - // // "assets/images/png/Vector (4).png", - // // width: 18.w, - // // height: 17.h, - // // ), - // // ), - - // sizedBoxHeight(20.h), - // text16400white("About"), - // sizedBoxHeight(16.h), - // CustomTextFormField2( - // textEditingController: aboutController, - // hintText: - // "Lorem Ipsum has been the industry's standard dummy text ever since the 1500s. Lorem Ipsum has been the industry's standard", - // maxlines: 3, - // ), - // // sizedBoxHeight(20.h), - - // text16400white("Position"), - // sizedBoxHeight(16.h), - // CustomTextFormField( - // textEditingController: positionController, - // hintText: "Lorem Ipsum", - // ), - // sizedBoxHeight(20.h), - // text16400white("Training Scores"), - // sizedBoxHeight(16.h), - // CustomTextFormField( - // textEditingController: - // trainingScoresController, - // hintText: "50", - // ), - // sizedBoxHeight(20.h), - // text16400white("Height"), - // sizedBoxHeight(16.h), - // CustomTextFormField( - // textEditingController: heightController, - // hintText: "6 feet", - // ), - // sizedBoxHeight(20.h), - // text16400white("Weight"), - // sizedBoxHeight(16.h), - // CustomTextFormField( - // textEditingController: weightController, - // hintText: "70kg", - // ), - // sizedBoxHeight(20.h), - // text16400white("Batting Average"), - // sizedBoxHeight(16.h), - // CustomTextFormField( - // textEditingController: battingAvgController, - // hintText: "372", - // ), - // sizedBoxHeight(20.h), - // sizedBoxHeight(60.h), - // CommonBtn( - // text: "Save", - // onTap: () { - // saveEditProfileInd(); - // }, - // ), - // sizedBoxHeight(60.h), - // ], - // ) - // ]))) - // ]); - // } - // return Container(); - // })); - } -} diff --git a/lib/Feed Module/Main_Screens/ProfileTab/TimeLine/AddTimeline.dart b/lib/Feed Module/Main_Screens/ProfileTab/TimeLine/AddTimeline.dart index ca67740..3246c48 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/TimeLine/AddTimeline.dart +++ b/lib/Feed Module/Main_Screens/ProfileTab/TimeLine/AddTimeline.dart @@ -6,12 +6,11 @@ import 'package:get/get.dart'; import 'package:regroup/Common/CommonGlassmorphism.dart'; import 'package:regroup/Common/CommonWidget.dart'; import 'package:regroup/Common/base_manager.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/EditProfile/ViewModel/EditProfileApi.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Model/timelineabilityModel.dart' - as timelineabilist; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/gettimelineability.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profileGetmethod.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profilePostmethod.dart'; +import 'package:regroup/Main_Screens/ProfileTab/Model/timelineabilityModel.dart' as timelineabilist; + +import 'package:regroup/Main_Screens/ProfileTab/view_model/gettimelineability.dart'; +import 'package:regroup/Main_Screens/ProfileTab/view_model/profileGetmethod.dart'; +import 'package:regroup/Main_Screens/ProfileTab/view_model/profilePostmethod.dart'; import 'package:regroup/Utils/Common/CommonAppbar.dart'; import 'package:regroup/Utils/Common/CommonDropdown.dart'; import 'package:regroup/Utils/Common/CustomNextButton.dart'; @@ -23,7 +22,6 @@ import 'package:regroup/resources/routes/route_name.dart'; import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart'; import 'package:intl/intl.dart'; import 'package:async/src/future_group.dart'; -import 'package:shared_preferences/shared_preferences.dart'; class AddTimeline extends StatefulWidget { const AddTimeline({super.key}); @@ -276,7 +274,7 @@ class _AddTimelineState extends State { hintText: 'Enter club name', validator: (value) { if (value!.isEmpty) { - return 'Enter your full name '; + return 'Enter your club name '; } return null; }, @@ -288,16 +286,16 @@ class _AddTimelineState extends State { ], ), sizedBoxHeight(25.h), - text16400white("Role in the club"), + text16400white("Role in "), sizedBoxHeight(15.h), CustomTextFormField( textEditingController: rollnameController, texttype: TextInputType.text, - hintText: 'Enter role in club', + hintText: 'Enter role in the club', validator: (value) { if (value!.isEmpty) { - return 'Enter role in club'; + return 'Enter role in the club'; } return null; }, @@ -404,9 +402,9 @@ class _AddTimelineState extends State { Row( children: [ Obx(() { - return commonGlassContainer( - border: 1, - borderradius: 2, + return commonGlassUI( + borderwidth: 1, + borderRadius: BorderRadius.circular(2), height: 20.h, width: 20.w, opacity1: 0.24, @@ -568,10 +566,10 @@ class _AddTimelineState extends State { textEditingController: rollnameController, texttype: TextInputType.text, - hintText: 'Enter role in club', + hintText: 'Enter role in the club', validator: (value) { if (value!.isEmpty) { - return 'Enter role in club'; + return 'Enter role in the club'; } return null; }, @@ -678,9 +676,9 @@ class _AddTimelineState extends State { Row( children: [ Obx(() { - return commonGlassContainer( - border: 1, - borderradius: 2, + return commonGlassUI( + borderwidth: 1, + borderRadius: BorderRadius.circular( 2), height: 20.h, width: 20.w, opacity1: 0.24, @@ -817,153 +815,6 @@ class _CustomDropDownCheckBoxTimelineState .addAll(widget.initiallySelected); // Initialize selectedValues } - // List> _buildDropdownMenuItems() { - // List> items = - // widget.listData.asMap().entries.map((entry) { - // int index = entry.key; - // String item = entry.value; - // return DropdownMenuItem( - // value: item, - // child: InkWell( - // onTap: () { - // setState(() { - // if (selectedValues.contains(item)) { - // selectedValues.remove(item); - // } else { - // selectedValues.add(item); - // } - // _textController.clear(); - // widget.onItemSelected( - // selectedValues.toList()); // Convert RxList to List - // }); - // }, - // child: Column( - // mainAxisAlignment: MainAxisAlignment.start, - // children: [ - // Row( - // children: [ - // Obx(() { - // return Checkbox( - // value: selectedValues.contains(item), - // activeColor: Colors.white, - // checkColor: const Color(0xFFD90B2E), - // onChanged: (bool? value) { - // setState(() { - // if (value == true) { - // selectedValues.add(item); - // } else { - // selectedValues.remove(item); - // } - // _textController.clear(); - // widget.onItemSelected(selectedValues.toList()); - // }); - // }, - // ); - // }), - // const SizedBox(width: 8), - // Text( - // item, - // style: const TextStyle( - // color: Colors.white, - // fontSize: 16, - // fontFamily: 'Helvetica', - // fontWeight: FontWeight.w500, - // ), - // overflow: TextOverflow.ellipsis, - // ), - // ], - // ), - // if (index != widget.listData.length - 1) - // const Divider(thickness: 1, color: Color(0xFF434A53)), - // ], - // ), - // ), - // ); - // }).toList(); - - // if (widget.showOtherOption) { - // items.add( - // DropdownMenuItem( - // value: _textController.text, - // child: Column( - // children: [ - // const Divider(thickness: 1, color: Color(0xFF434A53)), - // Row( - // children: [ - // Obx(() { - // return Checkbox( - // value: selectedValues.contains(_textController.text), - // activeColor: Colors.white, - // onChanged: (bool? value) { - // setState(() { - // if (value == true && - // _textController.text.trim().isNotEmpty) { - // selectedValues.add(_textController.text); - // } else { - // selectedValues.remove(_textController.text); - // } - // widget.onItemSelected(selectedValues.toList()); - // }); - // }, - // ); - // }), - // const SizedBox(width: 8), - // const Text( - // "Other: ", - // style: TextStyle( - // color: Colors.white, - // fontSize: 16, - // fontFamily: 'Helvetica', - // fontWeight: FontWeight.w500, - // ), - // overflow: TextOverflow.ellipsis, - // ), - // Expanded( - // child: TextField( - // controller: _textController, - // style: const TextStyle( - // color: Colors.white, - // fontSize: 16, - // fontFamily: 'Helvetica', - // fontWeight: FontWeight.w500, - // ), - // decoration: const InputDecoration( - // hintText: '', - // hintStyle: TextStyle(color: Colors.white70), - // border: UnderlineInputBorder(), - // ), - // ), - // ), - // TextButton( - // onPressed: () { - // setState(() { - // if (_textController.text.trim().isNotEmpty) { - // selectedValues.add(_textController.text); - // widget.onItemSelected(selectedValues.toList()); - // } - // }); - // }, - // child: const Text( - // 'OK', - // style: TextStyle( - // color: Colors.white, - // fontSize: 16, - // fontFamily: 'Helvetica', - // fontWeight: FontWeight.w500, - // ), - // ), - // ), - // ], - // ), - // SizedBox(height: 10), - // ], - // ), - // ), - // ); - // } - // return items; - // } - List> _buildDropdownMenuItems() { return widget.listData.asMap().entries.map((entry) { int index = entry.key; @@ -1043,11 +894,9 @@ class _CustomDropDownCheckBoxTimelineState }, child: Container( width: double.infinity, - height: 50, - padding: EdgeInsets.only( - right: 22, - left: 12, - ), + // height: 50, + padding: + EdgeInsets.only(right: 22, left: 12, top: 15, bottom: 15), decoration: BoxDecoration( color: const Color(0xFFFFFFFF).withOpacity(0.10), borderRadius: onDropTap.value @@ -1085,10 +934,10 @@ class _CustomDropDownCheckBoxTimelineState fontFamily: 'Helvetica', fontWeight: FontWeight.w400, ), - overflow: TextOverflow.ellipsis, + // overflow: TextOverflow.ellipsis, ), ), - const Spacer(), + // const Spacer(), onDropTap.value ? Image.asset('assets/images/png/arrowup.png') : Image.asset('assets/images/png/arrowdown.png'), diff --git a/lib/Feed Module/sidemenu/Community/Admin/PopupItem/Community settings/CommunitySetting.dart b/lib/Feed Module/sidemenu/Community/Admin/PopupItem/Community settings/CommunitySetting.dart deleted file mode 100644 index 38784d9..0000000 --- a/lib/Feed Module/sidemenu/Community/Admin/PopupItem/Community settings/CommunitySetting.dart +++ /dev/null @@ -1,81 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; -import 'package:regroup/Common/CommonWidget.dart'; -import 'package:regroup/Utils/Common/CommonAppbar.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; -import 'package:regroup/Utils/Common/sized_box.dart'; -import 'package:regroup/Utils/texts.dart'; -import 'package:regroup/resources/routes/route_name.dart'; - -class CommunitySetting extends StatefulWidget { - const CommunitySetting({super.key}); - - @override - State createState() => _CommunitySettingState(); -} - -class _CommunitySettingState extends State { - @override - Widget build(BuildContext context) { - return Scaffold( - // key: _scaffoldKey1, - backgroundColor: Color(0xFF222935), - extendBody: true, - resizeToAvoidBottomInset: false, - appBar: CommonAppbar( - titleTxt: "Community settings", - ), - body: Stack(children: [ - Container( - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage("assets/images/png/Ellipse 1496.png"), - fit: BoxFit.fill)), - ), Column(children: [ - sizedBoxHeight(30.h), - GestureDetector( - onTap: () { - Get.toNamed(RouteName.editcommunity); - }, - child: rowTile(text: 'Edit community info')), - commonDivider(), - GestureDetector( - onTap: () { - Get.toNamed(RouteName.managemembers); - }, - child: rowTile(text: 'Manage members')), - commonDivider(), - GestureDetector( - onTap: () { - Get.toNamed(RouteName.managegroups); - }, - child: rowTile(text: 'Manage groups')), - commonDivider(), - GestureDetector( - onTap: () { - Get.toNamed(RouteName.managetags); - }, - child: rowTile(text: 'Manage tags')), - sizedBoxHeight(20.h), - ]) - ])); - } - - Widget rowTile({ - required String text, - }) { - return Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 20.h), - child: Row(children: [ - text18w400_FCFCFC(text), - Spacer(), - Icon( - Icons.arrow_forward_ios, - color: Colors.white, - size: 20, - ) - ]), - ); - } -} diff --git a/lib/Feed Module/sidemenu/Community/Admin/PopupItem/Community settings/EditCommunity/EditCommunity.dart b/lib/Feed Module/sidemenu/Community/Admin/PopupItem/Community settings/EditCommunity/EditCommunity.dart deleted file mode 100644 index 0a14f8b..0000000 --- a/lib/Feed Module/sidemenu/Community/Admin/PopupItem/Community settings/EditCommunity/EditCommunity.dart +++ /dev/null @@ -1,307 +0,0 @@ -import 'dart:io'; - -import 'package:dotted_border/dotted_border.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:regroup/Common/CommonDropDown.dart'; -import 'package:regroup/Common/CommonGlassmorphism.dart'; -import 'package:regroup/Utils/Common/CommonAppbar.dart'; -import 'package:regroup/Utils/Common/CommonDropdown.dart'; -import 'package:regroup/Utils/Common/CustomNextButton.dart'; -import 'package:regroup/Utils/Common/ImageUpload.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; -import 'package:regroup/Utils/Common/sized_box.dart'; -import 'package:regroup/Utils/texts.dart'; -import 'package:regroup/Utils/Common/CustomTextformfield.dart'; - -class EditCommunity extends StatefulWidget { - const EditCommunity({super.key}); - - @override - State createState() => _EditCommunityState(); -} - -class _EditCommunityState extends State { - TextEditingController communitynameController = TextEditingController(); - TextEditingController descriptionController = TextEditingController(); - - @override - void initState() { - communitynameController.text = 'Active alliance network'; - descriptionController.text = - "Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer ."; - super.initState(); - } - - List filePath = []; - List bannerPath = []; - bool isImageAdded = false; - bool isbannerAdded = false; - @override - Widget build(BuildContext context) { - return Scaffold( - // key: _scaffoldKey1, - backgroundColor: Color(0xFF222935), - extendBody: true, - appBar: CommonAppbar( - titleTxt: "Edit community info", - ), - resizeToAvoidBottomInset: false, - body: Stack(children: [ - Container( - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage("assets/images/png/Ellipse 1496.png"), - fit: BoxFit.fill)), - ), - SingleChildScrollView( - child: Column(children: [ - sizedBoxHeight(30.h), - Stack( - clipBehavior: Clip.none, - children: [ - Container( - height: 100.h, - width: 100.w, - decoration: BoxDecoration( - shape: BoxShape.circle, - border: - Border.all(color: Color(0xFF434A53), width: 0.5.w), - ), - child: Center( - child: filePath.isNotEmpty - ? ClipOval( - child: SizedBox.fromSize( - size: Size.fromRadius(50.r), - child: Image.file( - filePath[0]!, - fit: BoxFit.cover, - width: double.infinity, - ), - ), - ) - : Image.asset('assets/images/png/Ellipse 37.png', - fit: BoxFit.cover), - ), - ), - Positioned( - right: -10, - bottom: 0, - child: InkWell( - onTap: () { - ImageUploadBottomSheet().showModal( - context, - true, - (result) { - var file = File(result); - - filePath.add(file); - isImageAdded = true; - setState(() {}); - }, - ); - }, - child: Container( - height: 35.h, - width: 35.w, - decoration: BoxDecoration( - color: Color(0xFFD90B2E), - shape: BoxShape.circle, - border: Border.all( - color: Color(0xFFD90B2E), width: 0.5.w)), - child: Center( - child: Image.asset( - 'assets/images/png/cameraicon.png', - height: 14.h, - width: 15.w, - ), - ), - ), - )) - ], - ), - sizedBoxHeight(25.h), - text16w400_white("Edit community profile picture"), - sizedBoxHeight(30.h), - Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - text16w400_FCFCFC("Community banner image"), - sizedBoxHeight(16.h), - GestureDetector( - onTap: () { - ImageUploadBottomSheet().showModal( - context, - false, - (result) { - var file = File(result); - - bannerPath.add(file); - isbannerAdded = true; - setState(() {}); - }, - ); - }, - child: DottedBorder( - strokeWidth: 1, - dashPattern: [7, 4], - borderType: BorderType.RRect, - radius: Radius.circular(14.r), - color: Color(0xFF434A53), - child: commonGlassContainer( - border: 0, - width: double.infinity, - height: 150.h, - borderradius: 10.r, - customWidget: bannerPath.isNotEmpty && isbannerAdded - ? Stack(children: [ - Image.file( - bannerPath[0]!, - fit: BoxFit.cover, - width: double.infinity, - ), - Positioned( - right: 5, - bottom: 5, - child: GestureDetector( - onTap: () { - bannerPath.clear(); - isbannerAdded = false; - setState(() {}); - }, - child: Container( - width: 27, - height: 27, - decoration: ShapeDecoration( - color: Color(0xFF7E7E7E), - shape: RoundedRectangleBorder( - borderRadius: - BorderRadius.circular(5)), - ), - child: Icon( - Icons.delete_outline_outlined, - color: Colors.white, - ))), - ), - ]) - : Padding( - padding: EdgeInsets.symmetric(vertical: 16.h), - child: Column( - children: [ - Image.asset( - "assets/images/png/cameraicon2.png", - height: 36.h, - width: 36.w, - ), - sizedBoxHeight(10.h), - text14w400white('Upload banner image'), - sizedBoxHeight(8.h), - SizedBox( - width: 270.w, - child: text10w400_whiteCenter( - "Lorem Ipsum has been the industry's standard dummy text ever since the 1500s"), - ), - ], - ), - ), - ), - ), - ), - sizedBoxHeight(16.w), - commonGlassContainer( - width: double.infinity, - height: 60.h, - borderradius: 10.r, - customWidget: Center( - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 12.w), - child: Row(children: [ - Container( - height: 40.h, - width: 40.w, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(5.r)), - child: Image.asset( - "assets/images/png/img2.png", - fit: BoxFit.cover, - ), - ), - sizedBoxWidth(8.w), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - text14400white("group1.png"), - sizedBoxHeight(2.h), - text12w400_FCFCFC_blur("10 kb") - ], - ), - Spacer(), - Image.asset( - 'assets/images/png/cancelicon.png', - height: 20.h, - width: 20.w, - ) - ]), - ), - ), - border: 1), - sizedBoxHeight(25.h), - text16w400_FCFCFC("Community name"), - sizedBoxHeight(14.h), - CustomTextFormField( - textEditingController: communitynameController, - validator: (val) { - if (val == null || val.isEmpty) { - return 'Enter Community name'; - } - return null; - }, - ), - sizedBoxHeight(25.h), - text16w400_FCFCFC("Group description"), - sizedBoxHeight(14.h), - CustomTextFormField2( - maxlines: 3, - textEditingController: descriptionController, - ), - text16w400_FCFCFC("Type of community"), - sizedBoxHeight(14.h), - CustomDropDownRadio( - header: "", - title: "", - listData: ["Public", "Private - Request to join"], - onItemSelected: (p0) {}, - leadingImage: SizedBox()), - sizedBoxHeight(25.h), - text16w400_FCFCFC("Location*"), - sizedBoxHeight(14.h), - CustomDropDownRadio( - header: "", - title: "", - listData: ["Public", "Private", "Secret"], - onItemSelected: (p0) {}, - leadingImage: SizedBox()), - sizedBoxHeight(25.h), - text16w400_FCFCFC("Primary activity*"), - sizedBoxHeight(14.h), - CustomDropDownRadio( - showOtherOption: true, - header: "", - title: "", - listData: ["Sports", "Hobby"], - onItemSelected: (p0) {}, - leadingImage: SizedBox()), - sizedBoxHeight(50.h), - CustomButton(text: 'Save changes', onPressed: () {}), - sizedBoxHeight(50.h), - ], - ), - ) - ]), - ) - ])); - } -} diff --git a/lib/Feed Module/sidemenu/Community/Admin/PopupItem/Community settings/ManageGroup.dart b/lib/Feed Module/sidemenu/Community/Admin/PopupItem/Community settings/ManageGroup.dart deleted file mode 100644 index 6dbf089..0000000 --- a/lib/Feed Module/sidemenu/Community/Admin/PopupItem/Community settings/ManageGroup.dart +++ /dev/null @@ -1,188 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:regroup/Common/CommonGlassmorphism.dart'; -import 'package:regroup/Common/CommonWidget.dart'; -import 'package:regroup/Utils/Common/CommonAppbar.dart'; -import 'package:regroup/Utils/Common/CustomTextformfield.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; -import 'package:regroup/Utils/Common/sized_box.dart'; -import 'package:regroup/Utils/texts.dart'; - -class ManageGroups extends StatefulWidget { - const ManageGroups({super.key}); - - @override - State createState() => _ManageGroupsState(); -} - -class _ManageGroupsState extends State { - List groupData = [ - { - "imagePath": "assets/images/png/img45.png", - "title": "Iron titans fitness crew", - "subtitle": "Lorem ipsum dummy text", - }, - { - "imagePath": "assets/images/png/Rectangle 25.png", - "title": "Body blitz brigade", - "subtitle": "Lorem ipsum dummy text", - }, - { - "imagePath": "assets/images/png/img2.png", - "title": "Fit fusion squad", - "subtitle": "Lorem ipsum dummy text", - }, - { - "imagePath": "assets/images/png/img2.png", - "title": "Power pulse posse", - "subtitle": "Lorem ipsum dummy text", - }, - { - "imagePath": "assets/images/png/img2.png", - "title": "Wellness warriors collective", - "subtitle": "Lorem ipsum dummy text", - }, - ]; - - @override - Widget build(BuildContext context) { - return Scaffold( - // key: _scaffoldKey1, - backgroundColor: Color(0xFF222935), - extendBody: true, - resizeToAvoidBottomInset: false, - appBar: CommonAppbar( - titleTxt: "Manage groups", - customActionWidget: InkWell( - onTap: () {}, - child: Container( - height: 35.h, - width: 35.w, - decoration: BoxDecoration( - color: Color(0xFFD90B2E), - shape: BoxShape.circle, - boxShadow: [ - BoxShadow( - color: Color(0x40000000), - offset: Offset(0, 6), - blurRadius: 8, - spreadRadius: 0, - ), - ], - ), - child: Icon(Icons.add, color: Colors.white, weight: 2), - ), - ), - ), - body: Stack(children: [ - Container( - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage("assets/images/png/Ellipse 1496.png"), - fit: BoxFit.fill)), - ), SingleChildScrollView( - child: Column(children: [ - Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - sizedBoxHeight(20.h), - CustomTextFormField( - leadingIcon: SizedBox( - height: 23, - width: 23, - child: Center( - child: Image.asset( - "assets/images/png/ion_search-outline.png", - height: 23, - width: 23, - ), - ), - ), - hintText: "Search groups", - ), - sizedBoxHeight(25.h), - Row( - children: [ - commonGlassContainer( - opacity1: 0.24, - opacity2: 0.24, - width: 50.w, - height: 50.h, - borderradius: 100, - customWidget: Center( - child: Image.asset( - "assets/images/png/Black.png", - height: 30.h, - width: 30.w, - )), - border: 0.5), - sizedBoxWidth(8.w), - text18w400_FCFCFC("Create group"), - Spacer(), - Icon( - Icons.arrow_forward_ios_outlined, - color: Colors.white, - size: 14.sp, - ), - ], - ), - sizedBoxHeight(30.h), - text18w700white("Groups"), - sizedBoxHeight(20.h), - ]), - ), - ListView.builder( - shrinkWrap: true, - itemCount: groupData.length, - itemBuilder: (context, index) { - return Column( - children: [ - groupWidget( - imagePath: groupData[index]["imagePath"], - title: groupData[index]["title"], - subtitle: groupData[index]["subtitle"]), - commonDivider(), - ], - ); - }, - ) - ]), - ) - ])); - } -} - -Widget groupWidget({ - required String imagePath, - required String title, - required String subtitle, -}) { - return Padding( - padding: EdgeInsets.symmetric(vertical: 16.h, horizontal: 16.w), - child: Row( - children: [ - CircleAvatar( - backgroundImage: AssetImage(imagePath), - radius: 20.r, - ), - sizedBoxWidth(10.w), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - text16w400_FCFCFC(title), - sizedBoxHeight(4.h), - text12w400_FCFCFC_blur(subtitle) - ], - ), - Spacer(), - Icon( - Icons.clear, - color: Color(0xFFFFFFFF), - weight: 1.88, - ) - ], - ), - ); -} diff --git a/lib/Feed Module/sidemenu/Community/Admin/PopupItem/Community settings/ManageTags.dart/ManageTags.dart b/lib/Feed Module/sidemenu/Community/Admin/PopupItem/Community settings/ManageTags.dart/ManageTags.dart deleted file mode 100644 index 0bacc8b..0000000 --- a/lib/Feed Module/sidemenu/Community/Admin/PopupItem/Community settings/ManageTags.dart/ManageTags.dart +++ /dev/null @@ -1,233 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; -import 'package:glassmorphism/glassmorphism.dart'; -import 'package:regroup/Common/CommonGlassmorphism.dart'; -import 'package:regroup/Common/CommonTabBar.dart'; -import 'package:regroup/Common/CommonWidget.dart'; -import 'package:regroup/Utils/Common/CommonAppbar.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; -import 'package:regroup/Utils/Common/sized_box.dart'; -import 'package:regroup/Utils/texts.dart'; -import 'package:regroup/resources/routes/route_name.dart'; - -class ManageTags extends StatefulWidget { - const ManageTags({super.key}); - - @override - State createState() => _ManageTagsState(); -} - -class _ManageTagsState extends State { - @override - Widget build(BuildContext context) { - return Scaffold( - // key: _scaffoldKey1, - backgroundColor: Color(0xFF222935), - extendBody: true, - appBar: CommonAppbar( - titleTxt: "Manage tags", - ), - resizeToAvoidBottomInset: false, - body: Stack(children: [ - Container( - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage("assets/images/png/Ellipse 1496.png"), - fit: BoxFit.fill)), - ), SingleChildScrollView( - child: Column(children: [ - sizedBoxHeight(20.h), - DefaultTabController( - length: 2, - // initialIndex: selectedIndex.value, - child: Column(children: [ - CommonTabBar(tabs: const [ - Tab( - text: 'Tags', - ), - Tab( - text: 'Tag requests', - ), - ]), - SizedBox( - height: 600.h, - child: TabBarView( - children: [ - tagsTab(), - tagrequestsrTab(), - ], - ), - ), - ])) - ])) - ]), - floatingActionButtonLocation: CustomFloatingActionButtonLocation(60.0), - floatingActionButton: Container( - height: 55.h, - width: 55.w, - decoration: BoxDecoration( - shape: BoxShape.circle, - boxShadow: [ - BoxShadow( - color: Color(0x40000000), // Hex color with 40% opacity - offset: Offset(0, 6), - blurRadius: 8, - ), - ], - ), - child: FloatingActionButton( - onPressed: () { - Get.toNamed(RouteName.newtag); - }, - backgroundColor: Color(0xFFD90B2E), - autofocus: true, - shape: CircleBorder(), - child: Image.asset( - "assets/images/png/iconamoon_edit-thin.png", - height: 30.h, - width: 30.w, - ), - ), - )); - } -} - -Widget tagsTab() { - List tags = ['Cycle', 'Sports', 'Fitness', 'Kayaking', 'Sports club']; - return Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - sizedBoxHeight(25.h), - Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), - child: text16400white("Special Announcement Tags"), - ), - sizedBoxHeight(15.h), - ListView.builder( - shrinkWrap: true, - itemCount: tags.length, - itemBuilder: (context, index) { - return Column( - children: [ - rowTagsTile(text: tags[index]), - if (index != tags.length - 1) commonDivider() - ], - ); - }, - ) - ], - ); -} - -Widget rowTagsTile({ - required String text, -}) { - return Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 18.h), - child: Row(children: [ - text16w400_FCFCFC(text), - Spacer(), - Image.asset( - "assets/images/png/Group 1000004071.png", - width: 5.w, - height: 22.h, - ) - ]), - ); -} - -Widget tagrequestsrTab() { - List tagrequest = [ - 'Running', - 'Fit fam friday', - ]; - - return Column( - children: [ - sizedBoxHeight(30.h), - ListView.builder( - shrinkWrap: true, - itemCount: tagrequest.length, - itemBuilder: (context, index) { - return Column( - children: [ - rowTagRequestTile(title: tagrequest[index]), - sizedBoxHeight(20.h) - ], - ); - }, - ) - ], - ); -} - -Widget rowTagRequestTile({ - required String title, -}) { - return Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), - child: commonGlassContainer( - width: double.infinity, - height: 60.h, - borderradius: 10.r, - customWidget: Center( - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), - child: Row(children: [ - text16w700_FCFCFC(title), - Spacer(), - commonGlassContainer( - width: 35.w, - height: 35.h, - opacity1: 0.24, - opacity2: 0.24, - borderradius: 100, - customWidget: Center( - child: Icon( - Icons.clear, - size: 20, - color: Colors.white, - weight: 1, - )), - border: 0.5), - sizedBoxWidth(16.w), - Container( - height: 35.h, - width: 35.w, - decoration: BoxDecoration( - color: Color(0xFFD90B2E), - shape: BoxShape.circle, - ), - child: Icon( - Icons.check, - size: 20, - color: Colors.white, - weight: 1, - ), - ) - ]), - ), - ), - border: 1), - ); -} - -class CustomFloatingActionButtonLocation extends FloatingActionButtonLocation { - final double offset; - - CustomFloatingActionButtonLocation(this.offset); - - @override - Offset getOffset(ScaffoldPrelayoutGeometry scaffoldGeometry) { - // Calculate the position - double fabX = scaffoldGeometry.scaffoldSize.width - - scaffoldGeometry.floatingActionButtonSize.width - - 16.0; - double fabY = scaffoldGeometry.scaffoldSize.height - - scaffoldGeometry.floatingActionButtonSize.height - - 16.0 - - offset; - return Offset(fabX, fabY); - } -} diff --git a/lib/Feed Module/sidemenu/Community/Admin/PopupItem/Community settings/ManageTags.dart/NewTag/NewTag.dart b/lib/Feed Module/sidemenu/Community/Admin/PopupItem/Community settings/ManageTags.dart/NewTag/NewTag.dart deleted file mode 100644 index 2e0b01f..0000000 --- a/lib/Feed Module/sidemenu/Community/Admin/PopupItem/Community settings/ManageTags.dart/NewTag/NewTag.dart +++ /dev/null @@ -1,59 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:regroup/Utils/Common/CommonAppbar.dart'; -import 'package:regroup/Utils/Common/CustomNextButton.dart'; -import 'package:regroup/Utils/Common/CustomTextformfield.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; -import 'package:regroup/Utils/Common/sized_box.dart'; -import 'package:regroup/Utils/texts.dart'; - -class NewTag extends StatefulWidget { - const NewTag({super.key}); - - @override - State createState() => _NewTagState(); -} - -class _NewTagState extends State { - @override - Widget build(BuildContext context) { - return Scaffold( - // key: _scaffoldKey1, - backgroundColor: Color(0xFF222935), - extendBody: true, - appBar: CommonAppbar( - titleTxt: "New tag", - ), - resizeToAvoidBottomInset: false, - body: Stack(children: [ - Container( - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage("assets/images/png/Ellipse 1496.png"), - fit: BoxFit.fill)), - ), SingleChildScrollView( - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 16), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.end, - children: [ - sizedBoxHeight(30.h), - text16w400_FCFCFC("Tag name"), - sizedBoxHeight(16.h), - CustomTextFormField( - hintText: "", - validator: (val) { - if (val == null || val.isEmpty) { - return 'Enter a tag name'; - } - return null; - }, - ), - sizedBoxHeight(80.h), - CustomButton(text: "Add", onPressed: () {}) - ]), - )) - ])); - } -} diff --git a/lib/Feed Module/sidemenu/Community/MyCommunity/AddGroups.dart b/lib/Feed Module/sidemenu/Community/MyCommunity/AddGroups.dart deleted file mode 100644 index e02620a..0000000 --- a/lib/Feed Module/sidemenu/Community/MyCommunity/AddGroups.dart +++ /dev/null @@ -1,201 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; -import 'package:regroup/Common/CommonButton.dart'; -import 'package:regroup/Common/CommonGlassmorphism.dart'; -import 'package:regroup/Common/CommonWidget.dart'; -import 'package:regroup/Utils/Common/CommonAppbar.dart'; -import 'package:regroup/Utils/Common/CustomTextformfield.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; -import 'package:regroup/Utils/Common/sized_box.dart'; -import 'package:regroup/Utils/texts.dart'; -import 'package:regroup/resources/routes/route_name.dart'; - -class AddGroup extends StatefulWidget { - const AddGroup({super.key}); - - @override - State createState() => _AddGroupState(); -} - -class _AddGroupState extends State { - List isCheckedList = [false, false, false, false].obs; - - List groupData = [ - { - "imagePath": "assets/images/png/img45.png", - "title": "Iron titans fitness crew", - "subtitle": "Lorem ipsum dummy text", - }, - { - "imagePath": "assets/images/png/Rectangle 25.png", - "title": "Body blitz brigade", - "subtitle": "Lorem ipsum dummy text", - }, - { - "imagePath": "assets/images/png/img2.png", - "title": "Fit fusion squad", - "subtitle": "Lorem ipsum dummy text", - }, - { - "imagePath": "assets/images/png/img2.png", - "title": "Power pulse posse", - "subtitle": "Lorem ipsum dummy text", - }, - ]; - @override - Widget build(BuildContext context) { - return Scaffold( - // key: _scaffoldKey1, - backgroundColor: Color(0xFF222935), - extendBody: true, - appBar: CommonAppbar( - titleTxt: "Add groups", - ), - resizeToAvoidBottomInset: false, - body: Stack(children: [ - Container( - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage("assets/images/png/Ellipse 1496.png"), - fit: BoxFit.fill)), - ), SingleChildScrollView( - child: Column(children: [ - Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - sizedBoxHeight(20.h), - CustomTextFormField( - leadingIcon: SizedBox( - height: 23, - width: 23, - child: Center( - child: Image.asset( - "assets/images/png/ion_search-outline.png", - height: 23, - width: 23, - ), - ), - ), - hintText: "Search groups", - ), - sizedBoxHeight(25.h), - Row( - children: [ - commonGlassContainer( - opacity1: 0.24, - opacity2: 0.24, - width: 50.w, - height: 50.h, - borderradius: 100, - customWidget: Center( - child: Image.asset( - "assets/images/png/Black.png", - height: 30.h, - width: 30.w, - )), - border: 0.5), - sizedBoxWidth(8.w), - text18w400_FCFCFC("Create group"), - Spacer(), - Icon( - Icons.arrow_forward_ios_outlined, - color: Colors.white, - size: 14.sp, - ), - ], - ), - sizedBoxHeight(25.h), - sizedBoxHeight(30.h), - text18w700white("Existing Groups"), - sizedBoxHeight(20.h), - ]), - ), - ListView.builder( - shrinkWrap: true, - itemCount: groupData.length, - itemBuilder: (context, index) { - return Column( - children: [ - groupWidget( - index: index, - imagePath: groupData[index]["imagePath"], - title: groupData[index]["title"], - subtitle: groupData[index]["subtitle"], - isChecked: isCheckedList[index], - onCheckedChanged: (bool? value) { - isCheckedList[index] = value ?? false; - }, - ), - commonDivider(), - ], - ); - }, - ), - sizedBoxHeight(50.h), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 16), - child: CommonBtn( - text: "Add", - onTap: () { - Get.toNamed(RouteName.mycommunity); - }, - ), - ), - ]), - ) - ])); - } - - Widget groupWidget({ - required int index, - required String imagePath, - required String title, - required String subtitle, - required bool isChecked, - required ValueChanged onCheckedChanged, - }) { - return Padding( - padding: EdgeInsets.symmetric(vertical: 16.h, horizontal: 16.w), - child: Row(children: [ - CircleAvatar( - backgroundImage: AssetImage(imagePath), - radius: 20.r, - ), - sizedBoxWidth(10.w), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - text16w400_FCFCFC(title), - sizedBoxHeight(4.h), - text12w400_FCFCFC_blur(subtitle), - ], - ), - Spacer(), - Obx(() { - return commonGlassContainer( - border: isCheckedList[index] ? 1.2 : 0.9, - borderradius: 2, - height: 23.h, - width: 23.w, - opacity1: 0.24, - opacity2: 0.24, - borderColor: - isCheckedList[index] ? Color(0xFFD90B2E) : Color(0xFF434A53), - customWidget: Transform.scale( - scale: 1, - child: Checkbox( - side: BorderSide(color: Colors.transparent), - value: isCheckedList[index], - activeColor: Colors.transparent, - checkColor: Color(0xFFD90B2E), - onChanged: onCheckedChanged, - ), - )); - }) - ]), - ); - } -} diff --git a/lib/Feed Module/sidemenu/Community/MyCommunity/NewCommunity.dart b/lib/Feed Module/sidemenu/Community/MyCommunity/NewCommunity.dart deleted file mode 100644 index c3b1e58..0000000 --- a/lib/Feed Module/sidemenu/Community/MyCommunity/NewCommunity.dart +++ /dev/null @@ -1,240 +0,0 @@ -import 'dart:io'; - -import 'package:dotted_border/dotted_border.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; -import 'package:regroup/Common/CommonButton.dart'; -import 'package:regroup/Common/CommonGlassmorphism.dart'; -import 'package:regroup/Utils/Common/CommonAppbar.dart'; -import 'package:regroup/Utils/Common/CommonDropdown.dart'; -import 'package:regroup/Utils/Common/CustomTextformfield.dart'; -import 'package:regroup/Utils/Common/ImageUpload.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; -import 'package:regroup/Utils/Common/sized_box.dart'; -import 'package:regroup/Utils/texts.dart'; -import 'package:regroup/resources/routes/route_name.dart'; - -class NewCommunity extends StatefulWidget { - const NewCommunity({super.key}); - - @override - State createState() => _NewCommunityState(); -} - -class _NewCommunityState extends State { - List filePath = []; - List bannerPath = []; - - bool isImageAdded = false; - bool isbannerAdded = false; - @override - Widget build(BuildContext context) { - return Scaffold( - // key: _scaffoldKey1, - backgroundColor: Color(0xFF222935), - extendBody: true, - resizeToAvoidBottomInset: false, - appBar: CommonAppbar( - titleTxt: "New community", - ), - body: Stack(children: [ - Container( - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage("assets/images/png/Ellipse 1496.png"), - fit: BoxFit.fill)), - ), SingleChildScrollView( - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), - child: - Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ - sizedBoxHeight(20.h), - Center( - child: InkWell( - onTap: () { - ImageUploadBottomSheet().showModal( - context, - true, - (result) { - var file = File(result); - - filePath.add(file); - isImageAdded = true; - setState(() {}); - }, - ); - }, - child: commonGlassContainer( - width: 95.w, - height: 95.h, - borderradius: 100, - opacity1: 0.24, - opacity2: 0.24, - customWidget: filePath.isNotEmpty && isImageAdded - ? ClipOval( - child: SizedBox.fromSize( - size: Size.fromRadius(47.5.r), - child: Image.file( - filePath[0]!, - fit: BoxFit.cover, - width: double.infinity, - ), - ), - ) - : Center( - child: Image.asset( - "assets/images/png/cameraicon2.png", - height: 30.h, - width: 30.w, - ), - ), - border: 0.5), - ), - ), - sizedBoxHeight(20.h), - Center(child: text16w400_white("Add community profile picture")), - sizedBoxHeight(30.h), - text16w400_FCFCFC("Banner image"), - sizedBoxHeight(15.h), - InkWell( - onTap: () { - ImageUploadBottomSheet().showModal( - context, - false, - (result) { - var file = File(result); - - bannerPath.add(file); - isbannerAdded = true; - setState(() {}); - }, - ); - }, - child: DottedBorder( - strokeWidth: 1, - dashPattern: [7, 4], - borderType: BorderType.RRect, - radius: Radius.circular(14.r), - color: Color(0xFF434A53), - child: commonGlassContainer( - border: 0, - width: double.infinity, - height: 130.h, - borderradius: 10.r, - customWidget: bannerPath.isNotEmpty && isbannerAdded - ? Stack(children: [ - Image.file( - bannerPath[0]!, - fit: BoxFit.cover, - width: double.infinity, - ), - Positioned( - right: 5, - bottom: 5, - child: GestureDetector( - onTap: () { - bannerPath.clear(); - isbannerAdded = false; - setState(() {}); - }, - child: Container( - width: 27, - height: 27, - decoration: ShapeDecoration( - color: Color(0xFF7E7E7E), - shape: RoundedRectangleBorder( - borderRadius: - BorderRadius.circular(5)), - ), - child: Icon( - Icons.delete_outline_outlined, - color: Colors.white, - ))), - ), - ]) - : Padding( - padding: EdgeInsets.symmetric(vertical: 16.h), - child: Column( - children: [ - Image.asset( - "assets/images/png/bi_download.png", - height: 36.h, - width: 36.w, - ), - sizedBoxHeight(10.h), - text14w400white('Upload banner image'), - sizedBoxHeight(8.h), - text8w400_8A8A8A( - "Allowed file extensions: jpg, png, gif Max file size: 10 MB"), - ], - ), - ), - ), - ), - ), - sizedBoxHeight(25.h), - - text16w400_FCFCFC("Community name*"), - sizedBoxHeight(15.h), - CustomTextFormField( - validator: (val) { - if (val == null || val.isEmpty) { - return 'Enter Community name'; - } - return null; - }, - ), - sizedBoxHeight(25.h), - text16w400_FCFCFC("Type of community*"), - sizedBoxHeight(15.h), - CustomDropDownRadio( - header: "", - title: "", - listData: ['Public', 'Private', 'Secret'], - onItemSelected: (p0) {}, - leadingImage: SizedBox()), - // CommonDropdownradioBtn( - // hint: '', - // items: ['Public', 'Private', 'Secret'], - // showOtherOption: false), - sizedBoxHeight(25.h), - text16w400_FCFCFC("Location*"), - sizedBoxHeight(15.h), - CustomDropDownRadio( - header: "", - title: "", - listData: ['Public', 'Private', 'Secret'], - onItemSelected: (p0) {}, - leadingImage: SizedBox()), - - sizedBoxHeight(25.h), - text16w400_FCFCFC("Primary activity*"), - - sizedBoxHeight(20.h), - CustomDropDownRadio( - header: "", - title: "", - listData: [ - 'Sports', - 'Hobby', - ], - showOtherOption: true, - onItemSelected: (p0) {}, - leadingImage: SizedBox()), - - sizedBoxHeight(25.h), - sizedBoxHeight(25.h), - CommonBtn( - text: "Create community", - onTap: () { - Get.toNamed(RouteName.addgroup); - }, - ), - sizedBoxHeight(25.h), - sizedBoxHeight(150.h), - ]), - )) - ])); - } -} diff --git a/lib/Feed Module/sidemenu/Community/MyCommunity/View/CommunityDetails.dart b/lib/Feed Module/sidemenu/Community/MyCommunity/View/CommunityDetails.dart deleted file mode 100644 index ceadd24..0000000 --- a/lib/Feed Module/sidemenu/Community/MyCommunity/View/CommunityDetails.dart +++ /dev/null @@ -1,767 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_reaction_button/flutter_reaction_button.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; -import 'package:regroup/Common/CommonGlassmorphism.dart'; -import 'package:regroup/Common/CommonTabBar.dart'; -import 'package:regroup/Common/CommonWidget.dart'; -import 'package:regroup/Utils/Common/CommonAppbar.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; -import 'package:regroup/Utils/Common/sized_box.dart'; -import 'package:regroup/Utils/texts.dart'; -import 'package:regroup/resources/routes/route_name.dart'; - -class CommunityDetails extends StatefulWidget { - const CommunityDetails({super.key}); - - @override - State createState() => _CommunityDetailsState(); -} - -class _CommunityDetailsState extends State { - @override - Widget build(BuildContext context) { - return Scaffold( - // key: _scaffoldKey1, - backgroundColor: Color(0xFF222935), - extendBody: true, - resizeToAvoidBottomInset: false, - appBar: CommonAppbar( - titleTxt: "", - customActionWidget: PopupMenuButton( - surfaceTintColor: Color(0xFF222935), - constraints: BoxConstraints.tightFor(width: 180.w), - offset: Offset(0, 40), - color: Color(0xFF222935), - tooltip: "", - itemBuilder: (BuildContext context) => [ - PopupMenuItem( - onTap: () {}, - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 8.w), - child: Row( - children: [ - text14w400white("Invite"), - Spacer(), - Image.asset( - "assets/images/png/uiw_user-add.png", - height: 15.h, - width: 15.w, - ) - ], - ), - ), - ), - PopupMenuDivider(), - PopupMenuItem( - onTap: () {}, - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 8.w), - child: Row( - children: [ - text14w400white("Share"), - Spacer(), - Image.asset( - "assets/images/png/share.png", - height: 20.h, - width: 20.w, - ) - ], - ), - ), - ), - PopupMenuDivider(), - PopupMenuItem( - onTap: () {}, - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 8.w), - child: Row( - children: [ - text14w400white("Search"), - Spacer(), - Image.asset( - "assets/images/png/Frame 58575.png", - height: 18.h, - width: 18.w, - ) - ], - ), - ), - ), - PopupMenuDivider(), - PopupMenuItem( - onTap: () {}, - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 8.w), - child: Row( - children: [ - text14w400white("Mute notification"), - Spacer(), - Image.asset( - "assets/images/png/Black1233.png", - height: 16.h, - width: 16.w, - ) - ], - ), - ), - ), - PopupMenuDivider(), - PopupMenuItem( - onTap: () {}, - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 8.w), - child: Row( - children: [ - text14w400white("Pin"), - Spacer(), - Image.asset( - "assets/images/png/f7_pin-fill (2).png", - height: 25.h, - width: 25.w, - ) - ], - ), - ), - ), - PopupMenuDivider(), - PopupMenuItem( - onTap: () { - Get.toNamed(RouteName.communitysetting); - }, - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 8.w), - child: Row( - children: [ - text14w400white("Edit community"), - Spacer(), - Image.asset( - "assets/images/png/setting2.png", - height: 18.h, - width: 18.w, - ) - ], - ), - ), - ), - ], - child: Image.asset( - 'assets/images/png/Group 1000004071.png', - height: 20.h, - width: 20.w, - )), - ), - body: Stack(children: [ - Container( - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage("assets/images/png/Ellipse 1496.png"), - fit: BoxFit.fill)), - ), - Positioned.fill( - child: SingleChildScrollView( - child: Column(children: [ - Stack(clipBehavior: Clip.none, children: [ - GestureDetector( - onTap: () { - Get.toNamed(RouteName.communityInfo); - }, - child: SizedBox( - height: 130.h, - width: double.infinity, - child: Image.asset( - "assets/images/png/img1.png", - fit: BoxFit.cover, - ), - ), - ), - Positioned( - bottom: -35.h, - left: 20.w, - child: Container( - width: 85.r, - height: 85.r, - decoration: BoxDecoration( - shape: BoxShape.circle, - border: Border.all( - color: Color.fromRGBO(255, 255, 255, 0.5), - width: 1, - ), - boxShadow: [ - BoxShadow( - color: Color.fromRGBO(0, 0, 0, 0.25), - blurRadius: 12, - offset: Offset(0, 6), - ), - ], - ), - child: CircleAvatar( - radius: 42.5.r, - foregroundImage: AssetImage("assets/images/png/img2.png"), - ), - )) - ]), - sizedBoxHeight(40.h), - Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), - child: Column( - children: [ - Row( - children: [ - text20w700_FCFCFC("Active alliance network"), - Spacer(), - commonGlassContainer( - width: 35.w, - height: 35.h, - borderradius: 100, - opacity1: 0.24, - opacity2: 0.24, - customWidget: Center( - child: Image.asset( - "assets/images/png/img12.png", - height: 18.w, - width: 18.w, - )), - border: 0.5), - sizedBoxWidth(8.w), - text16w400_FCFCFCblur("Public"), - ], - ), - sizedBoxHeight(20.h), - commonGlassContainer( - width: double.infinity, - height: 51.h, - borderradius: 10.r, - customWidget: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Row( - children: [ - sizedBoxWidth(16.w), - stackContainers( - number: "+2", - containerImages: [ - "assets/images/png/cimg3.png", - "assets/images/png/cimg2.png", - "assets/images/png/cimg3.png", - "assets/images/png/cimg2.png", - ], - ), - sizedBoxWidth(90.w), - text16w400_white('7 members'), - Spacer(), - Icon( - Icons.arrow_forward, - size: 20.sp, - color: Colors.white, - ), - sizedBoxWidth(16.w), - ], - ), - ], - ), - border: 1.w), - sizedBoxHeight(20.h), - GestureDetector( - onTap: () { - Get.toNamed(RouteName.addgroup); - }, - child: commonGlassContainer( - width: double.infinity, - height: 51.h, - borderradius: 10.r, - customWidget: Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Row(children: [ - Image.asset( - "assets/images/png/Black.png", - height: 23.h, - width: 31.w, - ), - sizedBoxWidth(15.w), - text16w400white('10 groups'), - Spacer(), - Icon( - Icons.arrow_forward, - size: 20.sp, - color: Colors.white, - ), - ]), - ], - ), - ), - border: 1), - ), - sizedBoxHeight(20.h), - GestureDetector( - onTap: () { - Get.toNamed(RouteName.announcement); - }, - child: commonGlassContainer( - width: double.infinity, - height: 51.h, - borderradius: 10.r, - customWidget: Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Row(children: [ - Image.asset( - "assets/images/png/marketing 1 (traced).png", - height: 23.h, - width: 31.w, - ), - sizedBoxWidth(15.w), - text16w400white('Announcements'), - Spacer(), - Container( - height: 21.h, - width: 43.w, - decoration: BoxDecoration( - color: Color(0xFFD90B2E), - borderRadius: - BorderRadius.circular(30.r)), - child: Center(child: text12w400_FCFCFC("11")), - ) - ]), - ], - ), - ), - border: 1), - ), - sizedBoxHeight(35.h), - Container( - height: 40.h, - width: 200.w, - decoration: BoxDecoration( - color: Color(0xFFD90B2E), - borderRadius: BorderRadius.circular(30.r)), - child: - Center(child: text14w400white("Leave the community")), - ), - sizedBoxHeight(50.h), - ], - ), - ), - DefaultTabController( - length: 2, - // initialIndex: selectedIndex.value, - child: Column( - children: [ - CommonTabBar(tabs: const [ - Tab( - text: 'Posts', - ), - Tab( - text: 'Events', - ), - ]), - SizedBox( - height: 600.h, - child: TabBarView( - children: [ - poststab(), - eventstab(), - ], - ), - ), - ], - ), - ), - ]))) - ])); - } - - Widget poststab() { - return Column( - children: [ - sizedBoxHeight(20.h), - normalcardtile( - profileImg: 'assets/images/png/Ellipse 43.png', - title: 'Edward Hackket', - mainImg: 'assets/images/png/Rectangle 24.png', - containerTitle: [ - 'Cycle', - 'Marathon', - 'Events', - 'Marathon', - 'Events' - ]), - ], - ); - } - - Widget eventstab() { - return Column( - children: [], - ); - } - - Widget normalcardtile({ - required String profileImg, - required String title, - required String mainImg, - required List containerTitle, - }) { - var mainImage = 'assets/images/png/uiw_like-o.png'.obs; - void updateImage(String reaction) { - if (reaction == 'like') { - mainImage.value = 'assets/images/png/f7_hand-thumbsup.png'; - } else if (reaction == 'heart') { - mainImage.value = 'assets/images/png/heart 2.png'; - } else if (reaction == 'party') { - mainImage.value = 'assets/images/png/party-popper 2.png'; - } - } - - return Column( - children: [ - sizedBoxHeight(25.h), - Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - CircleAvatar( - foregroundImage: AssetImage(profileImg), - radius: 25.r, - ), - sizedBoxWidth(12.w), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - text16w400_FCFCFC(title), - sizedBoxHeight(5.h), - Row( - children: [ - Image.asset( - 'assets/images/png/community 1 (traced).png', - height: 14.w, - width: 14.w, - ), - sizedBoxWidth(7.w), - text12w400_FCFCFC('Active alliance network'), - sizedBoxWidth(7.w), - Icon( - Icons.circle, - color: Color(0xFFFCFCFC), - size: 4.sp, - ), - sizedBoxWidth(6.w), - text12w400_FCFCFC('1 Hour ago'), - ], - ) - ], - ), - Spacer(), - PopupMenuButton( - surfaceTintColor: Color(0xFF222935), - constraints: BoxConstraints.tightFor(width: 176.w), - offset: Offset(0, 50), - color: Color(0xFF222935), - tooltip: "", - itemBuilder: (BuildContext context) => [ - PopupMenuItem( - onTap: () {}, - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 12.w), - child: Row( - children: [ - Text( - 'Report Post', - style: TextStyle( - fontSize: 16.sp, - color: Colors.white, - fontWeight: FontWeight.w800, - fontFamily: "Nunito Sans", - ), - ), - Spacer(), - Image.asset( - "assets/images/png/Vector (5).png", - height: 15.h, - width: 15.w, - ) - ], - ), - ), - ), - PopupMenuDivider(), - PopupMenuItem( - onTap: () {}, - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 12.w), - child: Row( - children: [ - Text( - 'Share post', - style: TextStyle( - fontSize: 16.sp, - color: Colors.white, - fontWeight: FontWeight.w800, - fontFamily: "Nunito Sans", - ), - ), - Spacer(), - Image.asset( - "assets/images/png/share.png", - height: 20.h, - width: 20.w, - ) - ], - ), - ), - ), - PopupMenuDivider(), - PopupMenuItem( - onTap: () {}, - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 12.w), - child: Row( - children: [ - Text( - 'Pin', - style: TextStyle( - fontSize: 16.sp, - color: Colors.white, - fontWeight: FontWeight.w800, - fontFamily: "Nunito Sans", - ), - ), - Spacer(), - Image.asset( - "assets/images/png/f7_pin-fill (2).png", - height: 25.h, - width: 25.w, - ) - ], - ), - ), - ), - ], - child: Image.asset( - 'assets/images/png/Group 1000004071.png', - width: 16.w, - height: 18.h, - ), - ), - sizedBoxWidth(5.w) - ], - ), - ), - sizedBoxHeight(20.h), - GestureDetector( - onTap: () { - Get.toNamed(RouteName.postdetailsScreen); - }, - child: Container( - height: 163.h, - width: double.infinity, - child: Image.asset( - mainImg, - fit: BoxFit.cover, - ), - )), - sizedBoxHeight(20.h), - Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), - child: Column(children: [ - SizedBox( - height: 30.h, - child: ListView.builder( - scrollDirection: Axis.horizontal, - shrinkWrap: true, - itemCount: containerTitle.length, - itemBuilder: (context, index) { - return Padding( - padding: EdgeInsets.only(right: 12.w), - child: GestureDetector( - onTap: () { - Get.toNamed(RouteName.cyclescreen); - }, - child: containertile(text: containerTitle[index])), - ); - }, - ), - ), - sizedBoxHeight(20.h), - text16w400_FCFCFC( - "Lorem Ipsum has been the industry's standard dummy text ever since the 1500s . . ."), - Row(children: [ - stackReaction(number: '20', containerImages: [ - 'assets/images/png/f7_hand-thumbsup.png', - 'assets/images/png/heart 2.png', - 'assets/images/png/party-popper 2.png' - ]), - Spacer(), - commonGlassContainer( - border: 0.43, - width: 30.w, - height: 30.h, - opacity1: 0.05, - opacity2: 0.06, - borderradius: 100, - customWidget: Center( - child: Image.asset( - 'assets/images/png/Frame 1000004088.png', - height: 13.h, - width: 13.w, - ), - ), - ), - sizedBoxWidth(12.w), - text14w400_FCFCFC('20'), - sizedBoxWidth(20.w), - commonGlassContainer( - border: 0.43, - width: 30.w, - height: 30.h, - borderradius: 100, - opacity1: 0.05, - opacity2: 0.06, - customWidget: Center( - child: Image.asset( - 'assets/images/png/Vector (1).png', - height: 12.h, - width: 12.w, - ), - ), - ), - sizedBoxWidth(12.w), - text14w400_FCFCFC('10'), - ]), - sizedBoxHeight(30.h), - Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Obx(() { - return ReactionButton( - onReactionChanged: (reaction) { - updateImage(reaction?.value ?? 'like'); - debugPrint('Selected value: ${reaction?.value}'); - }, - reactions: ?>[ - Reaction( - value: 'like', - previewIcon: _buildReactionsPreviewIcon( - 'assets/images/png/f7_hand-thumbsup.png'), - icon: _buildReactionsIcon( - 'assets/images/png/f7_hand-thumbsup.png'), - ), - Reaction( - value: 'heart', - previewIcon: _buildReactionsPreviewIcon( - 'assets/images/png/heart 2.png'), - icon: _buildReactionsIcon( - 'assets/images/png/heart 2.png'), - ), - Reaction( - value: 'party', - previewIcon: _buildReactionsPreviewIcon( - 'assets/images/png/party-popper 2.png'), - icon: _buildReactionsIcon( - 'assets/images/png/party-popper 2.png'), - ), - ], - selectedReaction: Reaction( - value: 'like', - icon: _buildReactionsIcon( - 'assets/images/png/f7_hand-thumbsup.png'), - ), - boxColor: Colors.white, - boxElevation: 9, - boxRadius: 30, - itemsSpacing: 8, - itemScale: 0.4, - itemSize: Size(45, 45), - boxPadding: EdgeInsets.all(8), - boxAnimationDuration: Duration(milliseconds: 200), - itemAnimationDuration: Duration(milliseconds: 500), - hoverDuration: Duration(milliseconds: 700), - // toggle: false, - - child: _buildReactionsIcon(mainImage.value), - ); - }) - ], - ), - GestureDetector( - onTap: () { - Get.toNamed(RouteName.postdetailsScreen); - }, - child: Column( - children: [ - Image.asset( - 'assets/images/png/Frame 1000004088.png', - height: 19.h, - width: 19.w, - ), - sizedBoxHeight(8.h), - text11w400_FCFCFC('Comment') - ], - ), - ), - Column( - children: [ - Image.asset( - 'assets/images/png/Frame 1000004089.png', - height: 19.h, - width: 19.w, - ), - sizedBoxHeight(8.h), - text11w400_FCFCFC('Save') - ], - ) - ], - ) - ]), - ), - ], - ); - } - - Widget _buildReactionsPreviewIcon(String assetPath) { - return Padding( - padding: const EdgeInsets.all(8.0), - child: Image.asset( - assetPath, - height: 40.h, - width: 40.w, - ), - ); - } - - Widget _buildReactionsIcon(String assetPath) { - return Column( - children: [ - Image.asset( - assetPath, - height: 19.h, - width: 19.w, - ), - sizedBoxHeight(8.h), - text11w400_FCFCFC('Like') - ], - ); - } - - Widget containertile({required String text}) { - return commonGlassContainer( - border: 1, - width: 100.w, - height: 30.h, - borderradius: 30.r, - borderColor: Color(0xFFD90B2E), - customWidget: Padding( - padding: EdgeInsets.symmetric(horizontal: 10.w), - child: Center(child: text14w400_FCFCFC(text)), - )); - } -} diff --git a/lib/Feed Module/sidemenu/Community/MyCommunity/View/MyCommunity.dart b/lib/Feed Module/sidemenu/Community/MyCommunity/View/MyCommunity.dart deleted file mode 100644 index 41c9543..0000000 --- a/lib/Feed Module/sidemenu/Community/MyCommunity/View/MyCommunity.dart +++ /dev/null @@ -1,381 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; -import 'package:regroup/Common/CommonGlassmorphism.dart'; -import 'package:regroup/Common/CommonWidget.dart'; -import 'package:regroup/Utils/Common/CommonAppbar.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; -import 'package:regroup/Utils/Common/sized_box.dart'; -import 'package:regroup/Utils/texts.dart'; -import 'package:regroup/resources/routes/route_name.dart'; - -class MyCommunity extends StatefulWidget { - const MyCommunity({super.key}); - - @override - State createState() => _MyCommunityState(); -} - -class _MyCommunityState extends State { - List JoinedcommunityData = [ - { - "imagePath": "assets/images/png/img2.png", - "text": "Active alliance network", - "members": "7 members", - "index": 1, - }, - { - "imagePath": "assets/images/png/img34.png", - "text": "FitFam federation", - "members": "7 members", - "index": 2, - }, - ]; - - List RequestcommunityData = [ - { - "imagePath": "assets/images/png/img45.png", - "text": "The athletic town", - "members": "7 members", - "index": 3, - }, - { - "imagePath": "assets/images/png/img2.png", - "text": "Football fever", - "members": "7 members", - "index": 4, - }, - ]; - - var selectedContainerIndices = {}.obs; - - void toggleSelectedIndex(int index) { - if (selectedContainerIndices.contains(index)) { - selectedContainerIndices.remove(index); - } else { - selectedContainerIndices.add(index); - } - } - - @override - Widget build(BuildContext context) { - return Scaffold( - // key: _scaffoldKey1, - backgroundColor: Color(0xFF222935), - extendBody: true, - resizeToAvoidBottomInset: false, - appBar: CommonAppbar( - titleTxt: "My Communities", - customActionWidget: Row( - children: [ - GestureDetector( - onTap: () { - Get.toNamed(RouteName.newcommunity); - }, - child: Container( - height: 30.h, - width: 30.w, - decoration: BoxDecoration( - color: Color(0xFFD90B2E), - boxShadow: [ - BoxShadow( - color: Color(0x40000000), - offset: Offset(0, 6), - blurRadius: 8, - spreadRadius: 0, - ), - ], - shape: BoxShape.circle), - child: Icon( - Icons.add, - color: Colors.white, - ), - ), - ), - sizedBoxWidth(12.w), - Image.asset( - "assets/images/png/Frame 9.png", - height: 22.h, - width: 22.w, - ) - ], - ), - ), - body: Stack(children: [ - Container( - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage("assets/images/png/Ellipse 1496.png"), - fit: BoxFit.fill)), - ), - Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), - child: SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - text18w700_FCFCFC("Joined communities"), - sizedBoxHeight(15.h), - Column( - children: - List.generate(JoinedcommunityData.length, (index) { - return communityCard( - ontap: () { - Get.toNamed(RouteName.communityDetails); - }, - imagepath: JoinedcommunityData[index] - ['imagePath'], - title: JoinedcommunityData[index]['text'], - members: JoinedcommunityData[index]['members'], - index: JoinedcommunityData[index]['index']); - }), - ), - text18w700_FCFCFC("Requested communities"), - sizedBoxHeight(20.h), - Column( - children: - List.generate(RequestcommunityData.length, (index) { - return communityCard( - ontap: () {}, - imagepath: RequestcommunityData[index] - ['imagePath'], - title: RequestcommunityData[index]['text'], - members: RequestcommunityData[index]['members'], - index: RequestcommunityData[index]['index']); - }), - ) - ]), - )) - ])); - } - - Widget communityCard({ - required String imagepath, - required String title, - required void Function()? ontap, - required String members, - required int index, - }) { - return Padding( - padding: EdgeInsets.only(bottom: 25.h), - child: GestureDetector( - onTap: ontap, - child: commonGlassUI( - width: double.infinity, - height: 162.h, - borderwidth: 0.9, - borderRadius: BorderRadius.circular(10.r), - customWidget: Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 16.h), - child: Column( - children: [ - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - height: 65.h, - width: 65.h, - decoration: BoxDecoration( - shape: BoxShape.circle, - // color: Colors.amber, - ), - child: - // Center( - // child: Image.asset(imagepath, fit: BoxFit.cover)), - - CircleAvatar( - backgroundImage: AssetImage( - imagepath, - ), - ), - ), - sizedBoxWidth(13.w), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - text18w700_FCFCFC(title), - sizedBoxHeight(10.h), - Row( - children: [ - Stack(clipBehavior: Clip.none, children: [ - commonGlassContainer( - border: 0.9, - width: 30.w, - height: 30.h, - borderradius: 100.r, - opacity1: 0.24, - opacity2: 0.24, - customWidget: Center( - child: Image.asset( - "assets/images/png/Black.png", - height: 12.h, - width: 16.w, - ), - )), - Positioned( - top: 0, - right: -4, - child: Container( - height: 12.h, - width: 12.w, - decoration: BoxDecoration( - shape: BoxShape.circle, - color: Color(0xFFD90B2E), - ), - child: Center(child: text6400white("2")), - )) - ]), - sizedBoxWidth(15.w), - text14w400_FCFCFCblur("10 groups") - ], - ), - ], - ), - Spacer(), - PopupMenuButton( - surfaceTintColor: Color(0xFF222935), - constraints: BoxConstraints.tightFor(width: 200.w), - offset: Offset(0, 30), - color: Color(0xFF222935), - tooltip: "", - itemBuilder: (BuildContext context) => - [ - PopupMenuItem( - onTap: () {}, - child: Padding( - padding: - EdgeInsets.symmetric(horizontal: 8.w), - child: Row( - children: [ - text14w400_FCFCFC("Mute community"), - Spacer(), - Image.asset( - "assets/images/png/Black (1).png", - height: 18.h, - width: 18.w, - ) - ], - ), - ), - ), - PopupMenuDivider(), - PopupMenuItem( - onTap: () {}, - child: Padding( - padding: - EdgeInsets.symmetric(horizontal: 8.w), - child: Row( - children: [ - text14w400_FCFCFC("Hide post"), - Spacer(), - Image.asset( - "assets/images/png/mingcute_eye-close-line.png", - height: 20.h, - width: 20.w, - ) - ], - ), - ), - ), - PopupMenuDivider(), - PopupMenuItem( - onTap: () {}, - child: Padding( - padding: - EdgeInsets.symmetric(horizontal: 8.w), - child: Row( - children: [ - text14w400_FCFCFC("Pin"), - Spacer(), - Image.asset( - "assets/images/png/f7_pin-fill (2).png", - height: 25.h, - width: 25.w, - ) - ], - ), - ), - ), - PopupMenuDivider(), - PopupMenuItem( - onTap: () {}, - child: Padding( - padding: - EdgeInsets.symmetric(horizontal: 8.w), - child: Row( - children: [ - text14w400_FCFCFC("Leave community"), - Spacer(), - Image.asset( - "assets/images/png/logout 1 (traced).png", - height: 18.h, - width: 18.w, - ) - ], - ), - ), - ), - ], - child: Image.asset( - "assets/images/png/Group 1000004071.png", - height: 18.h, - width: 20.w, - )), - ], - ), - sizedBoxHeight(16.h), - commonDivider(), - sizedBoxHeight(10.h), - Expanded( - child: Row( - children: [ - stackContainers( - number: "+2", - containerImages: [ - "assets/images/png/cimg3.png", - "assets/images/png/cimg2.png", - "assets/images/png/cimg3.png", - "assets/images/png/cimg2.png", - ], - ), - sizedBoxWidth(95.w), - text12w400_FCFCFC_blur(members), - Spacer(), - Obx(() { - return GestureDetector( - onTap: () { - toggleSelectedIndex(index); - }, - child: Container( - width: selectedContainerIndices.contains(index) - ? 118.w - : 100.w, - height: 30.h, - decoration: BoxDecoration( - color: - selectedContainerIndices.contains(index) - ? null - : Color(0xFFD90B2E), - borderRadius: BorderRadius.all( - Radius.circular(30.r), - ), - border: Border.all( - color: Color(0xFFD90B2E), width: 1.w)), - child: Center( - child: - selectedContainerIndices.contains(index) - ? text14400white("Requested") - : text14400white("Joined")), - ), - ); - }) - ], - ), - ) - ], - ), - )), - ), - ); - } -} diff --git a/lib/Feed Module/sidemenu/sidemenu.dart b/lib/Feed Module/sidemenu/sidemenu.dart deleted file mode 100644 index 46b1503..0000000 --- a/lib/Feed Module/sidemenu/sidemenu.dart +++ /dev/null @@ -1,488 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; - -import 'package:get/get.dart'; -import 'package:regroup/Common/CommonGlassmorphism.dart'; -import 'package:regroup/Common/CommonWidget.dart'; -import 'package:regroup/Utils/Common/sized_box.dart'; -import 'package:regroup/Utils/texts.dart'; -import 'package:regroup/resources/routes/route_name.dart'; - -class SideMenu extends StatefulWidget { - const SideMenu({super.key}); - - @override - State createState() => _SideMenuState(); -} - -class _SideMenuState extends State { - @override - void initState() { - // TODO: implement initState - super.initState(); - } - - final RxBool isPinned = false.obs; - - List sideBarData = [ - { - "imagePath": "assets/images/svg/sidemenu/Faq.svg", - "text": "FAQ’s", - }, - { - "imagePath": "assets/images/svg/sidemenu/contact.svg", - "text": "Contact Us" - }, - { - "imagePath": "assets/images/svg/sidemenu/rate.svg", - "text": "Rate this app" - }, - { - "imagePath": "assets/images/svg/sidemenu/terms.svg", - "text": "Terms & Conditions" - }, - { - "imagePath": "assets/images/svg/sidemenu/privacy.svg", - "text": "Privacy Policy" - }, - {"imagePath": "assets/images/svg/sidemenu/about.svg", "text": "About Us"}, - { - "imagePath": "assets/images/svg/sidemenu/settingmenu.svg", - "text": "Settings" - }, - {"imagePath": "assets/images/svg/sidemenu/logout.svg", "text": "Logout"}, - ]; - - Color sideBarBackgroundColor = const Color(0xFF222935); - Color whitecolor = Colors.white; - - var selectedIndices = {}.obs; - - void toggleSelectedIndex(int index) { - if (selectedIndices.contains(index)) { - selectedIndices.remove(index); - } else { - selectedIndices.add(index); - } - } - - @override - Widget build(BuildContext context) { - return Scaffold( - backgroundColor: Color(0xFF222935), - body: Column( - children: [ - sizedBoxHeight(50.h), - Expanded( - child: ListView(children: [ - Padding( - padding: EdgeInsets.symmetric(horizontal: 10.w), - child: commonGlassUI( - width: double.infinity, - height: 330.h, - borderRadius: BorderRadius.circular(10.r), - customWidget: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.symmetric( - horizontal: 16.w, vertical: 12.h), - child: Row( - children: [ - text16w400_FCFCFC("Pinned"), - Spacer(), - Icon( - Icons.arrow_drop_up, - color: Colors.white, - size: 25, - ) - ], - ), - ), - commonDivider(), - sizedBoxHeight(10.h), - firstRowTile( - text: "Row bridge", - leadingimage: - "assets/images/png/sidemenu/rowing 1 (traced).png", - index: 1), - firstRowTile( - text: "Advice", - leadingimage: - "assets/images/png/sidemenu/solar_cloud-outline.png", - index: 2), - firstRowTile( - text: "Crush", - leadingimage: - "assets/images/png/sidemenu/Vector (4).png", - index: 3), - ListTile( - leading: CircleAvatar( - radius: 15.r, - foregroundImage: AssetImage( - "assets/images/png/sidemenu/Ellipse 52.png"), - ), - title: text14w400_FCFCFC("Ryan Dorwart"), - trailing: Image.asset( - "assets/images/png/sidemenu/f7_pin-fill (1).png", - width: 19.w, - height: 19.h, - ), - onTap: () {}, - ), - ListTile( - leading: CircleAvatar( - radius: 15.r, - foregroundImage: AssetImage( - "assets/images/png/sidemenu/Ellipse 53.png"), - ), - title: text14w400_FCFCFC("Ahmad Rhiel Madsen"), - trailing: Image.asset( - "assets/images/png/sidemenu/f7_pin-fill (1).png", - width: 19.w, - height: 19.h, - ), - onTap: () {}, - ), - ]), - ), - ), - sizedBoxHeight(18.h), - Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), - child: Container( - height: 1, - margin: EdgeInsets.symmetric(vertical: 10.h), - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Color.fromRGBO(255, 255, 255, 0.3), - width: 1.w, - ), - ), - ), - ), - ), - sizedBoxHeight(18.h), - Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), - child: Row( - children: [ - text16w400_FCFCFC("Communities"), - Spacer(), - GestureDetector( - onTap: () { - Get.toNamed(RouteName.mycommunity); - }, - child: text14w400_FCFCFC("View all")), - ], - ), - ), - sizedBoxHeight(20.h), - firstRowTile( - text: "Row bridge", - leadingimage: - "assets/images/png/sidemenu/rowing 1 (traced).png", - index: 4), - firstRowTile( - text: "Advice", - leadingimage: - "assets/images/png/sidemenu/solar_cloud-outline.png", - index: 5), - firstRowTile( - text: "Crush", - leadingimage: "assets/images/png/sidemenu/Vector (4).png", - index: 6), - firstRowTile( - text: "Row bridge", - leadingimage: - "assets/images/png/sidemenu/rowing 1 (traced).png", - index: 7), - sizedBoxHeight(18.h), - Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), - child: Container( - height: 1, - margin: EdgeInsets.symmetric(vertical: 10.h), - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Color.fromRGBO(255, 255, 255, 0.3), - width: 1.w, - ), - ), - ), - ), - ), - sizedBoxHeight(18.h), - Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), - child: Row( - children: [ - text16w400_FCFCFC("Watchlist"), - Spacer(), - GestureDetector( - onTap: () { - Get.toNamed(RouteName.watchlist); - }, - child: text14w400_FCFCFC("View all")), - ], - ), - ), - sizedBoxHeight(20.h), - firstRowTile( - text: "Row bridge", - leadingimage: - "assets/images/png/sidemenu/rowing 1 (traced).png", - index: 8), - firstRowTile( - text: "Advice", - leadingimage: - "assets/images/png/sidemenu/solar_cloud-outline.png", - index: 9), - firstRowTile( - text: "Crush", - leadingimage: "assets/images/png/sidemenu/Vector (4).png", - index: 10), - firstRowTile( - text: "Row bridge", - leadingimage: - "assets/images/png/sidemenu/rowing 1 (traced).png", - index: 11), - sizedBoxHeight(18.h), - Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), - child: Container( - height: 1, - margin: EdgeInsets.symmetric(vertical: 10.h), - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Color.fromRGBO(255, 255, 255, 0.3), - width: 1.w, - ), - ), - ), - ), - ), - sizedBoxHeight(18.h), - Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), - child: Row( - children: [ - text16w400_FCFCFC("Recent"), - Spacer(), - GestureDetector( - onTap: () { - Get.toNamed(RouteName.mycommunity); - }, - child: text14w400_FCFCFC("View all")), - ], - ), - ), - sizedBoxHeight(20.h), - firstRowTile( - text: "Row bridge", - leadingimage: - "assets/images/png/sidemenu/rowing 1 (traced).png", - index: 8), - firstRowTile( - text: "Advice", - leadingimage: - "assets/images/png/sidemenu/solar_cloud-outline.png", - index: 9), - firstRowTile( - text: "Crush", - leadingimage: "assets/images/png/sidemenu/Vector (4).png", - index: 10), - firstRowTile( - text: "Row bridge", - leadingimage: - "assets/images/png/sidemenu/rowing 1 (traced).png", - index: 11), - sizedBoxHeight(18.h), - Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), - child: Container( - height: 1, - margin: EdgeInsets.symmetric(vertical: 10.h), - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Color.fromRGBO(255, 255, 255, 0.3), - width: 1.w, - ), - ), - ), - ), - ), - sizedBoxHeight(18.h), - Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), - child: Row( - children: [ - text16w400_FCFCFC("Users"), - Spacer(), - GestureDetector( - onTap: () { - Get.toNamed(RouteName.mycommunity); - }, - child: text14w400_FCFCFC("View all")), - ], - ), - ), - sizedBoxHeight(20.h), - firstRowTile( - text: "Row bridge", - leadingimage: - "assets/images/png/sidemenu/rowing 1 (traced).png", - index: 8), - firstRowTile( - text: "Advice", - leadingimage: - "assets/images/png/sidemenu/solar_cloud-outline.png", - index: 9), - firstRowTile( - text: "Crush", - leadingimage: "assets/images/png/sidemenu/Vector (4).png", - index: 10), - firstRowTile( - text: "Row bridge", - leadingimage: - "assets/images/png/sidemenu/rowing 1 (traced).png", - index: 11), - sizedBoxHeight(18.h), - sizedBoxHeight(80.h), - ]), - ), - ], - )); - } - - Widget firstRowTile({ - required String text, - required String leadingimage, - required int index, - }) { - return ListTile( - leading: commonContainer( - width: 29.w, - height: 29.h, - borderwidth: 0.9, - boxShape: BoxShape.circle, - customWidget: Center( - child: Image.asset( - leadingimage, - width: 13.w, - height: 13.h, - ), - )), - title: text14w400_FCFCFC(text), - trailing: InkWell( - onTap: () { - toggleSelectedIndex(index); - }, - child: Obx( - () { - return selectedIndices.contains(index) - ? Image.asset( - "assets/images/png/sidemenu/f7_pin-fill.png", - width: 19, - height: 19, - ) - : Image.asset( - "assets/images/png/sidemenu/f7_pin-fill (1).png", - width: 19, - height: 19, - ); - }, - ), - ), - onTap: () {}, - ); - } - -// LogOutdialog(context) { -// return showDialog( -// // barrierDismissible: false, -// context: context, -// builder: (context) => Column( -// mainAxisAlignment: MainAxisAlignment.center, -// children: [ -// AlertDialog( -// insetPadding: EdgeInsets.symmetric(horizontal: 16.w), -// backgroundColor: -// Get.isDarkMode ? Colors.black : const Color(0XFF1B243D), -// contentPadding: EdgeInsets.fromLTRB(29.w, 44.h, 29.w, 35.h), -// shape: RoundedRectangleBorder( -// borderRadius: BorderRadius.all(Radius.circular(5.r)), -// ), -// content: Column( -// mainAxisAlignment: MainAxisAlignment.center, -// crossAxisAlignment: CrossAxisAlignment.center, -// children: [ -// Container( -// height: 87.h, -// width: 80.w, -// decoration: const BoxDecoration( -// shape: BoxShape.circle, color: Color(0xFFC18948)), -// child: Align( -// alignment: Alignment.topLeft, -// child: Container( -// height: 79.h, -// width: 73.w, -// decoration: BoxDecoration( -// shape: BoxShape.circle, -// color: const Color(0xFFE8C69F).withOpacity(0.5), -// ), -// child: Center( -// child: SvgPicture.asset( -// 'assets/images/svg/apps 1.svg', -// // fit: BoxFit.fill, -// ), -// ), -// ), -// ), -// ), -// sizedBoxHeight(30.h), -// Text( -// "Are you sure you want to logout ?", -// textAlign: TextAlign.center, -// style: TextStyle( -// fontFamily: "hiragino", -// fontWeight: FontWeight.w400, -// fontSize: 20.sp, -// color: const Color(0xFFFFFFFF)), -// ), -// sizedBoxHeight(40.h), -// Row( -// mainAxisAlignment: MainAxisAlignment.spaceBetween, -// children: [ -// SizedBox( -// width: 140.w, -// child: CommonYesNoBtn( -// yesonTap: () async { -// SharedPreferences prefs = -// await SharedPreferences.getInstance(); -// await prefs.clear(); -// Get.offNamed(RouteName.loginscreen); -// }, -// )), -// SizedBox( -// width: 140.w, -// child: CommonYesNoBtn( -// noonTap: () { -// Get.back(); -// }, -// ), -// ), -// ], -// ) -// ], -// ), -// ), -// ], -// ), -// ); -// } -} diff --git a/lib/Feed Module/sidemenu/view_model/tagcommunityuser.dart b/lib/Feed Module/sidemenu/view_model/tagcommunityuser.dart new file mode 100644 index 0000000..6443a3b --- /dev/null +++ b/lib/Feed Module/sidemenu/view_model/tagcommunityuser.dart @@ -0,0 +1,22 @@ +import 'dart:developer'; + +import 'package:regroup/Common/api_urls.dart'; +import 'package:regroup/Common/base_manager.dart'; +import 'package:regroup/Common/controller/data/network/network_api.dart'; +import 'package:regroup/sidemenu/Model/TagCommunityUserModel.dart'; + +TagCommunityUserModel? tagcommunityuserobj; + +class Sidegetmethod { + Future> getJoinedusergroups(updata) async { + final response = await NetworkApiServices().getApi( + "${ApiUrls.tagcommunityuser}?=$updata", + // optionalpar: false + ); + if (response.status == ResponseStatus.SUCCESS) { + tagcommunityuserobj = TagCommunityUserModel.fromJson(response.data); + log(tagcommunityuserobj!.data.toString()); + } + return response; + } +} diff --git a/lib/Global.dart b/lib/Global.dart index ca8119d..dc71b9e 100644 --- a/lib/Global.dart +++ b/lib/Global.dart @@ -14,4 +14,8 @@ RxInt notification = 0.obs; late Timer timerhomeglobal; bool isTimerInitialize = false; String? globalAccountType; +String? mainWelcomeName; +String userIdGlobal = "0"; + + diff --git a/lib/Login/Model/LoginModel.dart b/lib/Login/Model/LoginModel.dart index 5a97c5d..ae13932 100644 --- a/lib/Login/Model/LoginModel.dart +++ b/lib/Login/Model/LoginModel.dart @@ -10,14 +10,14 @@ class LoginModel { status = json['status']; statusCode = json['status_code']; message = json['message']; - data = json['data'] != null ? new Data.fromJson(json['data']) : null; + data = json['data'] != null ? Data.fromJson(json['data']) : null; } Map toJson() { - final Map data = new Map(); - data['status'] = this.status; - data['status_code'] = this.statusCode; - data['message'] = this.message; + final Map data = {}; + data['status'] = status; + data['status_code'] = statusCode; + data['message'] = message; if (this.data != null) { data['data'] = this.data!.toJson(); } @@ -34,15 +34,15 @@ class Data { Data.fromJson(Map json) { accessToken = json['access-token']; userData = json['user_data'] != null - ? new UserData.fromJson(json['user_data']) + ? UserData.fromJson(json['user_data']) : null; } Map toJson() { - final Map data = new Map(); - data['access-token'] = this.accessToken; - if (this.userData != null) { - data['user_data'] = this.userData!.toJson(); + final Map data = {}; + data['access-token'] = accessToken; + if (userData != null) { + data['user_data'] = userData!.toJson(); } return data; } @@ -188,51 +188,51 @@ class UserData { } Map toJson() { - final Map data = new Map(); - data['id'] = this.id; - data['principal_type_xid'] = this.principalTypeXid; - data['principal_source_xid'] = this.principalSourceXid; - data['one_signal_player_id'] = this.oneSignalPlayerId; - data['google_id'] = this.googleId; - data['apple_id'] = this.appleId; - data['facebook_id'] = this.facebookId; - data['microsoft_id'] = this.microsoftId; - data['user_name'] = this.userName; - data['pin'] = this.pin; - data['full_name'] = this.fullName; - data['gender'] = this.gender; - data['date_of_birth'] = this.dateOfBirth; - data['phone_number'] = this.phoneNumber; - data['other_phone_number'] = this.otherPhoneNumber; - data['email_address'] = this.emailAddress; - data['address_line1'] = this.addressLine1; - data['address_line2'] = this.addressLine2; - data['city_xid'] = this.cityXid; - data['state_xid'] = this.stateXid; - data['country_xid'] = this.countryXid; - data['post_code'] = this.postCode; - data['last_login_datetime'] = this.lastLoginDatetime; - data['profile_photo'] = this.profilePhoto; - data['referral_code'] = this.referralCode; - data['description'] = this.description; - data['about'] = this.about; - data['position'] = this.position; - data['training_scores'] = this.trainingScores; - data['height'] = this.height; - data['weight'] = this.weight; - data['batting_average'] = this.battingAverage; - data['is_profile_updated'] = this.isProfileUpdated; - data['is_active'] = this.isActive; - data['group_notification'] = this.groupNotification; - data['community_notification'] = this.communityNotification; - data['follower_notification'] = this.followerNotification; - data['new_follower_notification'] = this.newFollowerNotification; - data['direct_message_notification'] = this.directMessageNotification; - data['created_by'] = this.createdBy; - data['modified_by'] = this.modifiedBy; - data['deleted_at'] = this.deletedAt; - data['created_at'] = this.createdAt; - data['updated_at'] = this.updatedAt; + final Map data = {}; + data['id'] = id; + data['principal_type_xid'] = principalTypeXid; + data['principal_source_xid'] = principalSourceXid; + data['one_signal_player_id'] = oneSignalPlayerId; + data['google_id'] = googleId; + data['apple_id'] = appleId; + data['facebook_id'] = facebookId; + data['microsoft_id'] = microsoftId; + data['user_name'] = userName; + data['pin'] = pin; + data['full_name'] = fullName; + data['gender'] = gender; + data['date_of_birth'] = dateOfBirth; + data['phone_number'] = phoneNumber; + data['other_phone_number'] = otherPhoneNumber; + data['email_address'] = emailAddress; + data['address_line1'] = addressLine1; + data['address_line2'] = addressLine2; + data['city_xid'] = cityXid; + data['state_xid'] = stateXid; + data['country_xid'] = countryXid; + data['post_code'] = postCode; + data['last_login_datetime'] = lastLoginDatetime; + data['profile_photo'] = profilePhoto; + data['referral_code'] = referralCode; + data['description'] = description; + data['about'] = about; + data['position'] = position; + data['training_scores'] = trainingScores; + data['height'] = height; + data['weight'] = weight; + data['batting_average'] = battingAverage; + data['is_profile_updated'] = isProfileUpdated; + data['is_active'] = isActive; + data['group_notification'] = groupNotification; + data['community_notification'] = communityNotification; + data['follower_notification'] = followerNotification; + data['new_follower_notification'] = newFollowerNotification; + data['direct_message_notification'] = directMessageNotification; + data['created_by'] = createdBy; + data['modified_by'] = modifiedBy; + data['deleted_at'] = deletedAt; + data['created_at'] = createdAt; + data['updated_at'] = updatedAt; return data; } } diff --git a/lib/Login/View/loginscreen.dart b/lib/Login/View/loginscreen.dart index 9ebeb6a..498895c 100644 --- a/lib/Login/View/loginscreen.dart +++ b/lib/Login/View/loginscreen.dart @@ -2,14 +2,14 @@ import 'dart:io'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; +import 'package:flutter_facebook_auth/flutter_facebook_auth.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:get/get.dart'; -import 'package:logger/web.dart'; import 'package:regroup/Common/base_manager.dart'; import 'package:regroup/Login/ViewModel/LoginApi.dart'; +import 'package:regroup/Main_Screens/Community/ViewModel/getmethod.dart'; import 'package:regroup/Utils/Common/AppleOAuthService.dart'; -import 'package:regroup/Utils/Common/CustomNextButton.dart'; import 'package:regroup/Utils/Common/CustomTextformfield.dart'; import 'package:regroup/Utils/Common/googleOAuthService.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; @@ -18,9 +18,6 @@ import 'package:regroup/Utils/texts.dart'; import 'package:regroup/onboarding/Signup/view_model/getUserprofile.dart'; import 'package:regroup/resources/routes/route_name.dart'; import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart'; -import 'package:flutter_facebook_auth/flutter_facebook_auth.dart'; -import 'package:regroup/Common/global.dart' as global; -// import 'package:regroup/Common/global.dart' as global; class LoginScreen extends StatefulWidget { const LoginScreen({super.key}); @@ -30,11 +27,11 @@ class LoginScreen extends StatefulWidget { } class _LoginScreenState extends State { - AccessToken? _accessToken; final TextEditingController _emailController = TextEditingController(); RxBool isObscured = true.obs; final TextEditingController _passwordController = TextEditingController(); GoogleAuthService googleSigninController = Get.put(GoogleAuthService()); + bool isLoading = false; @override void initState() { @@ -74,21 +71,21 @@ class _LoginScreenState extends State { ); // Get.toNamed(RouteName.mainscreen,arguments: 0); await Getuserdetails().Getuser().then((value) { - if (getuserobj?.data?.userData?.isProfileUpdated == 0) { - String? accountype = - getuserobj?.data?.userData?.principalTypeXid.toString(); + if (getuserobj?.data?.userData?.isProfileUpdated == 0) { + String? accountype = + getuserobj?.data?.userData?.principalTypeXid.toString(); - if (accountype == "1") { - Get.toNamed(RouteName.tellusindividualscreen, - arguments: {'pageroute': "mainscreen"}); - } else if (accountype == "2") { - Get.toNamed(RouteName.tellusbusinessscreen, - arguments: {'pageroute': "mainscreen"}); + if (accountype == "1") { + Get.toNamed(RouteName.tellusindividualscreen, + arguments: {'pageroute': "mainscreen"}); + } else if (accountype == "2") { + Get.toNamed(RouteName.tellusbusinessscreen, + arguments: {'pageroute': "mainscreen"}); + } + } else { + Get.toNamed(RouteName.mainscreen, arguments: 0); } - } else { - Get.toNamed(RouteName.mainscreen,arguments: 0); - } - }); + }); logger.d("go to login"); } } else { @@ -123,8 +120,6 @@ class _LoginScreenState extends State { final LoginResult result = await FacebookAuth.instance.login(); if (result.status == LoginStatus.success) { - _accessToken = result.accessToken; - final userData = await FacebookAuth.instance.getUserData(); logger.i(userData['email']); logger.i(userData['id']); @@ -140,7 +135,6 @@ class _LoginScreenState extends State { _logout() async { await FacebookAuth.instance.logOut(); - _accessToken = null; setState(() {}); } @@ -221,7 +215,7 @@ class _LoginScreenState extends State { context: context, builder: (context) { return AlertDialog( - backgroundColor: Color(0xff222935), + backgroundColor: const Color(0xff222935), title: Text( 'Exit App', style: TextStyle( @@ -293,21 +287,21 @@ class _LoginScreenState extends State { image: DecorationImage( image: AssetImage("assets/images/png/Choice screen.png"), - fit: BoxFit.cover)), + fit: BoxFit.fill)), ), Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( - height: 150.h, + height: 130.h, ), Padding( padding: EdgeInsets.symmetric(horizontal: 16.w), child: Align( alignment: Alignment.center, - child: Container( + child: SizedBox( width: 107.w, - height: 70.h, + height: 86.h, child: SvgPicture.asset( "assets/images/svg/onboarding2.svg", fit: BoxFit.cover, @@ -355,18 +349,6 @@ class _LoginScreenState extends State { } return null; }, - // onInput: (p0) { - // if (p0!.isEmpty) { - // errormsg.value = 'Enter your e-mail address'; - // } - // if (!RegExp( - // r'^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$') - // .hasMatch(p0!)) { - // errormsg.value = 'Enter a valid e-mail address'; - // } - // return null; - // }, - // validatorText: "Email Id", inputFormatters: [ LengthLimitingTextInputFormatter(30), @@ -412,22 +394,72 @@ class _LoginScreenState extends State { ), sizedBoxHeight(10.h), Align( - alignment: Alignment.centerRight, - child: Padding( - padding: EdgeInsets.only(right: 6.w), - child: GestureDetector( - onTap: () { - Get.toNamed(RouteName.forgotpass); - }, - child: - text14400white('Forgot password ?')), - )), + alignment: Alignment.centerRight, + child: Padding( + padding: EdgeInsets.only(right: 6.w), + child: GestureDetector( + onTap: () { + Get.toNamed(RouteName.forgotpass); + }, + child: text14400white('Forgot password ?'), + ), + ), + ), sizedBoxHeight(40.h), - CustomButton( - text: "Login", - onPressed: () { - _logincheck(); - }), + Center( + child: SizedBox( + width: isLoading ? 50 : double.infinity, + height: 50, + child: ElevatedButton( + style: ElevatedButton.styleFrom( + backgroundColor: const Color(0xFFD90B2E), + padding: EdgeInsets.zero), + onPressed: () { + setState( + () { + isLoading = true; + }, + ); + Future.delayed( + const Duration(seconds: 1), + () { + setState(() { + isLoading = false; + }); + _logincheck(); + }, + ); + }, + child: isLoading + ? const Row( + mainAxisAlignment: + MainAxisAlignment.center, + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + SizedBox( + width: 30, + height: 30, + child: CircularProgressIndicator( + color: Colors.white, + strokeWidth: 2, + ), + ), + ], + ) + : Text( + 'Login', + textAlign: TextAlign.center, + style: TextStyle( + fontFamily: "Helvetica", + fontWeight: FontWeight.w400, + fontSize: 16.sp, + color: const Color(0xFFFCFCFC), + ), + ), + ), + ), + ), sizedBoxHeight(20.h), GestureDetector( onTap: () { diff --git a/lib/Login/View/verifygoogleapple.dart b/lib/Login/View/verifygoogleapple.dart index cd8df8d..23b1807 100644 --- a/lib/Login/View/verifygoogleapple.dart +++ b/lib/Login/View/verifygoogleapple.dart @@ -10,7 +10,7 @@ import 'package:regroup/Login/ViewModel/LoginApi.dart'; import 'package:regroup/Utils/Common/CommonAppbar.dart'; import 'package:regroup/Utils/Common/CommonDropdown.dart'; import 'package:regroup/Utils/Common/CustomNextButton.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; + import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/dialogs.dart'; import 'package:regroup/Utils/texts.dart'; @@ -52,7 +52,7 @@ class _VerifygoogleandappleState extends State { } } - final Map _accountTypeMap = { + final Map _accountTypeMap = { 'Individual': 1, 'Business': 2, }; @@ -68,12 +68,11 @@ class _VerifygoogleandappleState extends State { SharedPreferences prefs = await SharedPreferences.getInstance(); if (resp.status == ResponseStatus.SUCCESS) { - int accountTypeValue = _accountTypeMap[_selectedAccountType] ?? 0; + int accountTypeValue = _accountTypeMap[_selectedAccountType] ?? 0; - await prefs.setString('accountTypefromLogin', - accountTypeValue.toString()); - await prefs.setString('accountTypeValue', - accountTypeValue.toString()); + await prefs.setString( + 'accountTypefromLogin', accountTypeValue.toString()); + await prefs.setString('accountTypeValue', accountTypeValue.toString()); if (_selectedAccountType == 'Individual') { Get.toNamed(RouteName.tellusindividualscreen); @@ -102,45 +101,54 @@ class _VerifygoogleandappleState extends State { backgroundColor: const Color.fromARGB(255, 18, 32, 47), body: Stack( children: [ - const Positioned( - top: 310, right: -30, child: CommonBlurRightSecond()), - const Positioned(top: 510, left: -30, child: CommonBlurLeftBlue()), - GlassmorphicContainer( - width: MediaQuery.of(context).size.width, - height: - // 500.h, - MediaQuery.of(context).size.height, - borderRadius: 2, - blur: 6, - alignment: Alignment.bottomLeft, - border: 2, - linearGradient: LinearGradient( - begin: Alignment.topCenter, - end: Alignment.bottomCenter, - colors: [ - const Color(0XFF222935).withOpacity(0.60), - const Color(0XFF222935).withOpacity(0.60), - const Color(0XFF222935).withOpacity(0.60), - const Color(0XFF222935).withOpacity(0.60), + + + // Positioned( + // top: 310, right: -30, child: CommonBlurRightSecond()), + // const Positioned(top: 510, left: -30, child: CommonBlurLeftBlue()), + // GlassmorphicContainer( + // width: MediaQuery.of(context).size.width, + // height: + // // 500.h, + // MediaQuery.of(context).size.height, + // borderRadius: 2, + // blur: 6, + // alignment: Alignment.bottomLeft, + // border: 2, + // linearGradient: LinearGradient( + // begin: Alignment.topCenter, + // end: Alignment.bottomCenter, + // colors: [ + // const Color(0XFF222935).withOpacity(0.60), + // const Color(0XFF222935).withOpacity(0.60), + // const Color(0XFF222935).withOpacity(0.60), + // const Color(0XFF222935).withOpacity(0.60), - // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50), - // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50), - // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50), - // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50), - ], - ), - borderGradient: LinearGradient( - begin: Alignment.topCenter, - end: Alignment.bottomCenter, - colors: [ - // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50), - // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50), - const Color(0XFF222935).withOpacity(0.60), + // // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50), + // // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50), + // // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50), + // // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50), + // ], + // ), + // borderGradient: LinearGradient( + // begin: Alignment.topCenter, + // end: Alignment.bottomCenter, + // colors: [ + // // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50), + // // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50), + // const Color(0XFF222935).withOpacity(0.60), - const Color(0XFF222935).withOpacity(0.60), - ], - ), - child: Padding( + // const Color(0XFF222935).withOpacity(0.60), + // ], + // ), + Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage("assets/images/png/Ellipse 1496.png"), + fit: BoxFit.fill)), + ), + + Padding( padding: EdgeInsets.symmetric(horizontal: 16.w), child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -234,10 +242,8 @@ class _VerifygoogleandappleState extends State { ], ), ), - ) - ], - ), - ), - ); + ] ) + + )); } } diff --git a/lib/Login/ViewModel/LoginApi.dart b/lib/Login/ViewModel/LoginApi.dart index 80cf01b..9cad84e 100644 --- a/lib/Login/ViewModel/LoginApi.dart +++ b/lib/Login/ViewModel/LoginApi.dart @@ -4,6 +4,7 @@ import 'package:regroup/Common/base_manager.dart'; import 'package:regroup/Common/controller/data/network/network_api.dart'; import 'package:regroup/Global.dart'; import 'package:regroup/Login/Model/LoginModel.dart'; +import 'package:regroup/Main_Screens/Community/ViewModel/getmethod.dart'; import 'package:regroup/onboarding/Signup/view_model/getUserprofile.dart'; import 'package:regroup/resources/routes/route_name.dart'; import 'package:shared_preferences/shared_preferences.dart'; @@ -19,6 +20,7 @@ class LoginAPI { if (response.data['status'] == 'success') { LoginModel loginObj = LoginModel.fromJson(response.data); await prefs.setString('access-token', loginObj.data!.accessToken!); + await Communityallgetmethod().getLikeicons(); await prefs.setString( 'fullname', loginObj.data?.userData?.fullName ?? ""); await prefs.setString( @@ -63,7 +65,7 @@ class LoginAPI { ); } } else { - Get.toNamed(RouteName.mainscreen); + Get.toNamed(RouteName.mainscreen,arguments: 0); } } else { return ResponseData( @@ -80,6 +82,7 @@ class LoginAPI { .postApi(data, ApiUrls.googlelogin, optionalpar: true); if (response.status == ResponseStatus.SUCCESS) { await prefs.setString('access-token', response.data['data']['token']); + await Communityallgetmethod().getLikeicons(); if (response.data['data']['is_account_type_updated'] == 3) { return ResponseData( "go-to-signin-via-oauth", ResponseStatus.SUCCESS, @@ -99,6 +102,7 @@ class LoginAPI { .postApi(data, ApiUrls.applelogin, optionalpar: true); if (response.status == ResponseStatus.SUCCESS) { await prefs.setString('access-token', response.data['data']['token']); + await Communityallgetmethod().getLikeicons(); if (response.data['data']['is_account_type_updated'] == 3) { Get.toNamed(RouteName.verifygoogleapplepage, arguments: {"email": emailReceived}); @@ -118,7 +122,7 @@ class LoginAPI { arguments: {'pageroute': "mainscreen"}); } } else { - Get.toNamed(RouteName.mainscreen,arguments: 0); + Get.toNamed(RouteName.mainscreen, arguments: 0); } }); // Get.toNamed(RouteName.mainscreen); @@ -136,6 +140,7 @@ class LoginAPI { .postApi(data, ApiUrls.facebooklogin, optionalpar: true); if (response.status == ResponseStatus.SUCCESS) { await prefs.setString('access-token', response.data['data']['token']); + await Communityallgetmethod().getLikeicons(); if (response.data['data']['is_account_type_updated'] == 3) { Get.toNamed(RouteName.verifygoogleapplepage, arguments: {"email": emailReceived}); @@ -143,6 +148,7 @@ class LoginAPI { "go-to-signin-via-oauth", ResponseStatus.SUCCESS); } else { // Get.toNamed(RouteName.mainscreen); + await Getuserdetails().Getuser().then((value) { if (getuserobj?.data?.userData?.isProfileUpdated == 0) { String? accountype = @@ -156,7 +162,7 @@ class LoginAPI { arguments: {'pageroute': "mainscreen"}); } } else { - Get.toNamed(RouteName.mainscreen,arguments: 0); + Get.toNamed(RouteName.mainscreen, arguments: 0); } }); return ResponseData("go-to-login", ResponseStatus.SUCCESS); diff --git a/lib/Feed Module/Main_Screens/CalenderTab/AddEvent/AddEvent.dart b/lib/Main_Screens/CalenderTab/AddEvent/AddEvent.dart similarity index 94% rename from lib/Feed Module/Main_Screens/CalenderTab/AddEvent/AddEvent.dart rename to lib/Main_Screens/CalenderTab/AddEvent/AddEvent.dart index ff085af..102deb7 100644 --- a/lib/Feed Module/Main_Screens/CalenderTab/AddEvent/AddEvent.dart +++ b/lib/Main_Screens/CalenderTab/AddEvent/AddEvent.dart @@ -103,11 +103,11 @@ class _AddEventState extends State { borderType: BorderType.RRect, radius: Radius.circular(14.r), color: const Color(0xFF434A53), - child: commonGlassContainer( - border: 0, + child: commonGlassUI( + // border: 0, width: double.infinity, height: 130.h, - borderradius: 10.r, + borderRadius: BorderRadius.circular( 10.r), customWidget: bannerPath.isNotEmpty && isbannerAdded ? Stack(children: [ Image.file( @@ -160,10 +160,10 @@ class _AddEventState extends State { ), ), sizedBoxHeight(20.h), - commonGlassContainer( + commonGlassUI( width: double.infinity, height: 60.h, - borderradius: 10.r, + borderRadius: BorderRadius.circular( 10.r), customWidget: Center( child: Padding( padding: EdgeInsets.symmetric(horizontal: 12.w), @@ -197,7 +197,7 @@ class _AddEventState extends State { ]), ), ), - border: 1), + borderwidth: 1), sizedBoxHeight(20.h), text16400white("Type of event"), sizedBoxHeight(14.h), @@ -313,10 +313,10 @@ class _AddEventState extends State { }); } }, - child: commonGlassContainer( + child: commonGlassUI( width: 174.w, height: 50.h, - borderradius: 30.r, + borderRadius: BorderRadius.circular( 30.r), customWidget: Center( child: Row(children: [ sizedBoxWidth(16.w), @@ -330,7 +330,7 @@ class _AddEventState extends State { formatTimeOfDay(starttime!)), ]), ), - border: 1), + borderwidth: 1), ) ], ), @@ -351,10 +351,10 @@ class _AddEventState extends State { }); } }, - child: commonGlassContainer( + child: commonGlassUI( width: 174.w, height: 50.h, - borderradius: 30.r, + borderRadius: BorderRadius.circular( 30.r), customWidget: Center( child: Row(children: [ sizedBoxWidth(16.w), @@ -368,7 +368,7 @@ class _AddEventState extends State { formatTimeOfDay(endtime!)), ]), ), - border: 1), + borderwidth: 1), ) ], ), @@ -378,9 +378,9 @@ class _AddEventState extends State { Row( children: [ Obx(() { - return commonGlassContainer( - border: 1, - borderradius: 2, + return commonGlassUI( + borderwidth: 1, + borderRadius: BorderRadius.circular( 2), height: 23.h, width: 23.w, opacity1: 0.24, @@ -474,19 +474,19 @@ class _AddEventState extends State { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - commonGlassContainer( + commonGlassUI( height: 50.h, width: 127.w, - borderradius: 30.r, - border: 1, + borderRadius: BorderRadius.circular( 30.r), + borderwidth: 1, customWidget: Center( child: text16400white("2"), )), - commonGlassContainer( + commonGlassUI( height: 50.h, width: 215.w, - borderradius: 30.r, - border: 1, + borderRadius: BorderRadius.circular( 30.r), + borderwidth: 1, customWidget: Center( child: Row( mainAxisAlignment: MainAxisAlignment.center, @@ -515,10 +515,10 @@ class _AddEventState extends State { required String imagePath, required String title, }) { - return commonGlassContainer( + return commonGlassUI( width: double.infinity, height: 50.h, - borderradius: 30, + borderRadius: BorderRadius.circular(30), customWidget: Padding( padding: const EdgeInsets.symmetric(horizontal: 16), child: Center( @@ -540,6 +540,6 @@ class _AddEventState extends State { ), ), ), - border: 1); + borderwidth: 1); } } diff --git a/lib/Feed Module/Main_Screens/CalenderTab/AddUsers/AddUsers.dart b/lib/Main_Screens/CalenderTab/AddUsers/AddUsers.dart similarity index 91% rename from lib/Feed Module/Main_Screens/CalenderTab/AddUsers/AddUsers.dart rename to lib/Main_Screens/CalenderTab/AddUsers/AddUsers.dart index f8c366c..725bc1b 100644 --- a/lib/Feed Module/Main_Screens/CalenderTab/AddUsers/AddUsers.dart +++ b/lib/Main_Screens/CalenderTab/AddUsers/AddUsers.dart @@ -7,7 +7,6 @@ import 'package:regroup/Common/CommonTabBar.dart'; import 'package:regroup/Common/CommonWidget.dart'; import 'package:regroup/Utils/Common/CommonAppbar.dart'; import 'package:regroup/Utils/Common/CustomTextformfield.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/texts.dart'; @@ -139,10 +138,10 @@ class _AddUsersState extends State { children: [ text18w700_FCFCFC("Group members"), const Spacer(), - commonGlassContainer( + commonGlassUI( width: 35.w, height: 35.h, - borderradius: 100, + borderRadius: BorderRadius.circular( 100), customWidget: Center( child: Image.asset( "assets/images/png/Vector (5)22.png", @@ -150,12 +149,12 @@ class _AddUsersState extends State { width: 12.w, ), ), - border: 0.5), + borderwidth: 0.5), sizedBoxWidth(14.w), - commonGlassContainer( + commonGlassUI( width: 35.w, height: 35.h, - borderradius: 100, + borderRadius: BorderRadius.circular(100), customWidget: Center( child: Image.asset( "assets/images/png/bi_filter.png", @@ -163,7 +162,7 @@ class _AddUsersState extends State { width: 18.w, ), ), - border: 0.5) + borderwidth: 0.5) ], ), ), @@ -238,9 +237,9 @@ class _AddUsersState extends State { ], ), const Spacer(), - commonGlassContainer( - border: 1, - borderradius: 2, + commonGlassUI( + borderwidth: 1, + borderRadius: BorderRadius.circular( 2), height: 23.h, width: 23.w, opacity1: 0.24, @@ -281,32 +280,32 @@ class _AddUsersState extends State { sizedBoxHeight(16.h), Row( children: [ - commonGlassContainer( + commonGlassUI( width: 40.w, height: 40.h, - borderradius: 100, + borderRadius: BorderRadius.circular( 100), opacity1: 0.24, opacity2: 0.24, customWidget: Center(child: text16w400_FCFCFC("M")), - border: 0.5), + borderwidth: 0.5), sizedBoxWidth(15.w), - commonGlassContainer( + commonGlassUI( width: 40.w, height: 40.h, - borderradius: 100, + borderRadius: BorderRadius.circular( 100), opacity1: 0.24, opacity2: 0.24, customWidget: Center(child: text16w400_FCFCFC("Tu")), - border: 0.5), + borderwidth: 0.5), sizedBoxWidth(15.w), - commonGlassContainer( + commonGlassUI( width: 40.w, height: 40.h, - borderradius: 100, + borderRadius: BorderRadius.circular( 100), opacity1: 0.24, opacity2: 0.24, customWidget: Center(child: text16w400_FCFCFC("W")), - border: 0.5), + borderwidth: 0.5), const Spacer(), Row( children: [ @@ -326,32 +325,32 @@ class _AddUsersState extends State { sizedBoxHeight(20.h), Row( children: [ - commonGlassContainer( + commonGlassUI( width: 40.w, height: 40.h, - borderradius: 100, + borderRadius: BorderRadius.circular(100), opacity1: 0.24, opacity2: 0.24, customWidget: Center(child: text16w400_FCFCFC("Th")), - border: 0.5), + borderwidth: 0.5), sizedBoxWidth(15.w), - commonGlassContainer( + commonGlassUI( width: 40.w, height: 40.h, - borderradius: 100, + borderRadius: BorderRadius.circular( 100), opacity1: 0.24, opacity2: 0.24, customWidget: Center(child: text16w400_FCFCFC("F")), - border: 0.5), + borderwidth: 0.5), sizedBoxWidth(15.w), - commonGlassContainer( + commonGlassUI( width: 40.w, height: 40.h, - borderradius: 100, + borderRadius: BorderRadius.circular( 100), opacity1: 0.24, opacity2: 0.24, customWidget: Center(child: text16w400_FCFCFC("Sa")), - border: 0.5), + borderwidth: 0.5), const Spacer(), Row( children: [ diff --git a/lib/Feed Module/Main_Screens/CalenderTab/Availabillity.dart b/lib/Main_Screens/CalenderTab/Availabillity.dart similarity index 97% rename from lib/Feed Module/Main_Screens/CalenderTab/Availabillity.dart rename to lib/Main_Screens/CalenderTab/Availabillity.dart index 5bd96ca..8549294 100644 --- a/lib/Feed Module/Main_Screens/CalenderTab/Availabillity.dart +++ b/lib/Main_Screens/CalenderTab/Availabillity.dart @@ -121,14 +121,15 @@ class _AvailabilityState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - commonGlassContainer( + commonGlassUI( width: double.infinity, height: 670.h, - borderradius: 1, - border: 0, + borderRadius: BorderRadius.circular(1), + // border: 0, customWidget: SfCalendar( view: CalendarView.timelineMonth, - appointmentTextStyle: const TextStyle(color: Colors.white), + appointmentTextStyle: + const TextStyle(color: Colors.white), headerStyle: const CalendarHeaderStyle( textStyle: TextStyle( color: Colors.blue, diff --git a/lib/Feed Module/Main_Screens/CalenderTab/CalenderTab.dart b/lib/Main_Screens/CalenderTab/CalenderTab.dart similarity index 97% rename from lib/Feed Module/Main_Screens/CalenderTab/CalenderTab.dart rename to lib/Main_Screens/CalenderTab/CalenderTab.dart index 6e67068..a146e0b 100644 --- a/lib/Feed Module/Main_Screens/CalenderTab/CalenderTab.dart +++ b/lib/Main_Screens/CalenderTab/CalenderTab.dart @@ -177,10 +177,7 @@ class _CalenderTabState extends State { // initialIndex: selectedIndex.value, child: Column( children: [ - const CommonTabBar( - - - tabs: [ + const CommonTabBar(tabs: [ Tab( text: 'My sessions', ), @@ -190,7 +187,6 @@ class _CalenderTabState extends State { ]), Expanded( child: TabBarView( - children: [ mySessionsTab(), comSessionTab(), @@ -215,10 +211,11 @@ class _CalenderTabState extends State { sizedBoxHeight(20.h), Padding( padding: EdgeInsets.symmetric(horizontal: 16.w), - child: commonGlassContainer( + child: commonGlassUI( width: double.infinity, height: 136.h, - borderradius: 10.r, + borderRadius: BorderRadius.circular(10.r) , + borderwidth: 1, customWidget: Row( children: [ Padding( @@ -245,15 +242,15 @@ class _CalenderTabState extends State { Image.asset("assets/images/png/Rectangle 45.png") ], ), - border: 1), + ), ), sizedBoxHeight(25.h), Stack(children: [ - commonGlassContainer( + commonGlassUI( width: double.infinity, height: 500.h, - borderradius: 1, - border: 0, + borderRadius: BorderRadius.circular(1), + // borderw: 0, customWidget: SfCalendar( view: CalendarView.month, appointmentTextStyle: const TextStyle(color: Colors.white), @@ -456,10 +453,11 @@ class _CalenderTabState extends State { onTap: () { Get.toNamed(RouteName.eventDetails); }, - child: commonGlassContainer( + child: commonGlassUI( width: double.infinity, height: 300.h, - borderradius: 10.r, + borderRadius: BorderRadius.circular( 10.r), + borderwidth: 1.w, customWidget: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -529,15 +527,15 @@ class _CalenderTabState extends State { sizedBoxWidth(16.w), CircleAvatar( radius: 12.r, - backgroundImage: - const AssetImage("assets/images/png/Ellipse 52.png"), + backgroundImage: const AssetImage( + "assets/images/png/Ellipse 52.png"), ), sizedBoxWidth(8.w), text14w400_FCFCFC("Ryan dorwat"), ], ) ]), - border: 1), + ), ) ], ), @@ -551,11 +549,11 @@ class _CalenderTabState extends State { sizedBoxHeight(25.h), Stack(children: [ - commonGlassContainer( + commonGlassUI( width: double.infinity, height: 530.h, - borderradius: 1, - border: 0, + borderRadius: BorderRadius.circular(1), + // border: 0, customWidget: SfCalendar( view: CalendarView.month, appointmentTextStyle: const TextStyle(color: Colors.white), @@ -730,10 +728,11 @@ class _CalenderTabState extends State { children: [ text18w700_FCFCFC(title), sizedBoxHeight(25.h), - commonGlassContainer( + commonGlassUI( width: double.infinity, height: 290.h, - borderradius: 10.r, + borderRadius: BorderRadius.circular( 10.r), + borderwidth: 1, customWidget: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -810,7 +809,7 @@ class _CalenderTabState extends State { ), ], ), - border: 1) + ) ], ), ); diff --git a/lib/Feed Module/Main_Screens/CalenderTab/EventDetails.dart b/lib/Main_Screens/CalenderTab/EventDetails.dart similarity index 82% rename from lib/Feed Module/Main_Screens/CalenderTab/EventDetails.dart rename to lib/Main_Screens/CalenderTab/EventDetails.dart index 6a10e56..48f893c 100644 --- a/lib/Feed Module/Main_Screens/CalenderTab/EventDetails.dart +++ b/lib/Main_Screens/CalenderTab/EventDetails.dart @@ -5,7 +5,6 @@ import 'package:regroup/Common/CommonButton.dart'; import 'package:regroup/Common/CommonGlassmorphism.dart'; import 'package:regroup/Common/CommonWidget.dart'; import 'package:regroup/Utils/Common/CommonAppbar.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/texts.dart'; import 'package:regroup/resources/routes/route_name.dart'; @@ -37,41 +36,44 @@ class _EventDetailsState extends State { onTap: () { Get.toNamed(RouteName.addEvent); }, - child: commonGlassContainer( - width: 40.w, - height: 40.h, - borderradius: 100, - opacity1: 0.24, - opacity2: 0.24, - customWidget: Center( - child: Image.asset("assets/images/png/Vector536.png", - height: 17.h, width: 17.w), - ), - border: 0.5), - ), - sizedBoxWidth(12.w), - commonGlassContainer( + child: commonGlassUI( width: 40.w, height: 40.h, - borderradius: 100, + borderRadius: BorderRadius.circular(100), opacity1: 0.24, opacity2: 0.24, + borderwidth: 0.5, customWidget: Center( - child: Image.asset("assets/images/png/Vector522.png", + child: Image.asset("assets/images/png/Vector536.png", height: 17.h, width: 17.w), ), - border: 0.5), + ), + ), + sizedBoxWidth(12.w), + commonGlassUI( + width: 40.w, + height: 40.h, + borderRadius: BorderRadius.circular(100), + opacity1: 0.24, + opacity2: 0.24, + borderwidth: 0.5, + customWidget: Center( + child: Image.asset("assets/images/png/Vector522.png", + height: 17.h, width: 17.w), + ), + ), ], ), ), body: Stack(children: [ - Container( + Container( decoration: const BoxDecoration( image: DecorationImage( image: AssetImage("assets/images/png/Ellipse 1496.png"), fit: BoxFit.fill)), - ), SingleChildScrollView( - child: Column( + ), + SingleChildScrollView( + child: Column( children: [ Padding( padding: const EdgeInsets.symmetric(horizontal: 16), @@ -98,20 +100,21 @@ class _EventDetailsState extends State { sizedBoxHeight(22.h), Row( children: [ - commonGlassContainer( - width: 35.w, - height: 35.h, - borderradius: 100, - opacity1: 0.24, - opacity2: 0.24, - customWidget: Center( - child: Image.asset( - "assets/images/png/calender.png", - height: 17.h, - width: 17.w, - ), + commonGlassUI( + width: 35.w, + height: 35.h, + borderRadius: BorderRadius.circular(100), + opacity1: 0.24, + opacity2: 0.24, + borderwidth: 0.5, + customWidget: Center( + child: Image.asset( + "assets/images/png/calender.png", + height: 17.h, + width: 17.w, ), - border: 0.5), + ), + ), sizedBoxWidth(10.w), text16400white("20th April 2024 - 21st April 2024"), ], @@ -119,10 +122,10 @@ class _EventDetailsState extends State { sizedBoxHeight(16.h), Row( children: [ - commonGlassContainer( + commonGlassUI( width: 35.w, height: 35.h, - borderradius: 100, + borderRadius: BorderRadius.circular(100), opacity1: 0.24, opacity2: 0.24, customWidget: Center( @@ -132,7 +135,7 @@ class _EventDetailsState extends State { width: 17.w, ), ), - border: 0.5), + borderwidth: 0.5), sizedBoxWidth(10.w), text16400white("3 hours"), ], @@ -140,10 +143,10 @@ class _EventDetailsState extends State { sizedBoxHeight(16.h), Row( children: [ - commonGlassContainer( + commonGlassUI( width: 35.w, height: 35.h, - borderradius: 100, + borderRadius: BorderRadius.circular(100), opacity1: 0.24, opacity2: 0.24, customWidget: Center( @@ -153,7 +156,7 @@ class _EventDetailsState extends State { width: 17.w, ), ), - border: 0.5), + borderwidth: 0.5), sizedBoxWidth(10.w), text16400white("Elm street london, United Kingdom"), ], @@ -172,26 +175,26 @@ class _EventDetailsState extends State { Row( mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ - commonGlassContainer( + commonGlassUI( width: 87.w, height: 40.h, - borderradius: 30.r, + borderRadius: BorderRadius.circular(30.r), customWidget: Center(child: text16w400_white("Yes")), - border: 1), - commonGlassContainer( + borderwidth: 1), + commonGlassUI( width: 87.w, height: 40.h, - borderradius: 30.r, + borderRadius: BorderRadius.circular(30.r), customWidget: Center(child: text16w400_white("No")), - border: 1), - commonGlassContainer( + borderwidth: 1), + commonGlassUI( width: 154.w, height: 40.h, - borderradius: 30.r, + borderRadius: BorderRadius.circular(30.r), customWidget: Center( child: text16w400_white("Not yet decided")), - border: 1), + borderwidth: 1), ], ), sizedBoxHeight(20.h), @@ -207,13 +210,13 @@ class _EventDetailsState extends State { sizedBoxHeight(16.h), text18w700white("Are you attending this event ?"), sizedBoxHeight(20.h), - commonGlassContainer( + commonGlassUI( width: 221.w, height: 40.h, - borderradius: 30.r, + borderRadius: BorderRadius.circular(30.r), customWidget: Center(child: text16w400_white("Request to join")), - border: 1), + borderwidth: 1), sizedBoxHeight(20.h), commonDivider(), ], @@ -241,10 +244,10 @@ class _EventDetailsState extends State { sizedBoxHeight(20.h), Visibility( visible: adminView, - child: commonGlassContainer( + child: commonGlassUI( width: double.infinity, height: 251.h, - borderradius: 10.r, + borderRadius: BorderRadius.circular(10.r), customWidget: Padding( padding: const EdgeInsets.symmetric(vertical: 20), child: Column( @@ -266,15 +269,15 @@ class _EventDetailsState extends State { ], ), ), - border: 1), + borderwidth: 1), ), sizedBoxHeight(30.h), Visibility( visible: memberView, - child: commonGlassContainer( + child: commonGlassUI( width: double.infinity, height: 65.h, - borderradius: 10.r, + borderRadius: BorderRadius.circular(10.r), customWidget: Row( crossAxisAlignment: CrossAxisAlignment.center, children: [ @@ -294,7 +297,7 @@ class _EventDetailsState extends State { text18w400white("90 Attending") ], ), - border: 1)), + borderwidth: 1)), text18w700white("Messages"), sizedBoxHeight(20.h), Row( @@ -307,20 +310,20 @@ class _EventDetailsState extends State { sizedBoxWidth(10.w), text16w400_white("Send message to invites"), const Spacer(), - commonGlassContainer( + commonGlassUI( width: 98.w, height: 30.h, - borderradius: 30.r, + borderRadius: BorderRadius.circular( 30.r), customWidget: Center(child: text14400white("Select")), - border: 1) + borderwidth: 1) ], ), sizedBoxHeight(25.h), - commonGlassContainer( + commonGlassUI( width: double.infinity, height: 240.h, - borderradius: 10.r, + borderRadius: BorderRadius.circular( 10.r), customWidget: Padding( padding: EdgeInsets.symmetric(horizontal: 80.w), child: Column( @@ -354,7 +357,7 @@ class _EventDetailsState extends State { ) ]), ), - border: 1), + borderwidth: 1), sizedBoxHeight(50.h), CommonBtn(text: "Join the event"), sizedBoxHeight(40.h), diff --git a/lib/Feed Module/Main_Screens/CalenderTab/ManageMenmbers/ManageMembersCal.dart b/lib/Main_Screens/CalenderTab/ManageMenmbers/ManageMembersCal.dart similarity index 91% rename from lib/Feed Module/Main_Screens/CalenderTab/ManageMenmbers/ManageMembersCal.dart rename to lib/Main_Screens/CalenderTab/ManageMenmbers/ManageMembersCal.dart index 4572b80..6ebb7f4 100644 --- a/lib/Feed Module/Main_Screens/CalenderTab/ManageMenmbers/ManageMembersCal.dart +++ b/lib/Main_Screens/CalenderTab/ManageMenmbers/ManageMembersCal.dart @@ -189,12 +189,12 @@ class _ManageMembersCalState extends State { child: Center(child: text10400white("Attending")), ), sizedBoxWidth(8.w), - commonGlassContainer( + commonGlassUI( width: 25.w, height: 25.h, opacity1: 0.24, opacity2: 0.24, - borderradius: 100.r, + borderRadius: BorderRadius.circular(100.r), customWidget: Center( child: Image.asset( "assets/images/png/alarm 1 (traced).png", @@ -202,14 +202,14 @@ class _ManageMembersCalState extends State { width: 13.w, ), ), - border: 0.5), + borderwidth: 0.5), sizedBoxWidth(8.w), - commonGlassContainer( + commonGlassUI( width: 25.w, height: 25.h, opacity1: 0.24, opacity2: 0.24, - borderradius: 100.r, + borderRadius: BorderRadius.circular( 100.r), customWidget: Center( child: Image.asset( "assets/images/png/fluent_delete-28-regular.png", @@ -217,7 +217,7 @@ class _ManageMembersCalState extends State { width: 13.w, ), ), - border: 0.5), + borderwidth: 0.5), sizedBoxWidth(12.w) ], ), @@ -244,32 +244,32 @@ class _ManageMembersCalState extends State { sizedBoxHeight(16.h), Row( children: [ - commonGlassContainer( + commonGlassUI( width: 40.w, height: 40.h, - borderradius: 100, + borderRadius: BorderRadius.circular(100), opacity1: 0.24, opacity2: 0.24, customWidget: Center(child: text16w400_FCFCFC("M")), - border: 0.5), + borderwidth: 0.5), sizedBoxWidth(15.w), - commonGlassContainer( + commonGlassUI( width: 40.w, height: 40.h, - borderradius: 100, + borderRadius: BorderRadius.circular( 100), opacity1: 0.24, opacity2: 0.24, customWidget: Center(child: text16w400_FCFCFC("Tu")), - border: 0.5), + borderwidth: 0.5), sizedBoxWidth(15.w), - commonGlassContainer( + commonGlassUI( width: 40.w, height: 40.h, - borderradius: 100, + borderRadius: BorderRadius.circular( 100), opacity1: 0.24, opacity2: 0.24, customWidget: Center(child: text16w400_FCFCFC("W")), - border: 0.5), + borderwidth: 0.5), const Spacer(), Row( children: [ @@ -289,32 +289,32 @@ class _ManageMembersCalState extends State { sizedBoxHeight(20.h), Row( children: [ - commonGlassContainer( + commonGlassUI( width: 40.w, height: 40.h, - borderradius: 100, + borderRadius: BorderRadius.circular( 100), opacity1: 0.24, opacity2: 0.24, customWidget: Center(child: text16w400_FCFCFC("Th")), - border: 0.5), + borderwidth: 0.5), sizedBoxWidth(15.w), - commonGlassContainer( + commonGlassUI( width: 40.w, height: 40.h, - borderradius: 100, + borderRadius: BorderRadius.circular(100), opacity1: 0.24, opacity2: 0.24, customWidget: Center(child: text16w400_FCFCFC("F")), - border: 0.5), + borderwidth: 0.5), sizedBoxWidth(15.w), - commonGlassContainer( + commonGlassUI( width: 40.w, height: 40.h, - borderradius: 100, + borderRadius: BorderRadius.circular( 100), opacity1: 0.24, opacity2: 0.24, customWidget: Center(child: text16w400_FCFCFC("Sa")), - border: 0.5), + borderwidth: 0.5), const Spacer(), Row( children: [ @@ -374,4 +374,6 @@ class _ManageMembersCalState extends State { ), )); } + + } diff --git a/lib/Feed Module/Main_Screens/CalenderTab/Resource Pool/ResourcePool.dart b/lib/Main_Screens/CalenderTab/Resource Pool/ResourcePool.dart similarity index 97% rename from lib/Feed Module/Main_Screens/CalenderTab/Resource Pool/ResourcePool.dart rename to lib/Main_Screens/CalenderTab/Resource Pool/ResourcePool.dart index 68a0fa5..9838fb4 100644 --- a/lib/Feed Module/Main_Screens/CalenderTab/Resource Pool/ResourcePool.dart +++ b/lib/Main_Screens/CalenderTab/Resource Pool/ResourcePool.dart @@ -89,10 +89,10 @@ class _ResourcePoolState extends State { } Widget resourceCard() { - return commonGlassContainer( + return commonGlassUI( width: double.infinity, height: 216.h, - borderradius: 10.r, + borderRadius: BorderRadius.circular( 10.r), customWidget: Padding( padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 16), child: @@ -177,7 +177,7 @@ class _ResourcePoolState extends State { ), ]), ), - border: 1); + borderwidth: 1); } void inviteBottomSheet() { @@ -258,9 +258,9 @@ class _ResourcePoolState extends State { sizedBoxWidth(10.w), text16w400_FCFCFC(title), const Spacer(), - commonGlassContainer( - border: 1, - borderradius: 2, + commonGlassUI( + borderwidth: 1, + borderRadius: BorderRadius.circular( 2), height: 23.h, width: 23.w, opacity1: 0.24, diff --git a/lib/Feed Module/Main_Screens/CalenderTab/SetAvailabillity.dart b/lib/Main_Screens/CalenderTab/SetAvailabillity.dart similarity index 96% rename from lib/Feed Module/Main_Screens/CalenderTab/SetAvailabillity.dart rename to lib/Main_Screens/CalenderTab/SetAvailabillity.dart index 1dd6be0..f05a41a 100644 --- a/lib/Feed Module/Main_Screens/CalenderTab/SetAvailabillity.dart +++ b/lib/Main_Screens/CalenderTab/SetAvailabillity.dart @@ -138,10 +138,10 @@ class _SetAvailabillityState extends State { children: [ text16400white("Start time"), sizedBoxHeight(14.h), - commonGlassContainer( + commonGlassUI( width: 174.w, height: 50.h, - borderradius: 30.r, + borderRadius: BorderRadius.circular(30.r), customWidget: Center( child: Row(children: [ sizedBoxWidth(16.w), @@ -154,7 +154,7 @@ class _SetAvailabillityState extends State { text16w400_white("3:00 pm") ]), ), - border: 1) + borderwidth: 1) ], ), const Spacer(), @@ -163,10 +163,10 @@ class _SetAvailabillityState extends State { children: [ text16400white("End time"), sizedBoxHeight(14.h), - commonGlassContainer( + commonGlassUI( width: 174.w, height: 50.h, - borderradius: 30.r, + borderRadius: BorderRadius.circular( 30.r), customWidget: Center( child: Row(children: [ sizedBoxWidth(16.w), @@ -179,7 +179,7 @@ class _SetAvailabillityState extends State { text16w400_white("5:00 pm") ]), ), - border: 1) + borderwidth: 1) ], ), ], diff --git a/lib/Feed Module/Main_Screens/Chats/View/chatsmainscreen.dart b/lib/Main_Screens/Chats/View/chatsmainscreen.dart similarity index 100% rename from lib/Feed Module/Main_Screens/Chats/View/chatsmainscreen.dart rename to lib/Main_Screens/Chats/View/chatsmainscreen.dart diff --git a/lib/Feed Module/Main_Screens/Chats/View/groupchat.dart b/lib/Main_Screens/Chats/View/groupchat.dart similarity index 99% rename from lib/Feed Module/Main_Screens/Chats/View/groupchat.dart rename to lib/Main_Screens/Chats/View/groupchat.dart index 8cad5e0..0e3ecff 100644 --- a/lib/Feed Module/Main_Screens/Chats/View/groupchat.dart +++ b/lib/Main_Screens/Chats/View/groupchat.dart @@ -264,13 +264,13 @@ class _GroupChatPageState extends State { child: Row( children: [ sizedBoxWidth(10.w), - commonGlassContainer( - border: 0.9, + commonGlassUI( + borderwidth: 0.9, width: 40.w, height: 40.h, opacity1: 0.24, opacity2: 0.24, - borderradius: 100, + borderRadius: BorderRadius.circular( 100), customWidget: Center( child: Image.asset( 'assets/images/png/appbararrowbutton.png') diff --git a/lib/Feed Module/Main_Screens/Chats/View/newchatpage.dart b/lib/Main_Screens/Chats/View/newchatpage.dart similarity index 100% rename from lib/Feed Module/Main_Screens/Chats/View/newchatpage.dart rename to lib/Main_Screens/Chats/View/newchatpage.dart diff --git a/lib/Feed Module/Main_Screens/Chats/View/newgroup.dart b/lib/Main_Screens/Chats/View/newgroup.dart similarity index 100% rename from lib/Feed Module/Main_Screens/Chats/View/newgroup.dart rename to lib/Main_Screens/Chats/View/newgroup.dart diff --git a/lib/Feed Module/Main_Screens/Chats/View/userchat.dart b/lib/Main_Screens/Chats/View/userchat.dart similarity index 98% rename from lib/Feed Module/Main_Screens/Chats/View/userchat.dart rename to lib/Main_Screens/Chats/View/userchat.dart index a63d0fb..918ccd2 100644 --- a/lib/Feed Module/Main_Screens/Chats/View/userchat.dart +++ b/lib/Main_Screens/Chats/View/userchat.dart @@ -7,7 +7,7 @@ import 'package:glassmorphism/glassmorphism.dart'; import 'package:regroup/Common/CommonGlassmorphism.dart'; import 'package:regroup/Common/CommonWidget.dart'; import 'package:regroup/Utils/Common/ImageUpload.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; + import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart'; @@ -266,13 +266,13 @@ class _UserChatPageState extends State { child: Row( children: [ sizedBoxWidth(10.w), - commonGlassContainer( - border: 0.9, + commonGlassUI( + borderwidth: 0.9, width: 40.w, height: 40.h, opacity1: 0.24, opacity2: 0.24, - borderradius: 100, + borderRadius: BorderRadius.circular( 100), customWidget: Center( child: Image.asset( 'assets/images/png/appbararrowbutton.png') @@ -330,7 +330,7 @@ class _UserChatPageState extends State { onTapDown: (details) { _showContextMenu(context, details.globalPosition); }, - child: Container( + child: SizedBox( width: 30, height: 20, child: Image.asset( @@ -495,7 +495,7 @@ class _UserChatPageState extends State { const Color(0xFFffffff).withOpacity(0.24), const Color(0xFFFFFFFF).withOpacity(0.24), ], - stops: [ + stops: const [ 0.1, 1, ]), diff --git a/lib/Main_Screens/Community/Model/CommonDatumObjModel.dart b/lib/Main_Screens/Community/Model/CommonDatumObjModel.dart new file mode 100644 index 0000000..34a8164 --- /dev/null +++ b/lib/Main_Screens/Community/Model/CommonDatumObjModel.dart @@ -0,0 +1,252 @@ +class CommonDatumObjModel { + CommonDatumObjModel({ + required this.status, + required this.statusCode, + required this.message, + required this.data, + }); + + final String? status; + final int? statusCode; + final String? message; + final List data; + + factory CommonDatumObjModel.fromJson(Map json) { + return CommonDatumObjModel( + status: json["status"], + statusCode: json["status_code"], + message: json["message"], + data: json["data"] == null + ? [] + : List.from( + json["data"]!.map((x) => CommonDatumObjModelData.fromJson(x))), + ); + } +} + +class CommonDatumObjModelData { + CommonDatumObjModelData({ + required this.id, + required this.likecount, + required this.isISaved, + required this.tagsXid, + required this.isILiked, + required this.totalComment, + required this.totalSave, + required this.iamPrincipalXid, + required this.postIn, + required this.caption, + required this.image, + required this.manageTagsXids, + required this.postAs, + required this.ctaTitle, + required this.ctaLink, + required this.createdAt, + required this.likeIcon, + required this.totalViewCount, + required this.totalReactionCount, + required this.totalCommentCount, + required this.totalImpressionCount, + required this.totalPopularScore, + required this.totalHoursAgo, + this.iamPrincipal, + this.community, + required this.attachTags, + }); + + final int? id; + final int? likecount; + final bool? isISaved; + final List tagsXid; + final bool? isILiked; + final int? totalComment; + final int? totalSave; + final int? iamPrincipalXid; + final int? postIn; + final String? caption; + final String? image; + final String? manageTagsXids; + final String? postAs; + final String? ctaTitle; + final String? ctaLink; + final DateTime? createdAt; + final LikeIcon1? likeIcon; + final int? totalViewCount; + final int? totalReactionCount; + final int? totalCommentCount; + final int? totalImpressionCount; + final int? totalPopularScore; + final int? totalHoursAgo; + final IamPrincipal? iamPrincipal; + final Community? community; + final List attachTags; + + factory CommonDatumObjModelData.fromJson(Map json) { + return CommonDatumObjModelData( + id: json["id"], + likecount: json["likecount"], + isISaved: json["is_i_saved"], + tagsXid: json["tags_xid"] == null + ? [] + : List.from(json["tags_xid"]!.map((x) => x)), + isILiked: json["is_i_liked"], + totalComment: json["total_comment"], + totalSave: json["total_save"], + iamPrincipalXid: json["iam_principal_xid"], + postIn: json["post_in"], + caption: json["caption"], + image: json["image"], + manageTagsXids: json["manage_tags_xids"], + postAs: json["post_as"], + ctaTitle: json["cta_title"], + ctaLink: json["cta_link"], + createdAt: DateTime.tryParse(json["created_at"] ?? ""), + likeIcon: json["likeIcon"] == null + ? null + : LikeIcon1.fromJson(json["likeIcon"]), + totalViewCount: json["totalViewCount"], + totalReactionCount: json["totalReactionCount"], + totalCommentCount: json["totalCommentCount"], + totalImpressionCount: json["totalImpressionCount"], + totalPopularScore: json["totalPopularScore"], + totalHoursAgo: json["totalHoursAgo"], + iamPrincipal: json["iam_principal"] == null + ? null + : IamPrincipal.fromJson(json["iam_principal"]), + community: json["community"] == null + ? null + : Community.fromJson(json["community"]), + attachTags: json["attach_tags"] == null + ? [] + : List.from( + json["attach_tags"]!.map((x) => AttachTag1.fromJson(x))), + ); + } +} + +class AttachTag1 { + AttachTag1({ + required this.managePostXid, + required this.manageTagXid, + required this.manageTag, + }); + + final int? managePostXid; + final int? manageTagXid; + final ManageTagPopular? manageTag; + + factory AttachTag1.fromJson(Map json) { + return AttachTag1( + managePostXid: json["manage_post_xid"], + manageTagXid: json["manage_tag_xid"], + manageTag: json["manage_tag"] == null + ? null + : ManageTagPopular.fromJson(json["manage_tag"]), + ); + } +} + +class ManageTagPopular { + ManageTagPopular({ + required this.id, + required this.isPinned, + required this.name, + }); + + final int? id; + final bool? isPinned; + final String? name; + + factory ManageTagPopular.fromJson(Map json) { + return ManageTagPopular( + id: json["id"], + isPinned: json["is_pinned"], + name: json["name"], + ); + } +} + +class Community { + Community({ + required this.id, + required this.communityProfilePhoto, + required this.communityName, + }); + + final int? id; + final String? communityProfilePhoto; + final String? communityName; + + factory Community.fromJson(Map json) { + return Community( + id: json["id"], + communityProfilePhoto: json["community_profile_photo"], + communityName: json["community_name"], + ); + } +} + +class IamPrincipal { + IamPrincipal({ + required this.id, + required this.isUserPinned, + required this.principalTypeXid, + required this.userName, + required this.fullName, + required this.profilePhoto, + }); + + final int? id; + final bool? isUserPinned; + final int? principalTypeXid; + final String? userName; + final String? fullName; + final String? profilePhoto; + + factory IamPrincipal.fromJson(Map json) { + return IamPrincipal( + id: json["id"], + isUserPinned: json["is_user_pinned"], + principalTypeXid: json["principal_type_xid"], + userName: json["user_name"], + fullName: json["full_name"], + profilePhoto: json["profile_photo"], + ); + } +} + +class LikeIcon1 { + LikeIcon1({ + required this.likeIconsXid, + required this.likeIcon, + }); + + final int? likeIconsXid; + final LikeIconClass1? likeIcon; + + factory LikeIcon1.fromJson(Map json) { + return LikeIcon1( + likeIconsXid: json["like_icons_xid"], + likeIcon: json["like_icon"] == null + ? null + : LikeIconClass1.fromJson(json["like_icon"]), + ); + } +} + +class LikeIconClass1 { + LikeIconClass1({ + required this.id, + required this.image, + }); + + final int? id; + final String? image; + + factory LikeIconClass1.fromJson(Map json) { + return LikeIconClass1( + id: json["id"], + image: json["image"], + ); + } +} diff --git a/lib/Main_Screens/Community/Model/FeedPostModel.dart b/lib/Main_Screens/Community/Model/FeedPostModel.dart new file mode 100644 index 0000000..f3daee5 --- /dev/null +++ b/lib/Main_Screens/Community/Model/FeedPostModel.dart @@ -0,0 +1,276 @@ +class FeedPostModel { + FeedPostModel({ + required this.status, + required this.statusCode, + required this.message, + required this.data, + }); + + final String? status; + final int? statusCode; + final String? message; + final Data? data; + + factory FeedPostModel.fromJson(Map json) { + return FeedPostModel( + status: json["status"], + statusCode: json["status_code"], + message: json["message"], + data: json["data"] == null ? null : Data.fromJson(json["data"]), + ); + } +} + +class Data { + Data({ + required this.pinnedCommunityPost, + required this.pinnedUserPost, + required this.pinnedTagsPost, + }); + + final List pinnedCommunityPost; + final List pinnedUserPost; + final List pinnedTagsPost; + + factory Data.fromJson(Map json) { + return Data( + pinnedCommunityPost: json["pinned_community_post"] == null + ? [] + : List.from(json["pinned_community_post"]! + .map((x) => PinnedPost.fromJson(x))), + pinnedUserPost: json["pinned_user_post"] == null + ? [] + : List.from( + json["pinned_user_post"]!.map((x) => PinnedPost.fromJson(x))), + // pinnedTagsPost: json["pinned_tags_post"] == null ? [] : List.from(json["pinned_tags_post"]!.map((x) => PinnedPost.fromJson(x))), + pinnedTagsPost: json["pinned_tags_post"] == null + ? [] + : + List.from( + json["pinned_tags_post"]!.map((x) => PinnedPost.fromJson(x))), + // List.from(json["pinned_tags_post"]! + // .expand((x) => x as List) + // .map((x) => PinnedPost.fromJson(x))), + ); + } +} + +class PinnedPost { + PinnedPost({ + required this.id, + required this.likecount, + required this.isISaved, + required this.tagsXid, + required this.isILiked, + required this.totalComment, + required this.totalSave, + required this.iamPrincipalXid, + required this.postIn, + required this.caption, + required this.image, + required this.manageTagsXids, + required this.postAs, + required this.ctaTitle, + required this.ctaLink, + required this.createdAt, + required this.likeIcon, + required this.totalViewCount, + required this.totalReactionCount, + required this.totalCommentCount, + required this.totalImpressionCount, + required this.totalPopularScore, + required this.totalHoursAgo, + required this.iamPrincipal, + required this.community, + required this.attachTags, + }); + + final int? id; + final int? likecount; + final bool? isISaved; + final List tagsXid; + final bool? isILiked; + final int? totalComment; + final int? totalSave; + final int? iamPrincipalXid; + final int? postIn; + final String? caption; + final String? image; + final String? manageTagsXids; + final String? postAs; + final String? ctaTitle; + final String? ctaLink; + final DateTime? createdAt; + final LikeIcon? likeIcon; + final int? totalViewCount; + final int? totalReactionCount; + final int? totalCommentCount; + final int? totalImpressionCount; + final int? totalPopularScore; + final int? totalHoursAgo; + final IamPrincipal? iamPrincipal; + final Community? community; + final List attachTags; + + factory PinnedPost.fromJson(Map json){ + return PinnedPost( + id: json["id"], + likecount: json["likecount"], + isISaved: json["is_i_saved"], + tagsXid: json["tags_xid"] == null ? [] : List.from(json["tags_xid"]!.map((x) => x)), + isILiked: json["is_i_liked"], + totalComment: json["total_comment"], + totalSave: json["total_save"], + iamPrincipalXid: json["iam_principal_xid"], + postIn: json["post_in"], + caption: json["caption"], + image: json["image"], + manageTagsXids: json["manage_tags_xids"], + postAs: json["post_as"], + ctaTitle: json["cta_title"], + ctaLink: json["cta_link"], + createdAt: DateTime.tryParse(json["created_at"] ?? ""), + likeIcon: json["likeIcon"] == null ? null : LikeIcon.fromJson(json["likeIcon"]), + totalViewCount: json["totalViewCount"], + totalReactionCount: json["totalReactionCount"], + totalCommentCount: json["totalCommentCount"], + totalImpressionCount: json["totalImpressionCount"], + totalPopularScore: json["totalPopularScore"], + totalHoursAgo: json["totalHoursAgo"], + iamPrincipal: json["iam_principal"] == null ? null : IamPrincipal.fromJson(json["iam_principal"]), + community: json["community"] == null ? null : Community.fromJson(json["community"]), + attachTags: json["attach_tags"] == null ? [] : List.from(json["attach_tags"]!.map((x) => AttachTag.fromJson(x))), + ); + } + +} + +class AttachTag { + AttachTag({ + required this.managePostXid, + required this.manageTagXid, + required this.manageTag, + }); + + final int? managePostXid; + final int? manageTagXid; + final ManageTag? manageTag; + + factory AttachTag.fromJson(Map json){ + return AttachTag( + managePostXid: json["manage_post_xid"], + manageTagXid: json["manage_tag_xid"], + manageTag: json["manage_tag"] == null ? null : ManageTag.fromJson(json["manage_tag"]), + ); + } + +} + +class ManageTag { + ManageTag({ + required this.id, + required this.isPinned, + required this.name, + }); + + final int? id; + final bool? isPinned; + final String? name; + + factory ManageTag.fromJson(Map json){ + return ManageTag( + id: json["id"], + isPinned: json["is_pinned"], + name: json["name"], + ); + } + +} + +class Community { + Community({ + required this.id, + required this.communityProfilePhoto, + required this.communityName, + }); + + final int? id; + final String? communityProfilePhoto; + final String? communityName; + + factory Community.fromJson(Map json){ + return Community( + id: json["id"], + communityProfilePhoto: json["community_profile_photo"], + communityName: json["community_name"], + ); + } + +} + +class IamPrincipal { + IamPrincipal({ + required this.id, + required this.isUserPinned, + required this.principalTypeXid, + required this.userName, + required this.fullName, + required this.profilePhoto, + }); + + final int? id; + final bool? isUserPinned; + final int? principalTypeXid; + final String? userName; + final String? fullName; + final String? profilePhoto; + + factory IamPrincipal.fromJson(Map json){ + return IamPrincipal( + id: json["id"], + isUserPinned: json["is_user_pinned"], + principalTypeXid: json["principal_type_xid"], + userName: json["user_name"], + fullName: json["full_name"], + profilePhoto: json["profile_photo"], + ); + } + +} + +class LikeIcon { + LikeIcon({ + required this.likeIconsXid, + required this.likeIcon, + }); + + final int? likeIconsXid; + final LikeIconClass? likeIcon; + + factory LikeIcon.fromJson(Map json){ + return LikeIcon( + likeIconsXid: json["like_icons_xid"], + likeIcon: json["like_icon"] == null ? null : LikeIconClass.fromJson(json["like_icon"]), + ); + } + +} + +class LikeIconClass { + LikeIconClass({ + required this.id, + required this.image, + }); + + final int? id; + final String? image; + + factory LikeIconClass.fromJson(Map json){ + return LikeIconClass( + id: json["id"], + image: json["image"], + ); + } + +} + diff --git a/lib/Main_Screens/Community/Model/LatestPostModel.dart b/lib/Main_Screens/Community/Model/LatestPostModel.dart new file mode 100644 index 0000000..0d8546a --- /dev/null +++ b/lib/Main_Screens/Community/Model/LatestPostModel.dart @@ -0,0 +1,242 @@ +class LatestpostModel { + LatestpostModel({ + required this.status, + required this.statusCode, + required this.message, + required this.data, + }); + + final String? status; + final int? statusCode; + final String? message; + final List data; + + factory LatestpostModel.fromJson(Map json){ + return LatestpostModel( + status: json["status"], + statusCode: json["status_code"], + message: json["message"], + data: json["data"] == null ? [] : List.from(json["data"]!.map((x) => Datum.fromJson(x))), + ); + } + +} + +class Datum { + Datum({ + required this.id, + required this.likecount, + required this.isISaved, + required this.tagsXid, + required this.isILiked, + required this.totalComment, + required this.totalSave, + required this.iamPrincipalXid, + required this.postIn, + required this.caption, + required this.image, + required this.manageTagsXids, + required this.postAs, + required this.ctaTitle, + required this.ctaLink, + required this.createdAt, + required this.likeIcon, + required this.totalViewCount, + required this.totalReactionCount, + required this.totalCommentCount, + required this.totalImpressionCount, + required this.totalPopularScore, + required this.totalHoursAgo, + required this.iamPrincipal, + required this.community, + required this.attachTags, + }); + + final int? id; + final int? likecount; + final bool? isISaved; + final List tagsXid; + final bool? isILiked; + final int? totalComment; + final int? totalSave; + final int? iamPrincipalXid; + final int? postIn; + final String? caption; + final String? image; + final String? manageTagsXids; + final String? postAs; + final String? ctaTitle; + final String? ctaLink; + final DateTime? createdAt; + final LikeIcon? likeIcon; + final int? totalViewCount; + final int? totalReactionCount; + final int? totalCommentCount; + final int? totalImpressionCount; + final int? totalPopularScore; + final int? totalHoursAgo; + final IamPrincipal? iamPrincipal; + final Community? community; + final List attachTags; + + factory Datum.fromJson(Map json){ + return Datum( + id: json["id"], + likecount: json["likecount"], + isISaved: json["is_i_saved"], + tagsXid: json["tags_xid"] == null ? [] : List.from(json["tags_xid"]!.map((x) => x)), + isILiked: json["is_i_liked"], + totalComment: json["total_comment"], + totalSave: json["total_save"], + iamPrincipalXid: json["iam_principal_xid"], + postIn: json["post_in"], + caption: json["caption"], + image: json["image"], + manageTagsXids: json["manage_tags_xids"], + postAs: json["post_as"], + ctaTitle: json["cta_title"], + ctaLink: json["cta_link"], + createdAt: DateTime.tryParse(json["created_at"] ?? ""), + likeIcon: json["likeIcon"] == null ? null : LikeIcon.fromJson(json["likeIcon"]), + totalViewCount: json["totalViewCount"], + totalReactionCount: json["totalReactionCount"], + totalCommentCount: json["totalCommentCount"], + totalImpressionCount: json["totalImpressionCount"], + totalPopularScore: json["totalPopularScore"], + totalHoursAgo: json["totalHoursAgo"], + iamPrincipal: json["iam_principal"] == null ? null : IamPrincipal.fromJson(json["iam_principal"]), + community: json["community"] == null ? null : Community.fromJson(json["community"]), + attachTags: json["attach_tags"] == null ? [] : List.from(json["attach_tags"]!.map((x) => AttachTag.fromJson(x))), + ); + } + +} + +class AttachTag { + AttachTag({ + required this.managePostXid, + required this.manageTagXid, + required this.manageTag, + }); + + final int? managePostXid; + final int? manageTagXid; + final ManageTag? manageTag; + + factory AttachTag.fromJson(Map json){ + return AttachTag( + managePostXid: json["manage_post_xid"], + manageTagXid: json["manage_tag_xid"], + manageTag: json["manage_tag"] == null ? null : ManageTag.fromJson(json["manage_tag"]), + ); + } + +} + +class ManageTag { + ManageTag({ + required this.id, + required this.isPinned, + required this.name, + }); + + final int? id; + final bool? isPinned; + final String? name; + + factory ManageTag.fromJson(Map json){ + return ManageTag( + id: json["id"], + isPinned: json["is_pinned"], + name: json["name"], + ); + } + +} + +class Community { + Community({ + required this.id, + required this.communityProfilePhoto, + required this.communityName, + }); + + final int? id; + final String? communityProfilePhoto; + final String? communityName; + + factory Community.fromJson(Map json){ + return Community( + id: json["id"], + communityProfilePhoto: json["community_profile_photo"], + communityName: json["community_name"], + ); + } + +} + +class IamPrincipal { + IamPrincipal({ + required this.id, + required this.isUserPinned, + required this.principalTypeXid, + required this.userName, + required this.fullName, + required this.profilePhoto, + }); + + final int? id; + final bool? isUserPinned; + final int? principalTypeXid; + final String? userName; + final String? fullName; + final String? profilePhoto; + + factory IamPrincipal.fromJson(Map json){ + return IamPrincipal( + id: json["id"], + isUserPinned: json["is_user_pinned"], + principalTypeXid: json["principal_type_xid"], + userName: json["user_name"], + fullName: json["full_name"], + profilePhoto: json["profile_photo"], + ); + } + +} + +class LikeIcon { + LikeIcon({ + required this.likeIconsXid, + required this.likeIcon, + }); + + final int? likeIconsXid; + final LikeIconClass? likeIcon; + + factory LikeIcon.fromJson(Map json){ + return LikeIcon( + likeIconsXid: json["like_icons_xid"], + likeIcon: json["like_icon"] == null ? null : LikeIconClass.fromJson(json["like_icon"]), + ); + } + +} + +class LikeIconClass { + LikeIconClass({ + required this.id, + required this.image, + }); + + final int? id; + final String? image; + + factory LikeIconClass.fromJson(Map json){ + return LikeIconClass( + id: json["id"], + image: json["image"], + ); + } + +} diff --git a/lib/Main_Screens/Community/Model/PopularPostModel.dart b/lib/Main_Screens/Community/Model/PopularPostModel.dart new file mode 100644 index 0000000..4a786f8 --- /dev/null +++ b/lib/Main_Screens/Community/Model/PopularPostModel.dart @@ -0,0 +1,242 @@ +class PopularpostModel { + PopularpostModel({ + required this.status, + required this.statusCode, + required this.message, + required this.data, + }); + + final String? status; + final int? statusCode; + final String? message; + final List data; + + factory PopularpostModel.fromJson(Map json){ + return PopularpostModel( + status: json["status"], + statusCode: json["status_code"], + message: json["message"], + data: json["data"] == null ? [] : List.from(json["data"]!.map((x) => Datum.fromJson(x))), + ); + } + +} + +class Datum { + Datum({ + required this.id, + required this.likecount, + required this.isISaved, + required this.tagsXid, + required this.isILiked, + required this.totalComment, + required this.totalSave, + required this.iamPrincipalXid, + required this.postIn, + required this.caption, + required this.image, + required this.manageTagsXids, + required this.postAs, + required this.ctaTitle, + required this.ctaLink, + required this.createdAt, + required this.likeIcon, + required this.totalViewCount, + required this.totalReactionCount, + required this.totalCommentCount, + required this.totalImpressionCount, + required this.totalPopularScore, + required this.totalHoursAgo, + required this.iamPrincipal, + required this.community, + required this.attachTags, + }); + + final int? id; + final int? likecount; + final bool? isISaved; + final List tagsXid; + final bool? isILiked; + final int? totalComment; + final int? totalSave; + final int? iamPrincipalXid; + final int? postIn; + final String? caption; + final String? image; + final String? manageTagsXids; + final String? postAs; + final String? ctaTitle; + final String? ctaLink; + final DateTime? createdAt; + final LikeIcon? likeIcon; + final int? totalViewCount; + final int? totalReactionCount; + final int? totalCommentCount; + final int? totalImpressionCount; + final int? totalPopularScore; + final int? totalHoursAgo; + final IamPrincipal? iamPrincipal; + final Community? community; + final List attachTags; + + factory Datum.fromJson(Map json){ + return Datum( + id: json["id"], + likecount: json["likecount"], + isISaved: json["is_i_saved"], + tagsXid: json["tags_xid"] == null ? [] : List.from(json["tags_xid"]!.map((x) => x)), + isILiked: json["is_i_liked"], + totalComment: json["total_comment"], + totalSave: json["total_save"], + iamPrincipalXid: json["iam_principal_xid"], + postIn: json["post_in"], + caption: json["caption"], + image: json["image"], + manageTagsXids: json["manage_tags_xids"], + postAs: json["post_as"], + ctaTitle: json["cta_title"], + ctaLink: json["cta_link"], + createdAt: DateTime.tryParse(json["created_at"] ?? ""), + likeIcon: json["likeIcon"] == null ? null : LikeIcon.fromJson(json["likeIcon"]), + totalViewCount: json["totalViewCount"], + totalReactionCount: json["totalReactionCount"], + totalCommentCount: json["totalCommentCount"], + totalImpressionCount: json["totalImpressionCount"], + totalPopularScore: json["totalPopularScore"], + totalHoursAgo: json["totalHoursAgo"], + iamPrincipal: json["iam_principal"] == null ? null : IamPrincipal.fromJson(json["iam_principal"]), + community: json["community"] == null ? null : Community.fromJson(json["community"]), + attachTags: json["attach_tags"] == null ? [] : List.from(json["attach_tags"]!.map((x) => AttachTag.fromJson(x))), + ); + } + +} + +class AttachTag { + AttachTag({ + required this.managePostXid, + required this.manageTagXid, + required this.manageTag, + }); + + final int? managePostXid; + final int? manageTagXid; + final ManageTagPopular? manageTag; + + factory AttachTag.fromJson(Map json){ + return AttachTag( + managePostXid: json["manage_post_xid"], + manageTagXid: json["manage_tag_xid"], + manageTag: json["manage_tag"] == null ? null : ManageTagPopular.fromJson(json["manage_tag"]), + ); + } + +} + +class ManageTagPopular { + ManageTagPopular({ + required this.id, + required this.isPinned, + required this.name, + }); + + final int? id; + final bool? isPinned; + final String? name; + + factory ManageTagPopular.fromJson(Map json){ + return ManageTagPopular( + id: json["id"], + isPinned: json["is_pinned"], + name: json["name"], + ); + } + +} + +class Community { + Community({ + required this.id, + required this.communityProfilePhoto, + required this.communityName, + }); + + final int? id; + final String? communityProfilePhoto; + final String? communityName; + + factory Community.fromJson(Map json){ + return Community( + id: json["id"], + communityProfilePhoto: json["community_profile_photo"], + communityName: json["community_name"], + ); + } + +} + +class IamPrincipal { + IamPrincipal({ + required this.id, + required this.isUserPinned, + required this.principalTypeXid, + required this.userName, + required this.fullName, + required this.profilePhoto, + }); + + final int? id; + final bool? isUserPinned; + final int? principalTypeXid; + final String? userName; + final String? fullName; + final String? profilePhoto; + + factory IamPrincipal.fromJson(Map json){ + return IamPrincipal( + id: json["id"], + isUserPinned: json["is_user_pinned"], + principalTypeXid: json["principal_type_xid"], + userName: json["user_name"], + fullName: json["full_name"], + profilePhoto: json["profile_photo"], + ); + } + +} + +class LikeIcon { + LikeIcon({ + required this.likeIconsXid, + required this.likeIcon, + }); + + final int? likeIconsXid; + final LikeIconClass? likeIcon; + + factory LikeIcon.fromJson(Map json){ + return LikeIcon( + likeIconsXid: json["like_icons_xid"], + likeIcon: json["like_icon"] == null ? null : LikeIconClass.fromJson(json["like_icon"]), + ); + } + +} + +class LikeIconClass { + LikeIconClass({ + required this.id, + required this.image, + }); + + final int? id; + final String? image; + + factory LikeIconClass.fromJson(Map json){ + return LikeIconClass( + id: json["id"], + image: json["image"], + ); + } + +} diff --git a/lib/Main_Screens/Community/Model/fetchicons.dart b/lib/Main_Screens/Community/Model/fetchicons.dart new file mode 100644 index 0000000..85d88a7 --- /dev/null +++ b/lib/Main_Screens/Community/Model/fetchicons.dart @@ -0,0 +1,64 @@ +class FetchlikeIconsModel { + String? status; + int? statusCode; + String? message; + List? data; + + FetchlikeIconsModel({this.status, this.statusCode, this.message, this.data}); + + FetchlikeIconsModel.fromJson(Map json) { + status = json['status']; + statusCode = json['status_code']; + message = json['message']; + if (json['data'] != null) { + data = []; + json['data'].forEach((v) { + data!.add(ReactionData.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = {}; + data['status'] = status; + data['status_code'] = statusCode; + data['message'] = message; + if (this.data != null) { + data['data'] = this.data!.map((v) => v.toJson()).toList(); + } + return data; + } +} + +class ReactionData { + int? id; + String image = ""; + + ReactionData({this.id, required this.image}); + + ReactionData.fromJson(Map json) { + id = json['id']; + image = json['image']; + } + + Map toJson() { + final Map data = {}; + data['id'] = id; + data['image'] = image; + return data; + } +} + +// class ReactionData { +// final int id; +// final String image; + +// ReactionData({required this.id, required this.image}); + +// factory ReactionData.fromJson(Map json) { +// return ReactionData( +// id: json['id'], +// image: json['image'], +// ); +// } +// } diff --git a/lib/Feed Module/sidemenu/view_model/postmethod.dart b/lib/Main_Screens/Community/View/CommunityDetail.dart similarity index 100% rename from lib/Feed Module/sidemenu/view_model/postmethod.dart rename to lib/Main_Screens/Community/View/CommunityDetail.dart diff --git a/lib/Main_Screens/Community/ViewModel/FeedPost.dart b/lib/Main_Screens/Community/ViewModel/FeedPost.dart new file mode 100644 index 0000000..6bfe4ee --- /dev/null +++ b/lib/Main_Screens/Community/ViewModel/FeedPost.dart @@ -0,0 +1,34 @@ +// ignore_for_file: file_names + +import 'package:regroup/Common/api_urls.dart'; +import 'package:regroup/Common/base_manager.dart'; +import 'package:regroup/Common/controller/data/network/network_api.dart'; +import 'package:regroup/Main_Screens/Community/Model/FeedPostModel.dart'; + +FeedPostModel? feedpostobj; + +class FeedpostApi { + FeedpostApi(); + + Future> getFeedPostApi() async { + final response = await NetworkApiServices().getApi(ApiUrls.getfeedpost); + + if (response.status == ResponseStatus.SUCCESS) { + + // dynamic responseData = response.data; + + if (response.data["status"] == "success") { + feedpostobj = FeedPostModel.fromJson(response.data); + } + // if (responseData is Map) { + // feedpostobj = FeedPostModel.fromJson(responseData); + // } + return ResponseData( + response.data['message'], ResponseStatus.SUCCESS, + data: response.data); + } else { + return ResponseData( + response.data['message'], ResponseStatus.FAILED); + } + } +} diff --git a/lib/Main_Screens/Community/ViewModel/LatestPost.dart b/lib/Main_Screens/Community/ViewModel/LatestPost.dart new file mode 100644 index 0000000..f536630 --- /dev/null +++ b/lib/Main_Screens/Community/ViewModel/LatestPost.dart @@ -0,0 +1,26 @@ +import 'package:regroup/Common/api_urls.dart'; +import 'package:regroup/Common/base_manager.dart'; +import 'package:regroup/Common/controller/data/network/network_api.dart'; +import 'package:regroup/Main_Screens/Community/Model/LatestPostModel.dart'; + +LatestpostModel? latestpostobj; + +class LatespostApi { + LatespostApi(); + + Future> getLatestPostApi() async { + final response = await NetworkApiServices().getApi(ApiUrls.getlatestpost); + + if (response.status == ResponseStatus.SUCCESS) { + if (response.data["status"] == "success") { + latestpostobj = LatestpostModel.fromJson(response.data); + } + return ResponseData( + response.data['message'], ResponseStatus.SUCCESS, + data: response.data); + } else { + return ResponseData( + response.data['message'], ResponseStatus.FAILED); + } + } +} \ No newline at end of file diff --git a/lib/Main_Screens/Community/ViewModel/PopularPost.dart b/lib/Main_Screens/Community/ViewModel/PopularPost.dart new file mode 100644 index 0000000..71d5e9b --- /dev/null +++ b/lib/Main_Screens/Community/ViewModel/PopularPost.dart @@ -0,0 +1,26 @@ +import 'package:regroup/Common/api_urls.dart'; +import 'package:regroup/Common/base_manager.dart'; +import 'package:regroup/Common/controller/data/network/network_api.dart'; +import 'package:regroup/Main_Screens/Community/Model/PopularPostModel.dart'; + +PopularpostModel? popularpostobj; + +class PopularpostApi{ + PopularpostApi(); + + Future> getPopularPostApi() async { + final response = await NetworkApiServices().getApi(ApiUrls.getpopularpost); + + if (response.status == ResponseStatus.SUCCESS) { + if (response.data["status"] == "success") { + popularpostobj = PopularpostModel.fromJson(response.data); + } + return ResponseData( + response.data['message'], ResponseStatus.SUCCESS, + data: response.data); + } else { + return ResponseData( + response.data['message'], ResponseStatus.FAILED); + } + } +} \ No newline at end of file diff --git a/lib/Main_Screens/Community/ViewModel/getmethod.dart b/lib/Main_Screens/Community/ViewModel/getmethod.dart new file mode 100644 index 0000000..9804178 --- /dev/null +++ b/lib/Main_Screens/Community/ViewModel/getmethod.dart @@ -0,0 +1,22 @@ + + +import 'package:regroup/Common/api_urls.dart'; +import 'package:regroup/Common/base_manager.dart'; +import 'package:regroup/Common/controller/data/network/network_api.dart'; +import 'package:regroup/Main_Screens/Community/Model/fetchicons.dart'; + +FetchlikeIconsModel? fetchlikeIconsModel; + +class Communityallgetmethod { + Future> getLikeicons() async { + final response = await NetworkApiServices().getApi( + ApiUrls.getLikeicons, + // optionalpar: false + ); + if (response.status == ResponseStatus.SUCCESS) { + fetchlikeIconsModel = FetchlikeIconsModel.fromJson(response.data); + // log(likeiconsobj!.data.toString()); + } + return response; + } +} diff --git a/lib/Main_Screens/Community/ViewModel/postmethod.dart b/lib/Main_Screens/Community/ViewModel/postmethod.dart new file mode 100644 index 0000000..5b65cf6 --- /dev/null +++ b/lib/Main_Screens/Community/ViewModel/postmethod.dart @@ -0,0 +1,15 @@ +import 'package:regroup/Common/api_urls.dart'; +import 'package:regroup/Common/base_manager.dart'; +import 'package:regroup/Common/controller/data/network/network_api.dart'; + +class CommunitypostMethod { +CommunitypostMethod(); + + Future> postLikepost(updata) async { + final response = await NetworkApiServices().postApi( + updata, + ApiUrls.postLike, + ); + return response; + } +} \ No newline at end of file diff --git a/lib/Main_Screens/Community_HomePage/Community.dart b/lib/Main_Screens/Community_HomePage/Community.dart new file mode 100644 index 0000000..e8c6445 --- /dev/null +++ b/lib/Main_Screens/Community_HomePage/Community.dart @@ -0,0 +1,911 @@ +// ignore_for_file: unused_local_variable, non_constant_identifier_names, avoid_print, file_names + +import 'dart:developer'; + +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:regroup/Common/CommonBottomNavigationBar.dart'; +import 'package:regroup/Common/CommonGlassmorphism.dart'; +import 'package:regroup/Common/CommonTabBar.dart'; +import 'package:regroup/Common/ConvertServerDateToUserDate.dart'; +import 'package:regroup/Common/controller/NormalPostCard.dart'; +import 'package:regroup/Common/controller/MainScreen.dart'; +import 'package:regroup/Main_Screens/Community/Model/CommonDatumObjModel.dart'; +import 'package:regroup/Main_Screens/Community/Model/FeedPostModel.dart' + as feedobj; +// import 'package:regroup/Main_Screens/Community/Model/PopularPostModel.dart'; +// import 'package:regroup/Main_Screens/Community/Model/LatestPostModel.dart' as latest; +import 'package:regroup/Main_Screens/Community/Model/fetchicons.dart'; +import 'package:regroup/Main_Screens/Community/ViewModel/FeedPost.dart'; +import 'package:regroup/Main_Screens/Community/ViewModel/LatestPost.dart'; +import 'package:regroup/Main_Screens/Community/ViewModel/PopularPost.dart'; +import 'package:regroup/Main_Screens/Community/ViewModel/getmethod.dart'; +import 'package:regroup/Main_Screens/Community_HomePage/PostDetailScreen/View/ReactionView.dart'; +import 'package:regroup/Utils/Common/ShimmerCommon.dart'; +// import 'package:regroup/Feed%20Module/sidemenu/sidemenu.dart'; +import 'package:regroup/Utils/Common/sized_box.dart'; +import 'package:regroup/Utils/texts.dart'; +import 'package:regroup/resources/routes/route_name.dart'; +import 'package:regroup/sidemenu/sidemenu.dart'; + +import 'view_model/CountersHelper.dart'; + +class CommunityScreen extends StatefulWidget { + const CommunityScreen({super.key}); + + @override + State createState() => _CommunityScreenState(); +} + +class _CommunityScreenState extends State { + final GlobalKey _scaffoldKey1 = GlobalKey(); + final CountersHelper countersHelper = Get.put(CountersHelper()); + @override + Widget build(BuildContext context) { + return Scaffold( + resizeToAvoidBottomInset: false, + key: _scaffoldKey1, + backgroundColor: const Color(0xFF222935), + drawer: SizedBox(width: 300.w, child: const SideMenu()), + extendBody: true, + appBar: AppBar( + scrolledUnderElevation: 0.0, + backgroundColor: const Color(0xff222935), + elevation: 0, + automaticallyImplyLeading: false, + titleSpacing: 0, + leading: InkWell( + onTap: () { + _scaffoldKey1.currentState?.openDrawer(); + }, + child: Center( + child: Image.asset( + 'assets/images/png/menu.png', + height: 15.h, + width: 20.w, + ), + ), + ), + title: Image.asset( + 'assets/images/png/Group.png', + width: 26.w, + height: 25.h, + ), + actions: [ + GestureDetector( + onTap: () { + Get.toNamed(RouteName.explorescreen); + }, + child: Image.asset( + 'assets/images/png/ion_search-outline.png', + height: 25.h, + width: 25.w, + ), + ), + sizedBoxWidth(10.w), + GestureDetector( + onTap: () { + Get.toNamed(RouteName.notificaationpage); + }, + child: Image.asset( + 'assets/images/png/Frame 9.png', + height: 25.h, + width: 25.w, + ), + ), + sizedBoxWidth(16.w), + ], + ), + body: Stack(clipBehavior: Clip.none, children: [ + Container( + decoration: const BoxDecoration( + image: DecorationImage( + fit: BoxFit.fill, + image: AssetImage( + 'assets/images/png/HomeScreenBackground.png', + ))), + ), + Padding( + padding: const EdgeInsets.symmetric(vertical: 16), + child: Column(children: [ + Expanded( + child: DefaultTabController( + length: 3, + child: Column( + children: [ + const CommonTabBar(tabs: [ + Tab( + text: 'Feed', + ), + Tab( + text: 'Popular', + ), + Tab( + text: 'Latest', + ), + ]), + const Expanded( + child: TabBarView( + children: [ + FeedTab(), + PopularTab(), + LatestTab(), + ], + ), + ), + sizedBoxHeight(90.h) + ], + ), + ), + ), + ])) + ]), + floatingActionButton: Container( + height: 40.h, + width: 164.w, + decoration: BoxDecoration( + // shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(30.r), + boxShadow: const [ + BoxShadow( + color: Color(0x40000000), + offset: Offset(0, 6), + blurRadius: 8, + ), + ], + ), + child: FloatingActionButton( + onPressed: () { + Get.toNamed(RouteName.postscreen); + }, + backgroundColor: const Color(0xFFD90B2E), + autofocus: true, + // shape: const OvalBorder(), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(30.r), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + // SvgPicture.asset('assets/images/svg/add 1.svg'), + Image.asset('assets/images/png/add 1.png'), + sizedBoxWidth(4.w), + text16400white('Create posts') + ], + ) + // Image.asset( + // "assets/images/png/iconamoon_edit-thin.png", + // height: 30.h, + // width: 30.w, + // ), + ), + ), + bottomNavigationBar: bottomnavigationbar(mainController), + ); + } +} + +class FeedTab extends StatefulWidget { + const FeedTab({super.key}); + + @override + State createState() => _FeedTabState(); +} + +class _FeedTabState extends State { + late Future feedfuture; + List _reactions = []; + final Map _selectedReactions = {}; + final CountersHelper countersHelper = Get.find(); + int? likeIconIdnew; + List combinedList = []; + @override + void initState() { + feedfuture = FeedpostApi().getFeedPostApi(); + + super.initState(); + } + + _fetchIcons() { + _reactions = fetchlikeIconsModel!.data ?? []; + for (var post in commonobjmodel!.data) { + //Check if post as a like icon + if (post.likeIcon?.likeIcon?.id != null) { + likeIconIdnew = post.likeIcon!.likeIconsXid; + + final selectedReaction = _reactions.firstWhere( + (r) => r.id == likeIconIdnew, + orElse: () => _reactions.first, + ); + + _selectedReactions[post.id!] = + selectedReaction; // Set selected reaction for this post + } else { + _selectedReactions[post.id!] = null; // No reaction selected + print('No reaction selected for post $postId'); + } + } + } + + Future setValues() async { + if (mounted) { + combinedList.clear(); + combinedListGlobal.clear(); + combinedList.addAll(feedpostobj!.data!.pinnedCommunityPost); + combinedList.addAll(feedpostobj!.data!.pinnedUserPost); + combinedList.addAll(feedpostobj!.data!.pinnedTagsPost); + combinedListGlobal.addAll(combinedList); + _setModel(); + countersHelper.setListsPopular(); + await _fetchIcons(); + } + } + + _sortTags(index) { + var tags = commonobjmodel!.data[index].attachTags + .where((tag) => tag.manageTag?.name?.isNotEmpty ?? false) + .map((tag) => tag.manageTag!) + .toList(); + + return tags; + } + + _setModel() { + commonobjmodel = null; + commonobjmodel = CommonDatumObjModel( + status: feedpostobj!.status, + statusCode: feedpostobj!.statusCode, + message: feedpostobj!.message, + data: combinedList + .map((e) => CommonDatumObjModelData( + id: e.id, + likecount: e.likecount, + isISaved: e.isISaved, + tagsXid: e.tagsXid, + isILiked: e.isILiked, + totalComment: e.totalComment, + totalSave: e.totalSave, + iamPrincipalXid: e.iamPrincipalXid, + postIn: e.postIn, + caption: e.caption, + image: e.image, + manageTagsXids: e.manageTagsXids, + postAs: e.postAs, + ctaTitle: e.ctaTitle, + ctaLink: e.ctaLink, + createdAt: e.createdAt, + likeIcon: LikeIcon1( + likeIcon: LikeIconClass1( + id: e.likeIcon?.likeIcon?.id, + image: e.likeIcon?.likeIcon?.image), + likeIconsXid: e.likeIcon?.likeIconsXid, + ), + totalViewCount: e.totalViewCount, + totalReactionCount: e.totalReactionCount, + totalCommentCount: e.totalCommentCount, + totalImpressionCount: e.totalImpressionCount, + totalPopularScore: e.totalPopularScore, + totalHoursAgo: e.totalHoursAgo, + iamPrincipal: IamPrincipal( + id: e.iamPrincipal!.id, + isUserPinned: e.iamPrincipal!.isUserPinned, + principalTypeXid: e.iamPrincipal!.principalTypeXid, + userName: e.iamPrincipal!.userName, + fullName: e.iamPrincipal!.fullName, + profilePhoto: e.iamPrincipal!.profilePhoto), + community: Community( + id: e.community!.id, + communityProfilePhoto: e.community!.communityProfilePhoto, + communityName: e.community!.communityName), + attachTags: e.attachTags + .map((e) => AttachTag1( + managePostXid: e.managePostXid, + manageTagXid: e.manageTagXid, + manageTag: ManageTagPopular( + id: e.manageTag?.id, + isPinned: e.manageTag?.isPinned, + name: e.manageTag?.name))) + .toList())) + .toList()); + } + + @override + Widget build(BuildContext context) { + return Obx( + () => countersHelper.updateFeedsPage.value + ? FutureBuilder( + future: FeedpostApi().getFeedPostApi(), + builder: (ctx, snapshot) { + if (snapshot.connectionState == ConnectionState.waiting) { + return const Center(child: ShimmerCommon()); + } + + if (snapshot.hasError) { + return Center( + child: Text( + '${snapshot.error} occurred', + style: TextStyle(fontSize: 18.spMin), + ), + ); + } + + if (snapshot.connectionState == ConnectionState.done && + snapshot.hasData) { + setValues(); + return Stack( + clipBehavior: Clip.none, + children: [ + Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage( + "assets/images/png/Ellipse 1496.png"), + fit: BoxFit.fill), + ), + ), + combinedList.isEmpty + ? Center( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + "No posts are currently pinned", + style: TextStyle( + color: Colors.white, + fontSize: 16.sp, + fontWeight: FontWeight.w600), + ) + ], + ), + ) + : Column( + children: [ + sizedBoxHeight(20.h), + Expanded( + child: ListView.builder( + shrinkWrap: true, + itemCount: commonobjmodel!.data.length, + itemBuilder: (context, index) { + var timeAgo = ConvertServerDateToUserDate() + .convertServerDateToReadableFormate( + commonobjmodel! + .data[index].createdAt + .toString()); + + return Column( + children: [ + NormalCardTile( + tags: _sortTags(index), + createAt: timeAgo ?? '1 hour', + commonObj: + commonobjmodel!.data[index], + forWhichTab: 'feed', + reactions: _reactions, + selectedReactions: + _selectedReactions, + currentIndex: index, + ), + sizedBoxHeight(20.h) + ], + ); + }, + ), + ), + ], + ) + ], + ); + } + return Container(); + }, + ) + : FutureBuilder( + future: FeedpostApi().getFeedPostApi(), + builder: (ctx, snapshot) { + if (snapshot.connectionState == ConnectionState.waiting) { + return const Center(child: ShimmerCommon()); + } + + if (snapshot.hasError) { + return Center( + child: Text( + '${snapshot.error} occurred', + style: TextStyle(fontSize: 18.spMin), + ), + ); + } + + if (snapshot.connectionState == ConnectionState.done && + snapshot.hasData) { + setValues(); + return Stack( + clipBehavior: Clip.none, + children: [ + Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage( + "assets/images/png/Ellipse 1496.png"), + fit: BoxFit.fill), + ), + ), + combinedList.isEmpty + ? Center( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + "No posts are currently pinned", + style: TextStyle( + color: Colors.white, + fontSize: 16.sp, + fontWeight: FontWeight.w600), + ) + ], + ), + ) + : Column( + children: [ + sizedBoxHeight(20.h), + Expanded( + child: ListView.builder( + shrinkWrap: true, + itemCount: commonobjmodel!.data.length, + itemBuilder: (context, index) { + var timeAgo = ConvertServerDateToUserDate() + .convertServerDateToReadableFormate( + commonobjmodel! + .data[index].createdAt + .toString()); + + return Column( + children: [ + NormalCardTile( + tags: _sortTags(index), + createAt: timeAgo ?? '1 hour', + commonObj: + commonobjmodel!.data[index], + forWhichTab: 'feed', + reactions: _reactions, + selectedReactions: + _selectedReactions, + currentIndex: index, + ), + sizedBoxHeight(20.h) + ], + ); + }, + ), + ), + ], + ) + ], + ); + } + return Container(); + }, + ), + ); + } +} + +class PopularTab extends StatefulWidget { + const PopularTab({super.key}); + + @override + State createState() => _PopularTabState(); +} + +class _PopularTabState extends State { + List _reactions = []; + final Map _selectedReactions = {}; + final CountersHelper countersHelper = Get.find(); + int? likeIconIdnew; + @override + void initState() { + super.initState(); + } + + Future _fetchIcons() async { + _reactions = fetchlikeIconsModel!.data ?? []; + for (var post in commonobjmodel!.data) { + //Check if post as a like icon + if (post.likeIcon?.likeIcon?.id != null) { + likeIconIdnew = post.likeIcon!.likeIconsXid; + + final selectedReaction = _reactions.firstWhere( + (r) => r.id == likeIconIdnew, + orElse: () => _reactions.first, + ); + + _selectedReactions[post.id!] = + selectedReaction; // Set selected reaction for this post + } else { + _selectedReactions[post.id!] = null; // No reaction selected + print('No reaction selected for post $postId'); + } + } + } + + Future setValues() async { + if (mounted) { + _setModel(); + countersHelper.setListsPopular(); + await _fetchIcons(); + } + } + + Future _initialize() async { + //api call here + await PopularpostApi().getPopularPostApi(); + await setValues(); + } + + _sortTags(index) { + var tags = commonobjmodel!.data[index].attachTags + .where((tag) => tag.manageTag?.name?.isNotEmpty ?? false) + .map((tag) => tag.manageTag!) + .toList(); + + return tags; + } + + _setModel() { + commonobjmodel = null; + commonobjmodel = CommonDatumObjModel( + status: popularpostobj!.status, + statusCode: popularpostobj!.statusCode, + message: popularpostobj!.message, + data: popularpostobj!.data + .map((e) => CommonDatumObjModelData( + id: e.id, + likecount: e.likecount, + isISaved: e.isISaved, + tagsXid: e.tagsXid, + isILiked: e.isILiked, + totalComment: e.totalComment, + totalSave: e.totalSave, + iamPrincipalXid: e.iamPrincipalXid, + postIn: e.postIn, + caption: e.caption, + image: e.image, + manageTagsXids: e.manageTagsXids, + postAs: e.postAs, + ctaTitle: e.ctaTitle, + ctaLink: e.ctaLink, + createdAt: e.createdAt, + likeIcon: LikeIcon1( + likeIcon: LikeIconClass1( + id: e.likeIcon?.likeIcon?.id, + image: e.likeIcon?.likeIcon?.image), + likeIconsXid: e.likeIcon?.likeIconsXid, + ), + totalViewCount: e.totalViewCount, + totalReactionCount: e.totalReactionCount, + totalCommentCount: e.totalCommentCount, + totalImpressionCount: e.totalImpressionCount, + totalPopularScore: e.totalPopularScore, + totalHoursAgo: e.totalHoursAgo, + iamPrincipal: IamPrincipal( + id: e.iamPrincipal!.id, + isUserPinned: e.iamPrincipal!.isUserPinned, + principalTypeXid: e.iamPrincipal!.principalTypeXid, + userName: e.iamPrincipal!.userName, + fullName: e.iamPrincipal!.fullName, + profilePhoto: e.iamPrincipal!.profilePhoto), + community: Community( + id: e.community!.id, + communityProfilePhoto: e.community!.communityProfilePhoto, + communityName: e.community!.communityName), + attachTags: e.attachTags + .map((e) => AttachTag1( + managePostXid: e.managePostXid, + manageTagXid: e.manageTagXid, + manageTag: ManageTagPopular( + id: e.manageTag?.id, + isPinned: e.manageTag?.isPinned, + name: e.manageTag?.name))) + .toList())) + .toList()); + } + + @override + Widget build(BuildContext context) { + return FutureBuilder( + future: _initialize(), + builder: (ctx, snapshot) { + if (snapshot.connectionState == ConnectionState.waiting) { + return const Center(child: ShimmerCommon()); + } + + if (snapshot.hasError) { + return Center( + child: Text( + '${snapshot.error} occurred', + style: TextStyle(fontSize: 18.spMin), + ), + ); + } + + if (snapshot.connectionState == ConnectionState.done) { + return Stack(clipBehavior: Clip.none, children: [ + Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage("assets/images/png/Ellipse 1496.png"), + fit: BoxFit.fill), + ), + ), + commonobjmodel!.data.isEmpty + ? Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Center( + child: Column( + children: [ + Text( + "No Posts Available", + style: TextStyle( + color: Colors.white, + fontSize: 16.sp, + fontWeight: FontWeight.w600), + ) + ], + ), + ), + ]) + : Column( + children: [ + sizedBoxHeight(20.h), + Expanded( + child: ListView.builder( + shrinkWrap: true, + itemCount: commonobjmodel!.data.length, + itemBuilder: (context, index) { + var timeAgo = ConvertServerDateToUserDate() + .convertServerDateToReadableFormate( + commonobjmodel!.data[index].createdAt + .toString()); + + return Column( + children: [ + NormalCardTile( + tags: _sortTags(index), + createAt: timeAgo ?? '1 hour', + commonObj: commonobjmodel!.data[index], + forWhichTab: 'popular', + reactions: _reactions, + selectedReactions: _selectedReactions, + currentIndex: index, + ), + sizedBoxHeight(20.h) + ], + ); + }, + ), + ), + ], + ) + ]); + } + return Container(); + }); + } +} + +class LatestTab extends StatefulWidget { + const LatestTab({super.key}); + + @override + State createState() => _LatestTabState(); +} + +class _LatestTabState extends State { + @override + void initState() { + super.initState(); + } + + List _reactions = []; + final Map _selectedReactions = {}; + final CountersHelper countersHelper = Get.find(); + + int? likeIconIdnew; + _fetchIcons() { + _reactions = fetchlikeIconsModel!.data ?? []; + for (var post in commonobjmodel!.data) { + //Check if post as a like icon + if (post.likeIcon?.likeIcon?.id != null) { + likeIconIdnew = post.likeIcon!.likeIconsXid; + + final selectedReaction = _reactions.firstWhere( + (r) => r.id == likeIconIdnew, + orElse: () => _reactions.first, + ); + + _selectedReactions[post.id!] = + selectedReaction; // Set selected reaction for this post + } else { + _selectedReactions[post.id!] = null; // No reaction selected + print('No reaction selected for post $postId'); + } + } + } + + bool _isDataInitialized = true; + + Future setValues() async { + if (_isDataInitialized) { + _setModel(); + countersHelper.setListsPopular(); + _fetchIcons(); + + _isDataInitialized = false; + } + } + + _sortTags(index) { + var tags = commonobjmodel!.data[index].attachTags + .where((tag) => tag.manageTag?.name?.isNotEmpty ?? false) + .map((tag) => tag.manageTag!) + .toList(); + + return tags; + } + + _setModel() { + commonobjmodel = null; + commonobjmodel = CommonDatumObjModel( + status: latestpostobj!.status, + statusCode: latestpostobj!.statusCode, + message: latestpostobj!.message, + data: latestpostobj!.data + .map((e) => CommonDatumObjModelData( + id: e.id, + likecount: e.likecount, + isISaved: e.isISaved, + tagsXid: e.tagsXid, + isILiked: e.isILiked, + totalComment: e.totalComment, + totalSave: e.totalSave, + iamPrincipalXid: e.iamPrincipalXid, + postIn: e.postIn, + caption: e.caption, + image: e.image, + manageTagsXids: e.manageTagsXids, + postAs: e.postAs, + ctaTitle: e.ctaTitle, + ctaLink: e.ctaLink, + createdAt: e.createdAt, + likeIcon: LikeIcon1( + likeIcon: LikeIconClass1( + id: e.likeIcon?.likeIcon?.id, + image: e.likeIcon?.likeIcon?.image), + likeIconsXid: e.likeIcon?.likeIconsXid, + ), + totalViewCount: e.totalViewCount, + totalReactionCount: e.totalReactionCount, + totalCommentCount: e.totalCommentCount, + totalImpressionCount: e.totalImpressionCount, + totalPopularScore: e.totalPopularScore, + totalHoursAgo: e.totalHoursAgo, + iamPrincipal: IamPrincipal( + id: e.iamPrincipal!.id, + isUserPinned: e.iamPrincipal!.isUserPinned, + principalTypeXid: e.iamPrincipal!.principalTypeXid, + userName: e.iamPrincipal!.userName, + fullName: e.iamPrincipal!.fullName, + profilePhoto: e.iamPrincipal!.profilePhoto), + community: Community( + id: e.community!.id, + communityProfilePhoto: e.community!.communityProfilePhoto, + communityName: e.community!.communityName), + attachTags: e.attachTags + .map((e) => AttachTag1( + managePostXid: e.managePostXid, + manageTagXid: e.manageTagXid, + manageTag: ManageTagPopular( + id: e.manageTag?.id, + isPinned: e.manageTag?.isPinned, + name: e.manageTag?.name))) + .toList())) + .toList()); + } + + Future _initialize() async { + //api call here + await LatespostApi().getLatestPostApi(); + await setValues(); + } + + @override + Widget build(BuildContext context) { + return FutureBuilder( + future: _initialize(), + builder: (ctx, snapshot) { + if (snapshot.connectionState == ConnectionState.waiting) { + return const Center(child: ShimmerCommon()); + } + + if (snapshot.hasError) { + return Center( + child: Text( + '${snapshot.error} occurred', + style: TextStyle(fontSize: 18.spMin), + ), + ); + } + + if (snapshot.connectionState == ConnectionState.done) { + return Stack( + clipBehavior: Clip.none, + children: [ + Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage("assets/images/png/Ellipse 1496.png"), + fit: BoxFit.fill), + ), + ), + commonobjmodel!.data.isEmpty + ? Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Center( + child: Column( + children: [ + Text( + "No Post Available", + style: TextStyle( + color: Colors.white, + fontSize: 16.sp, + fontWeight: FontWeight.w600), + ) + ], + ), + ), + ], + ) + : Column( + children: [ + sizedBoxHeight(20.h), + Expanded( + child: ListView.builder( + shrinkWrap: true, + itemCount: commonobjmodel!.data.length, + itemBuilder: (context, index) { + var timeAgo = ConvertServerDateToUserDate() + .convertServerDateToReadableFormate( + commonobjmodel!.data[index].createdAt + .toString()); + + return Column( + children: [ + NormalCardTile( + tags: _sortTags(index), + createAt: timeAgo ?? '1 hour', + commonObj: commonobjmodel!.data[index], + forWhichTab: 'latest', + reactions: _reactions, + selectedReactions: _selectedReactions, + currentIndex: index, + ), + sizedBoxHeight(20.h) + ], + ); + }, + ), + ), + ], + ), + ], + ); + } + return Container(); + }, + ); + } +} diff --git a/lib/Main_Screens/Community_HomePage/Model/tagdetailModel.dart b/lib/Main_Screens/Community_HomePage/Model/tagdetailModel.dart new file mode 100644 index 0000000..82c9c28 --- /dev/null +++ b/lib/Main_Screens/Community_HomePage/Model/tagdetailModel.dart @@ -0,0 +1,242 @@ +class TagdetailsModel { + TagdetailsModel({ + required this.status, + required this.statusCode, + required this.message, + required this.data, + }); + + final String? status; + final int? statusCode; + final String? message; + final List data; + + factory TagdetailsModel.fromJson(Map json){ + return TagdetailsModel( + status: json["status"], + statusCode: json["status_code"], + message: json["message"], + data: json["data"] == null ? [] : List.from(json["data"]!.map((x) => Datum.fromJson(x))), + ); + } + +} + +class Datum { + Datum({ + required this.id, + required this.likecount, + required this.isISaved, + required this.tagsXid, + required this.isILiked, + required this.totalComment, + required this.totalSave, + required this.iamPrincipalXid, + required this.postIn, + required this.caption, + required this.image, + required this.manageTagsXids, + required this.postAs, + required this.ctaTitle, + required this.ctaLink, + required this.createdAt, + required this.likeIcon, + required this.totalViewCount, + required this.totalReactionCount, + required this.totalCommentCount, + required this.totalImpressionCount, + required this.totalPopularScore, + required this.totalHoursAgo, + required this.iamPrincipal, + required this.community, + required this.attachTags, + }); + + final int? id; + final int? likecount; + final bool? isISaved; + final List tagsXid; + final bool? isILiked; + final int? totalComment; + final int? totalSave; + final int? iamPrincipalXid; + final int? postIn; + final String? caption; + final String? image; + final String? manageTagsXids; + final String? postAs; + final String? ctaTitle; + final String? ctaLink; + final DateTime? createdAt; + final LikeIcon? likeIcon; + final int? totalViewCount; + final int? totalReactionCount; + final int? totalCommentCount; + final int? totalImpressionCount; + final int? totalPopularScore; + final int? totalHoursAgo; + final IamPrincipal? iamPrincipal; + final Community? community; + final List attachTags; + + factory Datum.fromJson(Map json){ + return Datum( + id: json["id"], + likecount: json["likecount"], + isISaved: json["is_i_saved"], + tagsXid: json["tags_xid"] == null ? [] : List.from(json["tags_xid"]!.map((x) => x)), + isILiked: json["is_i_liked"], + totalComment: json["total_comment"], + totalSave: json["total_save"], + iamPrincipalXid: json["iam_principal_xid"], + postIn: json["post_in"], + caption: json["caption"], + image: json["image"], + manageTagsXids: json["manage_tags_xids"], + postAs: json["post_as"], + ctaTitle: json["cta_title"], + ctaLink: json["cta_link"], + createdAt: DateTime.tryParse(json["created_at"] ?? ""), + likeIcon: json["likeIcon"] == null ? null : LikeIcon.fromJson(json["likeIcon"]), + totalViewCount: json["totalViewCount"], + totalReactionCount: json["totalReactionCount"], + totalCommentCount: json["totalCommentCount"], + totalImpressionCount: json["totalImpressionCount"], + totalPopularScore: json["totalPopularScore"], + totalHoursAgo: json["totalHoursAgo"], + iamPrincipal: json["iam_principal"] == null ? null : IamPrincipal.fromJson(json["iam_principal"]), + community: json["community"] == null ? null : Community.fromJson(json["community"]), + attachTags: json["attach_tags"] == null ? [] : List.from(json["attach_tags"]!.map((x) => AttachTag.fromJson(x))), + ); + } + +} + +class AttachTag { + AttachTag({ + required this.managePostXid, + required this.manageTagXid, + required this.manageTag, + }); + + final int? managePostXid; + final int? manageTagXid; + final ManageTag? manageTag; + + factory AttachTag.fromJson(Map json){ + return AttachTag( + managePostXid: json["manage_post_xid"], + manageTagXid: json["manage_tag_xid"], + manageTag: json["manage_tag"] == null ? null : ManageTag.fromJson(json["manage_tag"]), + ); + } + +} + +class ManageTag { + ManageTag({ + required this.id, + required this.isPinned, + required this.name, + }); + + final int? id; + final bool? isPinned; + final String? name; + + factory ManageTag.fromJson(Map json){ + return ManageTag( + id: json["id"], + isPinned: json["is_pinned"], + name: json["name"], + ); + } + +} + +class Community { + Community({ + required this.id, + required this.communityProfilePhoto, + required this.communityName, + }); + + final int? id; + final String? communityProfilePhoto; + final String? communityName; + + factory Community.fromJson(Map json){ + return Community( + id: json["id"], + communityProfilePhoto: json["community_profile_photo"], + communityName: json["community_name"], + ); + } + +} + +class IamPrincipal { + IamPrincipal({ + required this.id, + required this.isUserPinned, + required this.principalTypeXid, + required this.userName, + required this.fullName, + required this.profilePhoto, + }); + + final int? id; + final bool? isUserPinned; + final int? principalTypeXid; + final String? userName; + final String? fullName; + final String? profilePhoto; + + factory IamPrincipal.fromJson(Map json){ + return IamPrincipal( + id: json["id"], + isUserPinned: json["is_user_pinned"], + principalTypeXid: json["principal_type_xid"], + userName: json["user_name"], + fullName: json["full_name"], + profilePhoto: json["profile_photo"], + ); + } + +} + +class LikeIcon { + LikeIcon({ + required this.likeIconsXid, + required this.likeIcon, + }); + + final int? likeIconsXid; + final LikeIconClass? likeIcon; + + factory LikeIcon.fromJson(Map json){ + return LikeIcon( + likeIconsXid: json["like_icons_xid"], + likeIcon: json["like_icon"] == null ? null : LikeIconClass.fromJson(json["like_icon"]), + ); + } + +} + +class LikeIconClass { + LikeIconClass({ + required this.id, + required this.image, + }); + + final int? id; + final String? image; + + factory LikeIconClass.fromJson(Map json){ + return LikeIconClass( + id: json["id"], + image: json["image"], + ); + } + +} diff --git a/lib/Main_Screens/Community_HomePage/Model/tagpopulardetailsModel.dart b/lib/Main_Screens/Community_HomePage/Model/tagpopulardetailsModel.dart new file mode 100644 index 0000000..664d9ee --- /dev/null +++ b/lib/Main_Screens/Community_HomePage/Model/tagpopulardetailsModel.dart @@ -0,0 +1,243 @@ +class TagPopulardetailsModel { + TagPopulardetailsModel({ + required this.status, + required this.statusCode, + required this.message, + required this.data, + }); + + final String? status; + final int? statusCode; + final String? message; + final List data; + + factory TagPopulardetailsModel.fromJson(Map json){ + return TagPopulardetailsModel( + status: json["status"], + statusCode: json["status_code"], + message: json["message"], + data: json["data"] == null ? [] : List.from(json["data"]!.map((x) => Datum.fromJson(x))), + ); + } + +} + +class Datum { + Datum({ + required this.id, + required this.likecount, + required this.isISaved, + required this.isILiked, + required this.totalComment, + required this.totalSave, + required this.iamPrincipalXid, + required this.postIn, + required this.caption, + required this.image, + required this.manageTagsXids, + required this.postAs, + required this.ctaTitle, + required this.ctaLink, + required this.createdAt, + required this.totalViewCount, + required this.totalReactionCount, + required this.totalCommentCount, + required this.totalImpressionCount, + required this.likeIcon, + required this.tagsXid, + required this.totalPopularScore, + required this.totalHoursAgo, + required this.iamPrincipal, + required this.community, + required this.attachTags, + }); + + final int? id; + final int? likecount; + final bool? isISaved; + final bool? isILiked; + final int? totalComment; + final int? totalSave; + final int? iamPrincipalXid; + final int? postIn; + final String? caption; + final String? image; + final String? manageTagsXids; + + final String? postAs; + final String? ctaTitle; + final String? ctaLink; + final DateTime? createdAt; + final int? totalViewCount; + final int? totalReactionCount; + final int? totalCommentCount; + final int? totalImpressionCount; + final LikeIcon? likeIcon; + final List tagsXid; + final int? totalPopularScore; + final int? totalHoursAgo; + final IamPrincipal? iamPrincipal; + final Community? community; + final List attachTags; + + factory Datum.fromJson(Map json){ + return Datum( + id: json["id"], + likecount: json["likecount"], + isISaved: json["is_i_saved"], + isILiked: json["is_i_liked"], + totalComment: json["total_comment"], + totalSave: json["total_save"], + iamPrincipalXid: json["iam_principal_xid"], + postIn: json["post_in"], + caption: json["caption"], + image: json["image"], + manageTagsXids: json["manage_tags_xids"], + postAs: json["post_as"], + ctaTitle: json["cta_title"], + ctaLink: json["cta_link"], + createdAt: DateTime.tryParse(json["created_at"] ?? ""), + totalViewCount: json["totalViewCount"], + totalReactionCount: json["totalReactionCount"], + totalCommentCount: json["totalCommentCount"], + totalImpressionCount: json["totalImpressionCount"], + likeIcon: json["likeIcon"] == null ? null : LikeIcon.fromJson(json["likeIcon"]), + tagsXid: json["tags_xid"] == null ? [] : List.from(json["tags_xid"]!.map((x) => x)), + totalPopularScore: json["totalPopularScore"], + totalHoursAgo: json["totalHoursAgo"], + iamPrincipal: json["iam_principal"] == null ? null : IamPrincipal.fromJson(json["iam_principal"]), + community: json["community"] == null ? null : Community.fromJson(json["community"]), + attachTags: json["attach_tags"] == null ? [] : List.from(json["attach_tags"]!.map((x) => AttachTag.fromJson(x))), + ); + } + +} + +class AttachTag { + AttachTag({ + required this.managePostXid, + required this.manageTagXid, + required this.manageTag, + }); + + final int? managePostXid; + final int? manageTagXid; + final ManageTag? manageTag; + + factory AttachTag.fromJson(Map json){ + return AttachTag( + managePostXid: json["manage_post_xid"], + manageTagXid: json["manage_tag_xid"], + manageTag: json["manage_tag"] == null ? null : ManageTag.fromJson(json["manage_tag"]), + ); + } + +} + +class LikeIcon { + LikeIcon({ + required this.likeIconsXid, + required this.likeIcon, + }); + + final int? likeIconsXid; + final LikeIconClass? likeIcon; + + factory LikeIcon.fromJson(Map json){ + return LikeIcon( + likeIconsXid: json["like_icons_xid"], + likeIcon: json["like_icon"] == null ? null : LikeIconClass.fromJson(json["like_icon"]), + ); + } + +} + +class LikeIconClass { + LikeIconClass({ + required this.id, + required this.image, + }); + + final int? id; + final String? image; + + factory LikeIconClass.fromJson(Map json){ + return LikeIconClass( + id: json["id"], + image: json["image"], + ); + } + +} + +class ManageTag { + ManageTag({ + required this.id, + required this.isPinned, + required this.name, + }); + + final int? id; + final bool? isPinned; + final String? name; + + factory ManageTag.fromJson(Map json){ + return ManageTag( + id: json["id"], + isPinned: json["is_pinned"], + name: json["name"], + ); + } + +} + +class Community { + Community({ + required this.id, + required this.communityProfilePhoto, + required this.communityName, + }); + + final int? id; + final String? communityProfilePhoto; + final String? communityName; + + factory Community.fromJson(Map json){ + return Community( + id: json["id"], + communityProfilePhoto: json["community_profile_photo"], + communityName: json["community_name"], + ); + } + +} + +class IamPrincipal { + IamPrincipal({ + required this.id, + required this.isUserPinned, + required this.principalTypeXid, + required this.userName, + required this.fullName, + required this.profilePhoto, + }); + + final int? id; + final bool? isUserPinned; + final int? principalTypeXid; + final String? userName; + final String? fullName; + final String? profilePhoto; + + factory IamPrincipal.fromJson(Map json){ + return IamPrincipal( + id: json["id"], + isUserPinned: json["is_user_pinned"], + principalTypeXid: json["principal_type_xid"], + userName: json["user_name"], + fullName: json["full_name"], + profilePhoto: json["profile_photo"], + ); + } + +} diff --git a/lib/Main_Screens/Community_HomePage/PostDetailScreen/Model/LikePostModel.dart b/lib/Main_Screens/Community_HomePage/PostDetailScreen/Model/LikePostModel.dart new file mode 100644 index 0000000..1298f5c --- /dev/null +++ b/lib/Main_Screens/Community_HomePage/PostDetailScreen/Model/LikePostModel.dart @@ -0,0 +1,97 @@ +class LikepostModel { + LikepostModel({ + required this.status, + required this.statusCode, + required this.message, + required this.data, + }); + + final String? status; + final int? statusCode; + final String? message; + final List data; + + factory LikepostModel.fromJson(Map json) { + return LikepostModel( + status: json["status"], + statusCode: json["status_code"], + message: json["message"], + data: json["data"] == null + ? [] + : List.from(json["data"]!.map((x) => Datum.fromJson(x))), + ); + } +} + +class Datum { + Datum({ + required this.id, + required this.managePostsXid, + required this.iamPrincipalXid, + required this.likeIconsXid, + required this.iamPrincipal, + required this.likeIcon, + }); + + final int? id; + final int? managePostsXid; + final int? iamPrincipalXid; + final int? likeIconsXid; + final IamPrincipal? iamPrincipal; + final LikeIcon? likeIcon; + + factory Datum.fromJson(Map json) { + return Datum( + id: json["id"], + managePostsXid: json["manage_posts_xid"], + iamPrincipalXid: json["iam_principal_xid"], + likeIconsXid: json["like_icons_xid"], + iamPrincipal: json["iam_principal"] == null + ? null + : IamPrincipal.fromJson(json["iam_principal"]), + likeIcon: json["like_icon"] == null + ? null + : LikeIcon.fromJson(json["like_icon"]), + ); + } +} + +class IamPrincipal { + IamPrincipal({ + required this.id, + required this.userName, + required this.fullName, + required this.profilePhoto, + }); + + final int? id; + final String? userName; + final String? fullName; + final String? profilePhoto; + + factory IamPrincipal.fromJson(Map json) { + return IamPrincipal( + id: json["id"], + userName: json["user_name"], + fullName: json["full_name"], + profilePhoto: json["profile_photo"], + ); + } +} + +class LikeIcon { + LikeIcon({ + required this.id, + required this.image, + }); + + final int? id; + final String? image; + + factory LikeIcon.fromJson(Map json) { + return LikeIcon( + id: json["id"], + image: json["image"], + ); + } +} diff --git a/lib/Main_Screens/Community_HomePage/PostDetailScreen/Model/NestedCommentsModel.dart b/lib/Main_Screens/Community_HomePage/PostDetailScreen/Model/NestedCommentsModel.dart new file mode 100644 index 0000000..596cf7d --- /dev/null +++ b/lib/Main_Screens/Community_HomePage/PostDetailScreen/Model/NestedCommentsModel.dart @@ -0,0 +1,101 @@ +class NestedCommentsModel { + NestedCommentsModel({ + required this.status, + required this.statusCode, + required this.message, + required this.data, + }); + + final String? status; + final int? statusCode; + final String? message; + final List data; + + factory NestedCommentsModel.fromJson(Map json){ + return NestedCommentsModel( + status: json["status"], + statusCode: json["status_code"], + message: json["message"], + data: json["data"] == null ? [] : List.from(json["data"]!.map((x) => Datum.fromJson(x))), + ); + } + +} + +class Datum { + Datum({ + required this.id, + required this.managePostsXid, + required this.iamPrincipalXid, + required this.comment, + required this.userDetail, + required this.repliedComment, + }); + + final int? id; + final int? managePostsXid; + final int? iamPrincipalXid; + final String? comment; + final UserDetail? userDetail; + final List repliedComment; + + factory Datum.fromJson(Map json){ + return Datum( + id: json["id"], + managePostsXid: json["manage_posts_xid"], + iamPrincipalXid: json["iam_principal_xid"], + comment: json["comment"], + userDetail: json["user_detail"] == null ? null : UserDetail.fromJson(json["user_detail"]), + repliedComment: json["replied_comment"] == null ? [] : List.from(json["replied_comment"]!.map((x) => RepliedComment.fromJson(x))), + ); + } + +} + +class RepliedComment { + RepliedComment({ + required this.id, + required this.postsMasterCommentXid, + required this.iamPrincipalXid, + required this.comment, + required this.userDetail, + }); + + final int? id; + final int? postsMasterCommentXid; + final int? iamPrincipalXid; + final String? comment; + final UserDetail? userDetail; + + factory RepliedComment.fromJson(Map json){ + return RepliedComment( + id: json["id"], + postsMasterCommentXid: json["posts_master_comment_xid"], + iamPrincipalXid: json["iam_principal_xid"], + comment: json["comment"], + userDetail: json["user_detail"] == null ? null : UserDetail.fromJson(json["user_detail"]), + ); + } + +} + +class UserDetail { + UserDetail({ + required this.id, + required this.userName, + required this.profilePhoto, + }); + + final int? id; + final String? userName; + final String? profilePhoto; + + factory UserDetail.fromJson(Map json){ + return UserDetail( + id: json["id"], + userName: json["user_name"], + profilePhoto: json["profile_photo"], + ); + } + +} diff --git a/lib/Main_Screens/Community_HomePage/PostDetailScreen/Model/PostDetailModel.dart b/lib/Main_Screens/Community_HomePage/PostDetailScreen/Model/PostDetailModel.dart new file mode 100644 index 0000000..39979bc --- /dev/null +++ b/lib/Main_Screens/Community_HomePage/PostDetailScreen/Model/PostDetailModel.dart @@ -0,0 +1,245 @@ +class PostDetailModel { + PostDetailModel({ + required this.status, + required this.statusCode, + required this.message, + required this.data, + }); + + final String? status; + final int? statusCode; + final String? message; + final Data? data; + + factory PostDetailModel.fromJson(Map json){ + return PostDetailModel( + status: json["status"], + statusCode: json["status_code"], + message: json["message"], + data: json["data"] == null ? null : Data.fromJson(json["data"]), + ); + } + +} + +class Data { + Data({ + required this.id, + required this.likecount, + required this.isISaved, + required this.tagsXid, + required this.isILiked, + required this.totalComment, + required this.totalSave, + required this.iamPrincipalXid, + required this.postIn, + required this.caption, + required this.image, + required this.manageTagsXids, + required this.postAs, + required this.ctaTitle, + required this.ctaLink, + required this.createdAt, + required this.likeIcon, + required this.totalViewCount, + required this.totalReactionCount, + required this.totalCommentCount, + required this.totalImpressionCount, + required this.totalPopularScore, + required this.totalHoursAgo, + required this.iamPrincipal, + required this.community, + required this.attachTags, + required this.isIFollow, + }); + + final int? id; + final int? likecount; + final bool? isISaved; + final List tagsXid; + final bool? isILiked; + final int? totalComment; + final int? totalSave; + final int? iamPrincipalXid; + final int? postIn; + final String? caption; + final String? image; + final String? manageTagsXids; + final String? postAs; + final String? ctaTitle; + final String? ctaLink; + final DateTime? createdAt; + final LikeIcon? likeIcon; + final int? totalViewCount; + final int? totalReactionCount; + final int? totalCommentCount; + final int? totalImpressionCount; + final int? totalPopularScore; + final int? totalHoursAgo; + final IamPrincipal? iamPrincipal; + final Community? community; + final List attachTags; + final bool? isIFollow; + + factory Data.fromJson(Map json){ + return Data( + id: json["id"], + likecount: json["likecount"], + isISaved: json["is_i_saved"], + tagsXid: json["tags_xid"] == null ? [] : List.from(json["tags_xid"]!.map((x) => x)), + isILiked: json["is_i_liked"], + totalComment: json["total_comment"], + totalSave: json["total_save"], + iamPrincipalXid: json["iam_principal_xid"], + postIn: json["post_in"], + caption: json["caption"], + image: json["image"], + manageTagsXids: json["manage_tags_xids"], + postAs: json["post_as"], + ctaTitle: json["cta_title"], + ctaLink: json["cta_link"], + createdAt: DateTime.tryParse(json["created_at"] ?? ""), + likeIcon: json["likeIcon"] == null ? null : LikeIcon.fromJson(json["likeIcon"]), + totalViewCount: json["totalViewCount"], + totalReactionCount: json["totalReactionCount"], + totalCommentCount: json["totalCommentCount"], + totalImpressionCount: json["totalImpressionCount"], + totalPopularScore: json["totalPopularScore"], + totalHoursAgo: json["totalHoursAgo"], + iamPrincipal: json["iam_principal"] == null ? null : IamPrincipal.fromJson(json["iam_principal"]), + community: json["community"] == null ? null : Community.fromJson(json["community"]), + attachTags: json["attach_tags"] == null ? [] : List.from(json["attach_tags"]!.map((x) => AttachTag.fromJson(x))), + isIFollow: json["is_i_follow"], + ); + } + +} + +class AttachTag { + AttachTag({ + required this.managePostXid, + required this.manageTagXid, + required this.manageTag, + }); + + final int? managePostXid; + final int? manageTagXid; + final ManageTag? manageTag; + + factory AttachTag.fromJson(Map json){ + return AttachTag( + managePostXid: json["manage_post_xid"], + manageTagXid: json["manage_tag_xid"], + manageTag: json["manage_tag"] == null ? null : ManageTag.fromJson(json["manage_tag"]), + ); + } + +} + +class ManageTag { + ManageTag({ + required this.id, + required this.isPinned, + required this.name, + }); + + final int? id; + final bool? isPinned; + final String? name; + + factory ManageTag.fromJson(Map json){ + return ManageTag( + id: json["id"], + isPinned: json["is_pinned"], + name: json["name"], + ); + } + +} + +class Community { + Community({ + required this.id, + required this.communityProfilePhoto, + required this.communityName, + }); + + final int? id; + final String? communityProfilePhoto; + final String? communityName; + + factory Community.fromJson(Map json){ + return Community( + id: json["id"], + communityProfilePhoto: json["community_profile_photo"], + communityName: json["community_name"], + ); + } + +} + +class IamPrincipal { + IamPrincipal({ + required this.id, + required this.isUserPinned, + required this.principalTypeXid, + required this.userName, + required this.fullName, + required this.profilePhoto, + }); + + final int? id; + final bool? isUserPinned; + final int? principalTypeXid; + final String? userName; + final String? fullName; + final String? profilePhoto; + + factory IamPrincipal.fromJson(Map json){ + return IamPrincipal( + id: json["id"], + isUserPinned: json["is_user_pinned"], + principalTypeXid: json["principal_type_xid"], + userName: json["user_name"], + fullName: json["full_name"], + profilePhoto: json["profile_photo"], + ); + } + +} + +class LikeIcon { + LikeIcon({ + required this.likeIconsXid, + required this.likeIcon, + }); + + final int? likeIconsXid; + final LikeIconClass? likeIcon; + + factory LikeIcon.fromJson(Map json){ + return LikeIcon( + likeIconsXid: json["like_icons_xid"], + likeIcon: json["like_icon"] == null ? null : LikeIconClass.fromJson(json["like_icon"]), + ); + } + +} + +class LikeIconClass { + LikeIconClass({ + required this.id, + required this.image, + }); + + final int? id; + final String? image; + + factory LikeIconClass.fromJson(Map json){ + return LikeIconClass( + id: json["id"], + image: json["image"], + ); + } + +} diff --git a/lib/Main_Screens/Community_HomePage/PostDetailScreen/View/PostDetailScreen.dart b/lib/Main_Screens/Community_HomePage/PostDetailScreen/View/PostDetailScreen.dart new file mode 100644 index 0000000..9b58250 --- /dev/null +++ b/lib/Main_Screens/Community_HomePage/PostDetailScreen/View/PostDetailScreen.dart @@ -0,0 +1,530 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_keyboard_visibility/flutter_keyboard_visibility.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import 'package:regroup/Common/base_manager.dart'; +import 'package:regroup/Common/controller/NormalPostCard.dart'; +import 'package:regroup/Global.dart'; +import 'package:regroup/Main_Screens/Community/Model/CommonDatumObjModel.dart'; +import 'package:regroup/Main_Screens/Community/Model/fetchicons.dart'; +import 'package:regroup/Main_Screens/Community_HomePage/PostDetailScreen/ViewModel/CommentsHelper.dart'; +import 'package:regroup/Main_Screens/Community_HomePage/PostDetailScreen/ViewModel/CommentsRepository.dart'; +import 'package:regroup/Main_Screens/Community_HomePage/PostDetailScreen/ViewModel/PostDetailApi.dart'; +import 'package:regroup/Main_Screens/Community_HomePage/view_model/CountersHelper.dart'; +import 'package:regroup/Main_Screens/ProfileTab/view_model/profilePostmethod.dart'; +import 'package:regroup/Utils/Common/CommonAppbar.dart'; +import 'package:regroup/Utils/Common/CustomTextformfield.dart'; +import 'package:regroup/Utils/Common/ShimmerCommon.dart'; +import 'package:regroup/Utils/Common/sized_box.dart'; +import 'package:regroup/Utils/dialogs.dart'; +import 'package:regroup/Utils/texts.dart'; +import 'package:async/async.dart'; + +class PostDetailsScreen extends StatefulWidget { + const PostDetailsScreen({super.key}); + + @override + State createState() => _PostDetailsScreenState(); +} + +class _PostDetailsScreenState extends State { + int? followunfollowid; + + followUnfollowUploadata() async { + // utils.loader(); + Map newupdata = { + "following_iam_principal_xid": followunfollowid, + }; + final data = await Profilepostmethod().postunfollowuser(newupdata); + if (data.status == ResponseStatus.SUCCESS) { + PostDetailApi().getPostDetail(mainpostid).then((value) {}); + } else { + Get.back(); + return utils.showToast(data.message); + } + } + + List hideReplies = []; + FutureGroup futureGroup = FutureGroup(); + final FocusNode _focusNode = FocusNode(); + final TextEditingController _controllerComments = TextEditingController(); + final CommentsHelper _commentsHelper = Get.put(CommentsHelper()); + final CountersHelper countersHelper = Get.find(); + String? mainpostid; + List? tags; + String? create_at; + CommonDatumObjModelData? commonObj; + String? formWhichTab; + List? reactions; + Map? selectedReactions; + int? currentIndex; + + @override + void initState() { + mainpostid = Get.arguments['postId'].toString(); + tags = Get.arguments['tagsList']; + create_at = Get.arguments['created_at']; + commonObj = Get.arguments['commonObj']; + formWhichTab = Get.arguments['fromWhichTab']; + reactions = Get.arguments['reactions']; + selectedReactions = Get.arguments['selectedReactions']; + currentIndex = Get.arguments['currentIndex']; + futureGroup.add(CommentsRepository().getAllComments(mainpostid)); + futureGroup.add(PostDetailApi().getPostDetail(mainpostid)); + futureGroup.close(); + super.initState(); + } + + bool isOnce = true; + _setViewMoreList() { + if (isOnce) { + hideReplies = List.filled(nestedComments!.data.length, false); + isOnce = false; + } + } + + _toggleReplies(index) { + setState(() { + hideReplies[index] = !hideReplies[index]; + }); + } + + void _focusTextField() { + FocusScope.of(context).requestFocus(_focusNode); + } + + _postComments() async { + var updata = { + "manage_posts_xid": mainpostid, + "comment": _controllerComments.text, + }; + final result = await CommentsRepository().postComments(updata); + if (result.status == ResponseStatus.SUCCESS) { + countersHelper.commentsCounterPopular[currentIndex!]++; + CommentsRepository() + .getAllComments(mainpostid) + .then((value) => setState(() { + isOnce = true; + _commentsHelper.isLoading.value = false; + _controllerComments.clear(); + })); + } + } + + String repliedCommentId = ""; + _postRepliesOnComment(repliedCommentId) async { + var updata = { + "manage_posts_xid": mainpostid, + "posts_master_comment_xid": repliedCommentId, + "comment": _controllerComments.text, + }; + final result = await CommentsRepository().postRepliesOnComments(updata); + if (result.status == ResponseStatus.SUCCESS) { + CommentsRepository() + .getAllComments(mainpostid) + .then((value) => setState(() { + isOnce = true; + _commentsHelper.isLoading.value = false; + _controllerComments.clear(); + })); + } + } + // _setComments(index) { + // List repliedCommentsList = []; + // for (var i = 0; + // i < nestedComments!.data[index].repliedComment.length; + // i++) { + // repliedCommentsList.add(Comment( + // avatar: nestedComments! + // .data[index].repliedComment[i].userDetail?.profilePhoto, + // userName: nestedComments! + // .data[index].repliedComment[i].userDetail?.userName, + // content: nestedComments!.data[index].repliedComment[i].comment)); + // } + // return repliedCommentsList; + // } + + // bool _hideReplies = true; + _deleteComment(String commentId) async { + var updata = {"id": commentId}; + final result = await CommentsRepository().deleteComments(updata); + if (result.status == ResponseStatus.SUCCESS) { + countersHelper.commentsCounterPopular[currentIndex!]--; + CommentsRepository() + .getAllComments(mainpostid) + .then((value) => setState(() { + isOnce = true; + })); + } + } + + _deleteRepliedComment(String commentId) async { + var updata = {"id": commentId}; + final result = await CommentsRepository().deleteRepliedComments(updata); + if (result.status == ResponseStatus.SUCCESS) { + CommentsRepository() + .getAllComments(mainpostid) + .then((value) => setState(() { + isOnce = true; + })); + } + } + +//reacttionlikelogic + + @override + Widget build(BuildContext context) { + return KeyboardVisibilityBuilder(builder: (context, isKeyboardVisible) { + return WillPopScope( + onWillPop: () async { + Get.back(result: true); + return false; // Prevent default back button action + }, + child: Scaffold( + resizeToAvoidBottomInset: false, + backgroundColor: const Color(0xFF222935), + extendBody: true, + appBar: const CommonAppbar( + customBack: true, + // customRouteName: RouteName.communityScreen, + titleTxt: "Post", + ), + body: FutureBuilder( + future: futureGroup.future, + builder: (context, snapshot) { + if (snapshot.connectionState == ConnectionState.waiting) { + return const Center(child: ShimmerCommon()); + } else if (snapshot.hasError) { + return Center( + child: Text( + '${snapshot.error} occurred', + style: TextStyle(fontSize: 18.spMin), + ), + ); + } else if (snapshot.connectionState == ConnectionState.done) { + _setViewMoreList(); + + return _buildBody(isKeyboardVisible); + } else { + return const Center(child: Text('Something went wrong')); + } + }, + )), + ); + }); + } + + _buildBody(isKeyboardVisible) { + return Stack(children: [ + Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage("assets/images/png/Ellipse 1496.png"), + fit: BoxFit.fill)), + ), + SingleChildScrollView( + child: + Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + // sizedBoxHeight(35.h), + + NormalCardTile( + tags: tags!, + createAt: create_at!, + commonObj: commonObj!, + forWhichTab: formWhichTab!, + reactions: reactions!, + selectedReactions: selectedReactions!, + currentIndex: currentIndex!, + showCommentButton: false, + ), + + sizedBoxHeight(35.h), + + ListView.builder( + physics: const NeverScrollableScrollPhysics(), + shrinkWrap: true, + itemCount: nestedComments?.data.length, + itemBuilder: (context, index) { + return Padding( + padding: EdgeInsets.symmetric(horizontal: 16.w), + child: Column( + children: [ + GestureDetector( + onLongPressStart: (details) { + nestedComments?.data[index].userDetail!.id + .toString() != + userIdGlobal + ? null + : showMenu( + context: context, + position: RelativeRect.fromLTRB( + details.globalPosition.dx, + details.globalPosition.dy, + details.globalPosition.dx + 1, + details.globalPosition.dy + 1, + ), + items: [ + const PopupMenuItem( + value: 0, + child: Text("Delete"), + ), + ], + elevation: 8.0, + ).then((value) { + if (value == 0) { + _deleteComment(nestedComments! + .data[index].id + .toString()); + } + }); + }, + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + CircleAvatar( + radius: 20.r, + foregroundImage: NetworkImage( + nestedComments! + .data[index].userDetail!.profilePhoto ?? + "https://upload.wikimedia.org/wikipedia/commons/7/7c/Profile_avatar_placeholder_large.png?20150327203541", + ), + ), + sizedBoxWidth(15.w), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + text12w400_FCFCFC_blur(nestedComments! + .data[index].userDetail!.userName ?? + ""), + text14w400_FCFCFC( + nestedComments!.data[index].comment ?? + ""), + SizedBox(height: 10.h), + GestureDetector( + onTap: () { + _focusTextField(); + _controllerComments.text = + "@${nestedComments!.data[index].userDetail!.userName!}"; + setState(() { + repliedCommentId = nestedComments! + .data[index].id + .toString(); + }); + }, + child: text10w400_FCFCFC_blur("Reply")), + SizedBox(height: 20.h), + nestedComments! + .data[index].repliedComment.isEmpty + ? const SizedBox() + : hideReplies[index] + ? GestureDetector( + onTap: () { + _toggleReplies(index); + }, + child: text10w400_FCFCFC_blur( + "Hide replies"), + ) + : GestureDetector( + onTap: () { + _toggleReplies(index); + }, + child: text10w400_FCFCFC_blur( + "View ${nestedComments!.data[index].repliedComment.length} more replies"), + ), + SizedBox(height: 10.h), + !hideReplies[index] + ? const SizedBox() + : ListView.builder( + physics: + const NeverScrollableScrollPhysics(), + shrinkWrap: true, + itemCount: nestedComments!.data[index] + .repliedComment.length, + itemBuilder: (context, index2) { + return GestureDetector( + onLongPressStart: + (LongPressStartDetails + details) { + nestedComments + ?.data[index] + .repliedComment[ + index2] + .userDetail + ?.id + .toString() != + userIdGlobal + ? null + : showMenu( + context: context, + position: RelativeRect + .fromLTRB( + details.globalPosition + .dx, + details.globalPosition + .dy, + details.globalPosition + .dx + + 1, + details.globalPosition + .dy + + 1, + ), + items: [ + const PopupMenuItem< + int>( + value: 0, + child: + Text("Delete"), + ), + ], + elevation: 8.0, + ).then((value) { + if (value == 0) { + _deleteRepliedComment( + nestedComments! + .data[index] + .repliedComment[ + index2] + .id + .toString()); + } + }); + }, + child: ListTile( + leading: Column( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + CircleAvatar( + radius: 13.r, + foregroundImage: + NetworkImage( + nestedComments! + .data[index] + .repliedComment[ + index2] + .userDetail + ?.profilePhoto ?? + "https://upload.wikimedia.org/wikipedia/commons/7/7c/Profile_avatar_placeholder_large.png?20150327203541", + ), + ), + ], + ), + title: text12w400_FCFCFC_blur( + nestedComments! + .data[index] + .repliedComment[ + index2] + .userDetail + ?.userName ?? + ""), + subtitle: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + text14w400_FCFCFC( + nestedComments! + .data[index] + .repliedComment[ + index2] + .comment ?? + ""), + SizedBox(height: 10.h), + GestureDetector( + onTap: () { + _focusTextField(); + _controllerComments + .text = + "@${nestedComments!.data[index].repliedComment[index2].userDetail!.userName!}"; + setState(() { + repliedCommentId = + nestedComments! + .data[index] + .repliedComment[ + index2] + .postsMasterCommentXid + .toString(); + }); + }, + child: + text10w400_FCFCFC_blur( + "Reply")), + ], + ), + ), + ); + }) + ], + ), + ), + ], + ), + ), + sizedBoxHeight(20.h), + //sizedBoxHeight(85.h) + ], + )); + }), + sizedBoxHeight(50.h), + ])), + Positioned.fill( + top: 625.h - MediaQuery.of(context).viewInsets.bottom, + // isKeyboardVisible ? 270.h : 625.h, + right: 16.0, + left: 16.0, + child: Align( + alignment: Alignment.bottomCenter, + child: Padding( + padding: const EdgeInsets.only(top: 15, bottom: 15), + child: Row( + children: [ + Obx(() { + return Expanded( + child: CustomTextFormField( + textEditingController: _controllerComments, + focusNode: _focusNode, + hintText: "Add comment", + suffixIcon: GestureDetector( + onTap: () { + FocusScope.of(context).unfocus(); + if (_controllerComments.text.isEmpty) { + print("Enter some text"); + } else { + _commentsHelper.isLoading.value = true; + if (repliedCommentId != "") { + _postRepliesOnComment(repliedCommentId); + } else { + _postComments(); + } + } + }, + child: _commentsHelper.isLoading.value + ? Container( + padding: const EdgeInsets.all(10), + height: 10.h, + width: 10.w, + child: const CircularProgressIndicator()) + : SizedBox( + height: 20.h, + width: 25.w, + child: Center( + child: Image.asset( + "assets/images/png/iconoir_send.png", + height: 20.h, + width: 25.w, + ), + ), + ), + ), + ), + ); + }) + ], + ), + )), + ), + ]); + } +} diff --git a/lib/Main_Screens/Community_HomePage/PostDetailScreen/View/ReactionView.dart b/lib/Main_Screens/Community_HomePage/PostDetailScreen/View/ReactionView.dart new file mode 100644 index 0000000..af4e1c8 --- /dev/null +++ b/lib/Main_Screens/Community_HomePage/PostDetailScreen/View/ReactionView.dart @@ -0,0 +1,486 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:regroup/Common/CommonGlassmorphism.dart'; +import 'package:regroup/Common/CommonTabBar.dart'; +import 'package:regroup/Common/CommonWidget.dart'; +import 'package:regroup/Main_Screens/Community_HomePage/PostDetailScreen/ViewModel/LikePost.dart'; +import 'package:regroup/Utils/Common/CommonAppbar.dart'; +import 'package:regroup/Utils/Common/sized_box.dart'; +import 'package:regroup/Utils/texts.dart'; + +String? postId; + +class ReactionView extends StatefulWidget { + const ReactionView({super.key}); + + @override + State createState() => _ReactionViewState(); +} + +class _ReactionViewState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: const Color(0xFF222935), + extendBody: true, + appBar: const CommonAppbar( + titleTxt: "Post", + ), + resizeToAvoidBottomInset: false, + body: Stack( + children: [ + Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage("assets/images/png/Ellipse 1496.png"), + fit: BoxFit.fill)), + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + sizedBoxHeight(10.h), + Expanded( + child: DefaultTabController( + length: 4, + // initialIndex: selectedIndex.value, + child: Column( + children: [ + CommonTabBar(tabs: [ + const Tab( + text: 'All', + ), + Tab( + child: Row(children: [ + commonGlassUI( + borderColor: const Color(0xFF1E3A46), + opacity1: 0.05, + opacity2: 0.06, + width: 30.w, + height: 30.h, + borderRadius: BorderRadius.circular(100), + customWidget: Center( + child: Image.asset( + "assets/images/png/f7_hand-thumbsup.png", + height: 17.h, + width: 17.w, + ), + ), + borderwidth: 1.71), + const Spacer(), + text14400white("110K"), + ]), + ), + Tab( + child: Row(children: [ + commonGlassUI( + borderColor: const Color(0xFF1E3A46), + opacity1: 0.05, + opacity2: 0.06, + width: 30.w, + height: 30.h, + borderRadius: BorderRadius.circular(100), + customWidget: Center( + child: Image.asset( + "assets/images/png/heart 2.png", + height: 17.h, + width: 17.w, + ), + ), + borderwidth: 1.71), + const Spacer(), + text14400white("9.7K"), + ]), + ), + Tab( + child: Row(children: [ + commonGlassUI( + borderColor: const Color(0xFF1E3A46), + opacity1: 0.05, + opacity2: 0.06, + width: 30.w, + height: 30.h, + borderRadius: BorderRadius.circular(100), + customWidget: Center( + child: Image.asset( + "assets/images/png/party-popper 2.png", + height: 17.h, + width: 17.w, + ), + ), + borderwidth: 1.71), + const Spacer(), + text14400white("7.4K"), + ]), + ), + ]), + const Expanded( + child: TabBarView( + children: [ + AllTabs(), + LikeTabs(), + FavouriteTabs(), + PartyTabs(), + ], + ), + ), + sizedBoxHeight(20.h) + ], + ), + ), + ), + ], + ), + ], + ), + ); + } +} + +class AllTabs extends StatefulWidget { + const AllTabs({super.key}); + + @override + State createState() => _AllTabsState(); +} + +class _AllTabsState extends State { + late Future alltabfuture; + + @override + void initState() { + postId = Get.arguments['postId'].toString(); + + alltabfuture = LikePostApi().postLike({'manage_posts_xid': postId}); + super.initState(); + } + + @override + Widget build(BuildContext context) { + return FutureBuilder( + future: alltabfuture, + builder: (ctx, snapshot) { + if (snapshot.connectionState == ConnectionState.waiting) { + return const Center( + child: CircularProgressIndicator( + color: Colors.blue, + ), + ); + } + + if (snapshot.hasError) { + return Center( + child: Text( + '${snapshot.error} occurred', + style: TextStyle(fontSize: 18.spMin), + ), + ); + } + + if (snapshot.connectionState == ConnectionState.done && + snapshot.hasData) { + return Column( + children: [ + sizedBoxHeight(20.h), + Expanded( + child: ListView.builder( + itemCount: likepostobj!.data.length, + shrinkWrap: true, + itemBuilder: (context, index) { + return Column( + children: [ + commonReaction( + imagePath: likepostobj! + .data[index].iamPrincipal!.profilePhoto ?? + '', + reactionimg: + likepostobj!.data[index].likeIcon!.image ?? + '', + title: likepostobj! + .data[index].iamPrincipal!.fullName ?? + ''), + if (likepostobj!.data.length - 1 != index) + commonDivider(), + ], + ); + }, + ), + ) + ], + ); + } + return Container(); + }); + } +} + +class LikeTabs extends StatefulWidget { + const LikeTabs({super.key}); + + @override + State createState() => _LikeTabsState(); +} + +class _LikeTabsState extends State { + late Future liketabfuture; + + @override + void initState() { + postId = Get.arguments['postId'].toString(); + + liketabfuture = LikePostApi() + .postLike({'manage_posts_xid': postId, 'like_icons_xid': 1}); + super.initState(); + } + + @override + Widget build(BuildContext context) { + return FutureBuilder( + future: liketabfuture, + builder: (ctx, snapshot) { + if (snapshot.connectionState == ConnectionState.waiting) { + return const Center( + child: CircularProgressIndicator( + color: Colors.blue, + ), + ); + } + + if (snapshot.hasError) { + return Center( + child: Text( + '${snapshot.error} occurred', + style: TextStyle(fontSize: 18.spMin), + ), + ); + } + + if (snapshot.connectionState == ConnectionState.done && + snapshot.hasData) { + return Column( + children: [ + sizedBoxHeight(20.h), + Expanded( + child: ListView.builder( + itemCount: likepostobj!.data.length, + shrinkWrap: true, + itemBuilder: (context, index) { + return Column( + children: [ + commonReaction( + imagePath: likepostobj! + .data[index].iamPrincipal!.profilePhoto ?? + '', + reactionimg: + likepostobj!.data[index].likeIcon!.image ?? + '', + title: likepostobj! + .data[index].iamPrincipal!.fullName ?? + ''), + if (likepostobj!.data.length - 1 != index) + commonDivider(), + ], + ); + }, + ), + ) + ], + ); + } + return Container(); + }); + } +} + +class FavouriteTabs extends StatefulWidget { + const FavouriteTabs({super.key}); + + @override + State createState() => _FavouriteTabsState(); +} + +class _FavouriteTabsState extends State { + late Future favouritetabfuture; + + @override + void initState() { + postId = Get.arguments['postId'].toString(); + + favouritetabfuture = LikePostApi() + .postLike({'manage_posts_xid': postId, 'like_icons_xid': 2}); + super.initState(); + } + + @override + Widget build(BuildContext context) { + return FutureBuilder( + future: favouritetabfuture, + builder: (ctx, snapshot) { + if (snapshot.connectionState == ConnectionState.waiting) { + return const Center( + child: CircularProgressIndicator( + color: Colors.blue, + ), + ); + } + + if (snapshot.hasError) { + return Center( + child: Text( + '${snapshot.error} occurred', + style: TextStyle(fontSize: 18.spMin), + ), + ); + } + + if (snapshot.connectionState == ConnectionState.done && + snapshot.hasData) { + return Column( + children: [ + sizedBoxHeight(20.h), + Expanded( + child: ListView.builder( + itemCount: likepostobj!.data.length, + shrinkWrap: true, + itemBuilder: (context, index) { + return Column( + children: [ + commonReaction( + imagePath: likepostobj! + .data[index].iamPrincipal!.profilePhoto ?? + '', + reactionimg: + likepostobj!.data[index].likeIcon!.image ?? + '', + title: likepostobj! + .data[index].iamPrincipal!.fullName ?? + ''), + if (likepostobj!.data.length - 1 != index) + commonDivider(), + ], + ); + }, + ), + ) + ], + ); + } + return Container(); + }); + } +} + +class PartyTabs extends StatefulWidget { + const PartyTabs({super.key}); + + @override + State createState() => _PartyTabsState(); +} + +class _PartyTabsState extends State { + late Future partytabfuture; + + @override + void initState() { + postId = Get.arguments['postId'].toString(); + partytabfuture = LikePostApi() + .postLike({'manage_posts_xid': postId, 'like_icons_xid': 3}); + super.initState(); + } + + @override + Widget build(BuildContext context) { + return FutureBuilder( + future: partytabfuture, + builder: (ctx, snapshot) { + if (snapshot.connectionState == ConnectionState.waiting) { + return const Center( + child: CircularProgressIndicator( + color: Colors.blue, + ), + ); + } + + if (snapshot.hasError) { + return Center( + child: Text( + '${snapshot.error} occurred', + style: TextStyle(fontSize: 18.spMin), + ), + ); + } + + if (snapshot.connectionState == ConnectionState.done && + snapshot.hasData) { + return Column( + children: [ + sizedBoxHeight(20.h), + Expanded( + child: ListView.builder( + itemCount: likepostobj!.data.length, + shrinkWrap: true, + itemBuilder: (context, index) { + return Column( + children: [ + commonReaction( + imagePath: likepostobj! + .data[index].iamPrincipal!.profilePhoto ?? + '', + reactionimg: + likepostobj!.data[index].likeIcon!.image ?? + '', + title: likepostobj! + .data[index].iamPrincipal!.fullName ?? + ''), + if (likepostobj!.data.length - 1 != index) + commonDivider(), + ], + ); + }, + ), + ) + ], + ); + } + return Container(); + }); + } +} + +Widget commonReaction( + {required String imagePath, + required String reactionimg, + required String title}) { + return Padding( + padding: EdgeInsets.symmetric(horizontal: 25.w, vertical: 18.h), + child: Row( + children: [ + Stack(children: [ + CircleAvatar( + radius: 25.r, + backgroundImage: NetworkImage(imagePath), + ), + Positioned( + bottom: 0, + right: 0, + child: Container( + height: 22.h, + width: 22.w, + decoration: BoxDecoration( + shape: BoxShape.circle, + // color: const Color(0xFF1E3A46), + border: Border.all( + color: const Color(0xFFFCFCFC).withOpacity(0.18), + width: 0.6), + image: DecorationImage( + image: NetworkImage(reactionimg), + ), + ), + )), + ]), + sizedBoxWidth(10.w), + text17400white(title), + ], + ), + ); +} diff --git a/lib/Main_Screens/Community_HomePage/PostDetailScreen/ViewModel/CommentsHelper.dart b/lib/Main_Screens/Community_HomePage/PostDetailScreen/ViewModel/CommentsHelper.dart new file mode 100644 index 0000000..3456efe --- /dev/null +++ b/lib/Main_Screens/Community_HomePage/PostDetailScreen/ViewModel/CommentsHelper.dart @@ -0,0 +1,5 @@ +import 'package:get/get.dart'; + +class CommentsHelper extends GetxController { + RxBool isLoading = false.obs; +} diff --git a/lib/Main_Screens/Community_HomePage/PostDetailScreen/ViewModel/CommentsRepository.dart b/lib/Main_Screens/Community_HomePage/PostDetailScreen/ViewModel/CommentsRepository.dart new file mode 100644 index 0000000..e2c75ce --- /dev/null +++ b/lib/Main_Screens/Community_HomePage/PostDetailScreen/ViewModel/CommentsRepository.dart @@ -0,0 +1,51 @@ +import 'package:regroup/Common/api_urls.dart'; +import 'package:regroup/Common/base_manager.dart'; +import 'package:regroup/Common/controller/data/network/network_api.dart'; +import 'package:regroup/Main_Screens/Community_HomePage/PostDetailScreen/Model/LikePostModel.dart'; +import 'package:regroup/Main_Screens/Community_HomePage/PostDetailScreen/Model/NestedCommentsModel.dart'; + +NestedCommentsModel? nestedComments; + +class CommentsRepository { + Future> getAllComments(updata) async { + final response = await NetworkApiServices().getApi( + "${ApiUrls.getComments}?manage_posts_xid=$updata", + ); + if (response.status == ResponseStatus.SUCCESS) { + nestedComments = NestedCommentsModel.fromJson(response.data); + } + return response; + } + + Future> postComments(updata) async { + final response = await NetworkApiServices().postApi( + updata, + ApiUrls.storeComments, + ); + return response; + } + + Future> postRepliesOnComments(updata) async { + final response = await NetworkApiServices().postApi( + updata, + ApiUrls.storeRepliesOnComments, + ); + return response; + } + + Future> deleteComments(updata) async { + final response = await NetworkApiServices().postApi( + updata, + ApiUrls.deleteComments, + ); + return response; + } + + Future> deleteRepliedComments(updata) async { + final response = await NetworkApiServices().postApi( + updata, + ApiUrls.deleteRepliesComments, + ); + return response; + } +} diff --git a/lib/Main_Screens/Community_HomePage/PostDetailScreen/ViewModel/LikePost.dart b/lib/Main_Screens/Community_HomePage/PostDetailScreen/ViewModel/LikePost.dart new file mode 100644 index 0000000..57b46ee --- /dev/null +++ b/lib/Main_Screens/Community_HomePage/PostDetailScreen/ViewModel/LikePost.dart @@ -0,0 +1,27 @@ +import 'package:regroup/Common/api_urls.dart'; +import 'package:regroup/Common/base_manager.dart'; +import 'package:regroup/Common/controller/data/network/network_api.dart'; +import 'package:regroup/Main_Screens/Community_HomePage/PostDetailScreen/Model/LikePostModel.dart'; + +LikepostModel? likepostobj; + +class LikePostApi { + Future> postLike(updata) async { + print("updata is $updata"); + final response = await NetworkApiServices().postApi( + updata, + ApiUrls.postlike, + ); + if (response.status == ResponseStatus.SUCCESS) { + if (response.data["status"] == "success") { + likepostobj = LikepostModel.fromJson(response.data); + } + return ResponseData( + response.data['message'], ResponseStatus.SUCCESS, + data: response.data); + } else { + return ResponseData( + response.data['message'], ResponseStatus.FAILED); + } + } +} diff --git a/lib/Main_Screens/Community_HomePage/PostDetailScreen/ViewModel/PostDetailApi.dart b/lib/Main_Screens/Community_HomePage/PostDetailScreen/ViewModel/PostDetailApi.dart new file mode 100644 index 0000000..eee7997 --- /dev/null +++ b/lib/Main_Screens/Community_HomePage/PostDetailScreen/ViewModel/PostDetailApi.dart @@ -0,0 +1,23 @@ + + +import 'package:regroup/Common/api_urls.dart'; +import 'package:regroup/Common/base_manager.dart'; +import 'package:regroup/Common/controller/data/network/network_api.dart'; +import 'package:regroup/Main_Screens/Community_HomePage/PostDetailScreen/Model/PostDetailModel.dart'; + +PostDetailModel? postDetailObj; + + + +class PostDetailApi { + Future> getPostDetail(updata) async { + final response = await NetworkApiServices().getApi( + "${ApiUrls.getpostdetail}?manage_post_xid=$updata", + ); + + if (response.status == ResponseStatus.SUCCESS) { + postDetailObj = PostDetailModel.fromJson(response.data); + } + return response; + } +} \ No newline at end of file diff --git a/lib/Main_Screens/Community_HomePage/PostScreen.dart b/lib/Main_Screens/Community_HomePage/PostScreen.dart new file mode 100644 index 0000000..970b375 --- /dev/null +++ b/lib/Main_Screens/Community_HomePage/PostScreen.dart @@ -0,0 +1,1638 @@ +import 'dart:async'; +import 'dart:convert'; +import 'dart:developer'; +import 'dart:io'; + +import 'package:dio/dio.dart'; +import 'package:dotted_border/dotted_border.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter/widgets.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart' hide MultipartFile, FormData; + +import 'package:regroup/Common/CommonGlassmorphism.dart'; +import 'package:regroup/Common/base_manager.dart'; +import 'package:regroup/Feed%20Module/Main_Screens/Community/Model/communitylistModel.dart' + as communitylist; +import 'package:regroup/Feed%20Module/Main_Screens/Community/Model/tagsmainModel.dart'; +import 'package:regroup/Feed%20Module/Main_Screens/Community/view_model/postApi.dart'; +import 'package:regroup/Feed%20Module/Main_Screens/Community/view_model/postinList.dart'; +import 'package:regroup/Global.dart'; +import 'package:regroup/Utils/Common/CommonAppbar.dart'; +import 'package:regroup/Utils/Common/CommonDropdown.dart'; +import 'package:regroup/Utils/Common/CustomNextButton.dart'; +import 'package:regroup/Utils/Common/CustomTextformfield.dart'; +import 'package:regroup/Utils/Common/ImageUpload.dart'; + +import 'package:regroup/Utils/Common/sized_box.dart'; +import 'package:regroup/Utils/colors.dart'; +import 'package:regroup/Utils/dialogs.dart'; +import 'package:regroup/Utils/texts.dart'; +import 'package:regroup/resources/routes/route_name.dart'; +import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart'; +import 'package:shared_preferences/shared_preferences.dart'; +import 'package:path/path.dart' as path; + +class PostScreen extends StatefulWidget { + const PostScreen({super.key}); + + @override + State createState() => _PostScreenState(); +} + +class _PostScreenState extends State { + List bannerPath = []; + bool isbannerAdded = false; + var selectedContainerIndices = {}.obs; + + void toggleSelectedIndex(int index) { + if (selectedContainerIndices.contains(index)) { + selectedContainerIndices.remove(index); + } else { + selectedContainerIndices.add(index); + } + } + + TextEditingController captioncontroller = TextEditingController(); + TextEditingController ctatitilecontroller = TextEditingController(); + TextEditingController ctalinkcontroller = TextEditingController(); + + bool _isSecondDropdownEnabled = false; + + communitylist.CommunityListModel? communityModel; + List postcommunity = []; + List _postindrop = []; + List _postindropimages = []; + + Future fetchCommunitylist() async { + CommunityLsitApi abilityLsitAPI = CommunityLsitApi(); + ResponseData response = await abilityLsitAPI.getPostinList(); + + if (response.status == ResponseStatus.SUCCESS) { + communityModel = + communitylist.CommunityListModel.fromJson(response.data!); + setState(() { + postcommunity = communityModel!.data ?? []; // Store the fetched cities + _postindrop = postcommunity + .map((platform) => platform.community!.communityName.toString()) + .toList(); + _postindropimages = postcommunity + .map((platform) => + platform.community!.communityProfilePhoto.toString()) + .toList(); + }); + log(postcommunity.toString()); + // Check if there are no communities and show a toast message + if (_postindrop.isEmpty) { + utils.showToast('Please join a community to post.'); + } + } else { + print('Failed to fetch abilities'); + } + } + + List selectedabilityid = []; + int? communityid; + + String? _selectedPostType; + int? posttagtype; + bool isCommunitySelected = false; + + void getCatIdFromName(List selectedAbilities) { + selectedabilityid.clear(); // Clear existing selections + for (var name in selectedAbilities) { + for (var i = 0; i < postcommunity.length; i++) { + if (name == postcommunity[i].community!.communityName) { + selectedabilityid.add(postcommunity[i].community!.id!); + communityid = postcommunity[i].community!.id!; + setState(() { + _selectedPostType = null; + _isSecondDropdownEnabled = false; + }); + // Fetch tags for the selected community + // fetchPopularTags(communityid!, tagtype!); + // _isSecondDropdownEnabled = true; + // if (tagtype != null) { + // fetchPopularTags(communityid!, tagtype!); + // _isSecondDropdownEnabled = true; + // } + break; // Assuming each name is unique, we break after finding a match + } + } + } + print('Selected IDs: $selectedabilityid'); + } + + List tags = []; // Change the type to List + + Future fetchPopularTags(int communityId, int tagtype) async { + SharedPreferences prefs = await SharedPreferences.getInstance(); + token = prefs.getString('access-token'); + String basicAuth = 'Basic ' + + base64.encode(utf8 + .encode('RegroupUserName:71%@L%es^bUX94`J9XT*@bh,._WWM{\$%^^&&')); + + try { + final response = await Dio().get( + // 'https://regroup.betadelivery.com/api/v1/fetch-popular-tags?manage_community_xid=$communityId&name=', + 'https://regroup.betadelivery.com/api/v1/fetch-popular-tags?manage_community_xid=$communityId&is_special=$tagtype&name=', + options: Options( + headers: {'authorization': basicAuth, 'access-token': token}, + )); + if (response.statusCode == 200) { + List data = response.data['data']; + + // Map the data to a list of Data objects + tags = data.map((tag) => Data.fromJson(tag)).toList(); + + // Now you can use the tags for your dropdown or any other purpose + setState(() {}); // Trigger a rebuild to update the UI + } else { + print('Failed to fetch tags'); + } + } catch (e) { + print('Error: $e'); + } + } + + List selectedpopularid = []; + + void getPopularIdFromName(List selectedTagNames) { + selectedpopularid.clear(); // Clear existing selections + for (var name in selectedTagNames) { + for (var i = 0; i < tags.length; i++) { + if (name == tags[i].name) { + selectedpopularid.add(tags[i].id!); + break; // Assuming each name is unique, we break after finding a match + } + } + } + + // You can now use the selectedpopularid list as needed + print('Selected IDs: $selectedpopularid'); + } + + @override + void initState() { + // TODO: implement initState + fetchCommunitylist(); + super.initState(); + } + + String _selectedPostas = ''; + + void _onItemSelected(String value) { + setState(() { + _selectedPostas = value; + }); + } + + TextEditingController _tagController = TextEditingController(); + + tagUploadata() async { + utils.loader(); + Map updata = { + 'manage_community_xid': communityid, + "name": _tagController.text, + "is_special": posttagtype, + }; + final data = await Communitypostmethod().postCreatedTag(updata); + if (data.status == ResponseStatus.SUCCESS) { + Get.back(); + print("Tag created done"); + _tagController.clear(); + utils.showToast(data.message); + + final tagData = data.data; + + // Create a Data object and add it to createdtags + final newTag = CreateData( + id: tagData['data']["id"], + name: tagData['data']["name"], + ); + + setState(() { + createdtags.add(newTag); + selectedpopularid + .add(newTag.id); // Add the new tag ID to selectedpopularid + }); + } else { + Get.back(); + print("tag not created"); + return utils.showToast(data.message); + } + } + + void _showCreateTagDialog() { + showDialog( + barrierDismissible: false, + // barrierColor: Colors.transparent, + context: context, + builder: (BuildContext context) { + return AlertDialog( + backgroundColor: const Color(0xFF222935).withOpacity(0.9), + title: const Text( + "Add Interest", + style: TextStyle(color: Colors.white), + ), + content: TextField( + style: const TextStyle(color: Colors.white), + controller: _tagController, + decoration: const InputDecoration( + labelText: "Interest", + labelStyle: TextStyle(color: AppColors.white), + disabledBorder: UnderlineInputBorder( + borderSide: BorderSide(color: AppColors.black), + ), + enabledBorder: UnderlineInputBorder( + borderSide: BorderSide(color: AppColors.black)), + focusedBorder: UnderlineInputBorder( + borderSide: BorderSide(color: AppColors.black)), + ), + ), + actions: [ + TextButton( + onPressed: () { + Navigator.of(context).pop(); + }, + child: const Text("Cancel", + style: TextStyle(color: AppColors.white)), + ), + TextButton( + onPressed: () async { + tagUploadata(); + Navigator.of(context).pop(); + }, + child: const Text("Submit", + style: TextStyle(color: AppColors.white)), + ), + ], + ); + }, + ); + } + + List createdtags = []; + + Widget buildSelectedTags() { + return Wrap( + spacing: 8.0, + runSpacing: 4.0, + children: createdtags + .where((tag) => selectedpopularid.contains(tag.id)) + .map((tag) { + return Chip( + label: + Text('#${tag.name}', style: const TextStyle(color: Colors.white)), + backgroundColor: const Color(0xFFD90B2E).withOpacity(0.9), + side: const BorderSide(color: Colors.black), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(30.r), + side: const BorderSide(width: 1, color: Colors.white)), + onDeleted: () { + setState(() { + selectedpopularid.remove(tag.id); + createdtags.removeWhere((t) => t.id == tag.id); + print(selectedpopularid + .toString()); // Remove the tag from createdtags + }); + }, + materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, + padding: const EdgeInsets.symmetric(horizontal: 16), + ); + }).toList(), + ); + } + + bool isValidWebBannerLink(String link) { + RegExp urlRegExp = RegExp( + r"^(http(s)?://)?" + r"((([a-zA-Z0-9-]+)\.)+[a-zA-Z]{2,}|" + r"((\d{1,3}\.){3}\d{1,3}))" + r"(:\d{1,5})?(/([a-zA-Z0-9-._?,'+&%\$#=~])*)?$", + ); + + return urlRegExp.hasMatch(link); + } + + indiUploadata() async { + utils.loader(); + List medialist = []; + + for (var file in bannerPath.where((file) => file != null)) { + medialist.add( + await MultipartFile.fromFile( + file!.path, + filename: path.basename(file.path), + ), + ); + } + + String selectedtags = '[${selectedpopularid.join(',')}]'; + print('Selected tags: $selectedtags'); + + FormData formdata = FormData.fromMap({ + "caption": captioncontroller.text, + "file": medialist[0], + "post_in": communityid, + "manage_tags_xids": selectedtags, + "post_as": _selectedPostas, + "is_announcement": posttagtype + }); + final data = await Communitypostmethod().postUpload(formdata); + if (data.status == ResponseStatus.SUCCESS) { + Get.back(); + print("post done"); + successdialog(); + + return utils.showToast(data.message); + } else { + Get.back(); + print("post not done"); + return utils.showToast(data.message); + } + } + + busUploadata() async { + utils.loader(); + List medialist = []; + + for (var file in bannerPath.where((file) => file != null)) { + medialist.add( + await MultipartFile.fromFile( + file!.path, + filename: path.basename(file.path), + ), + ); + } + + String selectedtags = '[${selectedpopularid.join(',')}]'; + print('Selected tags: $selectedtags'); + + FormData formdata = FormData.fromMap({ + "caption": captioncontroller.text, + "file": medialist[0], + "post_in": communityid, + "manage_tags_xids": selectedtags, + "post_as": _selectedPostas, + "cta_title": ctatitilecontroller.text, + "cta_link": ctalinkcontroller.text, + "is_announcement": posttagtype + }); + final data = await Communitypostmethod().postUpload(formdata); + if (data.status == ResponseStatus.SUCCESS) { + Get.back(); + print("post done"); + successdialog(); + + return utils.showToast(data.message); + } else { + Get.back(); + print("post not done"); + return utils.showToast(data.message); + } + } + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: () => FocusManager.instance.primaryFocus?.unfocus(), + child: Scaffold( + backgroundColor: const Color(0xFF222935), + extendBody: true, + resizeToAvoidBottomInset: false, + appBar: const CommonAppbar( + titleTxt: "Create a post", + ), + body: Stack(children: [ + Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage("assets/images/png/Ellipse 1496.png"), + fit: BoxFit.fill)), + ), + Padding( + padding: EdgeInsets.symmetric(horizontal: 16.w), + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + sizedBoxHeight(20.h), + text16w400_FCFCFC("Post in"), + sizedBoxHeight(18.h), + CustomDropDownCheckBoxPostNew( + header: "Select post in", + title: "", + listData: _postindrop, + + onItemSelected: + // getCatIdFromName, + (List selectedAbilities) { + getCatIdFromName(selectedAbilities); + isCommunitySelected = true; + }, + // (p0) {}, + images: _postindropimages, + + leadingImage: const SizedBox(), + ), + sizedBoxHeight(20.h), + // sizedBoxHeight(20.h), + text16w400_FCFCFC("Post type"), + sizedBoxHeight(18.h), + CustomRadioListTile( + title: 'Regular', + subtitle: + 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.', + value: 'Regular', + groupValue: _selectedPostType, + onChanged: (String? value) { + if (isCommunitySelected && communityid != null) { + setState(() { + _selectedPostType = value!; + posttagtype = 0; + fetchPopularTags(communityid!, + posttagtype!); // Call the API after both selections + _isSecondDropdownEnabled = true; + }); + } else { + utils.showToast('Please select a community first.'); + } + }, + activeColor: Color(0XFFD90B2E), + ), + CustomRadioListTile( + title: 'Announcement', + subtitle: + 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.', + value: 'Announcement', + groupValue: _selectedPostType, + onChanged: (String? value) { + if (isCommunitySelected && communityid != null) { + setState(() { + _selectedPostType = value!; + posttagtype = 1; + fetchPopularTags(communityid!, + posttagtype!); // Call the API after both selections + _isSecondDropdownEnabled = true; + }); + } else { + utils.showToast('Please select a community first.'); + } + }, + activeColor: Color(0XFFD90B2E), + ), + + sizedBoxHeight(38.h), + // text16w400_FCFCFC("Caption"), + // sizedBoxHeight(18.h), + CustomTextFormField2( + maxlines: 3, + hintText: "Enter caption", + validator: (value) { + if (value!.isEmpty) { + return 'Enter caption'; + } + return null; + }, + inputFormatters: [ + // LengthLimitingTextInputFormatter(20), + RemoveEmojiInputFormatter(), + // FilteringTextInputFormatter.allow(RegExp('[a-zA-Z ]')) + ], + textEditingController: captioncontroller, + ), + sizedBoxHeight(25.h), + text16w400_FCFCFC("Media"), + sizedBoxHeight(18.h), + DottedBorder( + strokeWidth: 1, + dashPattern: const [7, 4], + borderType: BorderType.RRect, + radius: Radius.circular(14.r), + color: const Color(0xFF434A53), + child: commonGlassUI( + width: double.infinity, + height: 339.h, + borderRadius: BorderRadius.circular(10.r), + borderColor: Colors.transparent, + customWidget: bannerPath.isNotEmpty && isbannerAdded + ? Stack(children: [ + Image.file( + bannerPath[0]!, + fit: BoxFit.cover, + width: double.infinity, + ), + Positioned( + right: 5, + bottom: 5, + child: GestureDetector( + onTap: () { + bannerPath.clear(); + isbannerAdded = false; + setState(() {}); + }, + child: Container( + width: 27, + height: 27, + decoration: ShapeDecoration( + color: const Color(0xFF7E7E7E), + shape: RoundedRectangleBorder( + borderRadius: + BorderRadius.circular( + 5)), + ), + child: const Icon( + Icons.delete_outline_outlined, + color: Colors.white, + ))), + ), + ]) + : GestureDetector( + onTap: () { + ImageUploadBottomSheet().showModal( + context, + false, + (result) { + if (result != null && + result.isNotEmpty) { + var file = File(result); + + // Check if the file size exceeds 10 MB + int fileSizeInBytes = + file.lengthSync(); + double fileSizeInMB = + fileSizeInBytes / (1024 * 1024); + + if (fileSizeInMB > 10) { + // Show toast message if the file size exceeds 10 MB + + utils.showToast( + "The selected file is too large. Max file size is 10 MB."); + } else { + // Clear the existing image and add the new one + bannerPath.clear(); + bannerPath.add(file); + isbannerAdded = true; + setState(() {}); + } + } else { + // Handle case where no image is selected + bannerPath.clear(); + isbannerAdded = false; + setState(() {}); + } + if (Platform.isAndroid) { + Get.back(); + } + }, + ); + }, + child: Padding( + padding: + EdgeInsets.symmetric(vertical: 16.h), + child: Center( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Image.asset( + "assets/images/png/bi_download.png", + height: 36.h, + width: 36.w, + ), + sizedBoxHeight(10.h), + text14w400_FCFCFC("Upload image"), + sizedBoxHeight(8.h), + text8w400_8A8A8A( + "Allowed file extensions: jpg, png, gif Max file size: 10 MB"), + ], + ), + ), + ), + )), + ), + sizedBoxHeight(25.h), + text16w400_FCFCFC("Interest"), + sizedBoxHeight(18.h), + _isSecondDropdownEnabled == true + ? CustomDropDownPopularTag( + tags: tags, + onItemSelected: (selectedTags) { + List selectedTagNames = selectedTags + .map((tag) => tag.name!) + .toList(); + getPopularIdFromName(selectedTagNames); + // Handle selected tags here + }, + isFirstDropdownSelected: _isSecondDropdownEnabled, + ) + : + // SizedBox(), + Center( + child: + // isCommunitySelected == true + // ? text14400white('Select post type') + // : + text14400white('No Interests')), + + sizedBoxHeight(25.h), + _isSecondDropdownEnabled == true + ? Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + buildSelectedTags(), + sizedBoxHeight(10.h), + GestureDetector( + onTap: () { + _showCreateTagDialog(); + }, + child: Container( + height: 35, + width: 185.w, + decoration: BoxDecoration( + color: const Color(0xFFFFFFFF) + .withOpacity(0.2), + borderRadius: BorderRadius.circular(30), + border: Border.all( + color: const Color(0xFFD90B2E), + width: 1)), + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: 10), + child: Center( + child: text14w400_FCFCFC( + '+create new interest')), + ), + ), + ), + ], + ) + : const SizedBox(), + sizedBoxHeight(25.h), + globalAccountType == '1' + ? const SizedBox() + : Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + text16w400_FCFCFC("CTA Title"), + sizedBoxHeight(18.h), + CustomTextFormField( + // maxlines: 3, + hintText: "Enter cta title", + validator: (value) { + if (value!.isEmpty) { + return 'Enter cta title'; + } + return null; + }, + inputFormatters: [ + // LengthLimitingTextInputFormatter(20), + RemoveEmojiInputFormatter(), + FilteringTextInputFormatter.allow( + RegExp('[a-zA-Z ]')) + ], + textEditingController: ctatitilecontroller, + ), + sizedBoxHeight(25.h), + text16w400_FCFCFC("CTA Link"), + sizedBoxHeight(18.h), + CustomTextFormField( + // maxlines: 3, + hintText: "Enter cta link", + validator: (value) { + if (value == null || value.isEmpty) { + return 'Please enter a web banner link.'; + } else if (!isValidWebBannerLink(value)) { + return 'Please enter a valid web banner link.'; + } + return null; + }, + inputFormatters: [ + // LengthLimitingTextInputFormatter(20), + RemoveEmojiInputFormatter(), + // FilteringTextInputFormatter.allow( + // RegExp('[a-zA-Z ]')) + ], + textEditingController: ctalinkcontroller, + ), + ], + ), + sizedBoxHeight(25.h), + text16w400_FCFCFC("Post as"), + sizedBoxHeight(18.h), + CustomDropDownRadio( + header: "Select post as", + title: "", + listData: const ['Individual', 'Anonymous'], + onItemSelected: _onItemSelected, + leadingImage: const SizedBox()), + sizedBoxHeight(25.h), + sizedBoxHeight(40.h), + CustomButton( + text: 'Submit post', + onPressed: () { + if (globalAccountType == '1') { + // Condition for account type 1 + if (selectedabilityid.isEmpty || + selectedpopularid.isEmpty || + captioncontroller.text.isEmpty || + _selectedPostas.isEmpty || + posttagtype.isBlank!) { + print('Tags selected are $selectedpopularid'); + print( + 'Community selected are $selectedabilityid'); + print('Post as selected are $_selectedPostas'); + utils.showToast('Please fill all fields'); + } else if (bannerPath.isEmpty) { + utils.showToast('Please add a media image'); + } else { + print('Tags selected are $selectedpopularid'); + print( + 'Community selected are $selectedabilityid'); + print('Post as selected are $_selectedPostas'); + indiUploadata(); + // indisuccess(); + } + } else if (globalAccountType == '2') { + // Condition for account type 2 + // You can define different validation criteria here for account type 2 + if (selectedabilityid.isEmpty || + selectedpopularid.isEmpty || + captioncontroller.text.isEmpty || + _selectedPostas.isEmpty || + ctalinkcontroller.text.isEmpty || + ctatitilecontroller.text.isEmpty || + posttagtype.isBlank!) { + print('Tags selected are $selectedpopularid'); + print( + 'Community selected are $selectedabilityid'); + utils.showToast('Please fill all fields'); + } else if (bannerPath.isEmpty) { + utils.showToast('Please add a media image'); + } else { + print('Tags selected are $selectedpopularid'); + print( + 'Community selected are $selectedabilityid'); + busUploadata(); + } + } else { + utils.showToast('Unknown account type'); + } + }, + ), + sizedBoxHeight(150.h), + ]), + ), + ), + ])), + ); + } + + void successdialog() { + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return AlertDialog( + insetPadding: + const EdgeInsets.symmetric(vertical: 10, horizontal: 15), + contentPadding: const EdgeInsets.fromLTRB(24, 8, 24, 24), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.all(Radius.circular(14.r))), + backgroundColor: const Color(0xFF222935), + content: Padding( + padding: EdgeInsets.symmetric(horizontal: 30.w), + child: Column(mainAxisSize: MainAxisSize.min, children: [ + sizedBoxHeight(20.h), + Image.asset( + 'assets/images/png/Frame 1000004082.png', + width: 199.w, + height: 158.h, + ), + sizedBoxHeight(20.h), + text18w500Center_FCFCFC( + 'Your post has been succesfully uploaded'), + sizedBoxHeight(20.h), + InkWell( + onTap: () { + Get.toNamed(RouteName.mainscreen, arguments: 0); + }, + child: Container( + height: 35.h, + width: 216.w, + decoration: BoxDecoration( + border: Border.all( + color: const Color(0xFF434A53), width: 1), + gradient: const LinearGradient( + begin: Alignment.topLeft, + end: Alignment.bottomRight, + colors: [ + Color.fromRGBO(255, 255, 255, 0.054), + Color.fromRGBO(255, 255, 255, 0.072), + ], + stops: [0.0233, 1.0], + transform: GradientRotation(271.14 * + (3.141592653589793 / + 180)), // Converting degrees to radians + ), + borderRadius: BorderRadius.circular(30.r), + ), + child: Center(child: text14w400_FCFCFC('View post')), + ), + ), + sizedBoxHeight(40.h) + ]))); + }, + ); + } + + void successBottomsheet() { + Get.bottomSheet(Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(14.r), + color: const Color(0xFF222935)), + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 30.w), + child: Column(mainAxisSize: MainAxisSize.min, children: [ + sizedBoxHeight(20.h), + Image.asset( + 'assets/images/png/Frame 1000004082.png', + width: 199.w, + height: 158.h, + ), + sizedBoxHeight(20.h), + text18w500Center_FCFCFC( + 'Your post has been succesfully uploaded'), + sizedBoxHeight(20.h), + InkWell( + onTap: () { + Get.toNamed(RouteName.mainscreen, arguments: 0); + }, + child: Container( + height: 35.h, + width: 216.w, + decoration: BoxDecoration( + border: + Border.all(color: const Color(0xFF434A53), width: 1), + gradient: const LinearGradient( + begin: Alignment.topLeft, + end: Alignment.bottomRight, + colors: [ + Color.fromRGBO(255, 255, 255, 0.054), + Color.fromRGBO(255, 255, 255, 0.072), + ], + stops: [0.0233, 1.0], + transform: GradientRotation(271.14 * + (3.141592653589793 / + 180)), // Converting degrees to radians + ), + borderRadius: BorderRadius.circular(30.r), + ), + child: Center(child: text14w400_FCFCFC('Check out')), + ), + ), + sizedBoxHeight(40.h) + ])))); + } + + Widget containerTile({ + required String text, + required int index, + }) { + return Obx(() { + return GestureDetector( + onTap: () { + toggleSelectedIndex(index); + }, + child: Container( + height: 35, + decoration: BoxDecoration( + color: selectedContainerIndices.contains(index) + ? const Color(0xFFD90B2E).withOpacity(0.4) + : const Color(0xFFFFFFFF).withOpacity(0.2), + borderRadius: BorderRadius.circular(30), + border: Border.all(color: const Color(0xFFD90B2E), width: 1)), + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 20), + child: Center(child: text14w400_FCFCFC(text)), + ), + ), + ); + }); + } +} + +// class CustomDropDownCheckBoxPostNew extends StatefulWidget { +// const CustomDropDownCheckBoxPostNew({ +// Key? key, +// required this.header, +// required this.title, +// required this.listData, +// required this.onItemSelected, +// required this.images, +// required this.leadingImage, +// }) : super(key: key); + +// final String header; +// final String title; +// final List listData; +// final Function(List) onItemSelected; +// final List? images; +// final Widget? leadingImage; + +// @override +// State createState() => +// _CustomDropDownCheckBoxPostNewState(); +// } + +// class _CustomDropDownCheckBoxPostNewState +// extends State { +// RxBool onDropTap = false.obs; +// RxString selectedValue = +// ''.obs; // Use a single string to track the selected value + +// @override +// Widget build(BuildContext context) { +// return Obx( +// () => Column( +// mainAxisSize: MainAxisSize.min, +// crossAxisAlignment: CrossAxisAlignment.start, +// children: [ +// GestureDetector( +// onTap: () { +// onDropTap.value = !onDropTap.value; +// }, +// child: Container( +// width: double.infinity, +// padding: EdgeInsets.only( +// top: 14.0, bottom: 14.0, right: 22.w, left: 12.w), +// decoration: BoxDecoration( +// color: const Color(0xFFFFFFFF).withOpacity(0.10), +// borderRadius: onDropTap.value +// ? BorderRadius.vertical(top: Radius.circular(30.r)) +// : BorderRadius.circular(30.r), +// gradient: LinearGradient( +// begin: Alignment.topLeft, +// end: Alignment.bottomRight, +// colors: [ +// const Color(0xFFffffff).withOpacity(0.50), +// const Color(0xFFFFFFFF).withOpacity(0.50), +// ], +// ), +// border: Border.all(color: const Color(0xFF434A53)), +// ), +// child: Row( +// mainAxisAlignment: MainAxisAlignment.spaceBetween, +// children: [ +// Expanded( +// child: Row( +// children: [ +// if (widget.leadingImage != null) widget.leadingImage!, +// SizedBox(width: 16.w), +// Expanded( +// child: Text( +// selectedValue.value.isEmpty +// ? widget.header +// : selectedValue.value, +// style: TextStyle( +// color: Colors.white, +// fontSize: 16.sp, +// fontFamily: 'Helvetica', +// fontWeight: FontWeight.w400, +// ), +// overflow: TextOverflow.ellipsis, +// ), +// ), +// ], +// ), +// ), +// onDropTap.value +// ? Image.asset('assets/images/png/arrowup.png') +// : Image.asset('assets/images/png/arrowdown.png'), +// ], +// ), +// ), +// ), +// if (onDropTap.value) +// Container( +// width: double.infinity, +// height: 250.h, +// decoration: BoxDecoration( +// color: const Color(0xFFFFFFFF).withOpacity(0.10), +// borderRadius: +// BorderRadius.vertical(bottom: Radius.circular(30.r)), +// border: Border.all(color: const Color(0xFF434A53)), +// gradient: LinearGradient( +// begin: Alignment.topLeft, +// end: Alignment.bottomRight, +// colors: [ +// const Color(0xFFffffff).withOpacity(0.50), +// const Color(0xFFFFFFFF).withOpacity(0.50), +// ], +// ), +// ), +// child: widget.listData.isEmpty +// ? Padding( +// padding: const EdgeInsets.symmetric( +// vertical: 10.0, horizontal: 20.0), +// child: Center( +// child: Text( +// 'No communities available', +// style: TextStyle( +// color: Colors.white, +// fontSize: 16.sp, +// fontFamily: 'Helvetica', +// fontWeight: FontWeight.w400, +// ), +// ), +// ), +// ) +// : ListView.builder( +// shrinkWrap: true, +// physics: ScrollPhysics(), +// itemCount: widget.listData.length, +// itemBuilder: (context, index) { +// String item = widget.listData[index]; +// String image = widget.images![index]; +// return InkWell( +// onTap: () { +// setState(() { +// selectedValue.value = +// item; // Set the selected value +// onDropTap.value = false; // Close the dropdown +// }); +// widget.onItemSelected( +// [item]); // Pass the selected item +// }, +// child: Column( +// crossAxisAlignment: CrossAxisAlignment.start, +// children: [ +// Padding( +// padding: const EdgeInsets.symmetric( +// vertical: 10.0, horizontal: 20.0), +// child: Row( +// children: [ +// Container( +// width: 40.w, +// height: 40.h, +// decoration: BoxDecoration( +// borderRadius: +// BorderRadius.circular(8.r), +// image: image.isEmpty +// ? null +// : DecorationImage( +// image: NetworkImage(image), +// fit: BoxFit.cover, +// )), +// ), +// SizedBox(width: 8.w), +// Expanded( +// child: Text( +// item, +// style: TextStyle( +// color: Colors.white, +// fontSize: 16.sp, +// fontFamily: 'hiragino', +// fontWeight: FontWeight.w500, +// ), +// overflow: TextOverflow.ellipsis, +// ), +// ), +// Checkbox( +// side: const BorderSide( +// color: Color(0xFF434A53)), +// value: selectedValue.value == +// item, // Check if item is selected +// activeColor: const Color(0xFF434A53), +// checkColor: Colors.white, +// onChanged: (bool? value) { +// if (value == true) { +// setState(() { +// selectedValue.value = +// item; // Set the selected value +// onDropTap.value = +// false; // Close the dropdown +// }); +// widget.onItemSelected( +// [item]); // Pass the selected item +// } +// }, +// ), +// ], +// ), +// ), +// if (index != widget.listData.length - 1) +// const Divider( +// thickness: 1, color: Color(0xFF434A53)), +// ], +// ), +// ); +// }, +// ), +// ), +// ], +// ), +// ); +// } +// } + +class CustomDropDownCheckBoxPostNew extends StatefulWidget { + const CustomDropDownCheckBoxPostNew({ + Key? key, + required this.header, + required this.title, + required this.listData, + required this.onItemSelected, + required this.images, + required this.leadingImage, + }) : super(key: key); + + final String header; + final String title; + final List listData; + final Function(List) onItemSelected; + final List? images; + final Widget? leadingImage; + + @override + State createState() => + _CustomDropDownCheckBoxPostNewState(); +} + +class _CustomDropDownCheckBoxPostNewState + extends State { + RxBool onDropTap = false.obs; + RxString selectedValue = ''.obs; + + @override + Widget build(BuildContext context) { + // Define the height of each item and the padding for the container + const double itemHeight = 60.0; + const double containerPadding = 16.0; + const double minimumDropdownHeight = + 50.0; // Minimum height when list is empty + // Calculate the height of the dropdown container based on the number of items + double dropdownHeight = widget.listData.isEmpty + ? minimumDropdownHeight + : (widget.listData.length * itemHeight) + containerPadding; + + // Set a maximum height to avoid the dropdown becoming too large + dropdownHeight = dropdownHeight > 250.0 ? 250.0 : dropdownHeight; + + return Obx( + () => Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + GestureDetector( + onTap: () { + onDropTap.value = !onDropTap.value; + }, + child: Container( + width: double.infinity, + padding: EdgeInsets.only( + top: 14.0, bottom: 14.0, right: 22.0, left: 12.0), + decoration: BoxDecoration( + color: const Color(0xFFFFFFFF).withOpacity(0.10), + borderRadius: onDropTap.value + ? BorderRadius.vertical(top: Radius.circular(30.0)) + : BorderRadius.circular(30.0), + gradient: LinearGradient( + begin: Alignment.topLeft, + end: Alignment.bottomRight, + colors: [ + const Color(0xFFffffff).withOpacity(0.50), + const Color(0xFFFFFFFF).withOpacity(0.50), + ], + ), + border: Border.all(color: const Color(0xFF434A53)), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Row( + children: [ + if (widget.leadingImage != null) widget.leadingImage!, + SizedBox(width: 16.0), + Expanded( + child: Text( + selectedValue.value.isEmpty + ? widget.header + : selectedValue.value, + style: TextStyle( + color: Colors.white, + fontSize: 16.0, + fontFamily: 'Helvetica', + fontWeight: FontWeight.w400, + ), + overflow: TextOverflow.ellipsis, + ), + ), + ], + ), + ), + onDropTap.value + ? Image.asset('assets/images/png/arrowup.png') + : Image.asset('assets/images/png/arrowdown.png'), + ], + ), + ), + ), + if (onDropTap.value) + ClipRRect( + borderRadius: + BorderRadius.vertical(bottom: Radius.circular(30.0)), + child: Container( + width: double.infinity, + height: dropdownHeight, + decoration: BoxDecoration( + color: const Color(0xFFFFFFFF).withOpacity(0.10), + border: Border.all(color: const Color(0xFF434A53)), + gradient: LinearGradient( + begin: Alignment.topLeft, + end: Alignment.bottomRight, + colors: [ + const Color(0xFFffffff).withOpacity(0.50), + const Color(0xFFFFFFFF).withOpacity(0.50), + ], + ), + ), + child: widget.listData.isEmpty + ? Padding( + padding: const EdgeInsets.symmetric( + vertical: 10.0, horizontal: 20.0), + child: Center( + child: Text( + 'No communities available', + style: TextStyle( + color: Colors.white, + fontSize: 16.0, + fontFamily: 'Helvetica', + fontWeight: FontWeight.w400, + ), + ), + ), + ) + : ListView.separated( + shrinkWrap: true, + physics: ClampingScrollPhysics(), + itemCount: widget.listData.length, + separatorBuilder: (context, index) => + Divider(thickness: 1, color: Color(0xFF434A53)), + itemBuilder: (context, index) { + String item = widget.listData[index]; + String image = widget.images![index]; + return InkWell( + onTap: () { + setState(() { + selectedValue.value = + item; // Set the selected value + onDropTap.value = false; // Close the dropdown + }); + widget.onItemSelected( + [item]); // Pass the selected item + }, + child: Padding( + padding: const EdgeInsets.symmetric( + vertical: 10.0, horizontal: 20.0), + child: Row( + children: [ + Container( + width: 40.0, + height: 40.0, + decoration: BoxDecoration( + borderRadius: + BorderRadius.circular(8.0), + image: image.isEmpty + ? null + : DecorationImage( + image: NetworkImage(image), + fit: BoxFit.cover, + )), + ), + SizedBox(width: 8.0), + Expanded( + child: Text( + item, + style: TextStyle( + color: Colors.white, + fontSize: 16.0, + fontFamily: 'hiragino', + fontWeight: FontWeight.w500, + ), + overflow: TextOverflow.ellipsis, + ), + ), + Checkbox( + side: const BorderSide( + color: Color(0xFF434A53)), + value: selectedValue.value == item, + activeColor: const Color(0xFF434A53), + checkColor: Colors.white, + onChanged: (bool? value) { + if (value == true) { + setState(() { + selectedValue.value = + item; // Set the selected value + onDropTap.value = + false; // Close the dropdown + }); + widget.onItemSelected( + [item]); // Pass the selected item + } + }, + ), + ], + ), + ), + ); + }, + ), + ), + ), + ], + ), + ); + } +} + +class CustomDropDownPopularTag extends StatefulWidget { + final List tags; + final Function(List) onItemSelected; + final bool isFirstDropdownSelected; + + CustomDropDownPopularTag({ + required this.tags, + required this.onItemSelected, + required this.isFirstDropdownSelected, + }); + + @override + _CustomDropDownPopularTagState createState() => + _CustomDropDownPopularTagState(); +} + +class _CustomDropDownPopularTagState extends State { + RxBool onDropTap = false.obs; + RxList selectedTags = [].obs; + RxList filteredTags = [].obs; + TextEditingController textEditingController = TextEditingController(); + + @override + void initState() { + super.initState(); + filteredTags.value = widget.tags; + textEditingController.addListener(filterTags); + } + + @override + void didUpdateWidget(CustomDropDownPopularTag oldWidget) { + super.didUpdateWidget(oldWidget); + if (widget.tags != oldWidget.tags) { + // Clear the selected tags and update the filtered tags when tags change + selectedTags.clear(); + filteredTags.value = widget.tags; + } + } + + void _handleDropdownTap() { + if (widget.isFirstDropdownSelected) { + onDropTap.value = !onDropTap.value; + } else { + utils.showToast('Please select an item from the first dropdown.'); + } + } + + void filterTags() { + String query = textEditingController.text.toLowerCase(); + if (query.isNotEmpty) { + filteredTags.value = widget.tags + .where((tag) => + tag.name!.toLowerCase().contains(query) && + !selectedTags.contains(tag)) + .toList(); + } else { + filteredTags.value = + widget.tags.where((tag) => !selectedTags.contains(tag)).toList(); + } + onDropTap.value = filteredTags.isNotEmpty; + } + + @override + Widget build(BuildContext context) { + const double itemHeight = 60.0; + const double containerPadding = 16.0; + const double minimumDropdownHeight = + 50.0; // Minimum height when list is empty + + // Calculate the height of the dropdown container based on the number of items + double dropdownHeight = filteredTags.isEmpty + ? minimumDropdownHeight + : (filteredTags.length * itemHeight) + containerPadding; + + // Set a maximum height to avoid the dropdown becoming too large + dropdownHeight = dropdownHeight > 250.0 ? 250.0 : dropdownHeight; + return Obx( + () => Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // Dropdown Search Input + Container( + width: double.infinity, + height: 50, + padding: const EdgeInsets.symmetric(horizontal: 12), + decoration: BoxDecoration( + color: const Color(0xFFFFFFFF).withOpacity(0.10), + borderRadius: onDropTap.value && filteredTags.isNotEmpty + ? const BorderRadius.vertical( + top: Radius.circular(30), + ) + : BorderRadius.circular(30), + border: Border.all(color: const Color(0xFF434A53)), + ), + child: Center( + child: TextFormField( + controller: textEditingController, + style: const TextStyle( + fontSize: 16, + color: Colors.white, + fontFamily: 'Helvetica', + ), + cursorColor: Colors.red, + obscureText: false, + decoration: InputDecoration( + hintText: 'Search Interest', + hintStyle: const TextStyle( + fontSize: 16, + color: Colors.white, + fontWeight: FontWeight.w400, + fontFamily: 'Helvetica', + ), + suffixIcon: GestureDetector( + onTap: _handleDropdownTap, + child: SizedBox( + height: 20, + width: 20, + child: Center( + child: Icon( + onDropTap.value + ? Icons.arrow_drop_up + : Icons.arrow_drop_down, + color: Colors.white, + ), + ), + ), + ), + border: InputBorder.none, + ), + onTap: _handleDropdownTap), + ), + ), + + // Dropdown List + if (onDropTap.value && filteredTags.isNotEmpty) + Container( + height: dropdownHeight, + // 250.h, + width: double.infinity, + decoration: BoxDecoration( + color: const Color(0xFFFFFFFF).withOpacity(0.10), + borderRadius: const BorderRadius.vertical( + bottom: Radius.circular(30), + ), + border: Border.all(color: const Color(0xFF434A53)), + ), + child: ListView.builder( + shrinkWrap: true, + physics: ScrollPhysics(), + itemCount: filteredTags.length, + itemBuilder: (context, index) { + return InkWell( + onTap: () { + Data selectedItem = filteredTags[index]; + if (selectedTags.contains(selectedItem)) { + selectedTags.remove(selectedItem); + } else { + selectedTags.add(selectedItem); + } + textEditingController.clear(); + widget.onItemSelected(selectedTags.toList()); + filterTags(); // Update the filtered list + }, + child: Padding( + padding: const EdgeInsets.all(10.0), + child: Row( + children: [ + Text( + filteredTags[index].name!, + style: const TextStyle( + color: Colors.white, + fontSize: 16, + fontWeight: FontWeight.w400, + fontFamily: 'Helvetica', + ), + ), + const Spacer(), + Text( + 'Popularity: ${filteredTags[index].tagPopularity}', + style: const TextStyle( + color: Colors.white70, + fontSize: 12, + ), + ), + ], + ), + ), + ); + }, + ), + ), + sizedBoxHeight(20.h), + + // Selected Tags Displayed as Chips + if (selectedTags.isNotEmpty) + Wrap( + spacing: 8.0, + runSpacing: 4.0, + children: selectedTags.map((tag) { + return Chip( + label: Text('#${tag.name!}', + style: const TextStyle(color: Colors.white)), + backgroundColor: const Color(0xFFD90B2E).withOpacity(0.9), + side: const BorderSide(color: Colors.black), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(30.r), + side: const BorderSide(width: 1, color: Colors.white)), + onDeleted: () { + selectedTags.remove(tag); + widget.onItemSelected(selectedTags.toList()); + filterTags(); // Update the filtered list after removing a tag + }, + materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, + padding: const EdgeInsets.symmetric(horizontal: 16), + ); + }).toList(), + ), + ], + ), + ); + } +} + +class CreateData { + final int id; + final String name; + + CreateData({required this.id, required this.name}); +} + +class CustomRadioListTile extends StatelessWidget { + final String title; + final String subtitle; + final String value; + final String? groupValue; + final ValueChanged onChanged; + final Color activeColor; + + const CustomRadioListTile({ + Key? key, + required this.title, + required this.subtitle, + required this.value, + required this.groupValue, + required this.onChanged, + required this.activeColor, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: () { + onChanged(value); + }, + child: ListTile( + contentPadding: EdgeInsets.zero, + leading: Transform.translate( + offset: Offset(0, -10), + child: Transform.scale( + scale: 1.5, + child: Radio( + value: value, + groupValue: groupValue, + onChanged: onChanged, + activeColor: activeColor, + materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, + ), + ), + ), + title: text18w400white(title), + subtitle: text14400white(subtitle), + ), + ); + } +} diff --git a/lib/Main_Screens/Community_HomePage/TagsdDetailScreen.dart b/lib/Main_Screens/Community_HomePage/TagsdDetailScreen.dart new file mode 100644 index 0000000..3150ac1 --- /dev/null +++ b/lib/Main_Screens/Community_HomePage/TagsdDetailScreen.dart @@ -0,0 +1,572 @@ +import 'dart:developer'; + +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:regroup/Common/CommonTabBar.dart'; +import 'package:regroup/Common/ConvertServerDateToUserDate.dart'; +import 'package:regroup/Common/base_manager.dart'; +import 'package:regroup/Common/controller/NormalPostCard.dart'; +import 'package:regroup/Main_Screens/Community/Model/CommonDatumObjModel.dart'; +import 'package:regroup/Main_Screens/Community/Model/fetchicons.dart'; +import 'package:regroup/Main_Screens/Community/ViewModel/getmethod.dart'; + +import 'package:regroup/Main_Screens/Community_HomePage/view_model/CountersHelper.dart'; +import 'package:regroup/Main_Screens/Community_HomePage/view_model/communitygetmethod.dart'; +import 'package:regroup/Utils/Common/CommonAppbar.dart'; +import 'package:regroup/Utils/Common/ShimmerCommon.dart'; +import 'package:regroup/Utils/Common/sized_box.dart'; +import 'package:regroup/Utils/dialogs.dart'; + +import 'package:regroup/sidemenu/view_model/postmethod.dart'; + +class TagdetailScreen extends StatefulWidget { + const TagdetailScreen({super.key}); + + @override + State createState() => _TagdetailScreenState(); +} + +class _TagdetailScreenState extends State { + int tagsid = Get.arguments['tagid']; + String tagsname = Get.arguments['tagname']; + bool istagpin = Get.arguments['ispinnedtag']; + + @override + void initState() { + // TODO: implement initState + + super.initState(); + } + + pinunpinTag(int tagid) async { + // utils.loader(); + Map updata = { + "manage_tags_xid": tagid, + }; + final data = await SidebarTags().postUserpin(updata); + if (data.status == ResponseStatus.SUCCESS) { + // Get.back(); + setState(() { + istagpin = !istagpin; // Toggle the pin state + }); + return utils.showToast(data.message); + } else { + // Get.back(); + return utils.showToast(data.message); + } + } + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: const Color(0xFF222935), + extendBody: true, + resizeToAvoidBottomInset: false, + appBar: CommonAppbar( + titleTxt: tagsname, + customActionWidget: GestureDetector( + onTap: () async { + await pinunpinTag(tagsid); + }, + child: istagpin == true + ? Image.asset( + "assets/images/png/sidemenu/f7_pin-fill.png", + height: 26.h, + width: 26.w, + ) + : Image.asset( + "assets/images/png/sidemenu/f7_pin-fill (1).png", + height: 26.h, + width: 26.w, + ), + )), + body: Stack(children: [ + Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage("assets/images/png/Ellipse 1496.png"), + fit: BoxFit.fill)), + ), + Padding( + padding: const EdgeInsets.symmetric(vertical: 16), + child: Column(children: [ + Expanded( + child: DefaultTabController( + length: 2, + child: Column( + children: [ + const CommonTabBar(tabs: [ + Tab( + text: 'Popular', + ), + Tab( + text: 'Latest', + ), + ]), + Expanded( + child: TabBarView( + children: [ + PopularTab(id: tagsid), + // cyclelatestTab(), + LatestTab(id: tagsid) + ], + ), + ), + ], + ), + ), + ), + ])) + ])); + } +} + +class PopularTab extends StatefulWidget { + const PopularTab({super.key, required this.id}); + + final int id; + + @override + State createState() => _PopularTabState(); +} + +class _PopularTabState extends State { + + List _reactions = []; + final Map _selectedReactions = {}; + final CountersHelper countersHelper = Get.find(); + int? likeIconIdnew; + + @override + void initState() { + + + super.initState(); + } + + _fetchIcons() { + _reactions = fetchlikeIconsModel!.data ?? []; + for (var post in commonobjmodel!.data) { + //Check if post as a like icon + if (post.likeIcon?.likeIcon?.id != null) { + likeIconIdnew = post.likeIcon!.likeIconsXid; + + final selectedReaction = _reactions.firstWhere( + (r) => r.id == likeIconIdnew, + orElse: () => _reactions.first, + ); + + _selectedReactions[post.id!] = + selectedReaction; // Set selected reaction for this post + } else { + _selectedReactions[post.id!] = null; // No reaction selected + // print('No reaction selected for post $postId'); + } + } + } + + Future setValues() async { + _setModel(); + countersHelper.setListsPopular(); + _fetchIcons(); + } + + _sortTags(index) { + var tags = commonobjmodel!.data[index].attachTags + .where((tag) => tag.manageTag?.name?.isNotEmpty ?? false) + .map((tag) => tag.manageTag!) + .toList(); + + return tags; + } + + _setModel() { + commonobjmodel = null; + commonobjmodel = CommonDatumObjModel( + status: tagpopulardetailobj!.status, + statusCode: tagpopulardetailobj!.statusCode, + message: tagpopulardetailobj!.message, + data: tagpopulardetailobj!.data + .map((e) => CommonDatumObjModelData( + id: e.id, + likecount: e.likecount, + isISaved: e.isISaved, + tagsXid: e.tagsXid, + isILiked: e.isILiked, + totalComment: e.totalComment, + totalSave: e.totalSave, + iamPrincipalXid: e.iamPrincipalXid, + postIn: e.postIn, + caption: e.caption, + image: e.image, + manageTagsXids: e.manageTagsXids, + postAs: e.postAs, + ctaTitle: e.ctaTitle, + ctaLink: e.ctaLink, + createdAt: e.createdAt, + likeIcon: LikeIcon1( + likeIcon: LikeIconClass1( + id: e.likeIcon?.likeIcon?.id, + image: e.likeIcon?.likeIcon?.image), + likeIconsXid: e.likeIcon?.likeIconsXid, + ), + totalViewCount: e.totalViewCount, + totalReactionCount: e.totalReactionCount, + totalCommentCount: e.totalCommentCount, + totalImpressionCount: e.totalImpressionCount, + totalPopularScore: e.totalPopularScore, + totalHoursAgo: e.totalHoursAgo, + iamPrincipal: IamPrincipal( + id: e.iamPrincipal!.id, + isUserPinned: e.iamPrincipal!.isUserPinned, + principalTypeXid: e.iamPrincipal!.principalTypeXid, + userName: e.iamPrincipal!.userName, + fullName: e.iamPrincipal!.fullName, + profilePhoto: e.iamPrincipal!.profilePhoto), + community: Community( + id: e.community!.id, + communityProfilePhoto: e.community!.communityProfilePhoto, + communityName: e.community!.communityName), + attachTags: e.attachTags + .map((e) => AttachTag1( + managePostXid: e.managePostXid, + manageTagXid: e.manageTagXid, + manageTag: ManageTagPopular( + id: e.manageTag?.id, + isPinned: e.manageTag?.isPinned, + name: e.manageTag?.name))) + .toList())) + .toList()); + } + + Future _initialize() async { + await Communitygetmethod().getPopularTagsdata(widget.id); + await setValues(); + } + + + @override + Widget build(BuildContext context) { + return FutureBuilder( + future: _initialize(), + builder: (ctx, snapshot) { + if (snapshot.connectionState == ConnectionState.waiting) { + return const Center(child: ShimmerCommon()); + } + + if (snapshot.hasError) { + return Center( + child: Text( + '${snapshot.error} occurred', + style: TextStyle(fontSize: 18.spMin), + ), + ); + } + + if (snapshot.connectionState == ConnectionState.done) { + + return Stack(clipBehavior: Clip.none, children: [ + Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage("assets/images/png/Ellipse 1496.png"), + fit: BoxFit.fill), + ), + ), + commonobjmodel!.data.isEmpty + ? Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Center( + child: Column( + children: [ + Text( + "No Posts Available", + style: TextStyle( + color: Colors.white, + fontSize: 16.sp, + fontWeight: FontWeight.w600), + ) + ], + ), + ), + ]) + : Column( + children: [ + sizedBoxHeight(20.h), + Expanded( + child: ListView.builder( + shrinkWrap: true, + itemCount: commonobjmodel!.data.length, + itemBuilder: (context, index) { + var timeAgo = ConvertServerDateToUserDate() + .convertServerDateToReadableFormate( + commonobjmodel!.data[index].createdAt + .toString()); + + return Column( + children: [ + NormalCardTile( + tags: _sortTags(index), + createAt: timeAgo ?? '1 hour', + commonObj: commonobjmodel!.data[index], + forWhichTab: 'popular', + reactions: _reactions, + selectedReactions: _selectedReactions, + currentIndex: index, + ), + sizedBoxHeight(20.h) + ], + ); + }, + ), + ), + ], + ) + ]); + } + return Container(); + }); + } + + Widget _buildNoDataBody(context) { + return Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + "No Data Found", + style: TextStyle( + color: Colors.white, + fontSize: 16.sp, + fontWeight: FontWeight.w600), + ) + ], + ), + ); + } +} + +class LatestTab extends StatefulWidget { + const LatestTab({super.key, required this.id}); + + final int id; + + @override + State createState() => _LatestTabState(); +} + +class _LatestTabState extends State { + List _reactions = []; + final Map _selectedReactions = {}; + final CountersHelper countersHelper = Get.find(); + int? likeIconIdnew; + + @override + void initState() { + super.initState(); + } + + Future _fetchIcons() async { + _reactions = fetchlikeIconsModel!.data ?? []; + for (var post in commonobjmodel!.data) { + //Check if post as a like icon + if (post.likeIcon?.likeIcon?.id != null) { + likeIconIdnew = post.likeIcon!.likeIconsXid; + + final selectedReaction = _reactions.firstWhere( + (r) => r.id == likeIconIdnew, + orElse: () => _reactions.first, + ); + + _selectedReactions[post.id!] = + selectedReaction; // Set selected reaction for this post + } else { + _selectedReactions[post.id!] = null; // No reaction selected + // print('No reaction selected for post $postId'); + } + } + } + + Future setValues() async { + _setModel(); + countersHelper.setListsPopular(); + _fetchIcons(); + } + + _sortTags(index) { + var tags = commonobjmodel!.data[index].attachTags + .where((tag) => tag.manageTag?.name?.isNotEmpty ?? false) + .map((tag) => tag.manageTag!) + .toList(); + + return tags; + } + + _setModel() { + commonobjmodel = null; + commonobjmodel = CommonDatumObjModel( + status: tagdetailobj!.status, + statusCode: tagdetailobj!.statusCode, + message: tagdetailobj!.message, + data: tagdetailobj!.data + .map((e) => CommonDatumObjModelData( + id: e.id, + likecount: e.likecount, + isISaved: e.isISaved, + tagsXid: e.tagsXid, + isILiked: e.isILiked, + totalComment: e.totalComment, + totalSave: e.totalSave, + iamPrincipalXid: e.iamPrincipalXid, + postIn: e.postIn, + caption: e.caption, + image: e.image, + manageTagsXids: e.manageTagsXids, + postAs: e.postAs, + ctaTitle: e.ctaTitle, + ctaLink: e.ctaLink, + createdAt: e.createdAt, + likeIcon: LikeIcon1( + likeIcon: LikeIconClass1( + id: e.likeIcon?.likeIcon?.id, + image: e.likeIcon?.likeIcon?.image), + likeIconsXid: e.likeIcon?.likeIconsXid, + ), + totalViewCount: e.totalViewCount, + totalReactionCount: e.totalReactionCount, + totalCommentCount: e.totalCommentCount, + totalImpressionCount: e.totalImpressionCount, + totalPopularScore: e.totalPopularScore, + totalHoursAgo: e.totalHoursAgo, + iamPrincipal: IamPrincipal( + id: e.iamPrincipal!.id, + isUserPinned: e.iamPrincipal!.isUserPinned, + principalTypeXid: e.iamPrincipal!.principalTypeXid, + userName: e.iamPrincipal!.userName, + fullName: e.iamPrincipal!.fullName, + profilePhoto: e.iamPrincipal!.profilePhoto), + community: Community( + id: e.community!.id, + communityProfilePhoto: e.community!.communityProfilePhoto, + communityName: e.community!.communityName), + attachTags: e.attachTags + .map((e) => AttachTag1( + managePostXid: e.managePostXid, + manageTagXid: e.manageTagXid, + manageTag: ManageTagPopular( + id: e.manageTag?.id, + isPinned: e.manageTag?.isPinned, + name: e.manageTag?.name))) + .toList())) + .toList()); + } + + Future _initialize() async { + await Communitygetmethod().getTagsdata(widget.id); + await setValues(); + } + + @override + Widget build(BuildContext context) { + return FutureBuilder( + future: _initialize(), + builder: (ctx, snapshot) { + if (snapshot.connectionState == ConnectionState.waiting) { + return const Center(child: ShimmerCommon()); + } + + if (snapshot.hasError) { + return Center( + child: Text( + '${snapshot.error} occurred', + style: TextStyle(fontSize: 18.spMin), + ), + ); + } + + if (snapshot.connectionState == ConnectionState.done) { + return Stack(clipBehavior: Clip.none, children: [ + Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage("assets/images/png/Ellipse 1496.png"), + fit: BoxFit.fill), + ), + ), + commonobjmodel!.data.isEmpty + ? Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Center( + child: Column( + children: [ + Text( + "No Posts Available", + style: TextStyle( + color: Colors.white, + fontSize: 16.sp, + fontWeight: FontWeight.w600), + ) + ], + ), + ), + ]) + : Column( + children: [ + sizedBoxHeight(20.h), + Expanded( + child: ListView.builder( + shrinkWrap: true, + itemCount: commonobjmodel!.data.length, + itemBuilder: (context, index) { + var timeAgo = ConvertServerDateToUserDate() + .convertServerDateToReadableFormate( + commonobjmodel!.data[index].createdAt + .toString()); + + return Column( + children: [ + NormalCardTile( + tags: _sortTags(index), + createAt: timeAgo ?? '1 hour', + commonObj: commonobjmodel!.data[index], + forWhichTab: 'popular', + reactions: _reactions, + selectedReactions: _selectedReactions, + currentIndex: index, + ), + sizedBoxHeight(20.h) + ], + ); + }, + ), + ), + ], + ) + ]); + } + return Container(); + }); + } + + Widget _buildNoDataBody(context) { + return Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + "No Data Found", + style: TextStyle( + color: Colors.white, + fontSize: 16.sp, + fontWeight: FontWeight.w600), + ) + ], + ), + ); + } +} diff --git a/lib/Main_Screens/Community_HomePage/view_model/CountersHelper.dart b/lib/Main_Screens/Community_HomePage/view_model/CountersHelper.dart new file mode 100644 index 0000000..b68e987 --- /dev/null +++ b/lib/Main_Screens/Community_HomePage/view_model/CountersHelper.dart @@ -0,0 +1,32 @@ +import 'package:get/get.dart'; +import 'package:regroup/Main_Screens/Community/Model/CommonDatumObjModel.dart'; +import 'package:regroup/Main_Screens/Community/Model/FeedPostModel.dart'; +import 'package:regroup/Main_Screens/Community/ViewModel/LatestPost.dart'; + +List combinedListGlobal = []; +CommonDatumObjModel? commonobjmodel; + +class CountersHelper extends GetxController { + RxList likesCounterPopular = [].obs; + RxList commentsCounterPopular = [].obs; + RxList savePostCounterPopular = [].obs; + RxList saveButtonPopular = [].obs; + List pinButtonPopular = []; + RxBool updateFeedsPage = false.obs; + setListsPopular() { + likesCounterPopular.clear(); + commentsCounterPopular.clear(); + savePostCounterPopular.clear(); + saveButtonPopular.clear(); + pinButtonPopular.clear(); + for (var i = 0; i < commonobjmodel!.data.length; i++) { + likesCounterPopular.add(commonobjmodel?.data[i].likecount ?? 0); + commentsCounterPopular + .add(commonobjmodel?.data[i].totalCommentCount ?? 0); + savePostCounterPopular.add(commonobjmodel?.data[i].totalSave ?? 0); + saveButtonPopular.add(commonobjmodel?.data[i].isISaved ?? false); + pinButtonPopular + .add(commonobjmodel?.data[i].iamPrincipal?.isUserPinned ?? false); + } + } +} diff --git a/lib/Main_Screens/Community_HomePage/view_model/communitygetmethod.dart b/lib/Main_Screens/Community_HomePage/view_model/communitygetmethod.dart new file mode 100644 index 0000000..b802ed0 --- /dev/null +++ b/lib/Main_Screens/Community_HomePage/view_model/communitygetmethod.dart @@ -0,0 +1,37 @@ +import 'dart:developer'; + +import 'package:regroup/Common/api_urls.dart'; +import 'package:regroup/Common/base_manager.dart'; +import 'package:regroup/Common/controller/data/network/network_api.dart'; +import 'package:regroup/Main_Screens/Community_HomePage/Model/tagdetailModel.dart'; +import 'package:regroup/Main_Screens/Community_HomePage/Model/tagpopulardetailsModel.dart'; + +TagdetailsModel? tagdetailobj; +TagPopulardetailsModel? tagpopulardetailobj; + + +class Communitygetmethod { + Future> getTagsdata(updata) async { + final response = await NetworkApiServices().getApi( + "${ApiUrls.getTagsdetails}?manage_tag_id=$updata", + ); + + if (response.status == ResponseStatus.SUCCESS) { + tagdetailobj = TagdetailsModel.fromJson(response.data); + log(tagdetailobj!.data.toString()); + } + return response; + } + + Future> getPopularTagsdata(updata) async { + final response = await NetworkApiServices().getApi( + "${ApiUrls.getpopularTagsdetails}?search_post_by_tag_id=$updata", + ); + + if (response.status == ResponseStatus.SUCCESS) { + tagpopulardetailobj = TagPopulardetailsModel.fromJson(response.data); + log(tagpopulardetailobj!.data.toString()); + } + return response; + } +} diff --git a/lib/Main_Screens/Community_HomePage/view_model/communitypostmethod.dart b/lib/Main_Screens/Community_HomePage/view_model/communitypostmethod.dart new file mode 100644 index 0000000..bce7b1f --- /dev/null +++ b/lib/Main_Screens/Community_HomePage/view_model/communitypostmethod.dart @@ -0,0 +1,18 @@ +import 'package:regroup/Common/api_urls.dart'; +import 'package:regroup/Common/base_manager.dart'; +import 'package:regroup/Common/controller/data/network/network_api.dart'; + +class Communitypostmethod { + Communitypostmethod(); + + + Future> postUserSave(updata) async { + final response = await NetworkApiServices().postApi( + updata, + ApiUrls.postusersave, + ); + return response; + } + + +} \ No newline at end of file diff --git a/lib/Feed Module/Main_Screens/ExploreDesign/DetailExplore.dart b/lib/Main_Screens/ExploreDesign/DetailExplore.dart similarity index 97% rename from lib/Feed Module/Main_Screens/ExploreDesign/DetailExplore.dart rename to lib/Main_Screens/ExploreDesign/DetailExplore.dart index 110c852..65c12a9 100644 --- a/lib/Feed Module/Main_Screens/ExploreDesign/DetailExplore.dart +++ b/lib/Main_Screens/ExploreDesign/DetailExplore.dart @@ -41,16 +41,16 @@ class _DetailExploreState extends State { onTap: () { Get.back(); }, - child: commonGlassContainer( + child: commonGlassUI( width: 40.w, height: 40.h, - borderradius: 100, + borderRadius: BorderRadius.circular( 100), customWidget: const Center( child: Icon( Icons.arrow_back, color: Colors.white, )), - border: 1, + borderwidth: 1, borderColor: const Color(0xFF55434F)), ), sizedBoxWidth(12.w), diff --git a/lib/Feed Module/Main_Screens/ExploreDesign/ExploreScreen.dart b/lib/Main_Screens/ExploreDesign/ExploreScreen.dart similarity index 96% rename from lib/Feed Module/Main_Screens/ExploreDesign/ExploreScreen.dart rename to lib/Main_Screens/ExploreDesign/ExploreScreen.dart index 20b4b60..46ce3d8 100644 --- a/lib/Feed Module/Main_Screens/ExploreDesign/ExploreScreen.dart +++ b/lib/Main_Screens/ExploreDesign/ExploreScreen.dart @@ -191,10 +191,10 @@ class _ExploreScreenState extends State { sizedBoxHeight(25.h), Row( children: [ - commonGlassContainer( + commonGlassUI( width: 30.w, height: 30.h, - borderradius: 100, + borderRadius: BorderRadius.circular( 100), customWidget: Center( child: Image.asset( "assets/images/png/community 1 (traced).png", @@ -202,21 +202,21 @@ class _ExploreScreenState extends State { width: 18.w, ), ), - border: 0.5), + borderwidth: 0.5), sizedBoxWidth(10.w), text16400white("10 subgroups "), const Spacer(), - commonGlassContainer( + commonGlassUI( width: 30.w, height: 30.h, - borderradius: 100, + borderRadius: BorderRadius.circular( 100), customWidget: Center( child: Image.asset( "assets/images/png/ph_users-light.png", height: 18.h, width: 18.w, )), - border: 0.5), + borderwidth: 0.5), sizedBoxWidth(10.w), text16400white("7 members"), ], @@ -224,14 +224,14 @@ class _ExploreScreenState extends State { sizedBoxHeight(30.h), Row( children: [ - commonGlassContainer( + commonGlassUI( width: 170.w, height: 35.h, opacity1: 0.05, opacity2: 0.07, - borderradius: 30.r, + borderRadius: BorderRadius.circular( 30.r), customWidget: Center(child: text14w400_FCFCFC("Message")), - border: 1), + borderwidth: 1), const Spacer(), Container( width: 170.w, diff --git a/lib/Feed Module/Main_Screens/ExploreDesign/SearchGroup.dart b/lib/Main_Screens/ExploreDesign/SearchGroup.dart similarity index 97% rename from lib/Feed Module/Main_Screens/ExploreDesign/SearchGroup.dart rename to lib/Main_Screens/ExploreDesign/SearchGroup.dart index 255ab64..1649038 100644 --- a/lib/Feed Module/Main_Screens/ExploreDesign/SearchGroup.dart +++ b/lib/Main_Screens/ExploreDesign/SearchGroup.dart @@ -125,10 +125,10 @@ class _SearchGroupState extends State { Widget rowTile({required String imagePath, required String title}) { return Row( children: [ - commonGlassContainer( + commonGlassUI( width: 30.w, height: 30.h, - borderradius: 100, + borderRadius: BorderRadius.circular( 100), customWidget: Center( child: Image.asset( imagePath, @@ -136,7 +136,7 @@ class _SearchGroupState extends State { width: 16.w, ), ), - border: 0.5), + borderwidth: 0.5), sizedBoxWidth(12.w), text16400white(title), const Spacer(), diff --git a/lib/Feed Module/Main_Screens/GroupTab/View/ConnectCommunity.dart b/lib/Main_Screens/GroupTab/View/ConnectCommunity.dart similarity index 98% rename from lib/Feed Module/Main_Screens/GroupTab/View/ConnectCommunity.dart rename to lib/Main_Screens/GroupTab/View/ConnectCommunity.dart index 14d0c1f..4554fd1 100644 --- a/lib/Feed Module/Main_Screens/GroupTab/View/ConnectCommunity.dart +++ b/lib/Main_Screens/GroupTab/View/ConnectCommunity.dart @@ -78,11 +78,11 @@ class _ConnectCommunityState extends State { padding: EdgeInsets.only(bottom: 25.h), child: GestureDetector( onTap: ontap, - child: commonGlassContainer( - border: 0.9, + child: commonGlassUI( + borderwidth: 0.9, width: double.infinity, height: 162.h, - borderradius: 10.r, + borderRadius: BorderRadius.circular( 10.r), customWidget: Padding( padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 16.h), child: Column( diff --git a/lib/Feed Module/Main_Screens/GroupTab/View/GoupSettings.dart b/lib/Main_Screens/GroupTab/View/GoupSettings.dart similarity index 100% rename from lib/Feed Module/Main_Screens/GroupTab/View/GoupSettings.dart rename to lib/Main_Screens/GroupTab/View/GoupSettings.dart diff --git a/lib/Feed Module/Main_Screens/GroupTab/View/GroupDetail.dart b/lib/Main_Screens/GroupTab/View/GroupDetail.dart similarity index 98% rename from lib/Feed Module/Main_Screens/GroupTab/View/GroupDetail.dart rename to lib/Main_Screens/GroupTab/View/GroupDetail.dart index ca7f802..08d0779 100644 --- a/lib/Feed Module/Main_Screens/GroupTab/View/GroupDetail.dart +++ b/lib/Main_Screens/GroupTab/View/GroupDetail.dart @@ -111,12 +111,12 @@ class _GroupDetailState extends State { ), ), ], - child: commonGlassContainer( + child: commonGlassUI( opacity1: 0.24, opacity2: 0.24, width: 40.w, height: 40.h, - borderradius: 100, + borderRadius: BorderRadius.circular( 100), customWidget: Center( child: Image.asset( "assets/images/png/Vector536.png", @@ -124,7 +124,7 @@ class _GroupDetailState extends State { width: 17.w, ), ), - border: 0.5), + borderwidth: 0.5), ), sizedBoxWidth(16.w), PopupMenuButton( @@ -370,10 +370,10 @@ class _GroupDetailState extends State { ], ), sizedBoxHeight(25.h), - commonGlassContainer( + commonGlassUI( width: double.infinity, height: 135.h, - borderradius: 10, + borderRadius: BorderRadius.circular( 10), customWidget: Padding( padding: EdgeInsets.symmetric( vertical: 12.h, horizontal: 16.w), @@ -420,12 +420,12 @@ class _GroupDetailState extends State { ], ), ), - border: 1), + borderwidth: 1), sizedBoxHeight(20.h), - commonGlassContainer( + commonGlassUI( width: double.infinity, height: 51.h, - borderradius: 10.r, + borderRadius: BorderRadius.circular( 10.r), customWidget: Padding( padding: EdgeInsets.only(right: 16.w), child: Center( @@ -447,7 +447,7 @@ class _GroupDetailState extends State { ]), ), ), - border: 1), + borderwidth: 1), sizedBoxHeight(20.h), Row( children: [ @@ -484,10 +484,10 @@ class _GroupDetailState extends State { ), ), sizedBoxHeight(25.h), - commonGlassContainer( + commonGlassUI( width: double.infinity, height: 51.h, - borderradius: 10.r, + borderRadius: BorderRadius.circular( 10.r), customWidget: Padding( padding: EdgeInsets.symmetric(horizontal: 12.w), child: Row(children: [ @@ -523,7 +523,7 @@ class _GroupDetailState extends State { ) ]), ), - border: 1), + borderwidth: 1), sizedBoxHeight(25.h), ], ), diff --git a/lib/Feed Module/Main_Screens/GroupTab/View/GroupEvent.dart b/lib/Main_Screens/GroupTab/View/GroupEvent.dart similarity index 94% rename from lib/Feed Module/Main_Screens/GroupTab/View/GroupEvent.dart rename to lib/Main_Screens/GroupTab/View/GroupEvent.dart index 9462d67..21ce10b 100644 --- a/lib/Feed Module/Main_Screens/GroupTab/View/GroupEvent.dart +++ b/lib/Main_Screens/GroupTab/View/GroupEvent.dart @@ -9,13 +9,10 @@ import 'package:regroup/Common/CommonDropDown.dart'; import 'package:regroup/Common/CommonGlassmorphism.dart'; import 'package:regroup/Common/CommonWidget.dart'; import 'package:regroup/Utils/Common/CommonAppbar.dart'; -import 'package:regroup/Utils/Common/CustomNextButton.dart'; import 'package:regroup/Utils/Common/CustomTextformfield.dart'; import 'package:regroup/Utils/Common/ImageUpload.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/texts.dart'; -import 'package:regroup/resources/routes/route_name.dart'; import 'package:intl/intl.dart'; class GroupEvent extends StatefulWidget { @@ -112,11 +109,11 @@ class _GroupEventState extends State { borderType: BorderType.RRect, radius: Radius.circular(14.r), color: const Color(0xFF434A53), - child: commonGlassContainer( - border: 0, + child: commonGlassUI( + borderwidth: 0, width: double.infinity, height: 130.h, - borderradius: 10.r, + borderRadius: BorderRadius.circular( 10.r), customWidget: bannerPath.isNotEmpty && isbannerAdded ? Stack(children: [ Image.file( @@ -169,10 +166,10 @@ class _GroupEventState extends State { ), ), sizedBoxHeight(20.h), - commonGlassContainer( + commonGlassUI( width: double.infinity, height: 60.h, - borderradius: 10.r, + borderRadius: BorderRadius.circular( 10.r), customWidget: Center( child: Padding( padding: EdgeInsets.symmetric(horizontal: 12.w), @@ -206,7 +203,7 @@ class _GroupEventState extends State { ]), ), ), - border: 1), + borderwidth: 1), sizedBoxHeight(20.h), text16400white("Type of event"), sizedBoxHeight(14.h), @@ -322,10 +319,10 @@ class _GroupEventState extends State { }); } }, - child: commonGlassContainer( + child: commonGlassUI( width: 174.w, height: 50.h, - borderradius: 30.r, + borderRadius: BorderRadius.circular( 30.r), customWidget: Center( child: Row(children: [ sizedBoxWidth(16.w), @@ -339,7 +336,7 @@ class _GroupEventState extends State { formatTimeOfDay(starttime!)), ]), ), - border: 1), + borderwidth: 1), ) ], ), @@ -360,10 +357,10 @@ class _GroupEventState extends State { }); } }, - child: commonGlassContainer( + child: commonGlassUI( width: 174.w, height: 50.h, - borderradius: 30.r, + borderRadius: BorderRadius.circular( 30.r), customWidget: Center( child: Row(children: [ sizedBoxWidth(16.w), @@ -377,7 +374,7 @@ class _GroupEventState extends State { formatTimeOfDay(endtime!)), ]), ), - border: 1), + borderwidth: 1), ) ], ), @@ -387,9 +384,9 @@ class _GroupEventState extends State { Row( children: [ Obx(() { - return commonGlassContainer( - border: 1, - borderradius: 2, + return commonGlassUI( + borderwidth: 1, + borderRadius: BorderRadius.circular( 2), height: 23.h, width: 23.w, opacity1: 0.24, @@ -433,7 +430,7 @@ class _GroupEventState extends State { onTap: () { // Get.toNamed(RouteName.addUsers); }, - leadingIcon: Container( + leadingIcon: SizedBox( height: 22.h, width: 18.w, child: Center( @@ -465,7 +462,7 @@ class _GroupEventState extends State { text16400white("Location"), sizedBoxHeight(14.h), CustomTextFormField( - leadingIcon: Container( + leadingIcon: SizedBox( height: 19.h, width: 15.w, child: Center( @@ -490,19 +487,19 @@ class _GroupEventState extends State { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - commonGlassContainer( + commonGlassUI( height: 50.h, width: 127.w, - borderradius: 30.r, - border: 1, + borderRadius: BorderRadius.circular( 30.r), + borderwidth: 1, customWidget: Center( child: text16400white("2"), )), - commonGlassContainer( + commonGlassUI( height: 50.h, width: 215.w, - borderradius: 30.r, - border: 1, + borderRadius: BorderRadius.circular( 30.r), + borderwidth: 1, customWidget: Center( child: Row( mainAxisAlignment: MainAxisAlignment.center, @@ -531,10 +528,10 @@ class _GroupEventState extends State { required String imagePath, required String title, }) { - return commonGlassContainer( + return commonGlassUI( width: double.infinity, height: 50.h, - borderradius: 30, + borderRadius: BorderRadius.circular( 30), customWidget: Padding( padding: const EdgeInsets.symmetric(horizontal: 16), child: Center( @@ -556,6 +553,6 @@ class _GroupEventState extends State { ), ), ), - border: 1); + borderwidth: 1); } } diff --git a/lib/Feed Module/Main_Screens/GroupTab/View/GroupInfo.dart b/lib/Main_Screens/GroupTab/View/GroupInfo.dart similarity index 89% rename from lib/Feed Module/Main_Screens/GroupTab/View/GroupInfo.dart rename to lib/Main_Screens/GroupTab/View/GroupInfo.dart index 6980c0d..15b57ee 100644 --- a/lib/Feed Module/Main_Screens/GroupTab/View/GroupInfo.dart +++ b/lib/Main_Screens/GroupTab/View/GroupInfo.dart @@ -5,7 +5,6 @@ import 'package:regroup/Common/CommonButton.dart'; import 'package:regroup/Common/CommonGlassmorphism.dart'; import 'package:regroup/Common/CommonWidget.dart'; import 'package:regroup/Utils/Common/CommonAppbar.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/texts.dart'; import 'package:regroup/resources/routes/route_name.dart'; @@ -22,9 +21,9 @@ class _GroupInfoState extends State { Widget build(BuildContext context) { return Scaffold( // key: _scaffoldKey1, - backgroundColor: Color(0xFF222935), + backgroundColor: const Color(0xFF222935), extendBody: true, - appBar: CommonAppbar( + appBar: const CommonAppbar( titleTxt: "Groups info", ), resizeToAvoidBottomInset: false, @@ -62,8 +61,9 @@ class _GroupInfoState extends State { color: Colors.white, width: 2, ), + // ignore: prefer_const_literals_to_create_immutables boxShadow: [ - BoxShadow( + const BoxShadow( color: Color.fromRGBO(0, 0, 0, 0.25), blurRadius: 12, offset: Offset(0, 6), @@ -73,7 +73,7 @@ class _GroupInfoState extends State { child: CircleAvatar( radius: 42.5.r, foregroundImage: - AssetImage("assets/images/png/group111.png"), + const AssetImage("assets/images/png/group111.png"), ), )) ]), @@ -94,12 +94,12 @@ class _GroupInfoState extends State { sizedBoxHeight(30.h), Row( children: [ - commonGlassContainer( + commonGlassUI( width: 35.w, height: 35.h, opacity1: 0.24, opacity2: 0.24, - borderradius: 100, + borderRadius: BorderRadius.circular( 100), customWidget: Center( child: Image.asset( "assets/images/png/Group 58645.png", @@ -107,7 +107,7 @@ class _GroupInfoState extends State { width: 13.w, ), ), - border: 0.5), + borderwidth: 0.5), sizedBoxWidth(12.w), text16400white("Elm street london, United Kingdom") ], @@ -115,12 +115,12 @@ class _GroupInfoState extends State { sizedBoxHeight(30.h), Row( children: [ - commonGlassContainer( + commonGlassUI( width: 35.w, height: 35.h, opacity1: 0.24, opacity2: 0.24, - borderradius: 100, + borderRadius: BorderRadius.circular( 100), customWidget: Center( child: Image.asset( "assets/images/png/Vector2a.png", @@ -128,7 +128,7 @@ class _GroupInfoState extends State { width: 20.w, ), ), - border: 0.5), + borderwidth: 0.5), sizedBoxWidth(12.w), text16400white("www.exampledummywebsite.com") ], diff --git a/lib/Feed Module/Main_Screens/GroupTab/View/GroupManage.dart b/lib/Main_Screens/GroupTab/View/GroupManage.dart similarity index 87% rename from lib/Feed Module/Main_Screens/GroupTab/View/GroupManage.dart rename to lib/Main_Screens/GroupTab/View/GroupManage.dart index 69e5612..47f895e 100644 --- a/lib/Feed Module/Main_Screens/GroupTab/View/GroupManage.dart +++ b/lib/Main_Screens/GroupTab/View/GroupManage.dart @@ -7,7 +7,6 @@ import 'package:regroup/Common/CommonTabBar.dart'; import 'package:regroup/Common/CommonWidget.dart'; import 'package:regroup/Utils/Common/CommonAppbar.dart'; import 'package:regroup/Utils/Common/CustomTextformfield.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/texts.dart'; @@ -34,7 +33,7 @@ class _GroupManageState extends State { Widget build(BuildContext context) { return Scaffold( // key: _scaffoldKey1, - backgroundColor: Color(0xFF222935), + backgroundColor: const Color(0xFF222935), extendBody: true, resizeToAvoidBottomInset: false, appBar: CommonAppbar( @@ -42,7 +41,7 @@ class _GroupManageState extends State { customActionWidget: Container( height: 35.h, width: 35.w, - decoration: BoxDecoration( + decoration: const BoxDecoration( color: Color(0xFFD90B2E), shape: BoxShape.circle, boxShadow: [ @@ -54,7 +53,7 @@ class _GroupManageState extends State { ), ], ), - child: Icon(Icons.add, color: Colors.white, weight: 2), + child: const Icon(Icons.add, color: Colors.white, weight: 2), ), ), body: Stack(children: [ @@ -70,7 +69,7 @@ class _GroupManageState extends State { length: 4, child: Column( children: [ - CommonTabBar(tabs: const [ + const CommonTabBar(tabs: [ Tab( text: 'Members', ), @@ -89,9 +88,9 @@ class _GroupManageState extends State { child: TabBarView( children: [ membersTab(), - AdminsTab(), - RequestsTab(), - InvitesTab(), + adminsTab(), + requestsTab(), + invitesTab(), ], ), ), @@ -110,7 +109,7 @@ class _GroupManageState extends State { children: [ sizedBoxHeight(25.h), CustomTextFormField( - leadingIcon: Container( + leadingIcon: SizedBox( height: 20.h, width: 20.w, child: Center( @@ -129,7 +128,7 @@ class _GroupManageState extends State { SizedBox( width: 300.w, child: CustomTextFormField( - leadingIcon: Container( + leadingIcon: SizedBox( height: 17.h, width: 17.w, child: Center( @@ -142,11 +141,11 @@ class _GroupManageState extends State { ), hintText: "Start date - End date", )), - Spacer(), - commonGlassContainer( + const Spacer(), + commonGlassUI( width: 40.w, height: 40.h, - borderradius: 100, + borderRadius: BorderRadius.circular( 100), opacity1: 0.24, opacity2: 0.24, customWidget: Center( @@ -156,7 +155,7 @@ class _GroupManageState extends State { width: 23.w, ), ), - border: 0.5) + borderwidth: 0.5) ], ), ], @@ -204,7 +203,7 @@ class _GroupManageState extends State { width: 15.w, ), ), - Spacer(), + const Spacer(), Image.asset( "assets/images/png/Group 1000004071.png", height: 22.h, @@ -226,7 +225,7 @@ class _GroupManageState extends State { width: double.infinity, decoration: BoxDecoration( borderRadius: BorderRadius.circular(10.r), - color: Color(0xFF222935)), + color: const Color(0xFF222935)), child: Padding( padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 20.h), child: Column( @@ -236,33 +235,33 @@ class _GroupManageState extends State { sizedBoxHeight(16.h), Row( children: [ - commonGlassContainer( + commonGlassUI( width: 40.w, height: 40.h, - borderradius: 100, + borderRadius: BorderRadius.circular( 100), opacity1: 0.24, opacity2: 0.24, customWidget: Center(child: text16w400_FCFCFC("M")), - border: 0.5), + borderwidth: 0.5), sizedBoxWidth(15.w), - commonGlassContainer( + commonGlassUI( width: 40.w, height: 40.h, - borderradius: 100, + borderRadius: BorderRadius.circular( 100), opacity1: 0.24, opacity2: 0.24, customWidget: Center(child: text16w400_FCFCFC("Tu")), - border: 0.5), + borderwidth: 0.5), sizedBoxWidth(15.w), - commonGlassContainer( + commonGlassUI( width: 40.w, height: 40.h, - borderradius: 100, + borderRadius: BorderRadius.circular( 100), opacity1: 0.24, opacity2: 0.24, customWidget: Center(child: text16w400_FCFCFC("W")), - border: 0.5), - Spacer(), + borderwidth: 0.5), + const Spacer(), Row( children: [ Image.asset( @@ -281,33 +280,33 @@ class _GroupManageState extends State { sizedBoxHeight(20.h), Row( children: [ - commonGlassContainer( + commonGlassUI( width: 40.w, height: 40.h, - borderradius: 100, + borderRadius: BorderRadius.circular( 100), opacity1: 0.24, opacity2: 0.24, customWidget: Center(child: text16w400_FCFCFC("Th")), - border: 0.5), + borderwidth: 0.5), sizedBoxWidth(15.w), - commonGlassContainer( + commonGlassUI( width: 40.w, height: 40.h, - borderradius: 100, + borderRadius: BorderRadius.circular( 100), opacity1: 0.24, opacity2: 0.24, customWidget: Center(child: text16w400_FCFCFC("F")), - border: 0.5), + borderwidth: 0.5), sizedBoxWidth(15.w), - commonGlassContainer( + commonGlassUI( width: 40.w, height: 40.h, - borderradius: 100, + borderRadius: BorderRadius.circular( 100), opacity1: 0.24, opacity2: 0.24, customWidget: Center(child: text16w400_FCFCFC("Sa")), - border: 0.5), - Spacer(), + borderwidth: 0.5), + const Spacer(), Row( children: [ Image.asset( @@ -335,7 +334,7 @@ class _GroupManageState extends State { begin: Alignment.topLeft, end: Alignment.bottomRight, colors: [ - Color(0xFFD90B2E).withOpacity(0.18), + const Color(0xFFD90B2E).withOpacity(0.18), const Color(0xFFD90B2E).withOpacity(0.4), ], stops: const [ @@ -343,7 +342,7 @@ class _GroupManageState extends State { 1, ], ), - borderGradient: LinearGradient( + borderGradient: const LinearGradient( begin: Alignment.topLeft, end: Alignment.bottomRight, colors: [ @@ -367,13 +366,13 @@ class _GroupManageState extends State { )); } - Widget AdminsTab() { - return Column( + Widget adminsTab() { + return const Column( children: [], ); } - Widget RequestsTab() { + Widget requestsTab() { return SingleChildScrollView( child: Column(children: [ Padding( @@ -382,7 +381,7 @@ class _GroupManageState extends State { children: [ sizedBoxHeight(25.h), CustomTextFormField( - leadingIcon: Container( + leadingIcon: SizedBox( height: 20.h, width: 20.w, child: Center( @@ -401,7 +400,7 @@ class _GroupManageState extends State { SizedBox( width: 300.w, child: CustomTextFormField( - leadingIcon: Container( + leadingIcon: SizedBox( height: 17.h, width: 17.w, child: Center( @@ -414,11 +413,11 @@ class _GroupManageState extends State { ), hintText: "Start date - End date", )), - Spacer(), - commonGlassContainer( + const Spacer(), + commonGlassUI( width: 40.w, height: 40.h, - borderradius: 100, + borderRadius: BorderRadius.circular( 100), opacity1: 0.24, opacity2: 0.24, customWidget: Center( @@ -428,7 +427,7 @@ class _GroupManageState extends State { width: 23.w, ), ), - border: 0.5) + borderwidth: 0.5) ], ), ], @@ -476,18 +475,18 @@ class _GroupManageState extends State { width: 15.w, ), ), - Spacer(), + const Spacer(), Container( width: 74.w, height: 25.h, decoration: BoxDecoration( borderRadius: BorderRadius.circular(23.r), - color: Color(0xFFD90B2E), + color: const Color(0xFFD90B2E), ), child: Center(child: text11w400white("Confirm")), ), sizedBoxWidth(6.w), - Icon( + const Icon( Icons.clear, size: 20, color: Colors.white, @@ -497,7 +496,7 @@ class _GroupManageState extends State { ); } - Widget InvitesTab() { + Widget invitesTab() { return SingleChildScrollView( child: Column(children: [ Padding( @@ -506,7 +505,7 @@ class _GroupManageState extends State { children: [ sizedBoxHeight(25.h), CustomTextFormField( - leadingIcon: Container( + leadingIcon: SizedBox( height: 20.h, width: 20.w, child: Center( @@ -525,7 +524,7 @@ class _GroupManageState extends State { SizedBox( width: 300.w, child: CustomTextFormField( - leadingIcon: Container( + leadingIcon: SizedBox( height: 17.h, width: 17.w, child: Center( @@ -538,11 +537,11 @@ class _GroupManageState extends State { ), hintText: "Start date - End date", )), - Spacer(), - commonGlassContainer( + const Spacer(), + commonGlassUI( width: 40.w, height: 40.h, - borderradius: 100, + borderRadius: BorderRadius.circular( 100), opacity1: 0.24, opacity2: 0.24, customWidget: Center( @@ -552,7 +551,7 @@ class _GroupManageState extends State { width: 23.w, ), ), - border: 0.5) + borderwidth: 0.5) ], ), ], @@ -600,13 +599,13 @@ class _GroupManageState extends State { width: 15.w, ), ), - Spacer(), + const Spacer(), Container( width: 74.w, height: 25.h, decoration: BoxDecoration( borderRadius: BorderRadius.circular(23.r), - color: Color(0xFFD90B2E), + color: const Color(0xFFD90B2E), ), child: Center(child: text11w400white("Invite")), ), diff --git a/lib/Feed Module/Main_Screens/GroupTab/View/GroupTab.dart b/lib/Main_Screens/GroupTab/View/GroupTab.dart similarity index 95% rename from lib/Feed Module/Main_Screens/GroupTab/View/GroupTab.dart rename to lib/Main_Screens/GroupTab/View/GroupTab.dart index e077efb..07e3994 100644 --- a/lib/Feed Module/Main_Screens/GroupTab/View/GroupTab.dart +++ b/lib/Main_Screens/GroupTab/View/GroupTab.dart @@ -6,7 +6,7 @@ import 'package:regroup/Common/CommonGlassmorphism.dart'; import 'package:regroup/Common/CommonWidget.dart'; import 'package:regroup/Common/controller/MainScreen.dart'; import 'package:regroup/Utils/Common/CustomTextformfield.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; + import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/texts.dart'; import 'package:regroup/resources/routes/route_name.dart'; @@ -42,11 +42,11 @@ class _GroupTabState extends State { return Scaffold( resizeToAvoidBottomInset: false, // key: _scaffoldKey1, - backgroundColor: Color(0xFF222935), + backgroundColor: const Color(0xFF222935), extendBody: true, appBar: AppBar( scrolledUnderElevation: 0.0, - backgroundColor: Color(0xff222935), + backgroundColor: const Color(0xff222935), elevation: 0, automaticallyImplyLeading: false, title: text20700white("Groups"), @@ -58,7 +58,7 @@ class _GroupTabState extends State { child: Container( height: 35.h, width: 35.w, - decoration: BoxDecoration( + decoration: const BoxDecoration( color: Color(0xFFD90B2E), shape: BoxShape.circle, boxShadow: [ @@ -70,7 +70,7 @@ class _GroupTabState extends State { ), ], ), - child: Icon(Icons.add, color: Colors.white, weight: 2), + child: const Icon(Icons.add, color: Colors.white, weight: 2), ), ), sizedBoxWidth(14.w), @@ -111,7 +111,7 @@ class _GroupTabState extends State { sizedBoxHeight(25.h), Row( children: [ - Spacer(), + const Spacer(), GestureDetector( onTap: () { Get.toNamed(RouteName.requestedgroups); @@ -138,7 +138,7 @@ class _GroupTabState extends State { Expanded( child: ListView.builder( shrinkWrap: true, - physics: BouncingScrollPhysics(), + physics: const BouncingScrollPhysics(), itemCount: groupData.length, itemBuilder: (context, index) { return groupCard( @@ -183,7 +183,7 @@ class _GroupTabState extends State { Container( height: 65.h, width: 65.h, - decoration: BoxDecoration( + decoration: const BoxDecoration( shape: BoxShape.circle, // color: Colors.amber, ), @@ -216,12 +216,12 @@ class _GroupTabState extends State { ), ], ), - Spacer(), + const Spacer(), PopupMenuButton( - surfaceTintColor: Color(0xFF222935), + surfaceTintColor: const Color(0xFF222935), constraints: BoxConstraints.tightFor(width: 200.w), - offset: Offset(0, 30), - color: Color(0xFF222935), + offset: const Offset(0, 30), + color: const Color(0xFF222935), tooltip: "", itemBuilder: (BuildContext context) => [ diff --git a/lib/Feed Module/Main_Screens/GroupTab/View/NewPost.dart b/lib/Main_Screens/GroupTab/View/NewPost.dart similarity index 91% rename from lib/Feed Module/Main_Screens/GroupTab/View/NewPost.dart rename to lib/Main_Screens/GroupTab/View/NewPost.dart index 4fc4d58..582fbe5 100644 --- a/lib/Feed Module/Main_Screens/GroupTab/View/NewPost.dart +++ b/lib/Main_Screens/GroupTab/View/NewPost.dart @@ -10,7 +10,6 @@ import 'package:regroup/Utils/Common/CommonAppbar.dart'; import 'package:regroup/Utils/Common/CommonDropdown.dart'; import 'package:regroup/Utils/Common/CustomTextformfield.dart'; import 'package:regroup/Utils/Common/ImageUpload.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/texts.dart'; @@ -38,10 +37,10 @@ class _NewPostState extends State { Widget build(BuildContext context) { return Scaffold( // key: _scaffoldKey1, - backgroundColor: Color(0xFF222935), + backgroundColor: const Color(0xFF222935), extendBody: true, resizeToAvoidBottomInset: false, - appBar: CommonAppbar( + appBar: const CommonAppbar( titleTxt: "New post", ), body: Stack(children: [ @@ -81,15 +80,15 @@ class _NewPostState extends State { }, child: DottedBorder( strokeWidth: 1, - dashPattern: [7, 4], + dashPattern: const [7, 4], borderType: BorderType.RRect, radius: Radius.circular(14.r), - color: Color(0xFF434A53), - child: commonGlassContainer( - border: 0, + color: const Color(0xFF434A53), + child: commonGlassUI( + borderwidth: 0, width: double.infinity, height: 130.h, - borderradius: 10.r, + borderRadius: BorderRadius.circular( 10.r), customWidget: bannerPath.isNotEmpty && isbannerAdded ? Stack(children: [ Image.file( @@ -110,13 +109,13 @@ class _NewPostState extends State { width: 27, height: 27, decoration: ShapeDecoration( - color: Color(0xFF7E7E7E), + color: const Color(0xFF7E7E7E), shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular( 5)), ), - child: Icon( + child: const Icon( Icons.delete_outline_outlined, color: Colors.white, ))), @@ -155,14 +154,14 @@ class _NewPostState extends State { CustomDropDownTag1( header: "Enter tags", title: "Enter tags", - listData: [ + listData: const [ "#Race", "#Swimming", "#Cycle", "#Swimming", "#Race" ], - rowData: [ + rowData: const [ "23,233 Recently use tags", "15,123 Recently use tags", "15,123 Recently use tags", @@ -170,7 +169,7 @@ class _NewPostState extends State { "15,123 Available tags" ], onItemSelected: (p0) {}, - leadingImage: SizedBox()), + leadingImage: const SizedBox()), // CustomTextFormField( // suffixIcon: Container( // height: 20.h, @@ -225,7 +224,7 @@ class _NewPostState extends State { header: "", title: "", - listData: [ + listData: const [ 'Active alliance network', 'Fitfam federation', 'The athletic town', @@ -233,13 +232,13 @@ class _NewPostState extends State { ], onItemSelected: (p0) {}, - images: [ + images: const [ 'assets/images/png/Rectangle 65.png', 'assets/images/png/Rectangle 66.png', 'assets/images/png/Rectangle 60.png', 'assets/images/png/Rectangle 68.png' ], - leadingImage: SizedBox()), + leadingImage: const SizedBox()), sizedBoxHeight(40.h), CommonBtn( @@ -268,12 +267,12 @@ class _NewPostState extends State { height: 35, decoration: BoxDecoration( color: selectedContainerIndices.contains(index) - ? Color(0xFFD90B2E).withOpacity(0.4) - : Color(0xFFFFFFFF).withOpacity(0.2), + ? const Color(0xFFD90B2E).withOpacity(0.4) + : const Color(0xFFFFFFFF).withOpacity(0.2), borderRadius: BorderRadius.circular(30), - border: Border.all(color: Color(0xFFD90B2E), width: 1)), + border: Border.all(color: const Color(0xFFD90B2E), width: 1)), child: Padding( - padding: EdgeInsets.symmetric(horizontal: 20), + padding: const EdgeInsets.symmetric(horizontal: 20), child: Center(child: text14w400_FCFCFC(text)), ), ), diff --git a/lib/Feed Module/Main_Screens/GroupTab/View/RequestedGroups.dart b/lib/Main_Screens/GroupTab/View/RequestedGroups.dart similarity index 95% rename from lib/Feed Module/Main_Screens/GroupTab/View/RequestedGroups.dart rename to lib/Main_Screens/GroupTab/View/RequestedGroups.dart index 31abd64..7fc0186 100644 --- a/lib/Feed Module/Main_Screens/GroupTab/View/RequestedGroups.dart +++ b/lib/Main_Screens/GroupTab/View/RequestedGroups.dart @@ -3,7 +3,6 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:regroup/Common/CommonGlassmorphism.dart'; import 'package:regroup/Common/CommonWidget.dart'; import 'package:regroup/Utils/Common/CommonAppbar.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/texts.dart'; @@ -37,9 +36,9 @@ class _RequestedGroupsState extends State { Widget build(BuildContext context) { return Scaffold( // key: _scaffoldKey1, - backgroundColor: Color(0xFF222935), + backgroundColor: const Color(0xFF222935), extendBody: true, - appBar: CommonAppbar( + appBar: const CommonAppbar( titleTxt: "Requested groups", ), body: Stack(children: [ @@ -56,7 +55,7 @@ class _RequestedGroupsState extends State { sizedBoxHeight(20.h), ListView.builder( shrinkWrap: true, - physics: BouncingScrollPhysics(), + physics: const BouncingScrollPhysics(), itemCount: groupData.length, itemBuilder: (context, index) { return groupCard( @@ -96,7 +95,7 @@ class _RequestedGroupsState extends State { Container( height: 65.h, width: 65.h, - decoration: BoxDecoration( + decoration: const BoxDecoration( shape: BoxShape.circle, // color: Colors.amber, ), @@ -129,12 +128,12 @@ class _RequestedGroupsState extends State { ), ], ), - Spacer(), + const Spacer(), PopupMenuButton( - surfaceTintColor: Color(0xFF222935), + surfaceTintColor: const Color(0xFF222935), constraints: BoxConstraints.tightFor(width: 200.w), - offset: Offset(0, 30), - color: Color(0xFF222935), + offset: const Offset(0, 30), + color: const Color(0xFF222935), tooltip: "", itemBuilder: (BuildContext context) => [ @@ -237,13 +236,13 @@ class _RequestedGroupsState extends State { ), sizedBoxWidth(95.w), text12w400_FCFCFC_blur(members), - Spacer(), + const Spacer(), Container( width: 127.w, height: 30.h, decoration: BoxDecoration( borderRadius: BorderRadius.circular(30.r), - color: Color(0xFFD90B2E)), + color: const Color(0xFFD90B2E)), child: Center(child: text14w400_FCFCFC("Cancel request")), ) diff --git a/lib/Feed Module/Main_Screens/GroupTab/View/Sessions.dart b/lib/Main_Screens/GroupTab/View/Sessions.dart similarity index 96% rename from lib/Feed Module/Main_Screens/GroupTab/View/Sessions.dart rename to lib/Main_Screens/GroupTab/View/Sessions.dart index 93640e3..9f06afd 100644 --- a/lib/Feed Module/Main_Screens/GroupTab/View/Sessions.dart +++ b/lib/Main_Screens/GroupTab/View/Sessions.dart @@ -245,9 +245,9 @@ class _SessionsState extends State { Row( children: [ Obx(() { - return commonGlassContainer( - border: 1, - borderradius: 2, + return commonGlassUI( + borderwidth: 1, + borderRadius: BorderRadius.circular( 2), height: 23.h, width: 23.w, opacity1: 0.24, @@ -334,19 +334,19 @@ class _SessionsState extends State { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - commonGlassContainer( + commonGlassUI( height: 50.h, width: 127.w, - borderradius: 30.r, - border: 1, + borderRadius: BorderRadius.circular( 30.r), + borderwidth: 1, customWidget: Center( child: text16400white("2"), )), - commonGlassContainer( + commonGlassUI( height: 50.h, width: 215.w, - borderradius: 30.r, - border: 1, + borderRadius: BorderRadius.circular( 30.r), + borderwidth: 1, customWidget: Center( child: Row( mainAxisAlignment: @@ -385,11 +385,11 @@ class _SessionsState extends State { borderType: BorderType.RRect, radius: Radius.circular(14.r), color: const Color(0xFF434A53), - child: commonGlassContainer( - border: 0, + child: commonGlassUI( + borderwidth: 0, width: double.infinity, height: 130.h, - borderradius: 10.r, + borderRadius: BorderRadius.circular( 10.r), customWidget: bannerPath.isNotEmpty && isbannerAdded ? Stack(children: [ diff --git a/lib/Feed Module/Main_Screens/GroupTab/View/SubGroup/EditSubgroupInfo.dart b/lib/Main_Screens/GroupTab/View/SubGroup/EditSubgroupInfo.dart similarity index 94% rename from lib/Feed Module/Main_Screens/GroupTab/View/SubGroup/EditSubgroupInfo.dart rename to lib/Main_Screens/GroupTab/View/SubGroup/EditSubgroupInfo.dart index c3cd44a..5adbe64 100644 --- a/lib/Feed Module/Main_Screens/GroupTab/View/SubGroup/EditSubgroupInfo.dart +++ b/lib/Main_Screens/GroupTab/View/SubGroup/EditSubgroupInfo.dart @@ -6,7 +6,6 @@ import 'package:regroup/Common/CommonButton.dart'; import 'package:regroup/Common/CommonGlassmorphism.dart'; import 'package:regroup/Utils/Common/CommonAppbar.dart'; import 'package:regroup/Utils/Common/ImageUpload.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/texts.dart'; import 'package:regroup/Utils/Common/CustomTextformfield.dart'; @@ -28,10 +27,10 @@ class _EditSubgroupInfoState extends State { Widget build(BuildContext context) { return Scaffold( // key: _scaffoldKey1, - backgroundColor: Color(0xFF222935), + backgroundColor: const Color(0xFF222935), extendBody: true, - appBar: CommonAppbar( + appBar: const CommonAppbar( titleTxt: "Edit subgroup info", ), body: Stack(children: [ @@ -64,7 +63,7 @@ class _EditSubgroupInfoState extends State { ), ) : CircleAvatar( - backgroundImage: AssetImage( + backgroundImage: const AssetImage( "assets/images/png/cimg3.png", ), radius: 50.r, @@ -89,7 +88,7 @@ class _EditSubgroupInfoState extends State { child: Container( height: 35.h, width: 35.w, - decoration: BoxDecoration( + decoration: const BoxDecoration( shape: BoxShape.circle, color: Color(0xFFD90B2E)), child: Center( @@ -124,11 +123,11 @@ class _EditSubgroupInfoState extends State { }, ); }, - child: commonGlassContainer( - border: 0.9, + child: commonGlassUI( + borderwidth: 0.9, width: double.infinity, height: 150.h, - borderradius: 10.r, + borderRadius: BorderRadius.circular(10.r), customWidget: bannerPath.isNotEmpty && isbannerAdded ? Stack(children: [ Image.file( @@ -149,13 +148,13 @@ class _EditSubgroupInfoState extends State { width: 27, height: 27, decoration: ShapeDecoration( - color: Color(0xFF7E7E7E), + color: const Color(0xFF7E7E7E), shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular( 5)), ), - child: Icon( + child: const Icon( Icons.delete_outline_outlined, color: Colors.white, ))), diff --git a/lib/Feed Module/Main_Screens/GroupTab/View/SubGroup/SubGroupInfo.dart b/lib/Main_Screens/GroupTab/View/SubGroup/SubGroupInfo.dart similarity index 89% rename from lib/Feed Module/Main_Screens/GroupTab/View/SubGroup/SubGroupInfo.dart rename to lib/Main_Screens/GroupTab/View/SubGroup/SubGroupInfo.dart index 27a60f2..0ea1678 100644 --- a/lib/Feed Module/Main_Screens/GroupTab/View/SubGroup/SubGroupInfo.dart +++ b/lib/Main_Screens/GroupTab/View/SubGroup/SubGroupInfo.dart @@ -6,7 +6,7 @@ import 'package:regroup/Common/CommonGlassmorphism.dart'; import 'package:regroup/Common/CommonTabBar.dart'; import 'package:regroup/Common/CommonWidget.dart'; import 'package:regroup/Utils/Common/CommonAppbar.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; + import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/texts.dart'; import 'package:regroup/resources/routes/route_name.dart'; @@ -42,19 +42,19 @@ class _SubGroupInfoState extends State { Widget build(BuildContext context) { return Scaffold( // key: _scaffoldKey1, - backgroundColor: Color(0xFF222935), + backgroundColor: const Color(0xFF222935), extendBody: true, resizeToAvoidBottomInset: false, appBar: CommonAppbar( titleTxt: "", customActionWidget: Row(children: [ PopupMenuButton( - surfaceTintColor: Color(0xFF222935), + surfaceTintColor: const Color(0xFF222935), constraints: BoxConstraints.tightFor( width: 150.w, ), - offset: Offset(0, 40), - color: Color(0xFF222935), + offset: const Offset(0, 40), + color: const Color(0xFF222935), tooltip: "", itemBuilder: (BuildContext context) => [ PopupMenuItem( @@ -66,7 +66,7 @@ class _SubGroupInfoState extends State { child: text14w400white("Create post"), ), ), - PopupMenuDivider(), + const PopupMenuDivider(), PopupMenuItem( onTap: () { Get.toNamed(RouteName.groupevent); @@ -77,12 +77,12 @@ class _SubGroupInfoState extends State { ), ), ], - child: commonGlassContainer( + child: commonGlassUI( opacity1: 0.24, opacity2: 0.24, width: 40.w, height: 40.h, - borderradius: 100, + borderRadius: BorderRadius.circular( 100), customWidget: Center( child: Image.asset( "assets/images/png/Vector536.png", @@ -90,19 +90,19 @@ class _SubGroupInfoState extends State { width: 17.w, ), ), - border: 0.5), + borderwidth: 0.5), ), sizedBoxWidth(16.w), GestureDetector( onTap: () { Get.toNamed(RouteName.editsubgroupinfo); }, - child: commonGlassContainer( + child: commonGlassUI( opacity1: 0.24, opacity2: 0.24, width: 40.w, height: 40.h, - borderradius: 100, + borderRadius: BorderRadius.circular( 100), customWidget: Center( child: Image.asset( "assets/images/png/codicon_account.png", @@ -110,16 +110,16 @@ class _SubGroupInfoState extends State { width: 20.w, ), ), - border: 0.5), + borderwidth: 0.5), ), sizedBoxWidth(16.w), PopupMenuButton( - surfaceTintColor: Color(0xFF222935), + surfaceTintColor: const Color(0xFF222935), constraints: BoxConstraints.tightFor( width: 230.w, ), - offset: Offset(0, 40), - color: Color(0xFF222935), + offset: const Offset(0, 40), + color: const Color(0xFF222935), tooltip: "", itemBuilder: (BuildContext context) => [ PopupMenuItem( @@ -129,7 +129,7 @@ class _SubGroupInfoState extends State { child: Row( children: [ text14w400white("Add members"), - Spacer(), + const Spacer(), Image.asset( "assets/images/png/uiw_user-add.png", height: 15.h, @@ -139,7 +139,7 @@ class _SubGroupInfoState extends State { ), ), ), - PopupMenuDivider(), + const PopupMenuDivider(), PopupMenuItem( onTap: () {}, child: Padding( @@ -147,7 +147,7 @@ class _SubGroupInfoState extends State { child: Row( children: [ text14w400white("Share"), - Spacer(), + const Spacer(), Image.asset( "assets/images/png/share.png", height: 20.h, @@ -157,7 +157,7 @@ class _SubGroupInfoState extends State { ), ), ), - PopupMenuDivider(), + const PopupMenuDivider(), PopupMenuItem( onTap: () { // Get.toNamed(RouteName.groupinfo); @@ -167,7 +167,7 @@ class _SubGroupInfoState extends State { child: Row( children: [ text14w400white("Sub -Group info"), - Spacer(), + const Spacer(), Image.asset( "assets/images/png/codicon_account.png", height: 20.h, @@ -177,7 +177,7 @@ class _SubGroupInfoState extends State { ), ), ), - PopupMenuDivider(), + const PopupMenuDivider(), PopupMenuItem( onTap: () {}, child: Padding( @@ -185,7 +185,7 @@ class _SubGroupInfoState extends State { child: Row( children: [ text14w400white("Search"), - Spacer(), + const Spacer(), Image.asset( "assets/images/png/Frame 58575.png", height: 18.h, @@ -195,7 +195,7 @@ class _SubGroupInfoState extends State { ), ), ), - PopupMenuDivider(), + const PopupMenuDivider(), PopupMenuItem( onTap: () {}, child: Padding( @@ -203,7 +203,7 @@ class _SubGroupInfoState extends State { child: Row( children: [ text14w400white("Mute Notification"), - Spacer(), + const Spacer(), Image.asset( "assets/images/png/Black1233.png", height: 16.h, @@ -213,7 +213,7 @@ class _SubGroupInfoState extends State { ), ), ), - PopupMenuDivider(), + const PopupMenuDivider(), PopupMenuItem( onTap: () { Get.toNamed(RouteName.subgroupsetting); @@ -223,7 +223,7 @@ class _SubGroupInfoState extends State { child: Row( children: [ text14w400white("Edit sub-group settings"), - Spacer(), + const Spacer(), Image.asset( "assets/images/png/setting2.png", height: 18.h, @@ -245,7 +245,8 @@ class _SubGroupInfoState extends State { Container( decoration: const BoxDecoration( image: DecorationImage( - image: AssetImage("assets/images/png/Ellipse 1496.png"), fit: BoxFit.fill)), + image: AssetImage("assets/images/png/Ellipse 1496.png"), + fit: BoxFit.fill)), ), SingleChildScrollView( child: @@ -275,7 +276,7 @@ class _SubGroupInfoState extends State { color: Colors.white, width: 2, ), - boxShadow: [ + boxShadow: const [ BoxShadow( color: Color.fromRGBO(0, 0, 0, 0.25), blurRadius: 12, @@ -286,7 +287,7 @@ class _SubGroupInfoState extends State { child: CircleAvatar( radius: 42.5.r, foregroundImage: - AssetImage("assets/images/png/group111.png"), + const AssetImage("assets/images/png/group111.png"), ), )) ]), @@ -300,31 +301,31 @@ class _SubGroupInfoState extends State { sizedBoxHeight(16.h), Row( children: [ - commonGlassContainer( + commonGlassUI( width: 35.w, height: 35.h, - borderradius: 100, + borderRadius: BorderRadius.circular( 100), opacity1: 0.24, opacity2: 0.24, customWidget: Center( child: Image.asset("assets/images/png/Black.png", height: 20.h, width: 20.w), ), - border: 0.5), + borderwidth: 0.5), sizedBoxWidth(7.w), text16w400_FCFCFCblur("The athlectic town"), sizedBoxWidth(20.w), - commonGlassContainer( + commonGlassUI( width: 35.w, height: 35.h, opacity1: 0.24, opacity2: 0.24, - borderradius: 100, + borderRadius: BorderRadius.circular( 100), customWidget: Center( child: Image.asset("assets/images/png/img12.png", height: 20.h, width: 20.w), ), - border: 0.5), + borderwidth: 0.5), sizedBoxWidth(7.w), text16w400_FCFCFCblur("Public"), ], @@ -338,7 +339,7 @@ class _SubGroupInfoState extends State { // initialIndex: selectedIndex.value, child: Column( children: [ - CommonTabBar(tabs: const [ + const CommonTabBar(tabs: [ Tab( text: 'Posts', ), @@ -401,11 +402,11 @@ class _SubGroupInfoState extends State { } } - return commonGlassContainer( + return commonGlassUI( width: double.infinity, height: 570.h, - border: 0, - borderradius: 1, + borderwidth: 0, + borderRadius: BorderRadius.circular( 1), customWidget: Column( children: [ sizedBoxHeight(25.h), @@ -436,7 +437,7 @@ class _SubGroupInfoState extends State { sizedBoxWidth(7.w), Icon( Icons.circle, - color: Color(0xFFFCFCFC), + color: const Color(0xFFFCFCFC), size: 4.sp, ), sizedBoxWidth(6.w), @@ -445,12 +446,12 @@ class _SubGroupInfoState extends State { ) ], ), - Spacer(), + const Spacer(), PopupMenuButton( - surfaceTintColor: Color(0xFF222935), + surfaceTintColor: const Color(0xFF222935), constraints: BoxConstraints.tightFor(width: 176.w), - offset: Offset(0, 50), - color: Color(0xFF222935), + offset: const Offset(0, 50), + color: const Color(0xFF222935), tooltip: "", itemBuilder: (BuildContext context) => [ PopupMenuItem( @@ -468,7 +469,7 @@ class _SubGroupInfoState extends State { fontFamily: "Nunito Sans", ), ), - Spacer(), + const Spacer(), Image.asset( "assets/images/png/Vector (5).png", height: 15.h, @@ -478,7 +479,7 @@ class _SubGroupInfoState extends State { ), ), ), - PopupMenuDivider(), + const PopupMenuDivider(), PopupMenuItem( onTap: () {}, child: Padding( @@ -494,7 +495,7 @@ class _SubGroupInfoState extends State { fontFamily: "Nunito Sans", ), ), - Spacer(), + const Spacer(), Image.asset( "assets/images/png/share.png", height: 20.h, @@ -504,7 +505,7 @@ class _SubGroupInfoState extends State { ), ), ), - PopupMenuDivider(), + const PopupMenuDivider(), PopupMenuItem( onTap: () {}, child: Padding( @@ -520,7 +521,7 @@ class _SubGroupInfoState extends State { fontFamily: "Nunito Sans", ), ), - Spacer(), + const Spacer(), Image.asset( "assets/images/png/f7_pin-fill (2).png", height: 25.h, @@ -590,14 +591,14 @@ class _SubGroupInfoState extends State { 'assets/images/png/party-popper 2.png' ]), ), - Spacer(), - commonGlassContainer( - border: 0.43, + const Spacer(), + commonGlassUI( + borderwidth: 0.43, width: 30.w, height: 30.h, opacity1: 0.05, opacity2: 0.06, - borderradius: 100, + borderRadius: BorderRadius.circular( 100), customWidget: Center( child: Image.asset( 'assets/images/png/Frame 1000004088.png', @@ -609,11 +610,11 @@ class _SubGroupInfoState extends State { sizedBoxWidth(12.w), text14w400_FCFCFC('20'), sizedBoxWidth(20.w), - commonGlassContainer( - border: 0.43, + commonGlassUI( + borderwidth: 0.43, width: 30.w, height: 30.h, - borderradius: 100, + borderRadius: BorderRadius.circular( 100), opacity1: 0.05, opacity2: 0.06, customWidget: Center( @@ -675,11 +676,13 @@ class _SubGroupInfoState extends State { boxRadius: 30, itemsSpacing: 8, itemScale: 0.4, - itemSize: Size(45, 45), - boxPadding: EdgeInsets.all(8), - boxAnimationDuration: Duration(milliseconds: 200), - itemAnimationDuration: Duration(milliseconds: 500), - hoverDuration: Duration(milliseconds: 700), + itemSize: const Size(45, 45), + boxPadding: const EdgeInsets.all(8), + boxAnimationDuration: + const Duration(milliseconds: 200), + itemAnimationDuration: + const Duration(milliseconds: 500), + hoverDuration: const Duration(milliseconds: 700), // toggle: false, child: _buildReactionsIcon(mainImage.value), @@ -751,12 +754,12 @@ class _SubGroupInfoState extends State { } Widget containertile({required String text}) { - return commonGlassContainer( - border: 1, + return commonGlassUI( + borderwidth: 1, width: 100.w, height: 30.h, - borderradius: 30.r, - borderColor: Color(0xFFD90B2E), + borderRadius: BorderRadius.circular( 30.r), + borderColor: const Color(0xFFD90B2E), customWidget: Padding( padding: EdgeInsets.symmetric(horizontal: 10.w), child: Center(child: text14w400_FCFCFC(text)), @@ -764,7 +767,7 @@ class _SubGroupInfoState extends State { } Widget eventsTab() { - return Column( + return const Column( children: [], ); } diff --git a/lib/Feed Module/Main_Screens/GroupTab/View/SubGroup/SubgroupSetting.dart b/lib/Main_Screens/GroupTab/View/SubGroup/SubgroupSetting.dart similarity index 70% rename from lib/Feed Module/Main_Screens/GroupTab/View/SubGroup/SubgroupSetting.dart rename to lib/Main_Screens/GroupTab/View/SubGroup/SubgroupSetting.dart index 7918eac..701bb6a 100644 --- a/lib/Feed Module/Main_Screens/GroupTab/View/SubGroup/SubgroupSetting.dart +++ b/lib/Main_Screens/GroupTab/View/SubGroup/SubgroupSetting.dart @@ -4,7 +4,7 @@ import 'package:get/get.dart'; import 'package:regroup/Common/CommonGlassmorphism.dart'; import 'package:regroup/Common/CommonWidget.dart'; import 'package:regroup/Utils/Common/CommonAppbar.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; + import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/texts.dart'; import 'package:regroup/resources/routes/route_name.dart'; @@ -39,57 +39,56 @@ class _SubGroupSettingState extends State { ), resizeToAvoidBottomInset: false, body: Stack(children: [ - Container( + Container( decoration: const BoxDecoration( image: DecorationImage( image: AssetImage("assets/images/png/Ellipse 1496.png"), fit: BoxFit.fill)), - ), Column( - crossAxisAlignment: CrossAxisAlignment.start, + ), + Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + sizedBoxHeight(30.h), + GestureDetector( + onTap: () { + inviteBottomSheet(); + }, + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 16.w), + child: Row( children: [ - sizedBoxHeight(30.h), - GestureDetector( - onTap: () { - inviteBottomSheet(); - }, - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), - child: Row( - children: [ - text18w400_FCFCFC("Group type"), - Spacer(), - Icon( - Icons.arrow_forward_ios_outlined, - color: Colors.white, - size: 18.sp, - ) - ], - ), - ), + text18w400_FCFCFC("Group type"), + Spacer(), + Icon( + Icons.arrow_forward_ios_outlined, + color: Colors.white, + size: 18.sp, + ) + ], ), - sizedBoxHeight(25.h), - commonDivider(), - sizedBoxHeight(25.h), - GestureDetector( - onTap: () { - Get.toNamed(RouteName.groupmanage); - }, - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), - child: Row( - children: [ - text18w400_FCFCFC("Manage members"), - Spacer(), - Icon( - Icons.arrow_forward_ios_outlined, - color: Colors.white, - size: 18.sp, - ) - ], - ), - ), + ), + ), + sizedBoxHeight(25.h), + commonDivider(), + sizedBoxHeight(25.h), + GestureDetector( + onTap: () { + Get.toNamed(RouteName.groupmanage); + }, + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 16.w), + child: Row( + children: [ + text18w400_FCFCFC("Manage members"), + Spacer(), + Icon( + Icons.arrow_forward_ios_outlined, + color: Colors.white, + size: 18.sp, + ) + ], ), - ]) + ), + ), + ]) ])); } diff --git a/lib/Feed Module/Main_Screens/GroupTab/View/SubGroup/Subgroups.dart b/lib/Main_Screens/GroupTab/View/SubGroup/Subgroups.dart similarity index 88% rename from lib/Feed Module/Main_Screens/GroupTab/View/SubGroup/Subgroups.dart rename to lib/Main_Screens/GroupTab/View/SubGroup/Subgroups.dart index 6b1b40d..d2d5b39 100644 --- a/lib/Feed Module/Main_Screens/GroupTab/View/SubGroup/Subgroups.dart +++ b/lib/Main_Screens/GroupTab/View/SubGroup/Subgroups.dart @@ -4,7 +4,7 @@ import 'package:get/get.dart'; import 'package:regroup/Common/CommonGlassmorphism.dart'; import 'package:regroup/Common/CommonWidget.dart'; import 'package:regroup/Utils/Common/CommonAppbar.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; + import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/texts.dart'; import 'package:regroup/resources/routes/route_name.dart'; @@ -73,29 +73,30 @@ class _SubGroupsState extends State { image: DecorationImage( image: AssetImage("assets/images/png/Ellipse 1496.png"), fit: BoxFit.fill)), - ), Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - sizedBoxHeight(30.h), - Expanded( - child: ListView.builder( - shrinkWrap: true, - physics: BouncingScrollPhysics(), - itemCount: subgroupData.length, - itemBuilder: (context, index) { - return subgroupCard( - ontap: () { - Get.toNamed(RouteName.groupdetail); - }, - imagepath: subgroupData[index]['imagePath'], - title: subgroupData[index]['text'], - members: subgroupData[index]['members']); - }, - ), - ) - ])) + ), + Padding( + padding: EdgeInsets.symmetric(horizontal: 16.w), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + sizedBoxHeight(30.h), + Expanded( + child: ListView.builder( + shrinkWrap: true, + physics: BouncingScrollPhysics(), + itemCount: subgroupData.length, + itemBuilder: (context, index) { + return subgroupCard( + ontap: () { + Get.toNamed(RouteName.groupdetail); + }, + imagepath: subgroupData[index]['imagePath'], + title: subgroupData[index]['text'], + members: subgroupData[index]['members']); + }, + ), + ) + ])) ])); } @@ -109,11 +110,11 @@ class _SubGroupsState extends State { padding: EdgeInsets.only(bottom: 25.h), child: GestureDetector( onTap: ontap, - child: commonGlassContainer( - border: 0.9, + child: commonGlassUI( + borderwidth: 0.9, width: double.infinity, height: 162.h, - borderradius: 10.r, + borderRadius: BorderRadius.circular( 10.r), customWidget: Padding( padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 16.h), child: Column( diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Badges/Badges.dart b/lib/Main_Screens/ProfileTab/Badges/Badges.dart similarity index 97% rename from lib/Feed Module/Main_Screens/ProfileTab/Badges/Badges.dart rename to lib/Main_Screens/ProfileTab/Badges/Badges.dart index 8ec6f61..31dcdb2 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/Badges/Badges.dart +++ b/lib/Main_Screens/ProfileTab/Badges/Badges.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:regroup/Utils/Common/CommonAppbar.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; + import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/texts.dart'; @@ -54,7 +54,8 @@ class _BadgesState extends State { Container( decoration: const BoxDecoration( image: DecorationImage( - image: AssetImage("assets/images/png/Ellipse 1496.png"), fit: BoxFit.fill)), + image: AssetImage("assets/images/png/Ellipse 1496.png"), + fit: BoxFit.fill)), ), SingleChildScrollView( child: Padding( diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Certificate/AddCertificate.dart b/lib/Main_Screens/ProfileTab/Certificate/AddCertificate.dart similarity index 95% rename from lib/Feed Module/Main_Screens/ProfileTab/Certificate/AddCertificate.dart rename to lib/Main_Screens/ProfileTab/Certificate/AddCertificate.dart index a1ffd3a..b6d10fb 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/Certificate/AddCertificate.dart +++ b/lib/Main_Screens/ProfileTab/Certificate/AddCertificate.dart @@ -3,11 +3,10 @@ import 'dart:io'; import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; -import 'package:flutter/widgets.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart' hide MultipartFile, FormData; import 'package:regroup/Common/base_manager.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profilePostmethod.dart'; +import 'package:regroup/Main_Screens/ProfileTab/view_model/profilePostmethod.dart'; import 'package:regroup/Utils/Common/CommonAppbar.dart'; import 'package:regroup/Utils/Common/CustomNextButton.dart'; import 'package:regroup/Utils/Common/CustomTextformfield.dart'; @@ -131,9 +130,9 @@ class _AddCertificateState extends State { onTap: () => FocusManager.instance.primaryFocus?.unfocus(), child: Scaffold( // key: _scaffoldKey1, - backgroundColor: Color(0xFF222935), + backgroundColor: const Color(0xFF222935), extendBody: true, - appBar: CommonAppbar( + appBar: const CommonAppbar( titleTxt: "Add certifications", ), body: Stack(children: [ @@ -155,7 +154,7 @@ class _AddCertificateState extends State { text16400white("Certification name"), sizedBoxHeight(16.h), CustomTextFormField( - leadingIcon: Container( + leadingIcon: SizedBox( height: 17.h, width: 18.w, child: Center( @@ -186,7 +185,7 @@ class _AddCertificateState extends State { text16400white("Certification reason"), sizedBoxHeight(16.h), CustomTextFormField( - leadingIcon: Container( + leadingIcon: SizedBox( height: 17.h, width: 18.w, child: Center( @@ -248,8 +247,8 @@ class _AddCertificateState extends State { width: double.infinity, decoration: ShapeDecoration( gradient: LinearGradient( - begin: Alignment(0.98, -0.21), - end: Alignment(-0.98, 0.21), + begin: const Alignment(0.98, -0.21), + end: const Alignment(-0.98, 0.21), colors: [ Colors.white .withOpacity(0.30000001192092896), @@ -258,7 +257,7 @@ class _AddCertificateState extends State { ], ), shape: RoundedRectangleBorder( - side: BorderSide( + side: const BorderSide( width: 0.50, color: Color(0xFF7E7E7E)), borderRadius: BorderRadius.circular(10), @@ -292,7 +291,7 @@ class _AddCertificateState extends State { BorderRadius.circular( 5)), ), - child: Icon( + child: const Icon( Icons.delete_outline_outlined, color: Colors.white, ))), @@ -337,8 +336,8 @@ class _AddCertificateState extends State { height: 167, decoration: ShapeDecoration( gradient: LinearGradient( - begin: Alignment(0.98, -0.21), - end: Alignment(-0.98, 0.21), + begin: const Alignment(0.98, -0.21), + end: const Alignment(-0.98, 0.21), colors: [ Colors.white .withOpacity(0.30000001192092896), @@ -347,7 +346,7 @@ class _AddCertificateState extends State { ], ), shape: RoundedRectangleBorder( - side: BorderSide( + side: const BorderSide( width: 0.50, color: Color(0xFF7E7E7E)), borderRadius: BorderRadius.circular(10), diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Certificate/Certificate.dart b/lib/Main_Screens/ProfileTab/Certificate/Certificate.dart similarity index 93% rename from lib/Feed Module/Main_Screens/ProfileTab/Certificate/Certificate.dart rename to lib/Main_Screens/ProfileTab/Certificate/Certificate.dart index 6748349..a4f129a 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/Certificate/Certificate.dart +++ b/lib/Main_Screens/ProfileTab/Certificate/Certificate.dart @@ -1,7 +1,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profileGetmethod.dart'; +import 'package:regroup/Main_Screens/ProfileTab/view_model/profileGetmethod.dart'; + import 'package:regroup/Utils/Common/CommonAppbar.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/texts.dart'; @@ -14,7 +15,7 @@ class Certificate extends StatefulWidget { } class _CertificateState extends State { - List CertificateData = [ + List certificateData = [ { "imagePath": "assets/images/png/image 17.png", "text": "Lorem ipsum is a dummy text", @@ -56,9 +57,9 @@ class _CertificateState extends State { Widget build(BuildContext context) { return Scaffold( // key: _scaffoldKey1, - backgroundColor: Color(0xFF222935), + backgroundColor: const Color(0xFF222935), extendBody: true, - appBar: CommonAppbar( + appBar: const CommonAppbar( titleTxt: "Certifications/Qualifications", ), resizeToAvoidBottomInset: false, @@ -127,7 +128,7 @@ class _CertificateState extends State { padding: const EdgeInsets.symmetric(horizontal: 16), child: Column(children: [ sizedBoxHeight(25.h), - Container( + SizedBox( height: 600.h, child: GridView.builder( scrollDirection: Axis.vertical, @@ -148,7 +149,7 @@ class _CertificateState extends State { certificateobj!.data![index] .certificationImage!.isEmpty ? Image.asset( - CertificateData[index]["imagePath"], + certificateData[index]["imagePath"], height: 100.h, width: 105.w, ) @@ -160,7 +161,7 @@ class _CertificateState extends State { errorBuilder: (context, error, stackTrace) { // Error handling when image fails to load return Image.asset( - CertificateData[index]["imagePath"], + certificateData[index]["imagePath"], fit: BoxFit.cover, ); }), @@ -172,7 +173,7 @@ class _CertificateState extends State { null || certificateobj!.data![index] .certificationName!.isEmpty - ? CertificateData[index]["text"] + ? certificateData[index]["text"] : certificateobj! .data![index].certificationName, textAlign: TextAlign.center, diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Clubs/Clubs.dart b/lib/Main_Screens/ProfileTab/Clubs/Clubs.dart similarity index 97% rename from lib/Feed Module/Main_Screens/ProfileTab/Clubs/Clubs.dart rename to lib/Main_Screens/ProfileTab/Clubs/Clubs.dart index b592b83..43e71bb 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/Clubs/Clubs.dart +++ b/lib/Main_Screens/ProfileTab/Clubs/Clubs.dart @@ -3,7 +3,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:regroup/Common/CommonGlassmorphism.dart'; import 'package:regroup/Common/CommonWidget.dart'; import 'package:regroup/Utils/Common/CommonAppbar.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; + import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/texts.dart'; @@ -44,13 +44,14 @@ class _ClubsState extends State { ), resizeToAvoidBottomInset: false, body: Stack(children: [ - Container( + Container( decoration: const BoxDecoration( image: DecorationImage( image: AssetImage("assets/images/png/Ellipse 1496.png"), fit: BoxFit.fill)), - ), SingleChildScrollView( - child: Padding( + ), + SingleChildScrollView( + child: Padding( padding: const EdgeInsets.symmetric(horizontal: 16), child: Column(children: [ sizedBoxHeight(25.h), @@ -80,11 +81,11 @@ class _ClubsState extends State { padding: EdgeInsets.only(bottom: 25.h), child: GestureDetector( onTap: ontap, - child: commonGlassContainer( - border: 0.9, + child: commonGlassUI( + borderwidth: 0.9, width: double.infinity, height: 143.h, - borderradius: 10.r, + borderRadius: BorderRadius.circular( 10.r), customWidget: Padding( padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 16.h), child: Column( @@ -218,5 +219,4 @@ class _ClubsState extends State { ), ); } - } diff --git a/lib/Feed Module/Main_Screens/ProfileTab/EditProfile/Model/GetEditProfileBus.dart b/lib/Main_Screens/ProfileTab/EditProfile/Model/GetEditProfileBus.dart similarity index 100% rename from lib/Feed Module/Main_Screens/ProfileTab/EditProfile/Model/GetEditProfileBus.dart rename to lib/Main_Screens/ProfileTab/EditProfile/Model/GetEditProfileBus.dart diff --git a/lib/Feed Module/Main_Screens/ProfileTab/EditProfile/Model/GetEditProfileIndi.dart b/lib/Main_Screens/ProfileTab/EditProfile/Model/GetEditProfileIndi.dart similarity index 63% rename from lib/Feed Module/Main_Screens/ProfileTab/EditProfile/Model/GetEditProfileIndi.dart rename to lib/Main_Screens/ProfileTab/EditProfile/Model/GetEditProfileIndi.dart index 51ca91f..bb81f4c 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/EditProfile/Model/GetEditProfileIndi.dart +++ b/lib/Main_Screens/ProfileTab/EditProfile/Model/GetEditProfileIndi.dart @@ -10,14 +10,14 @@ class GetEditProfileIndi { status = json['status']; statusCode = json['status_code']; message = json['message']; - data = json['data'] != null ? new Data.fromJson(json['data']) : null; + data = json['data'] != null ? Data.fromJson(json['data']) : null; } Map toJson() { - final Map data = new Map(); - data['status'] = this.status; - data['status_code'] = this.statusCode; - data['message'] = this.message; + final Map data = {}; + data['status'] = status; + data['status_code'] = statusCode; + data['message'] = message; if (this.data != null) { data['data'] = this.data!.toJson(); } @@ -83,7 +83,7 @@ class Data { if (json['interest'] != null) { interest = []; json['interest'].forEach((v) { - interest!.add(new Interest.fromJson(v)); + interest!.add(Interest.fromJson(v)); }); } about = json['about']; @@ -93,65 +93,65 @@ class Data { weight = json['weight']; battingAverage = json['batting_average']; follows = - json['follows'] != null ? new Follows.fromJson(json['follows']) : null; + json['follows'] != null ? Follows.fromJson(json['follows']) : null; if (json['timelines'] != null) { timelines = []; json['timelines'].forEach((v) { - timelines!.add(new Timelines.fromJson(v)); + timelines!.add(Timelines.fromJson(v)); }); } accountVisibility = json['account_visibility']; if (json['my_joined_groups'] != null) { myJoinedGroups = []; json['my_joined_groups'].forEach((v) { - myJoinedGroups!.add(new MyJoinedGroups.fromJson(v)); + myJoinedGroups!.add(MyJoinedGroups.fromJson(v)); }); } if (json['certifications'] != null) { certifications = []; json['certifications'].forEach((v) { - certifications!.add(new Certifications.fromJson(v)); + certifications!.add(Certifications.fromJson(v)); }); } daysBeforeJoined = json['days_before_joined']; } Map toJson() { - final Map data = new Map(); - data['id'] = this.id; - data['user_name'] = this.userName; - data['location'] = this.location; + final Map data = {}; + data['id'] = id; + data['user_name'] = userName; + data['location'] = location; - data['full_name'] = this.fullName; + data['full_name'] = fullName; // data['profile_image'] = this.profileImage; - data['profile_photo'] = this.profilePhoto; - data['gender'] = this.gender; - data['date_of_birth'] = this.dateOfBirth; - if (this.interest != null) { - data['interest'] = this.interest!.map((v) => v.toJson()).toList(); + data['profile_photo'] = profilePhoto; + data['gender'] = gender; + data['date_of_birth'] = dateOfBirth; + if (interest != null) { + data['interest'] = interest!.map((v) => v.toJson()).toList(); } - data['about'] = this.about; - data['position'] = this.position; - data['training_scores'] = this.trainingScores; - data['height'] = this.height; - data['weight'] = this.weight; - data['batting_average'] = this.battingAverage; - if (this.follows != null) { - data['follows'] = this.follows!.toJson(); + data['about'] = about; + data['position'] = position; + data['training_scores'] = trainingScores; + data['height'] = height; + data['weight'] = weight; + data['batting_average'] = battingAverage; + if (follows != null) { + data['follows'] = follows!.toJson(); } - if (this.timelines != null) { - data['timelines'] = this.timelines!.map((v) => v.toJson()).toList(); + if (timelines != null) { + data['timelines'] = timelines!.map((v) => v.toJson()).toList(); } - data['account_visibility'] = this.accountVisibility; - if (this.myJoinedGroups != null) { + data['account_visibility'] = accountVisibility; + if (myJoinedGroups != null) { data['my_joined_groups'] = - this.myJoinedGroups!.map((v) => v.toJson()).toList(); + myJoinedGroups!.map((v) => v.toJson()).toList(); } - if (this.certifications != null) { + if (certifications != null) { data['certifications'] = - this.certifications!.map((v) => v.toJson()).toList(); + certifications!.map((v) => v.toJson()).toList(); } - data['days_before_joined'] = this.daysBeforeJoined; + data['days_before_joined'] = daysBeforeJoined; return data; } } @@ -168,9 +168,9 @@ class Interest { } Map toJson() { - final Map data = new Map(); - data['id'] = this.id; - data['name'] = this.name; + final Map data = {}; + data['id'] = id; + data['name'] = name; return data; } } @@ -206,22 +206,22 @@ class Timelines { if (json['abilities'] != null) { abilities = []; json['abilities'].forEach((v) { - abilities!.add(new Abilities.fromJson(v)); + abilities!.add(Abilities.fromJson(v)); }); } } Map toJson() { - final Map data = new Map(); - data['id'] = this.id; - data['club_name'] = this.clubName; - data['role_name'] = this.roleName; - data['team_name'] = this.teamName; - data['start_date'] = this.startDate; - data['end_date'] = this.endDate; - data['abilities_xids'] = this.abilitiesXids; - if (this.abilities != null) { - data['abilities'] = this.abilities!.map((v) => v.toJson()).toList(); + final Map data = {}; + data['id'] = id; + data['club_name'] = clubName; + data['role_name'] = roleName; + data['team_name'] = teamName; + data['start_date'] = startDate; + data['end_date'] = endDate; + data['abilities_xids'] = abilitiesXids; + if (abilities != null) { + data['abilities'] = abilities!.map((v) => v.toJson()).toList(); } return data; } @@ -239,9 +239,9 @@ class Abilities { } Map toJson() { - final Map data = new Map(); - data['id'] = this.id; - data['name'] = this.name; + final Map data = {}; + data['id'] = id; + data['name'] = name; return data; } } @@ -258,9 +258,9 @@ class Follows { } Map toJson() { - final Map data = new Map(); - data['following'] = this.following; - data['followers'] = this.followers; + final Map data = {}; + data['following'] = following; + data['followers'] = followers; return data; } } @@ -291,13 +291,13 @@ class Certifications { } Map toJson() { - final Map data = new Map(); - data['id'] = this.id; - data['certification_name'] = this.certificationName; - data['certification_image'] = this.certificationImage; - data['certification_reason'] = this.certificationReason; - data['certification_date'] = this.certificationDate; - data['iam_principal_xid'] = this.iamPrincipalXid; + final Map data = {}; + data['id'] = id; + data['certification_name'] = certificationName; + data['certification_image'] = certificationImage; + data['certification_reason'] = certificationReason; + data['certification_date'] = certificationDate; + data['iam_principal_xid'] = iamPrincipalXid; return data; } } @@ -316,17 +316,17 @@ class MyJoinedGroups { iamPrincipalXid = json['iam_principal_xid']; manageGroupXid = json['manage_group_xid']; groupData = json['group_data'] != null - ? new GroupData.fromJson(json['group_data']) + ? GroupData.fromJson(json['group_data']) : null; } Map toJson() { - final Map data = new Map(); - data['id'] = this.id; - data['iam_principal_xid'] = this.iamPrincipalXid; - data['manage_group_xid'] = this.manageGroupXid; - if (this.groupData != null) { - data['group_data'] = this.groupData!.toJson(); + final Map data = {}; + data['id'] = id; + data['iam_principal_xid'] = iamPrincipalXid; + data['manage_group_xid'] = manageGroupXid; + if (groupData != null) { + data['group_data'] = groupData!.toJson(); } return data; } @@ -346,10 +346,10 @@ class GroupData { } Map toJson() { - final Map data = new Map(); - data['id'] = this.id; - data['title'] = this.title; - data['group_image'] = this.groupImage; + final Map data = {}; + data['id'] = id; + data['title'] = title; + data['group_image'] = groupImage; return data; } } diff --git a/lib/Feed Module/Main_Screens/ProfileTab/EditProfile/Model/InterestModel.dart b/lib/Main_Screens/ProfileTab/EditProfile/Model/InterestModel.dart similarity index 100% rename from lib/Feed Module/Main_Screens/ProfileTab/EditProfile/Model/InterestModel.dart rename to lib/Main_Screens/ProfileTab/EditProfile/Model/InterestModel.dart diff --git a/lib/Feed Module/Main_Screens/ProfileTab/EditProfile/View/BusEditProfile.dart b/lib/Main_Screens/ProfileTab/EditProfile/View/BusEditProfile.dart similarity index 92% rename from lib/Feed Module/Main_Screens/ProfileTab/EditProfile/View/BusEditProfile.dart rename to lib/Main_Screens/ProfileTab/EditProfile/View/BusEditProfile.dart index e2a0d0c..a012092 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/EditProfile/View/BusEditProfile.dart +++ b/lib/Main_Screens/ProfileTab/EditProfile/View/BusEditProfile.dart @@ -2,13 +2,14 @@ import 'dart:io'; import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart' hide MultipartFile, FormData; import 'package:regroup/Common/CommonButton.dart'; import 'package:regroup/Common/CommonWidget.dart'; import 'package:regroup/Common/base_manager.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/EditProfile/View/picturecontroller/profileimagecontoller.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/EditProfile/ViewModel/EditProfileApi.dart'; +import 'package:regroup/Main_Screens/ProfileTab/EditProfile/View/picturecontroller/profileimagecontoller.dart'; +import 'package:regroup/Main_Screens/ProfileTab/EditProfile/ViewModel/EditProfileApi.dart'; import 'package:regroup/Utils/Common/CommonAppbar.dart'; import 'package:regroup/Utils/Common/ImageUpload.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; @@ -93,7 +94,6 @@ class _BusEditProfileState extends State { editProfileImage.usserprofilePicPath.value, filename: path.basename(profilePicture), ); - } FormData? updata; @@ -348,7 +348,11 @@ class _BusEditProfileState extends State { ), ), ), - hintText: "Victory gear sports emporium", + hintText: "Enter your business name", + inputFormatters: [ + FilteringTextInputFormatter.allow( + RegExp(r'[a-zA-Z0-9\s]')), + ], ), sizedBoxHeight(20.h), text16400white("Business username"), @@ -367,7 +371,11 @@ class _BusEditProfileState extends State { ), ), ), - hintText: "", + hintText: "Enter your business username", + inputFormatters: [ + FilteringTextInputFormatter.allow( + RegExp(r'[a-zA-Z0-9\s]')), + ], ), sizedBoxHeight(20.h), text16400white("Owner name"), @@ -385,7 +393,11 @@ class _BusEditProfileState extends State { ), ), ), - hintText: "", + hintText: "Enter your owner name", + inputFormatters: [ + FilteringTextInputFormatter.allow( + RegExp(r'[a-zA-Z0-9\s]')), + ], ), sizedBoxHeight(20.h), text16400white("Founded on"), @@ -406,7 +418,7 @@ class _BusEditProfileState extends State { ), ), ), - hintText: "", + hintText: "Select date", textEditingController: foundedonController, ), @@ -429,7 +441,7 @@ class _BusEditProfileState extends State { ), ), ), - hintText: "", + hintText: "Enter your website link", ), sizedBoxHeight(25.h), Row( @@ -457,15 +469,23 @@ class _BusEditProfileState extends State { ), ), ), - hintText: "", + hintText: "Enter your location", + inputFormatters: [ + FilteringTextInputFormatter.allow( + RegExp(r'[a-zA-Z0-9\s]')), + ], ), sizedBoxHeight(20.h), text16400white("Bio"), sizedBoxHeight(16.h), CustomTextFormField2( textEditingController: bioController, - hintText: "", + hintText: "Enter your business bio", maxlines: 3, + inputFormatters: [ + FilteringTextInputFormatter.allow( + RegExp(r'[a-zA-Z0-9\s]')), + ], ), sizedBoxHeight(60.h), CommonBtn( diff --git a/lib/Main_Screens/ProfileTab/EditProfile/View/EditProfile.dart b/lib/Main_Screens/ProfileTab/EditProfile/View/EditProfile.dart new file mode 100644 index 0000000..80ffc44 --- /dev/null +++ b/lib/Main_Screens/ProfileTab/EditProfile/View/EditProfile.dart @@ -0,0 +1,576 @@ +import 'dart:developer'; +import 'dart:io'; + +import 'package:dio/dio.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart' hide MultipartFile, FormData; +import 'package:path/path.dart' as path; +import 'package:regroup/Common/CommonButton.dart'; +import 'package:regroup/Common/CommonWidget.dart'; +import 'package:regroup/Common/base_manager.dart'; +import 'package:regroup/Main_Screens/ProfileTab/EditProfile/View/picturecontroller/indiprofileimagecontroller.dart'; +import 'package:regroup/Main_Screens/ProfileTab/EditProfile/ViewModel/EditProfileApi.dart'; +import 'package:regroup/Main_Screens/ProfileTab/EditProfile/ViewModel/InterestApiList.dart'; +import 'package:regroup/Utils/Common/CommonAppbar.dart'; +import 'package:regroup/Utils/Common/CommonDropdown.dart'; +import 'package:regroup/Utils/Common/CustomTextformfield.dart'; +import 'package:regroup/Utils/Common/ImageUpload.dart'; +import 'package:regroup/Utils/Common/sized_box.dart'; +import 'package:regroup/Utils/dialogs.dart'; +import 'package:regroup/Utils/texts.dart'; +import 'package:regroup/resources/routes/route_name.dart'; + +class EditProfile extends StatefulWidget { + const EditProfile({super.key}); + + @override + State createState() => _EditProfileState(); +} + +class _EditProfileState extends State { + TextEditingController fullNameController = TextEditingController(); + TextEditingController userNameController = TextEditingController(); + TextEditingController dateController = TextEditingController(); + TextEditingController locationController = TextEditingController(); + TextEditingController aboutController = TextEditingController(); + TextEditingController positionController = TextEditingController(); + TextEditingController trainingScoresController = TextEditingController(); + TextEditingController heightController = TextEditingController(); + TextEditingController weightController = TextEditingController(); + TextEditingController battingAvgController = TextEditingController(); + + String profilePicture = ""; + bool isImageAdded = false; + + bool isOnce = true; + late Future myfuture; + + convertFileToMultiPart1(String? file) async { + return await MultipartFile.fromFile( + file!, + filename: path.basename(file), + ); + } + + String extractFileName1(String filePath) { + return path.basename(filePath); + } + + String _selectedgenderType = ''; + + void _onItemSelected(String value) { + setState(() { + _selectedgenderType = value; + }); + } + + List selectedinterestid = []; + RxBool isloading = true.obs; + + void getCatIdFromName(List selectedInterests) { + for (var name in selectedInterests) { + for (var i = 0; i < interestlistobj!.data!.length; i++) { + if (name == interestlistobj!.data![i].name) { + selectedinterestid.add(interestlistobj!.data![i].id!); + break; + } + } + } + } + + @override + void initState() { + myfuture = EditProfileApi() + .getEditProfileIndividual() + .then((value) => {setValues()}); + + super.initState(); + } + + setValues() async { + if (isOnce) { + fullNameController.text = getEditProfileIndi!.data!.fullName ?? ''; + userNameController.text = getEditProfileIndi!.data!.userName ?? ''; + dateController.text = getEditProfileIndi!.data!.dateOfBirth ?? ''; + + _selectedgenderType = getEditProfileIndi!.data!.gender ?? ''; + locationController.text = getEditProfileIndi!.data!.location ?? ''; + + locationController.text = getEditProfileIndi!.data!.about ?? ''; + aboutController.text = getEditProfileIndi!.data!.about ?? ''; + positionController.text = getEditProfileIndi!.data!.position ?? ''; + + trainingScoresController.text = + getEditProfileIndi!.data!.trainingScores ?? ''; + + heightController.text = getEditProfileIndi!.data!.height ?? ''; + weightController.text = getEditProfileIndi!.data!.weight ?? ''; + battingAvgController.text = + getEditProfileIndi!.data!.battingAverage ?? ''; + + isOnce = false; + setState(() {}); + } + } + + void saveEditProfileInd() async { + utils.loader(); + FormData? updata; + MultipartFile imageFile = MultipartFile.fromBytes([]); + selectedinterestid.isEmpty + ? getCatIdFromName(listofUserInterests) + : selectedinterestid; + String abilitiesIds = selectedinterestid.toString(); + if (editProfileImage.usserprofilePicPath.value.isNotEmpty) { + imageFile = await MultipartFile.fromFile( + editProfileImage.usserprofilePicPath.value, + filename: path.basename(profilePicture), + ); + } + + updata = FormData.fromMap({ + "full_name": fullNameController.text, + "profile_image": editProfileImage.usserprofilePicPath.value.isNotEmpty + ? imageFile + : null, + "user_name": userNameController.text, + "date_of_birth": dateController.text, + "gender": _selectedgenderType, + "interest": abilitiesIds, + "about": aboutController.text, + "position": positionController.text, + "training_scores": trainingScoresController.text, + "height": heightController.text, + "weight": weightController.text, + "batting_average": battingAvgController.text, + "address_line1": battingAvgController.text, + }); + log(updata.toString()); + + final data = await EditProfileApi().postEditProfileIndividual(updata); + if (data.status == ResponseStatus.SUCCESS) { + Get.back(); + Get.toNamed(RouteName.mainscreen, arguments: 4); + } else { + Get.back(); + + Get.snackbar( + "Error!", + data.data['message'], + duration: const Duration(seconds: 2), + colorText: Colors.white, + backgroundColor: Colors.red, + margin: const EdgeInsets.all(8), + snackStyle: SnackStyle.FLOATING, + snackPosition: SnackPosition.BOTTOM, + ); + } + } + + final UserIndiProfileImageController editProfileImage = + Get.put(UserIndiProfileImageController()); + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: () => FocusManager.instance.primaryFocus?.unfocus(), + child: Scaffold( + backgroundColor: const Color(0xFF222935), + extendBody: true, + appBar: const CommonAppbar( + titleTxt: "", + ), + body: FutureBuilder( + future: myfuture, + builder: (ctx, snapshot) { + if (snapshot.connectionState == ConnectionState.waiting) { + return const Center( + child: CircularProgressIndicator( + color: Colors.blue, + ), + ); + } + + if (snapshot.hasError) { + return Center( + child: Text( + '${snapshot.error} occurred', + style: TextStyle(fontSize: 18.spMin), + ), + ); + } + + if (snapshot.connectionState == ConnectionState.done && + snapshot.hasData) { + return Stack(children: [ + Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage( + "assets/images/png/Ellipse 1496.png"), + fit: BoxFit.fill)), + ), + SingleChildScrollView( + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 16), + child: Column(children: [ + sizedBoxHeight(25.h), + Stack( + children: [ + Obx( + () => editProfileImage + .usserprofilePicPath.value != + '' + ? ClipOval( + child: SizedBox.fromSize( + size: Size.fromRadius(50.r), + child: editProfileImage + .usserprofilePicPath + .value != + '' + ? Image( + image: FileImage( + File( + editProfileImage + .usserprofilePicPath + .value, + ), + ), + fit: BoxFit.cover, + width: double.infinity, + errorBuilder: + (BuildContext context, + Object exception, + StackTrace? + stackTrace) { + return CircleAvatar( + backgroundImage: + const AssetImage( + "assets/images/png/cimg3.png"), + radius: 50.r, + ); + }, + ) + : Image.asset( + 'assets/images/png/cimg3.png')), + ) + : ClipOval( + child: SizedBox.fromSize( + size: Size.fromRadius(60.r), + child: getEditProfileIndi! + .data!.profilePhoto != + null + ? ClipOval( + child: SizedBox.fromSize( + size: Size.fromRadius( + 25.r), + child: CircleAvatar( + backgroundImage: NetworkImage( + getEditProfileIndi! + .data! + .profilePhoto!), + radius: 25.r, + ), + ), + ) + : Image.asset( + "assets/images/blank-profile-picture-973460_1280.png")), + ), + ), + Positioned( + bottom: 0, + right: 0, + child: InkWell( + onTap: () { + ImageUploadBottomSheet().showModal( + context, + true, + (result) { + editProfileImage.usserprofilePicPath + .value = result; + + var filenameresult = + extractFileName1(result); + + profilePicture = result; + isImageAdded = true; + setState(() {}); + }, + ); + }, + child: Container( + height: 35.h, + width: 35.w, + decoration: const BoxDecoration( + shape: BoxShape.circle, + color: Color(0xFFD90B2E)), + child: Center( + child: Image.asset( + "assets/images/png/cameraicon2.png", + height: 19.h, + width: 19.w, + ), + ), + ), + )) + ], + ), + sizedBoxHeight(15.h), + text16400white("Edit profile picture"), + sizedBoxHeight(20.h), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + text16400white("Full name"), + sizedBoxHeight(16.h), + CustomTextFormField( + textEditingController: fullNameController, + leadingIcon: SizedBox( + width: 18.w, + height: 17.h, + child: Center( + child: Image.asset( + "assets/images/png/Frame 24.png", + width: 18.w, + height: 17.h, + ), + ), + ), + hintText: "Enter your full name", + inputFormatters: [ + FilteringTextInputFormatter.allow( + RegExp('[a-zA-Z ]')), + ], + ), + sizedBoxHeight(20.h), + text16400white("User name"), + sizedBoxHeight(16.h), + CustomTextFormField( + textEditingController: userNameController, + leadingIcon: SizedBox( + width: 18.w, + height: 17.h, + child: Center( + child: Image.asset( + "assets/images/png/Frame 24.png", + width: 18.w, + height: 17.h, + ), + ), + ), + hintText: "Enter your user name", + inputFormatters: [ + FilteringTextInputFormatter.allow( + RegExp('[a-zA-Z ]')), + ], + ), + sizedBoxHeight(20.h), + text16400white("Date of birth"), + sizedBoxHeight(16.h), + GestureDetector( + onTap: () => + datePicker(context, dateController), + child: AbsorbPointer( + child: CustomTextFormField( + leadingIcon: SizedBox( + width: 18.0, + height: 17.0, + child: Center( + child: Image.asset( + "assets/images/png/calender.png", + width: 18.0, + height: 17.0, + ), + ), + ), + hintText: "12-04-2024", + textEditingController: dateController, + ), + ), + ), + sizedBoxHeight(20.h), + text16400white("Gender"), + sizedBoxHeight(16.h), + CustomDropDownRadio( + initialSelectedValue: _selectedgenderType, + header: _selectedgenderType ?? "Male", + title: "", + showOtherOption: true, + listData: const [ + "Male", + "Female", + "Prefer not to say" + ], + onItemSelected: _onItemSelected, + leadingImage: Image.asset( + "assets/images/png/Vector ws.png", + width: 18.w, + height: 17.h, + ), + ), + sizedBoxHeight(25.h), + Row( + children: [ + text16400white("Location"), + sizedBoxWidth(6.w), + Image.asset( + "assets/images/png/octicon_question-24.png", + height: 16.h, + width: 16.w, + ) + ], + ), + sizedBoxHeight(16.h), + CustomTextFormField( + textEditingController: locationController, + leadingIcon: SizedBox( + width: 18.w, + height: 17.h, + child: Center( + child: Image.asset( + "assets/images/png/Group 58645.png", + width: 18.w, + height: 17.h, + ), + ), + ), + hintText: "Enter your location", + inputFormatters: [ + FilteringTextInputFormatter.allow( + RegExp('[a-zA-Z ]')), + ], + ), + sizedBoxHeight(20.h), + Row( + children: [ + text16400white("Interests"), + sizedBoxWidth(6.w), + Image.asset( + "assets/images/png/octicon_question-24.png", + height: 16.h, + width: 16.w, + ) + ], + ), + sizedBoxHeight(16.h), + CustomDropDownChexkBox( + header: 'Select interest', + title: "", + listData: listofInterests, + onItemSelected: getCatIdFromName, + leadingImage: Image.asset( + "assets/images/png/Vector (4).png", + width: 18.w, + height: 17.h, + ), + initiallySelected: listofUserInterests, + ), + sizedBoxHeight(20.h), + text16400white("About"), + sizedBoxHeight(16.h), + CustomTextFormField2( + textEditingController: aboutController, + hintText: + "Lorem Ipsum has been the industry's standard dummy text ever since the 1500s. Lorem Ipsum has been the industry's standard", + maxlines: 3, + ), + text16400white("Position"), + sizedBoxHeight(16.h), + CustomTextFormField( + textEditingController: positionController, + hintText: "Enter your position", + inputFormatters: [ + LengthLimitingTextInputFormatter(50), + ], + ), + sizedBoxHeight(20.h), + text16400white("Training Scores"), + sizedBoxHeight(16.h), + CustomTextFormField( + textEditingController: + trainingScoresController, + texttype: TextInputType.number, + hintText: "Enter your training scores", + inputFormatters: [ + LengthLimitingTextInputFormatter(10), + FilteringTextInputFormatter.allow( + RegExp('[0-9]')), + ], + ), + sizedBoxHeight(20.h), + text16400white("Height"), + sizedBoxHeight(16.h), + CustomTextFormField( + textEditingController: heightController, + hintText: "Enter your height", + inputFormatters: [ + FilteringTextInputFormatter.allow( + RegExp(r'[a-zA-Z0-9\s]')), + ], + ), + sizedBoxHeight(20.h), + text16400white("Weight"), + sizedBoxHeight(16.h), + CustomTextFormField( + textEditingController: weightController, + hintText: "Enter your weight", + inputFormatters: [ + FilteringTextInputFormatter.allow( + RegExp(r'[a-zA-Z0-9\s]')), + ], + ), + sizedBoxHeight(20.h), + text16400white("Batting Average"), + sizedBoxHeight(16.h), + CustomTextFormField( + texttype: TextInputType.number, + textEditingController: battingAvgController, + hintText: "Enter your batting average", + inputFormatters: [ + LengthLimitingTextInputFormatter(10), + FilteringTextInputFormatter.allow( + RegExp('[0-9]')), + ], + ), + sizedBoxHeight(20.h), + sizedBoxHeight(60.h), + CommonBtn( + text: "Save", + onTap: () { + if (fullNameController.text.isBlank! || + userNameController.text.isBlank! || + dateController.text.isBlank! || + locationController.text.isBlank! || + aboutController.text.isBlank! || + positionController.text.isBlank! || + trainingScoresController + .text.isBlank! || + heightController.text.isBlank! || + weightController.text.isBlank! || + battingAvgController.text.isBlank!) { + Get.snackbar( + 'Error', + 'Please fill missing details', + snackPosition: SnackPosition.BOTTOM, + backgroundColor: Colors.red, + colorText: Colors.white, + ); + } else { + saveEditProfileInd(); + } + }, + ), + sizedBoxHeight(60.h), + ], + ) + ]))) + ]); + } + return Container(); + }), + ), + ); + } +} diff --git a/lib/Feed Module/Main_Screens/ProfileTab/EditProfile/View/ProfileTab.dart b/lib/Main_Screens/ProfileTab/EditProfile/View/ProfileTab.dart similarity index 94% rename from lib/Feed Module/Main_Screens/ProfileTab/EditProfile/View/ProfileTab.dart rename to lib/Main_Screens/ProfileTab/EditProfile/View/ProfileTab.dart index fe9ef93..21e4f2c 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/EditProfile/View/ProfileTab.dart +++ b/lib/Main_Screens/ProfileTab/EditProfile/View/ProfileTab.dart @@ -1,3 +1,4 @@ +import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_reaction_button/flutter_reaction_button.dart'; @@ -8,10 +9,10 @@ import 'package:regroup/Common/CommonGlassmorphism.dart'; import 'package:regroup/Common/CommonWidget.dart'; import 'package:regroup/Common/base_manager.dart'; import 'package:regroup/Common/controller/MainScreen.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/EditProfile/ViewModel/EditProfileApi.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profilePostmethod.dart'; import 'package:regroup/Global.dart'; +import 'package:regroup/Main_Screens/ProfileTab/EditProfile/ViewModel/EditProfileApi.dart'; +import 'package:regroup/Main_Screens/ProfileTab/view_model/profilePostmethod.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/dialogs.dart'; @@ -99,13 +100,15 @@ class _ProfileTabState extends State { String? interestText; @override void initState() { - individualfuture = EditProfileApi() - .getEditProfileIndividual() - .then((value) => {setValues()}); - - businessfuture = EditProfileApi() - .getEditProfileBusiness() - .then((value) => {setValues2()}); + if (globalAccountType == '1') { + individualfuture = EditProfileApi() + .getEditProfileIndividual() + .then((value) => {setValues()}); + } else { + businessfuture = EditProfileApi() + .getEditProfileBusiness() + .then((value) => {setValues2()}); + } super.initState(); } @@ -125,8 +128,6 @@ class _ProfileTabState extends State { SharedPreferences prefs = await SharedPreferences.getInstance(); accountTypeValue = prefs.getString('accountTypeValue'); accounTypeLogin = prefs.getString('accountTypefromLogin'); - print('account tupe login is $accounTypeLogin'); - print('account tupe value is $accountTypeValue'); // foodItemDropdownController.selectedFooddynamic.clear(); // foodItemDropdownController.foodItemQControllerList.clear(); // foodItemDropdownController.OtherFoodIngredientList.clear(); @@ -151,7 +152,7 @@ class _ProfileTabState extends State { int? certificationsremoveid; - RemoveTimelineUploadata() async { + removeTimelineUploadata() async { utils.loader(); Map updata = { "timeline_id": timelineremoveid, @@ -159,11 +160,9 @@ class _ProfileTabState extends State { final data = await Profilepostmethod().postRemoveTimeline(updata); if (data.status == ResponseStatus.SUCCESS) { Get.back(); - print("block done"); return utils.showToast(data.message); } else { Get.back(); - print("block not done"); return utils.showToast(data.message); } } @@ -176,11 +175,9 @@ class _ProfileTabState extends State { final data = await Profilepostmethod().postRemoveCertification(updata); if (data.status == ResponseStatus.SUCCESS) { Get.back(); - print("block done"); return utils.showToast(data.message); } else { Get.back(); - print("block not done"); return utils.showToast(data.message); } } @@ -216,7 +213,6 @@ class _ProfileTabState extends State { if (snapshot.connectionState == ConnectionState.done && snapshot.hasData) { - print("Data fetched-->"); return Stack(clipBehavior: Clip.none, children: [ Container( decoration: const BoxDecoration( @@ -232,7 +228,7 @@ class _ProfileTabState extends State { children: [ Stack( children: [ - Container( + SizedBox( height: 484.h, width: double.infinity, child: getEditProfileIndi! @@ -361,9 +357,12 @@ class _ProfileTabState extends State { sizedBoxHeight(30.h), text18w700white("About"), sizedBoxHeight(10.h), - text14400white(getEditProfileIndi! - .data!.about ?? - "Lorem Ipsum has been the industry's standard dummy text ever since the 1500s."), + getEditProfileIndi!.data!.about == null || + getEditProfileIndi! + .data!.about!.isEmpty + ? const SizedBox() + : text14400white( + getEditProfileIndi!.data!.about!), sizedBoxHeight(25.h), Row( children: [ @@ -382,9 +381,14 @@ class _ProfileTabState extends State { )), ), sizedBoxWidth(12.w), - text14400whiteblur(getEditProfileIndi! - .data!.location ?? - "Elm street london, United Kingdom"), + getEditProfileIndi!.data!.location == + null || + getEditProfileIndi! + .data!.location!.isEmpty + ? const SizedBox() + : text14400whiteblur( + getEditProfileIndi! + .data!.location!), ], ), sizedBoxHeight(20.h), @@ -488,43 +492,11 @@ class _ProfileTabState extends State { getEditProfileIndi!.data! .timelines![index]; - // List> - // abilities = - // timeline.abilities! - // .map((ability) => { - // 'id': ability.id, - // 'name': - // ability.name, - // }) - // .toList(); - return - // commonTimelineCard( - // imagePath: getEditProfileIndi - // ?.data - // ?.profileImage ?? - // '', - // title: getEditProfileIndi! - // .data! - // .timelines![index] - // .clubName!, - // role: getEditProfileIndi! - // .data! - // .timelines![index] - // .roleName!, - // teamname: getEditProfileIndi! - // .data! - // .timelines![index] - // .teamName!, - // abilities: abilities, - // id: getEditProfileIndi!.data! - // .timelines![index].id, - // starttoend: startToEnd, - // ); - Row( + return Row( children: [ - Container( + SizedBox( width: 10, - height: 170.h, + height: 200.h, child: Stack( clipBehavior: Clip.none, children: [ @@ -543,7 +515,7 @@ class _ProfileTabState extends State { right: 3.w, child: Container( width: 1.w, - height: 170.h, + height: 200.h, decoration: const BoxDecoration( color: Colors @@ -560,7 +532,7 @@ class _ProfileTabState extends State { commonGlassUI( width: double.infinity, - height: 155.h, + height: 174.h, borderRadius: BorderRadius .circular( @@ -611,7 +583,7 @@ class _ProfileTabState extends State { timelineremoveid = getEditProfileIndi!.data!.timelines![index].id ?? 0; getEditProfileIndi!.data!.timelines!.removeWhere((item) => item.id! == timelineremoveid); // .removeAt(index); - RemoveTimelineUploadata(); + removeTimelineUploadata(); }); }, child: SizedBox( @@ -627,17 +599,6 @@ class _ProfileTabState extends State { InkWell( onTap: () { - // setState( - // () { - // timelineremoveid = - // getEditProfileIndi!.data!.timelines![index].id ?? 0; - // getEditProfileIndi!.data!.timelines!.removeWhere((item) => - // item.id! == - // timelineremoveid); - // // .removeAt(index); - // RemoveTimelineUploadata(); - // }); - Get.toNamed(RouteName.addtimeline, arguments: { 'id': getEditProfileIndi!.data!.timelines![index].id, 'edit': true, @@ -750,7 +711,7 @@ class _ProfileTabState extends State { // }, // ), // ), - Container( + SizedBox( height: 30.h, // Adjust the height as needed child: @@ -768,7 +729,6 @@ class _ProfileTabState extends State { // String formattedNames = abilityName.join(', '); List abilityNames = abilityName.split(',').map((e) => e.trim()).toList(); String formattedNames = abilityNames.join(', '); - print(formattedNames); return Padding( padding: EdgeInsets.only(right: 8.w), child: text10400whiteblur(formattedNames), @@ -781,6 +741,7 @@ class _ProfileTabState extends State { ), // border: 1 ), + sizedBoxHeight(20.h), ], ), ), @@ -833,7 +794,7 @@ class _ProfileTabState extends State { children: [ commonGlassUI( width: 266.w, - height: 70.h, + height: 75.h, borderRadius: BorderRadius .circular(10.r), @@ -1012,6 +973,7 @@ class _ProfileTabState extends State { arguments: { 'id': getEditProfileIndi!.data!.id, + 'iscommunity' : false, }); }, child: text16400white('View more')) @@ -1137,7 +1099,6 @@ class _ProfileTabState extends State { if (snapshot.connectionState == ConnectionState.done && snapshot.hasData) { - print("Data fetched-->"); return Stack(clipBehavior: Clip.none, children: [ Container( decoration: const BoxDecoration( @@ -1153,7 +1114,7 @@ class _ProfileTabState extends State { children: [ Stack( children: [ - Container( + SizedBox( height: 484.h, width: double.infinity, child: getEditProfileBus!.data! @@ -1253,8 +1214,8 @@ class _ProfileTabState extends State { color: Colors.white, width: 1.0, ), - boxShadow: [ - const BoxShadow( + boxShadow: const [ + BoxShadow( color: Color(0x66000000), offset: Offset(0, 4), @@ -1350,8 +1311,11 @@ class _ProfileTabState extends State { sizedBoxHeight(30.h), text18w700white("About"), sizedBoxHeight(10.h), - text14400white(getEditProfileBus!.data!.bio ?? - "Lorem Ipsum has been the industry's standard dummy text ever since the 1500s."), + getEditProfileBus!.data!.bio == null || + getEditProfileBus!.data!.bio!.isEmpty + ? const SizedBox() + : text14400white( + getEditProfileBus!.data!.bio!), sizedBoxHeight(25.h), Row( children: [ @@ -1370,9 +1334,15 @@ class _ProfileTabState extends State { )), ), sizedBoxWidth(12.w), - text14400whiteblur(getEditProfileBus! - .data!.businessOwnerName ?? - "James Bothman"), + getEditProfileBus!.data! + .businessOwnerName == + null || + getEditProfileBus!.data! + .businessOwnerName!.isEmpty + ? const SizedBox() + : text14400whiteblur( + getEditProfileBus! + .data!.businessOwnerName!), ], ), sizedBoxHeight(20.h), @@ -1393,9 +1363,14 @@ class _ProfileTabState extends State { )), ), sizedBoxWidth(12.w), - text14400whiteblur(getEditProfileBus! - .data!.websiteLink ?? - "www.exampledummywebsite.com"), + getEditProfileBus!.data!.websiteLink == + null || + getEditProfileBus! + .data!.websiteLink!.isEmpty + ? const SizedBox() + : text14400whiteblur( + getEditProfileBus! + .data!.websiteLink!), ], ), sizedBoxHeight(20.h), @@ -1416,9 +1391,15 @@ class _ProfileTabState extends State { )), ), sizedBoxWidth(12.w), - text14400whiteblur(getEditProfileBus! - .data!.businessLocation ?? - "Elm street london, United Kingdom"), + getEditProfileBus! + .data!.businessLocation == + null || + getEditProfileBus!.data! + .businessLocation!.isEmpty + ? const SizedBox() + : text14400whiteblur( + getEditProfileBus! + .data!.businessLocation!), ], ), sizedBoxHeight(20.h), @@ -1442,9 +1423,14 @@ class _ProfileTabState extends State { // text14400whiteblur(getEditProfileIndi! // .data!.interest! // .join(', ')), - text14400whiteblur( - getEditProfileBus!.data!.foundedon ?? - "Founded at : 2010"), + getEditProfileBus!.data!.foundedon == + null || + getEditProfileBus! + .data!.foundedon!.isEmpty + ? const SizedBox() + : text14400whiteblur( + getEditProfileBus! + .data!.foundedon!), ], ), sizedBoxHeight(30.h), @@ -1527,7 +1513,7 @@ class _ProfileTabState extends State { }) { return Row( children: [ - Container( + SizedBox( width: 10, height: 170.h, child: Stack( @@ -1636,7 +1622,7 @@ class _ProfileTabState extends State { // }, // ), - Container( + SizedBox( height: 30.h, // Adjust the height as needed child: ListView.builder( shrinkWrap: true, @@ -1825,7 +1811,7 @@ class _ProfileTabState extends State { onTap: () { Get.toNamed(RouteName.postdetailsScreen); }, - child: Container( + child: SizedBox( height: 163.h, width: double.infinity, child: Image.asset( diff --git a/lib/Feed Module/Main_Screens/ProfileTab/EditProfile/View/picturecontroller/indiprofileimagecontroller.dart b/lib/Main_Screens/ProfileTab/EditProfile/View/picturecontroller/indiprofileimagecontroller.dart similarity index 100% rename from lib/Feed Module/Main_Screens/ProfileTab/EditProfile/View/picturecontroller/indiprofileimagecontroller.dart rename to lib/Main_Screens/ProfileTab/EditProfile/View/picturecontroller/indiprofileimagecontroller.dart diff --git a/lib/Feed Module/Main_Screens/ProfileTab/EditProfile/View/picturecontroller/profileimagecontoller.dart b/lib/Main_Screens/ProfileTab/EditProfile/View/picturecontroller/profileimagecontoller.dart similarity index 100% rename from lib/Feed Module/Main_Screens/ProfileTab/EditProfile/View/picturecontroller/profileimagecontoller.dart rename to lib/Main_Screens/ProfileTab/EditProfile/View/picturecontroller/profileimagecontoller.dart diff --git a/lib/Feed Module/Main_Screens/ProfileTab/EditProfile/ViewModel/EditProfileApi.dart b/lib/Main_Screens/ProfileTab/EditProfile/ViewModel/EditProfileApi.dart similarity index 89% rename from lib/Feed Module/Main_Screens/ProfileTab/EditProfile/ViewModel/EditProfileApi.dart rename to lib/Main_Screens/ProfileTab/EditProfile/ViewModel/EditProfileApi.dart index 85524f2..3e19f97 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/EditProfile/ViewModel/EditProfileApi.dart +++ b/lib/Main_Screens/ProfileTab/EditProfile/ViewModel/EditProfileApi.dart @@ -3,8 +3,8 @@ import 'package:regroup/Common/api_urls.dart'; import 'package:regroup/Common/base_manager.dart'; import 'package:regroup/Common/controller/data/network/network_api.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/EditProfile/Model/GetEditProfileBus.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/EditProfile/Model/GetEditProfileIndi.dart'; +import 'package:regroup/Main_Screens/ProfileTab/EditProfile/Model/GetEditProfileBus.dart'; +import 'package:regroup/Main_Screens/ProfileTab/EditProfile/Model/GetEditProfileIndi.dart'; import 'package:shared_preferences/shared_preferences.dart'; GetEditProfileIndi? getEditProfileIndi; @@ -17,7 +17,7 @@ class EditProfileApi { EditProfileApi(); Future> postEditProfileIndividual(var data) async { - SharedPreferences prefs = await SharedPreferences.getInstance(); + // SharedPreferences prefs = await SharedPreferences.getInstance(); final response = await NetworkApiServices().postApi(data, ApiUrls.posteditprofile); @@ -62,7 +62,7 @@ class EditProfileApi { } Future> postEditProfileBusiness(var data) async { - SharedPreferences prefs = await SharedPreferences.getInstance(); + // SharedPreferences prefs = await SharedPreferences.getInstance(); final response = await NetworkApiServices() .postApi(data, ApiUrls.posteditprofilebusiness); diff --git a/lib/Feed Module/Main_Screens/ProfileTab/EditProfile/ViewModel/InterestApiList.dart b/lib/Main_Screens/ProfileTab/EditProfile/ViewModel/InterestApiList.dart similarity index 90% rename from lib/Feed Module/Main_Screens/ProfileTab/EditProfile/ViewModel/InterestApiList.dart rename to lib/Main_Screens/ProfileTab/EditProfile/ViewModel/InterestApiList.dart index fc9968c..f8ab05e 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/EditProfile/ViewModel/InterestApiList.dart +++ b/lib/Main_Screens/ProfileTab/EditProfile/ViewModel/InterestApiList.dart @@ -1,8 +1,7 @@ - import 'package:regroup/Common/api_urls.dart'; import 'package:regroup/Common/base_manager.dart'; import 'package:regroup/Common/controller/data/network/network_api.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/EditProfile/Model/InterestModel.dart'; +import 'package:regroup/Main_Screens/ProfileTab/EditProfile/Model/InterestModel.dart'; InterestModel? interestlistobj; List listofInterests = []; @@ -30,6 +29,7 @@ class InterestListApi { } getIntersetFromResponse() { + listofInterests.clear(); for (var interests in interestlistobj!.data!) { listofInterests.add(interests.name ?? "null"); } diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Followers/Followers.dart b/lib/Main_Screens/ProfileTab/Followers/Followers.dart similarity index 98% rename from lib/Feed Module/Main_Screens/ProfileTab/Followers/Followers.dart rename to lib/Main_Screens/ProfileTab/Followers/Followers.dart index 8117225..adc2d9b 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/Followers/Followers.dart +++ b/lib/Main_Screens/ProfileTab/Followers/Followers.dart @@ -5,11 +5,12 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:regroup/Common/CommonWidget.dart'; import 'package:regroup/Common/base_manager.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Guest%20User/Model/GetGuestFollowers.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Guest%20User/ViewModel/GuestProfileApi.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Model/followersModel.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profileGetmethod.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profilePostmethod.dart'; +import 'package:regroup/Main_Screens/ProfileTab/Guest%20User/Model/GetGuestFollowers.dart'; +import 'package:regroup/Main_Screens/ProfileTab/Guest%20User/ViewModel/GuestProfileApi.dart'; +import 'package:regroup/Main_Screens/ProfileTab/Model/followersModel.dart'; +import 'package:regroup/Main_Screens/ProfileTab/view_model/profileGetmethod.dart'; + + import 'package:regroup/Utils/Common/CommonAppbar.dart'; import 'package:regroup/Utils/Common/CustomTextformfield.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; @@ -18,6 +19,8 @@ import 'package:regroup/Utils/texts.dart'; import 'package:regroup/resources/routes/route_name.dart'; import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart'; +import '../view_model/profilePostmethod.dart'; + class Followers extends StatefulWidget { const Followers({super.key}); @@ -37,7 +40,6 @@ class _FollowersState extends State { @override void initState() { - // TODO: implement initState var updata = ""; if (fromMainBusProfile == 'MainBusProfile') { Profilegetmethod() @@ -66,7 +68,7 @@ class _FollowersState extends State { int? blockid; int? removeid; - RemoveUploadata() async { + removeUploadata() async { utils.loader(); Map updata = { "iam_principal_xid": removeid, @@ -83,7 +85,7 @@ class _FollowersState extends State { } } - BlockUploadata() async { + blockUploadata() async { utils.loader(); Map updata = { "blocked_iam_principal_xid": blockid, @@ -332,7 +334,7 @@ class _FollowersState extends State { followersobj!.data!.removeWhere((item) => item.follower!.id == removeid); - RemoveUploadata(); + removeUploadata(); }); }, child: @@ -397,7 +399,7 @@ class _FollowersState extends State { followersobj!.data!.removeWhere((item) => item.follower!.id == blockid); - BlockUploadata(); + blockUploadata(); }); }, child: diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Following/Following.dart b/lib/Main_Screens/ProfileTab/Following/Following.dart similarity index 98% rename from lib/Feed Module/Main_Screens/ProfileTab/Following/Following.dart rename to lib/Main_Screens/ProfileTab/Following/Following.dart index 31bc182..742a8ce 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/Following/Following.dart +++ b/lib/Main_Screens/ProfileTab/Following/Following.dart @@ -5,12 +5,12 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:regroup/Common/CommonWidget.dart'; import 'package:regroup/Common/base_manager.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Guest%20User/Model/GetGuestFollowers.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Guest%20User/Model/GetGuestFollowing.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Guest%20User/ViewModel/GuestProfileApi.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Model/followingModel.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profileGetmethod.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profilePostmethod.dart'; +import 'package:regroup/Main_Screens/ProfileTab/Guest%20User/Model/GetGuestFollowing.dart'; +import 'package:regroup/Main_Screens/ProfileTab/Guest%20User/ViewModel/GuestProfileApi.dart'; +import 'package:regroup/Main_Screens/ProfileTab/Model/followingModel.dart'; +import 'package:regroup/Main_Screens/ProfileTab/view_model/profileGetmethod.dart'; +import 'package:regroup/Main_Screens/ProfileTab/view_model/profilePostmethod.dart'; + import 'package:regroup/Utils/Common/CommonAppbar.dart'; import 'package:regroup/Utils/Common/CustomTextformfield.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Guest User/Model/GetGuestFollowers.dart b/lib/Main_Screens/ProfileTab/Guest User/Model/GetGuestFollowers.dart similarity index 100% rename from lib/Feed Module/Main_Screens/ProfileTab/Guest User/Model/GetGuestFollowers.dart rename to lib/Main_Screens/ProfileTab/Guest User/Model/GetGuestFollowers.dart diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Guest User/Model/GetGuestFollowing.dart b/lib/Main_Screens/ProfileTab/Guest User/Model/GetGuestFollowing.dart similarity index 100% rename from lib/Feed Module/Main_Screens/ProfileTab/Guest User/Model/GetGuestFollowing.dart rename to lib/Main_Screens/ProfileTab/Guest User/Model/GetGuestFollowing.dart diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Guest User/Model/GuestGetProfileDataBus.dart b/lib/Main_Screens/ProfileTab/Guest User/Model/GuestGetProfileDataBus.dart similarity index 64% rename from lib/Feed Module/Main_Screens/ProfileTab/Guest User/Model/GuestGetProfileDataBus.dart rename to lib/Main_Screens/ProfileTab/Guest User/Model/GuestGetProfileDataBus.dart index 99e8b83..6ae3d2e 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/Guest User/Model/GuestGetProfileDataBus.dart +++ b/lib/Main_Screens/ProfileTab/Guest User/Model/GuestGetProfileDataBus.dart @@ -11,14 +11,14 @@ class GuestGetProfileDataBus { status = json['status']; statusCode = json['status_code']; message = json['message']; - data = json['data'] != null ? new Data.fromJson(json['data']) : null; + data = json['data'] != null ? Data.fromJson(json['data']) : null; } Map toJson() { - final Map data = new Map(); - data['status'] = this.status; - data['status_code'] = this.statusCode; - data['message'] = this.message; + final Map data = {}; + data['status'] = status; + data['status_code'] = statusCode; + data['message'] = message; if (this.data != null) { data['data'] = this.data!.toJson(); } @@ -91,44 +91,44 @@ class Data { businessProfileImage = json['business_profile_image']; bio = json['bio']; follows = - json['follows'] != null ? new Follows.fromJson(json['follows']) : null; + json['follows'] != null ? Follows.fromJson(json['follows']) : null; isIamFollowingToGuestUser = json['is_iam_following_to_guest_user']; businessType = json['business_type'] != null - ? new BusinessType.fromJson(json['business_type']) + ? BusinessType.fromJson(json['business_type']) : null; iamPrincipalData = json['iam_principal_data'] != null - ? new IamPrincipalData.fromJson(json['iam_principal_data']) + ? IamPrincipalData.fromJson(json['iam_principal_data']) : null; } Map toJson() { - final Map data = new Map(); - data['id'] = this.id; - data['iam_principal_xid'] = this.iamPrincipalXid; - data['business_type_xid'] = this.businessTypeXid; - data['business_owner_name'] = this.businessOwnerName; - data['business_name'] = this.businessName; - data['business_username'] = this.businessUsername; - data['business_location'] = this.businessLocation; - data['business_contact_number'] = this.businessContactNumber; - data['business_email'] = this.businessEmail; - data['business_handle'] = this.businessHandle; - data['website_link'] = this.websiteLink; - data['google_review_link'] = this.googleReviewLink; - data['business_logo'] = this.businessLogo; - data['tags'] = this.tags; - data['banner_image'] = this.bannerImage; - data['business_profile_image'] = this.businessProfileImage; - data['bio'] = this.bio; - if (this.follows != null) { - data['follows'] = this.follows!.toJson(); + final Map data = {}; + data['id'] = id; + data['iam_principal_xid'] = iamPrincipalXid; + data['business_type_xid'] = businessTypeXid; + data['business_owner_name'] = businessOwnerName; + data['business_name'] = businessName; + data['business_username'] = businessUsername; + data['business_location'] = businessLocation; + data['business_contact_number'] = businessContactNumber; + data['business_email'] = businessEmail; + data['business_handle'] = businessHandle; + data['website_link'] = websiteLink; + data['google_review_link'] = googleReviewLink; + data['business_logo'] = businessLogo; + data['tags'] = tags; + data['banner_image'] = bannerImage; + data['business_profile_image'] = businessProfileImage; + data['bio'] = bio; + if (follows != null) { + data['follows'] = follows!.toJson(); } - data['is_iam_following_to_guest_user'] = this.isIamFollowingToGuestUser; - if (this.businessType != null) { - data['business_type'] = this.businessType!.toJson(); + data['is_iam_following_to_guest_user'] = isIamFollowingToGuestUser; + if (businessType != null) { + data['business_type'] = businessType!.toJson(); } - if (this.iamPrincipalData != null) { - data['iam_principal_data'] = this.iamPrincipalData!.toJson(); + if (iamPrincipalData != null) { + data['iam_principal_data'] = iamPrincipalData!.toJson(); } return data; } @@ -146,9 +146,9 @@ class Follows { } Map toJson() { - final Map data = new Map(); - data['following'] = this.following; - data['followers'] = this.followers; + final Map data = {}; + data['following'] = following; + data['followers'] = followers; return data; } } @@ -191,17 +191,17 @@ class BusinessType { } Map toJson() { - final Map data = new Map(); - data['id'] = this.id; - data['name'] = this.name; - data['image'] = this.image; - data['description'] = this.description; - data['is_active'] = this.isActive; - data['created_by'] = this.createdBy; - data['modified_by'] = this.modifiedBy; - data['deleted_at'] = this.deletedAt; - data['created_at'] = this.createdAt; - data['updated_at'] = this.updatedAt; + final Map data = {}; + data['id'] = id; + data['name'] = name; + data['image'] = image; + data['description'] = description; + data['is_active'] = isActive; + data['created_by'] = createdBy; + data['modified_by'] = modifiedBy; + data['deleted_at'] = deletedAt; + data['created_at'] = createdAt; + data['updated_at'] = updatedAt; return data; } } @@ -358,55 +358,55 @@ class IamPrincipalData { } Map toJson() { - final Map data = new Map(); - data['id'] = this.id; - data['principal_type_xid'] = this.principalTypeXid; - data['principal_source_xid'] = this.principalSourceXid; - data['one_signal_player_id'] = this.oneSignalPlayerId; - data['google_id'] = this.googleId; - data['apple_id'] = this.appleId; - data['facebook_id'] = this.facebookId; - data['microsoft_id'] = this.microsoftId; - data['user_name'] = this.userName; - data['pin'] = this.pin; - data['full_name'] = this.fullName; - data['gender'] = this.gender; - data['date_of_birth'] = this.dateOfBirth; - data['phone_number'] = this.phoneNumber; - data['other_phone_number'] = this.otherPhoneNumber; - data['email_address'] = this.emailAddress; - data['address_line1'] = this.addressLine1; - data['address_line2'] = this.addressLine2; - data['city_xid'] = this.cityXid; - data['state_xid'] = this.stateXid; - data['country_xid'] = this.countryXid; - data['post_code'] = this.postCode; - data['last_login_datetime'] = this.lastLoginDatetime; - data['profile_photo'] = this.profilePhoto; - data['referral_code'] = this.referralCode; - data['description'] = this.description; - data['about'] = this.about; - data['position'] = this.position; - data['training_scores'] = this.trainingScores; - data['height'] = this.height; - data['weight'] = this.weight; - data['batting_average'] = this.battingAverage; - data['is_profile_updated'] = this.isProfileUpdated; - data['is_active'] = this.isActive; - data['group_notification'] = this.groupNotification; - data['community_notification'] = this.communityNotification; - data['follower_notification'] = this.followerNotification; - data['new_follower_notification'] = this.newFollowerNotification; - data['direct_message_notification'] = this.directMessageNotification; - data['is_account_visibility'] = this.isAccountVisibility; - data['is_deleted'] = this.isDeleted; - data['reason'] = this.reason; - data['created_by'] = this.createdBy; - data['modified_by'] = this.modifiedBy; - data['deleted_at'] = this.deletedAt; - data['created_at'] = this.createdAt; - data['updated_at'] = this.updatedAt; - data['profile_image'] = this.profileImage; + final Map data = {}; + data['id'] = id; + data['principal_type_xid'] = principalTypeXid; + data['principal_source_xid'] = principalSourceXid; + data['one_signal_player_id'] = oneSignalPlayerId; + data['google_id'] = googleId; + data['apple_id'] = appleId; + data['facebook_id'] = facebookId; + data['microsoft_id'] = microsoftId; + data['user_name'] = userName; + data['pin'] = pin; + data['full_name'] = fullName; + data['gender'] = gender; + data['date_of_birth'] = dateOfBirth; + data['phone_number'] = phoneNumber; + data['other_phone_number'] = otherPhoneNumber; + data['email_address'] = emailAddress; + data['address_line1'] = addressLine1; + data['address_line2'] = addressLine2; + data['city_xid'] = cityXid; + data['state_xid'] = stateXid; + data['country_xid'] = countryXid; + data['post_code'] = postCode; + data['last_login_datetime'] = lastLoginDatetime; + data['profile_photo'] = profilePhoto; + data['referral_code'] = referralCode; + data['description'] = description; + data['about'] = about; + data['position'] = position; + data['training_scores'] = trainingScores; + data['height'] = height; + data['weight'] = weight; + data['batting_average'] = battingAverage; + data['is_profile_updated'] = isProfileUpdated; + data['is_active'] = isActive; + data['group_notification'] = groupNotification; + data['community_notification'] = communityNotification; + data['follower_notification'] = followerNotification; + data['new_follower_notification'] = newFollowerNotification; + data['direct_message_notification'] = directMessageNotification; + data['is_account_visibility'] = isAccountVisibility; + data['is_deleted'] = isDeleted; + data['reason'] = reason; + data['created_by'] = createdBy; + data['modified_by'] = modifiedBy; + data['deleted_at'] = deletedAt; + data['created_at'] = createdAt; + data['updated_at'] = updatedAt; + data['profile_image'] = profileImage; return data; } } diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Guest User/Model/GuestGetProfileDataIndi.dart b/lib/Main_Screens/ProfileTab/Guest User/Model/GuestGetProfileDataIndi.dart similarity index 64% rename from lib/Feed Module/Main_Screens/ProfileTab/Guest User/Model/GuestGetProfileDataIndi.dart rename to lib/Main_Screens/ProfileTab/Guest User/Model/GuestGetProfileDataIndi.dart index 9e8fe7d..b0365c8 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/Guest User/Model/GuestGetProfileDataIndi.dart +++ b/lib/Main_Screens/ProfileTab/Guest User/Model/GuestGetProfileDataIndi.dart @@ -11,14 +11,14 @@ class GuestGetProfileDataIndi { status = json['status']; statusCode = json['status_code']; message = json['message']; - data = json['data'] != null ? new Data.fromJson(json['data']) : null; + data = json['data'] != null ? Data.fromJson(json['data']) : null; } Map toJson() { - final Map data = new Map(); - data['status'] = this.status; - data['status_code'] = this.statusCode; - data['message'] = this.message; + final Map data = {}; + data['status'] = status; + data['status_code'] = statusCode; + data['message'] = message; if (this.data != null) { data['data'] = this.data!.toJson(); } @@ -28,7 +28,9 @@ class GuestGetProfileDataIndi { class Data { int? id; + int? principalTypeXid; String? userName; + String? location; String? fullName; String? gender; String? profilePhoto; @@ -51,7 +53,9 @@ class Data { Data( {this.id, + this.principalTypeXid, this.userName, + this.location, this.fullName, this.gender, this.profilePhoto, @@ -75,7 +79,9 @@ class Data { Data.fromJson(Map json) { id = json['id']; + principalTypeXid = json['principal_type_xid']; userName = json['user_name']; + location = json['location']; fullName = json['full_name']; gender = json['gender']; profilePhoto = json['profile_photo']; @@ -83,7 +89,7 @@ class Data { if (json['interest'] != null) { interest = []; json['interest'].forEach((v) { - interest!.add(new Interest.fromJson(v)); + interest!.add(Interest.fromJson(v)); }); } about = json['about']; @@ -93,18 +99,18 @@ class Data { weight = json['weight']; battingAverage = json['batting_average']; follows = - json['follows'] != null ? new Follows.fromJson(json['follows']) : null; + json['follows'] != null ? Follows.fromJson(json['follows']) : null; if (json['timelines'] != null) { timelines = []; json['timelines'].forEach((v) { - timelines!.add(new Timelines.fromJson(v)); + timelines!.add(Timelines.fromJson(v)); }); } accountVisibility = json['account_visibility']; if (json['my_joined_groups'] != null) { myJoinedGroups = []; json['my_joined_groups'].forEach((v) { - myJoinedGroups!.add(new MyJoinedGroups.fromJson(v)); + myJoinedGroups!.add(MyJoinedGroups.fromJson(v)); }); } // if (json['my_joined_subgroups'] != null) { @@ -116,7 +122,7 @@ class Data { if (json['certifications'] != null) { certifications = []; json['certifications'].forEach((v) { - certifications!.add(new Certifications.fromJson(v)); + certifications!.add(Certifications.fromJson(v)); }); } daysBeforeJoined = json['days_before_joined']; @@ -124,43 +130,45 @@ class Data { } Map toJson() { - final Map data = new Map(); - data['id'] = this.id; - data['user_name'] = this.userName; - data['full_name'] = this.fullName; - data['gender'] = this.gender; - data['profile_photo'] = this.profilePhoto; - data['date_of_birth'] = this.dateOfBirth; - if (this.interest != null) { - data['interest'] = this.interest!.map((v) => v.toJson()).toList(); + final Map data = {}; + data['id'] = id; + data['principal_type_xid'] = this.principalTypeXid; + data['user_name'] = userName; + data['location'] = this.location; + data['full_name'] = fullName; + data['gender'] = gender; + data['profile_photo'] = profilePhoto; + data['date_of_birth'] = dateOfBirth; + if (interest != null) { + data['interest'] = interest!.map((v) => v.toJson()).toList(); } - data['about'] = this.about; - data['position'] = this.position; - data['training_scores'] = this.trainingScores; - data['height'] = this.height; - data['weight'] = this.weight; - data['batting_average'] = this.battingAverage; - if (this.follows != null) { - data['follows'] = this.follows!.toJson(); + data['about'] = about; + data['position'] = position; + data['training_scores'] = trainingScores; + data['height'] = height; + data['weight'] = weight; + data['batting_average'] = battingAverage; + if (follows != null) { + data['follows'] = follows!.toJson(); } - if (this.timelines != null) { - data['timelines'] = this.timelines!.map((v) => v.toJson()).toList(); + if (timelines != null) { + data['timelines'] = timelines!.map((v) => v.toJson()).toList(); } - data['account_visibility'] = this.accountVisibility; - if (this.myJoinedGroups != null) { + data['account_visibility'] = accountVisibility; + if (myJoinedGroups != null) { data['my_joined_groups'] = - this.myJoinedGroups!.map((v) => v.toJson()).toList(); + myJoinedGroups!.map((v) => v.toJson()).toList(); } // if (this.myJoinedSubgroups != null) { // data['my_joined_subgroups'] = // this.myJoinedSubgroups!.map((v) => v.toJson()).toList(); // } - if (this.certifications != null) { + if (certifications != null) { data['certifications'] = - this.certifications!.map((v) => v.toJson()).toList(); + certifications!.map((v) => v.toJson()).toList(); } - data['days_before_joined'] = this.daysBeforeJoined; - data['is_iam_following_to_guest_user'] = this.isIamFollowingToGuestUser; + data['days_before_joined'] = daysBeforeJoined; + data['is_iam_following_to_guest_user'] = isIamFollowingToGuestUser; return data; } } @@ -176,9 +184,9 @@ class Interest { } Map toJson() { - final Map data = new Map(); - data['id'] = this.id; - data['name'] = this.name; + final Map data = {}; + data['id'] = id; + data['name'] = name; return data; } } @@ -195,9 +203,9 @@ class Follows { } Map toJson() { - final Map data = new Map(); - data['following'] = this.following; - data['followers'] = this.followers; + final Map data = {}; + data['following'] = following; + data['followers'] = followers; return data; } } @@ -233,22 +241,22 @@ class Timelines { if (json['abilities'] != null) { abilities = []; json['abilities'].forEach((v) { - abilities!.add(new Abilities.fromJson(v)); + abilities!.add(Abilities.fromJson(v)); }); } } Map toJson() { - final Map data = new Map(); - data['id'] = this.id; - data['club_name'] = this.clubName; - data['role_name'] = this.roleName; - data['team_name'] = this.teamName; - data['start_date'] = this.startDate; - data['end_date'] = this.endDate; - data['abilities_xids'] = this.abilitiesXids; - if (this.abilities != null) { - data['abilities'] = this.abilities!.map((v) => v.toJson()).toList(); + final Map data = {}; + data['id'] = id; + data['club_name'] = clubName; + data['role_name'] = roleName; + data['team_name'] = teamName; + data['start_date'] = startDate; + data['end_date'] = endDate; + data['abilities_xids'] = abilitiesXids; + if (abilities != null) { + data['abilities'] = abilities!.map((v) => v.toJson()).toList(); } return data; } @@ -266,9 +274,9 @@ class Abilities { } Map toJson() { - final Map data = new Map(); - data['id'] = this.id; - data['name'] = this.name; + final Map data = {}; + data['id'] = id; + data['name'] = name; return data; } } @@ -287,17 +295,17 @@ class MyJoinedGroups { iamPrincipalXid = json['iam_principal_xid']; manageGroupXid = json['manage_group_xid']; groupData = json['group_data'] != null - ? new GroupData.fromJson(json['group_data']) + ? GroupData.fromJson(json['group_data']) : null; } Map toJson() { - final Map data = new Map(); - data['id'] = this.id; - data['iam_principal_xid'] = this.iamPrincipalXid; - data['manage_group_xid'] = this.manageGroupXid; - if (this.groupData != null) { - data['group_data'] = this.groupData!.toJson(); + final Map data = {}; + data['id'] = id; + data['iam_principal_xid'] = iamPrincipalXid; + data['manage_group_xid'] = manageGroupXid; + if (groupData != null) { + data['group_data'] = groupData!.toJson(); } return data; } @@ -317,10 +325,10 @@ class GroupData { } Map toJson() { - final Map data = new Map(); - data['id'] = this.id; - data['title'] = this.title; - data['group_image'] = this.groupImage; + final Map data = {}; + data['id'] = id; + data['title'] = title; + data['group_image'] = groupImage; return data; } } @@ -345,18 +353,18 @@ class MyJoinedSubgroups { manageGroupXid = json['manage_group_xid']; manageSubGroupXid = json['manage_sub_group_xid']; subGroupData = json['sub_group_data'] != null - ? new SubGroupData.fromJson(json['sub_group_data']) + ? SubGroupData.fromJson(json['sub_group_data']) : null; } Map toJson() { - final Map data = new Map(); - data['id'] = this.id; - data['iam_principal_xid'] = this.iamPrincipalXid; - data['manage_group_xid'] = this.manageGroupXid; - data['manage_sub_group_xid'] = this.manageSubGroupXid; - if (this.subGroupData != null) { - data['sub_group_data'] = this.subGroupData!.toJson(); + final Map data = {}; + data['id'] = id; + data['iam_principal_xid'] = iamPrincipalXid; + data['manage_group_xid'] = manageGroupXid; + data['manage_sub_group_xid'] = manageSubGroupXid; + if (subGroupData != null) { + data['sub_group_data'] = subGroupData!.toJson(); } return data; } @@ -376,10 +384,10 @@ class SubGroupData { } Map toJson() { - final Map data = new Map(); - data['id'] = this.id; - data['title'] = this.title; - data['sub_group_image'] = this.subGroupImage; + final Map data = {}; + data['id'] = id; + data['title'] = title; + data['sub_group_image'] = subGroupImage; return data; } } @@ -410,13 +418,13 @@ class Certifications { } Map toJson() { - final Map data = new Map(); - data['id'] = this.id; - data['certification_name'] = this.certificationName; - data['certification_image'] = this.certificationImage; - data['certification_reason'] = this.certificationReason; - data['certification_date'] = this.certificationDate; - data['iam_principal_xid'] = this.iamPrincipalXid; + final Map data = {}; + data['id'] = id; + data['certification_name'] = certificationName; + data['certification_image'] = certificationImage; + data['certification_reason'] = certificationReason; + data['certification_date'] = certificationDate; + data['iam_principal_xid'] = iamPrincipalXid; return data; } } diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Guest User/View/Business/ProfileTabBusGuest.dart b/lib/Main_Screens/ProfileTab/Guest User/View/Business/ProfileTabBusGuest.dart similarity index 92% rename from lib/Feed Module/Main_Screens/ProfileTab/Guest User/View/Business/ProfileTabBusGuest.dart rename to lib/Main_Screens/ProfileTab/Guest User/View/Business/ProfileTabBusGuest.dart index ece5e3a..4d9d3d8 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/Guest User/View/Business/ProfileTabBusGuest.dart +++ b/lib/Main_Screens/ProfileTab/Guest User/View/Business/ProfileTabBusGuest.dart @@ -5,9 +5,10 @@ import 'package:get/get.dart'; import 'package:regroup/Common/CommonGlassmorphism.dart'; import 'package:regroup/Common/CommonWidget.dart'; import 'package:regroup/Common/base_manager.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/EditProfile/ViewModel/EditProfileApi.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Guest%20User/ViewModel/GuestProfileApi.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profilePostmethod.dart'; +import 'package:regroup/Main_Screens/ProfileTab/Guest%20User/ViewModel/GuestProfileApi.dart'; +import 'package:regroup/Main_Screens/ProfileTab/view_model/profilePostmethod.dart'; + + import 'package:regroup/Utils/Common/ShimmerCommon.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/dialogs.dart'; @@ -56,7 +57,6 @@ class _profiletabBusGestState extends State { // return utils.showToast(data.message); } else { Get.back(); - print("unfollow not done"); return utils.showToast(data.message); } } @@ -71,11 +71,9 @@ class _profiletabBusGestState extends State { Get.back(); // Get.back(); Get.toNamed(RouteName.mainscreen, arguments: 4); - print("block done"); return utils.showToast(data.message); } else { Get.back(); - print("block not done"); return utils.showToast(data.message); } } @@ -84,17 +82,17 @@ class _profiletabBusGestState extends State { Widget build(BuildContext context) { return Scaffold( // key: _scaffoldKey1, - backgroundColor: Color(0xFF222935), + backgroundColor: const Color(0xFF222935), extendBody: true, // accountTypeValue == '1' || body: FutureBuilder( future: guestBusfuture, builder: (ctx, snapshot) { if (snapshot.connectionState == ConnectionState.waiting) { - return - // ShimmerCommon(); + return + // ShimmerCommon(); - Center( + const Center( child: CircularProgressIndicator( color: Colors.blue, ), @@ -112,7 +110,6 @@ class _profiletabBusGestState extends State { if (snapshot.connectionState == ConnectionState.done && snapshot.hasData) { - print("Data fetched-->"); return Stack(clipBehavior: Clip.none, children: [ Container( decoration: const BoxDecoration( @@ -143,10 +140,10 @@ class _profiletabBusGestState extends State { ).image, fit: BoxFit.cover, ), - shape: LinearBorder(), + shape: const LinearBorder(), ), ) - : Container( + : SizedBox( height: 484.h, width: double.infinity, child: Image.asset( @@ -156,7 +153,7 @@ class _profiletabBusGestState extends State { ), Positioned.fill( child: Container( - decoration: BoxDecoration( + decoration: const BoxDecoration( gradient: LinearGradient( begin: Alignment.topCenter, end: Alignment.bottomCenter, @@ -232,7 +229,7 @@ class _profiletabBusGestState extends State { width: 1.0, ), boxShadow: [ - BoxShadow( + const BoxShadow( color: Color(0x66000000), offset: Offset(0, 4), blurRadius: 4.0, @@ -297,7 +294,6 @@ class _profiletabBusGestState extends State { followunfollowid = guestGetProfileBus!.data!.id; FollowUnfollowUploadata(); - print(followunfollowid); }, child: guestGetProfileBus!.data! .isIamFollowingToGuestUser == @@ -306,7 +302,7 @@ class _profiletabBusGestState extends State { height: 40.h, width: 170.w, decoration: BoxDecoration( - color: Color(0xFFD90B2E), + color: const Color(0xFFD90B2E), borderRadius: BorderRadius.circular(30.r), ), @@ -318,7 +314,7 @@ class _profiletabBusGestState extends State { height: 40.h, width: 170.w, decoration: BoxDecoration( - color: Color(0xFFD90B2E), + color: const Color(0xFFD90B2E), borderRadius: BorderRadius.circular(30.r), ), @@ -351,8 +347,11 @@ class _profiletabBusGestState extends State { sizedBoxHeight(30.h), text18w700white("About"), sizedBoxHeight(10.h), - text14400white( - "Lorem Ipsum has been the industry's standard dummy text ever since the 1500s."), + guestGetProfileBus!.data!.bio == null || + guestGetProfileBus!.data!.bio!.isEmpty + ? const SizedBox() + : text14400white( + guestGetProfileBus!.data!.bio!), sizedBoxHeight(25.h), Row( children: [ @@ -371,9 +370,14 @@ class _profiletabBusGestState extends State { )), ), sizedBoxWidth(12.w), - text14400whiteblur(guestGetProfileBus! - .data!.businessOwnerName ?? - "James Bothman"), + guestGetProfileBus! + .data!.businessOwnerName == + null || + guestGetProfileBus!.data! + .businessOwnerName!.isEmpty + ? const SizedBox() + : text14400whiteblur(guestGetProfileBus! + .data!.businessOwnerName!), ], ), sizedBoxHeight(20.h), @@ -394,9 +398,13 @@ class _profiletabBusGestState extends State { )), ), sizedBoxWidth(12.w), - text14400whiteblur( - guestGetProfileBus!.data!.websiteLink ?? - "www.exampledummywebsite.com"), + guestGetProfileBus!.data!.websiteLink == + null || + guestGetProfileBus! + .data!.websiteLink!.isEmpty + ? const SizedBox() + : text14400whiteblur(guestGetProfileBus! + .data!.websiteLink!), ], ), sizedBoxHeight(20.h), @@ -417,9 +425,14 @@ class _profiletabBusGestState extends State { )), ), sizedBoxWidth(12.w), - text14400whiteblur(guestGetProfileBus! - .data!.businessLocation ?? - "Elm street london, United Kingdom"), + guestGetProfileBus! + .data!.businessLocation == + null || + guestGetProfileBus! + .data!.businessLocation!.isEmpty + ? const SizedBox() + : text14400whiteblur(guestGetProfileBus! + .data!.businessLocation!), ], ), sizedBoxHeight(20.h), @@ -448,8 +461,9 @@ class _profiletabBusGestState extends State { null ? text14400whiteblur( ' Founded at : ${guestGetProfileBus!.data!.businessType!.createdAt}') - : text14400whiteblur( - "Founded at : 2010") + : const SizedBox(), + // text14400whiteblur( + // "Founded at : 2010") ], ), sizedBoxHeight(30.h), @@ -505,7 +519,7 @@ class _profiletabBusGestState extends State { ), )), ), - Spacer(), + const Spacer(), commonContainer( width: 40.w, height: 40.h, @@ -680,7 +694,7 @@ Widget normalcardtile({ sizedBoxWidth(7.w), Icon( Icons.circle, - color: Color(0xFFFCFCFC), + color: const Color(0xFFFCFCFC), size: 4.sp, ), sizedBoxWidth(6.w), @@ -689,12 +703,12 @@ Widget normalcardtile({ ) ], ), - Spacer(), + const Spacer(), PopupMenuButton( - surfaceTintColor: Color(0xFF222935), + surfaceTintColor: const Color(0xFF222935), constraints: BoxConstraints.tightFor(width: 176.w), - offset: Offset(0, 50), - color: Color(0xFF222935), + offset: const Offset(0, 50), + color: const Color(0xFF222935), tooltip: "", itemBuilder: (BuildContext context) => [ PopupMenuItem( @@ -712,7 +726,7 @@ Widget normalcardtile({ fontFamily: "Nunito Sans", ), ), - Spacer(), + const Spacer(), Image.asset( "assets/images/png/Vector (5).png", height: 15.h, @@ -722,7 +736,7 @@ Widget normalcardtile({ ), ), ), - PopupMenuDivider(), + const PopupMenuDivider(), PopupMenuItem( onTap: () {}, child: Padding( @@ -738,7 +752,7 @@ Widget normalcardtile({ fontFamily: "Nunito Sans", ), ), - Spacer(), + const Spacer(), Image.asset( "assets/images/png/share.png", height: 20.h, @@ -748,7 +762,7 @@ Widget normalcardtile({ ), ), ), - PopupMenuDivider(), + const PopupMenuDivider(), PopupMenuItem( onTap: () {}, child: Padding( @@ -764,7 +778,7 @@ Widget normalcardtile({ fontFamily: "Nunito Sans", ), ), - Spacer(), + const Spacer(), Image.asset( "assets/images/png/f7_pin-fill (2).png", height: 25.h, @@ -790,7 +804,7 @@ Widget normalcardtile({ onTap: () { Get.toNamed(RouteName.postdetailsScreen); }, - child: Container( + child: SizedBox( height: 163.h, width: double.infinity, child: Image.asset( @@ -829,7 +843,7 @@ Widget normalcardtile({ 'assets/images/png/heart 2.png', 'assets/images/png/party-popper 2.png' ]), - Spacer(), + const Spacer(), commonContainer( width: 30.w, height: 30.h, @@ -912,11 +926,11 @@ Widget normalcardtile({ boxRadius: 30, itemsSpacing: 8, itemScale: 0.4, - itemSize: Size(45, 45), - boxPadding: EdgeInsets.all(8), - boxAnimationDuration: Duration(milliseconds: 200), - itemAnimationDuration: Duration(milliseconds: 500), - hoverDuration: Duration(milliseconds: 700), + itemSize: const Size(45, 45), + boxPadding: const EdgeInsets.all(8), + boxAnimationDuration: const Duration(milliseconds: 200), + itemAnimationDuration: const Duration(milliseconds: 500), + hoverDuration: const Duration(milliseconds: 700), // toggle: false, child: _buildReactionsIcon(mainImage.value), @@ -989,7 +1003,7 @@ Widget containertile({required String text}) { width: 100.w, height: 30.h, borderRadius: BorderRadius.circular(30.r), - borderColor: Color(0xFFD90B2E), + borderColor: const Color(0xFFD90B2E), borderwidth: 0.9, customWidget: Padding( padding: EdgeInsets.symmetric(horizontal: 10.w), diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Guest User/View/Individual/ProfileTabIndGuest.dart b/lib/Main_Screens/ProfileTab/Guest User/View/Individual/ProfileTabIndGuest.dart similarity index 97% rename from lib/Feed Module/Main_Screens/ProfileTab/Guest User/View/Individual/ProfileTabIndGuest.dart rename to lib/Main_Screens/ProfileTab/Guest User/View/Individual/ProfileTabIndGuest.dart index c10ca6a..ed6cd02 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/Guest User/View/Individual/ProfileTabIndGuest.dart +++ b/lib/Main_Screens/ProfileTab/Guest User/View/Individual/ProfileTabIndGuest.dart @@ -1,3 +1,4 @@ +import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_reaction_button/flutter_reaction_button.dart'; @@ -6,9 +7,8 @@ import 'package:get/get.dart'; import 'package:regroup/Common/CommonGlassmorphism.dart'; import 'package:regroup/Common/CommonWidget.dart'; import 'package:regroup/Common/base_manager.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/EditProfile/ViewModel/EditProfileApi.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Guest%20User/ViewModel/GuestProfileApi.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profilePostmethod.dart'; +import 'package:regroup/Main_Screens/ProfileTab/Guest%20User/ViewModel/GuestProfileApi.dart'; +import 'package:regroup/Main_Screens/ProfileTab/view_model/profilePostmethod.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/dialogs.dart'; import 'package:regroup/Utils/texts.dart'; @@ -84,6 +84,7 @@ class _ProfileTabIndGuestState extends State { late Future guestIndfuture; var updata; + String? interestText; @override void initState() { @@ -104,7 +105,6 @@ class _ProfileTabIndGuestState extends State { int? followunfollowid; int? blockid; - FollowUnfollowUploadata() async { utils.loader(); Map newupdata = { @@ -128,8 +128,7 @@ class _ProfileTabIndGuestState extends State { } } - - BlockUploadata() async { + BlockUploadata() async { utils.loader(); Map updata = { "blocked_iam_principal_xid": blockid, @@ -178,13 +177,18 @@ class _ProfileTabIndGuestState extends State { if (snapshot.connectionState == ConnectionState.done && snapshot.hasData) { print("Data fetched-->"); - return - // guestGetProfileInd!.data!.isBlank! - // ? - // _buildNoDataBody(context) - // : + if (guestGetProfileInd!.data!.interest != null) { + interestText = guestGetProfileInd!.data!.interest! + .map((e) => e.name) + .join(', '); + } + return + // guestGetProfileInd!.data!.isBlank! + // ? + // _buildNoDataBody(context) + // : - Stack(clipBehavior: Clip.none, children: [ + Stack(clipBehavior: Clip.none, children: [ Container( decoration: const BoxDecoration( image: DecorationImage( @@ -212,7 +216,7 @@ class _ProfileTabIndGuestState extends State { ).image, fit: BoxFit.cover, ), - shape: LinearBorder(), + shape: const LinearBorder(), ), ) : Container( @@ -445,7 +449,7 @@ class _ProfileTabIndGuestState extends State { sizedBoxHeight(10.h), guestGetProfileInd!.data!.about == null || guestGetProfileInd!.data!.about!.isEmpty - ? text14400white("No about added") + ? const SizedBox() : text14400white( guestGetProfileInd!.data!.about!), sizedBoxHeight(25.h), @@ -466,8 +470,13 @@ class _ProfileTabIndGuestState extends State { )), ), sizedBoxWidth(12.w), - text14400whiteblur( - "Elm street london, United Kingdom"), + guestGetProfileInd!.data!.location == + null || + guestGetProfileInd! + .data!.location!.isEmpty + ? const SizedBox() + : text14400whiteblur(guestGetProfileInd! + .data!.location!), ], ), sizedBoxHeight(20.h), @@ -488,8 +497,10 @@ class _ProfileTabIndGuestState extends State { )), ), sizedBoxWidth(12.w), - text14400whiteblur( - 'Rowing, Football, Swimming'), + Flexible( + child: text14400whiteblur( + interestText ?? ''), + ), // interestText // text14400whiteblur(guestGetProfileInd! // .data!.interest! @@ -640,7 +651,7 @@ class _ProfileTabIndGuestState extends State { child: Container( height: 11.h, width: 11.w, - decoration: BoxDecoration( + decoration: const BoxDecoration( color: Colors .white, shape: BoxShape @@ -652,7 +663,7 @@ class _ProfileTabIndGuestState extends State { width: 1.w, height: 170.h, decoration: - BoxDecoration( + const BoxDecoration( color: Colors .white), ), @@ -695,7 +706,7 @@ class _ProfileTabIndGuestState extends State { children: [ guestGetProfileInd?.data?.profilePhoto == null || guestGetProfileInd!.data!.profilePhoto!.isEmpty - ? CircleAvatar(radius: 10.r, backgroundImage: AssetImage('assets/images/png/cimg1.png')) + ? CircleAvatar(radius: 10.r, backgroundImage: const AssetImage('assets/images/png/cimg1.png')) : CircleAvatar(radius: 10.r, backgroundImage: NetworkImage(guestGetProfileInd!.data!.profilePhoto!)), sizedBoxWidth( 8.w), @@ -876,7 +887,7 @@ class _ProfileTabIndGuestState extends State { scrollDirection: Axis.horizontal, // padding: // EdgeInsets.only(left: 16.w), - physics: ScrollPhysics(), + physics: const ScrollPhysics(), itemCount: guestGetProfileInd! .data!.certifications!.length, itemBuilder: (context, index) { @@ -986,7 +997,7 @@ class _ProfileTabIndGuestState extends State { fontSize: 9.sp, fontWeight: FontWeight.w400, - color: Color(0xffFFFFFF).withOpacity(0.70), + color: const Color(0xffFFFFFF).withOpacity(0.70), fontFamily: 'Helvetica'), ) : Text( @@ -995,7 +1006,7 @@ class _ProfileTabIndGuestState extends State { fontSize: 9.sp, fontWeight: FontWeight.w400, - color: Color(0xffFFFFFF).withOpacity(0.70), + color: const Color(0xffFFFFFF).withOpacity(0.70), fontFamily: 'Helvetica'), ) ], @@ -1190,16 +1201,13 @@ class _ProfileTabIndGuestState extends State { ), const PopupMenuDivider(), PopupMenuItem( - onTap: ()async { + onTap: () async { setState(() { - blockid = guestGetProfileInd!.data!.id ?? 0; + blockid = + guestGetProfileInd!.data!.id ?? 0; - BlockUploadata(); - + BlockUploadata(); }); - - - }, child: Padding( padding: EdgeInsets.symmetric( @@ -1245,8 +1253,8 @@ class _ProfileTabIndGuestState extends State { return Container(); })); } - - Widget _buildNoDataBody(context) { + + Widget _buildNoDataBody(context) { return Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, @@ -1692,7 +1700,7 @@ class _ProfileTabIndGuestState extends State { ).image, fit: BoxFit.cover, ), - shape: LinearBorder(), + shape: const LinearBorder(), ), ) : Container( diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Guest User/ViewModel/GuestProfileApi.dart b/lib/Main_Screens/ProfileTab/Guest User/ViewModel/GuestProfileApi.dart similarity index 85% rename from lib/Feed Module/Main_Screens/ProfileTab/Guest User/ViewModel/GuestProfileApi.dart rename to lib/Main_Screens/ProfileTab/Guest User/ViewModel/GuestProfileApi.dart index 824147b..4efe360 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/Guest User/ViewModel/GuestProfileApi.dart +++ b/lib/Main_Screens/ProfileTab/Guest User/ViewModel/GuestProfileApi.dart @@ -4,11 +4,10 @@ import 'dart:developer'; import 'package:regroup/Common/api_urls.dart'; import 'package:regroup/Common/base_manager.dart'; import 'package:regroup/Common/controller/data/network/network_api.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Guest%20User/Model/GetGuestFollowers.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Guest%20User/Model/GetGuestFollowing.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Guest%20User/Model/GuestGetProfileDataBus.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Guest%20User/Model/GuestGetProfileDataIndi.dart'; - +import 'package:regroup/Main_Screens/ProfileTab/Guest%20User/Model/GetGuestFollowers.dart'; +import 'package:regroup/Main_Screens/ProfileTab/Guest%20User/Model/GetGuestFollowing.dart'; +import 'package:regroup/Main_Screens/ProfileTab/Guest%20User/Model/GuestGetProfileDataBus.dart'; +import 'package:regroup/Main_Screens/ProfileTab/Guest%20User/Model/GuestGetProfileDataIndi.dart'; GuestGetProfileDataIndi? guestGetProfileInd; GuestGetProfileDataBus? guestGetProfileBus; diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Model/accountSessionModel.dart b/lib/Main_Screens/ProfileTab/Model/accountSessionModel.dart similarity index 69% rename from lib/Feed Module/Main_Screens/ProfileTab/Model/accountSessionModel.dart rename to lib/Main_Screens/ProfileTab/Model/accountSessionModel.dart index 0714af3..70154e4 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/Model/accountSessionModel.dart +++ b/lib/Main_Screens/ProfileTab/Model/accountSessionModel.dart @@ -14,16 +14,16 @@ class GetAccountSessionsModel { if (json['data'] != null) { data = []; json['data'].forEach((v) { - data!.add(new Data.fromJson(v)); + data!.add(Data.fromJson(v)); }); } } Map toJson() { - final Map data = new Map(); - data['status'] = this.status; - data['status_code'] = this.statusCode; - data['message'] = this.message; + final Map data = {}; + data['status'] = status; + data['status_code'] = statusCode; + data['message'] = message; if (this.data != null) { data['data'] = this.data!.map((v) => v.toJson()).toList(); } @@ -72,18 +72,18 @@ class Data { } Map toJson() { - final Map data = new Map(); - data['id'] = this.id; - data['device_name'] = this.deviceName; - data['ip_address'] = this.ipAddress; - data['country'] = this.country; - data['state'] = this.state; - data['city'] = this.city; - data['zip'] = this.zip; - data['isp'] = this.isp; - data['lat'] = this.lat; - data['lon'] = this.lon; - data['timezone'] = this.timezone; + final Map data = {}; + data['id'] = id; + data['device_name'] = deviceName; + data['ip_address'] = ipAddress; + data['country'] = country; + data['state'] = state; + data['city'] = city; + data['zip'] = zip; + data['isp'] = isp; + data['lat'] = lat; + data['lon'] = lon; + data['timezone'] = timezone; return data; } } diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Model/certificateModel.dart b/lib/Main_Screens/ProfileTab/Model/certificateModel.dart similarity index 100% rename from lib/Feed Module/Main_Screens/ProfileTab/Model/certificateModel.dart rename to lib/Main_Screens/ProfileTab/Model/certificateModel.dart diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Model/editTimelineModel.dart b/lib/Main_Screens/ProfileTab/Model/editTimelineModel.dart similarity index 100% rename from lib/Feed Module/Main_Screens/ProfileTab/Model/editTimelineModel.dart rename to lib/Main_Screens/ProfileTab/Model/editTimelineModel.dart diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Model/faqModel.dart b/lib/Main_Screens/ProfileTab/Model/faqModel.dart similarity index 100% rename from lib/Feed Module/Main_Screens/ProfileTab/Model/faqModel.dart rename to lib/Main_Screens/ProfileTab/Model/faqModel.dart diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Model/followersModel.dart b/lib/Main_Screens/ProfileTab/Model/followersModel.dart similarity index 100% rename from lib/Feed Module/Main_Screens/ProfileTab/Model/followersModel.dart rename to lib/Main_Screens/ProfileTab/Model/followersModel.dart diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Model/followingModel.dart b/lib/Main_Screens/ProfileTab/Model/followingModel.dart similarity index 100% rename from lib/Feed Module/Main_Screens/ProfileTab/Model/followingModel.dart rename to lib/Main_Screens/ProfileTab/Model/followingModel.dart diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Model/privacyPolicyModel.dart b/lib/Main_Screens/ProfileTab/Model/privacyPolicyModel.dart similarity index 100% rename from lib/Feed Module/Main_Screens/ProfileTab/Model/privacyPolicyModel.dart rename to lib/Main_Screens/ProfileTab/Model/privacyPolicyModel.dart diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Model/termsconditionsModel.dart b/lib/Main_Screens/ProfileTab/Model/termsconditionsModel.dart similarity index 100% rename from lib/Feed Module/Main_Screens/ProfileTab/Model/termsconditionsModel.dart rename to lib/Main_Screens/ProfileTab/Model/termsconditionsModel.dart diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Model/timelineabilityModel.dart b/lib/Main_Screens/ProfileTab/Model/timelineabilityModel.dart similarity index 100% rename from lib/Feed Module/Main_Screens/ProfileTab/Model/timelineabilityModel.dart rename to lib/Main_Screens/ProfileTab/Model/timelineabilityModel.dart diff --git a/lib/Feed Module/Main_Screens/ProfileTab/My Network/MyNetwork.dart b/lib/Main_Screens/ProfileTab/My Network/MyNetwork.dart similarity index 97% rename from lib/Feed Module/Main_Screens/ProfileTab/My Network/MyNetwork.dart rename to lib/Main_Screens/ProfileTab/My Network/MyNetwork.dart index dab35fc..19985ab 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/My Network/MyNetwork.dart +++ b/lib/Main_Screens/ProfileTab/My Network/MyNetwork.dart @@ -8,10 +8,10 @@ import 'package:get/get.dart'; import 'package:regroup/Common/CommonTabBar.dart'; import 'package:regroup/Common/CommonWidget.dart'; import 'package:regroup/Common/base_manager.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Model/followersModel.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Model/followingModel.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profileGetmethod.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profilePostmethod.dart'; +import 'package:regroup/Main_Screens/ProfileTab/Model/followersModel.dart'; +import 'package:regroup/Main_Screens/ProfileTab/Model/followingModel.dart'; +import 'package:regroup/Main_Screens/ProfileTab/view_model/profileGetmethod.dart'; +import 'package:regroup/Main_Screens/ProfileTab/view_model/profilePostmethod.dart'; import 'package:regroup/Utils/Common/CommonAppbar.dart'; import 'package:regroup/Utils/Common/CustomTextformfield.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; @@ -117,11 +117,9 @@ class _FollowersTabState extends State { final data = await Profilepostmethod().postRemoveuser(updata); if (data.status == ResponseStatus.SUCCESS) { Get.back(); - print("block done"); return utils.showToast(data.message); } else { Get.back(); - print("block not done"); return utils.showToast(data.message); } } @@ -134,11 +132,9 @@ class _FollowersTabState extends State { final data = await Profilepostmethod().postBlockuser(updata); if (data.status == ResponseStatus.SUCCESS) { Get.back(); - print("block done"); return utils.showToast(data.message); } else { Get.back(); - print("block not done"); return utils.showToast(data.message); } } @@ -328,6 +324,7 @@ class _FollowersTabState extends State { // onTap: () {}, onTap: () async { setState(() { + removeid = followersobj! .data![index] .follower! @@ -350,8 +347,8 @@ class _FollowersTabState extends State { const Spacer(), Image.asset( "assets/images/png/fluent_delete-28-regular.png", - height: 15.h, - width: 15.w, + height: 20.h, + width: 20.w, ) ], ), @@ -402,16 +399,16 @@ class _FollowersTabState extends State { "Block user"), const Spacer(), Image.asset( - "assets/images/png/blockchat.png", - height: 25.h, - width: 25.w, + "assets/images/png/blocked.png", + height: 17.h, + width: 17.w, ) ], ), ), ), ], - child: Container( + child: SizedBox( height: 20, width: 20, child: Center( @@ -437,7 +434,7 @@ class _FollowersTabState extends State { ); } - Widget _buildNoDataBody(context) { + Widget _buildNoDataBody(context) { return Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, @@ -452,8 +449,6 @@ class _FollowersTabState extends State { ], ); } - - } class FollowingTab extends StatefulWidget { @@ -501,8 +496,6 @@ class _FollowingTabState extends State { @override void initState() { - // TODO: implement initState - var updata = ""; Profilegetmethod().getFollowing(updata, streamController: searchcontroller); @@ -523,7 +516,6 @@ class _FollowingTabState extends State { final data = await Profilepostmethod().postunfollowuser(updata); if (data.status == ResponseStatus.SUCCESS) { Get.back(); - print("unfollow done"); // setState(() { // // Assuming followingobj is a list of items, remove the item with matching user ID // followingobj!.data!.removeWhere((item) => item.following!.id == userid); @@ -531,7 +523,6 @@ class _FollowingTabState extends State { return utils.showToast(data.message); } else { Get.back(); - print("unfollow not done"); return utils.showToast(data.message); } } @@ -758,7 +749,7 @@ class _FollowingTabState extends State { ), ), ], - child: Container( + child: SizedBox( height: 20, width: 20, child: Center( diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Settings/AccountSessions.dart b/lib/Main_Screens/ProfileTab/Settings/AccountSessions.dart similarity index 63% rename from lib/Feed Module/Main_Screens/ProfileTab/Settings/AccountSessions.dart rename to lib/Main_Screens/ProfileTab/Settings/AccountSessions.dart index 347e96b..ead3211 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/Settings/AccountSessions.dart +++ b/lib/Main_Screens/ProfileTab/Settings/AccountSessions.dart @@ -1,7 +1,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:regroup/Common/CommonGlassmorphism.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profileGetmethod.dart'; +import 'package:regroup/Main_Screens/ProfileTab/view_model/profileGetmethod.dart'; + import 'package:regroup/Utils/Common/CommonAppbar.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/texts.dart'; @@ -23,15 +24,14 @@ class _AccountSessionState extends State { @override Widget build(BuildContext context) { return Scaffold( - // key: _scaffoldKey1, - resizeToAvoidBottomInset: false, - backgroundColor: Color(0xFF222935), - extendBody: true, - appBar: CommonAppbar( - titleTxt: "Account sessions", - ), - body: - FutureBuilder( + // key: _scaffoldKey1, + resizeToAvoidBottomInset: false, + backgroundColor: const Color(0xFF222935), + extendBody: true, + appBar: const CommonAppbar( + titleTxt: "Account sessions", + ), + body: FutureBuilder( future: Profilegetmethod().getAccountSessions(), builder: (ctx, snapshot) { if (snapshot.data == null) { @@ -62,12 +62,10 @@ class _AccountSessionState extends State { : _buildBody(context); }, ), - - - ); + ); } - Widget _buildNoDataBody(context) { + Widget _buildNoDataBody(context) { return Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, @@ -86,65 +84,63 @@ class _AccountSessionState extends State { } Widget _buildBody(context) { - return - - Stack(children: [ - Container( - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage("assets/images/png/Ellipse 1496.png"), fit: BoxFit.fill)), - ), - Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), - child: - Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ - sizedBoxHeight(25.h), - text18w400white("Last login sessions"), - sizedBoxHeight(16.h), - ListView.builder( - shrinkWrap: true, - physics: ScrollPhysics(), - itemCount: accountsessionobj!.data!.length, - itemBuilder: (context, index) { - final city = accountsessionobj!.data![index].city; - final state = accountsessionobj!.data![index].state; - final country = accountsessionobj!.data![index].country; + return Stack(children: [ + Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage("assets/images/png/Ellipse 1496.png"), + fit: BoxFit.fill)), + ), + Padding( + padding: EdgeInsets.symmetric(horizontal: 16.w), + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + sizedBoxHeight(25.h), + text18w400white("Last login sessions"), + sizedBoxHeight(16.h), + ListView.builder( + shrinkWrap: true, + physics: const ScrollPhysics(), + itemCount: accountsessionobj!.data!.length, + itemBuilder: (context, index) { + final city = accountsessionobj!.data![index].city; + final state = accountsessionobj!.data![index].state; + final country = accountsessionobj!.data![index].country; - // Combine city, state, and country - final locationTitle = '$city, $state, $country'; - return sessionCard( - title: locationTitle, - devicename: accountsessionobj!.data![index].deviceName!, - ipaddress: accountsessionobj!.data![index].ipAddress! - - ); - }, - ) - ]), + // Combine city, state, and country + final locationTitle = '$city, $state, $country'; + return sessionCard( + title: locationTitle, + devicename: accountsessionobj!.data![index].deviceName!, + ipaddress: accountsessionobj!.data![index].ipAddress!); + }, ) - ]); - - } + ]), + ) + ]); + } - Widget sessionCard({required String title, required String devicename, required String ipaddress}) { + Widget sessionCard( + {required String title, + required String devicename, + required String ipaddress}) { return Padding( padding: const EdgeInsets.symmetric(vertical: 15), - child: commonGlassContainer( + child: commonGlassUI( width: double.infinity, height: 90.h, - borderradius: 10.r, + borderRadius: BorderRadius.circular( 10.r), customWidget: Padding( padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12), child: Column( children: [ Row( children: [ - commonGlassContainer( + commonGlassUI( width: 25.w, height: 25.h, opacity1: 0.24, opacity2: 0.24, - borderradius: 100, + borderRadius: BorderRadius.circular( 100), customWidget: Center( child: Image.asset( "assets/images/png/Group 58645.png", @@ -152,7 +148,7 @@ class _AccountSessionState extends State { width: 9.w, ), ), - border: 1), + borderwidth: 1), sizedBoxWidth(10.w), text16400white(title), ], @@ -174,7 +170,7 @@ class _AccountSessionState extends State { ], ), ), - border: 1), + borderwidth: 1), ); } } diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Settings/AccountSetting.dart b/lib/Main_Screens/ProfileTab/Settings/AccountSetting.dart similarity index 70% rename from lib/Feed Module/Main_Screens/ProfileTab/Settings/AccountSetting.dart rename to lib/Main_Screens/ProfileTab/Settings/AccountSetting.dart index 815dab9..7054342 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/Settings/AccountSetting.dart +++ b/lib/Main_Screens/ProfileTab/Settings/AccountSetting.dart @@ -4,10 +4,10 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:regroup/Common/CommonWidget.dart'; import 'package:regroup/Common/base_manager.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/EditProfile/ViewModel/EditProfileApi.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profilePostmethod.dart'; +import 'package:regroup/Main_Screens/ProfileTab/EditProfile/ViewModel/EditProfileApi.dart'; +import 'package:regroup/Main_Screens/ProfileTab/view_model/profilePostmethod.dart'; + import 'package:regroup/Utils/Common/CommonAppbar.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/dialogs.dart'; import 'package:regroup/Utils/texts.dart'; @@ -24,7 +24,7 @@ class AccountSettings extends StatefulWidget { class _AccountSettingsState extends State { // bool swichvalue = false; - String? accountTypeValue; + String? accountTypeValue; String? accounTypeLogin; @override @@ -44,15 +44,14 @@ class _AccountSettingsState extends State { }); } - Future UploadData() async { + Future UploadData() async { print("upload data called"); SharedPreferences prefs = await SharedPreferences.getInstance(); - int? accountype ; + int? accountype; if (accountvisibility == false) { accountype = 0; - } - else if (accountvisibility == true) { + } else if (accountvisibility == true) { accountype = 1; } Map updata = { @@ -64,24 +63,20 @@ class _AccountSettingsState extends State { if (data.status == ResponseStatus.SUCCESS) { String? accountype; -accountype = prefs.getString('accountTypefromLogin'); - -if (accountype == "1") { - EditProfileApi() - .getEditProfileIndividual(); -} -else if (accountype == "2") { - EditProfileApi() - .getEditProfileBusiness(); -} - + accountype = prefs.getString('accountTypefromLogin'); + if (accountype == "1") { + EditProfileApi().getEditProfileIndividual(); + } else if (accountype == "2") { + EditProfileApi().getEditProfileBusiness(); + } return utils.showToast(data.message); } else { return utils.showToast(data.message); } } + @override Widget build(BuildContext context) { return Scaffold( @@ -112,42 +107,40 @@ else if (accountype == "2") { ), sizedBoxHeight(20.h), accounTypeLogin == '1' - ? + ? Column( + children: [ + Padding( + padding: EdgeInsets.symmetric( + horizontal: 16.w, vertical: 20.h), + child: Row(children: [ + Image.asset( + "assets/images/png/eyeIcon.png", + height: 21.h, + width: 21.w, + ), + sizedBoxWidth(12.w), + text16w400_FCFCFC("Account visibility"), + Spacer(), + Transform.scale( + scale: 0.9, + child: CupertinoSwitch( + value: accountvisibility, + trackColor: Colors.white.withOpacity(0.4), + activeColor: Color(0xFF34C759), + onChanged: (bool value) { + setState(() { + accountvisibility = value; + UploadData(); - Column( - children: [ - Padding( - padding: - EdgeInsets.symmetric(horizontal: 16.w, vertical: 20.h), - child: Row(children: [ - Image.asset( - "assets/images/png/eyeIcon.png", - height: 21.h, - width: 21.w, - ), - sizedBoxWidth(12.w), - text16w400_FCFCFC("Account visibility"), - Spacer(), - Transform.scale( - scale: 0.9, - child: CupertinoSwitch( - value: accountvisibility, - trackColor: Colors.white.withOpacity(0.4), - activeColor: Color(0xFF34C759), - onChanged: (bool value) { - setState(() { - accountvisibility = value; - UploadData(); - - // swichvalue = value ?? false; - }); - })) - ]), - ), - commonDivider(), - ], - ) - : SizedBox(), + // swichvalue = value ?? false; + }); + })) + ]), + ), + commonDivider(), + ], + ) + : SizedBox(), GestureDetector( onTap: () { Get.toNamed(RouteName.changepassword); diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Settings/ChangePassword.dart b/lib/Main_Screens/ProfileTab/Settings/ChangePassword.dart similarity index 93% rename from lib/Feed Module/Main_Screens/ProfileTab/Settings/ChangePassword.dart rename to lib/Main_Screens/ProfileTab/Settings/ChangePassword.dart index 6cd5d7f..a7d4acb 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/Settings/ChangePassword.dart +++ b/lib/Main_Screens/ProfileTab/Settings/ChangePassword.dart @@ -4,10 +4,10 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:regroup/Common/CommonButton.dart'; import 'package:regroup/Common/base_manager.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profilePostmethod.dart'; +import 'package:regroup/Main_Screens/ProfileTab/view_model/profilePostmethod.dart'; import 'package:regroup/Utils/Common/CommonAppbar.dart'; import 'package:regroup/Utils/Common/CustomTextformfield.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; + import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/dialogs.dart'; import 'package:regroup/Utils/texts.dart'; @@ -38,13 +38,11 @@ class _ChangePasswordState extends State { Get.back(); print("Change pass up done"); - Get.toNamed(RouteName.verifycode, - arguments: { - "currentpass" : currentpasscontroller.text, - "newpass" : newpasscontroller.text, - "confirmpass" : repeatpasscontroller.text - } - ); + Get.toNamed(RouteName.verifycode, arguments: { + "currentpass": currentpasscontroller.text, + "newpass": newpasscontroller.text, + "confirmpass": repeatpasscontroller.text + }); return utils.showToast(data.message); } else { Get.back(); @@ -60,9 +58,9 @@ class _ChangePasswordState extends State { child: Scaffold( resizeToAvoidBottomInset: false, // key: _scaffoldKey1, - backgroundColor: Color(0xFF222935), + backgroundColor: const Color(0xFF222935), extendBody: true, - appBar: CommonAppbar( + appBar: const CommonAppbar( titleTxt: "Change password", ), body: Stack(children: [ @@ -172,7 +170,6 @@ class _ChangePasswordState extends State { utils.showToast('Please fill all fields'); } else { Uploadata(); - } }, ) diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Settings/ContactUs.dart b/lib/Main_Screens/ProfileTab/Settings/ContactUs.dart similarity index 94% rename from lib/Feed Module/Main_Screens/ProfileTab/Settings/ContactUs.dart rename to lib/Main_Screens/ProfileTab/Settings/ContactUs.dart index 1e0dc27..1d2217a 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/Settings/ContactUs.dart +++ b/lib/Main_Screens/ProfileTab/Settings/ContactUs.dart @@ -3,7 +3,7 @@ import 'package:flutter/services.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:regroup/Common/base_manager.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profilePostmethod.dart'; +import 'package:regroup/Main_Screens/ProfileTab/view_model/profilePostmethod.dart'; import 'package:regroup/Utils/Common/CommonAppbar.dart'; import 'package:regroup/Utils/Common/CommonDropdown.dart'; import 'package:regroup/Utils/Common/CustomNextButton.dart'; @@ -35,7 +35,7 @@ class _ContactUsState extends State { }); } - Uploadata() async { + uploadata() async { utils.loader(); Map updata = { "full_name": fullname.text, @@ -62,9 +62,9 @@ class _ContactUsState extends State { onTap: () => FocusManager.instance.primaryFocus?.unfocus(), child: Scaffold( // key: _scaffoldKey1, - backgroundColor: Color(0xFF222935), + backgroundColor: const Color(0xFF222935), extendBody: true, - appBar: CommonAppbar( + appBar: const CommonAppbar( titleTxt: "Contact us", ), body: Stack(children: [ @@ -86,7 +86,7 @@ class _ContactUsState extends State { text16400white("Full name"), sizedBoxHeight(16.h), CustomTextFormField( - leadingIcon: Container( + leadingIcon: SizedBox( height: 17.h, width: 18.w, child: Center( @@ -117,7 +117,7 @@ class _ContactUsState extends State { text16400white("Email address"), sizedBoxHeight(16.h), CustomTextFormField( - leadingIcon: Container( + leadingIcon: SizedBox( height: 17.h, width: 18.w, child: Center( @@ -153,7 +153,7 @@ class _ContactUsState extends State { CustomDropDownRadio( header: "", title: "", - listData: [ + listData: const [ "Feature suggestion", "Issues with app", "Scoreboard", @@ -174,7 +174,7 @@ class _ContactUsState extends State { hintText: "Enter query", validator: (value) { if (value!.isEmpty) { - return 'Enter your full name '; + return 'Enter your query'; } return null; }, @@ -196,7 +196,7 @@ class _ContactUsState extends State { _selectedreasontocontact.isEmpty) { utils.showToast("Please fill all fields"); } else { - Uploadata(); + uploadata(); } }, text: "Send") diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Settings/DeleteAccount.dart b/lib/Main_Screens/ProfileTab/Settings/DeleteAccount.dart similarity index 94% rename from lib/Feed Module/Main_Screens/ProfileTab/Settings/DeleteAccount.dart rename to lib/Main_Screens/ProfileTab/Settings/DeleteAccount.dart index 7d453cf..9eb0a61 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/Settings/DeleteAccount.dart +++ b/lib/Main_Screens/ProfileTab/Settings/DeleteAccount.dart @@ -5,10 +5,10 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:regroup/Common/CommonButton.dart'; import 'package:regroup/Common/base_manager.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profilePostmethod.dart'; +import 'package:regroup/Main_Screens/ProfileTab/view_model/profilePostmethod.dart'; import 'package:regroup/Utils/Common/CommonAppbar.dart'; import 'package:regroup/Utils/Common/CustomTextformfield.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; + import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/dialogs.dart'; import 'package:regroup/Utils/texts.dart'; @@ -64,9 +64,9 @@ class _DeleteAccountState extends State { child: Scaffold( // key: _scaffoldKey1, // resizeToAvoidBottomInset: false, - backgroundColor: Color(0xFF222935), + backgroundColor: const Color(0xFF222935), extendBody: true, - appBar: CommonAppbar( + appBar: const CommonAppbar( titleTxt: "", ), body: Stack(children: [ @@ -118,7 +118,8 @@ class _DeleteAccountState extends State { CommonBtn( text: "I don’t want to delete", onTap: () { - Get.toNamed(RouteName.mainscreen); + // Get.toNamed(RouteName.mainscreen); + Get.back(); }, ), sizedBoxHeight(18.h), diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Settings/FaqScreen.dart b/lib/Main_Screens/ProfileTab/Settings/FaqScreen.dart similarity index 94% rename from lib/Feed Module/Main_Screens/ProfileTab/Settings/FaqScreen.dart rename to lib/Main_Screens/ProfileTab/Settings/FaqScreen.dart index ebb976d..3d22deb 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/Settings/FaqScreen.dart +++ b/lib/Main_Screens/ProfileTab/Settings/FaqScreen.dart @@ -2,9 +2,10 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:regroup/Common/CommonGlassmorphism.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profileGetmethod.dart'; +import 'package:regroup/Main_Screens/ProfileTab/view_model/profileGetmethod.dart'; + import 'package:regroup/Utils/Common/CommonAppbar.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; + import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/texts.dart'; @@ -64,10 +65,10 @@ class _FaqScreenState extends State { Widget build(BuildContext context) { return Scaffold( // key: _scaffoldKey1, - backgroundColor: Color(0xFF222935), + backgroundColor: const Color(0xFF222935), resizeToAvoidBottomInset: false, extendBody: true, - appBar: CommonAppbar( + appBar: const CommonAppbar( titleTxt: "FAQ’s", ), body: FutureBuilder( @@ -96,8 +97,8 @@ class _FaqScreenState extends State { ); } } - isExpandedList = - RxList.generate(faqobj!.data!.length, (index) => index == 0); + isExpandedList = + RxList.generate(faqobj!.data!.length, (index) => index == 0); return faqobj!.data!.isEmpty ? _buildNoDataBody(context) : _buildBody(context); @@ -169,10 +170,10 @@ class _FaqScreenState extends State { child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ - commonGlassContainer( + commonGlassUI( width: double.infinity, height: isExpanded ? 250.h : 82.h, - borderradius: 10.r, + borderRadius: BorderRadius.circular( 10.r), customWidget: SingleChildScrollView( child: Padding( padding: @@ -207,7 +208,7 @@ class _FaqScreenState extends State { ), ), ), - border: 1), + borderwidth: 1), ], ), ); diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Settings/HelpAndSupport.dart b/lib/Main_Screens/ProfileTab/Settings/HelpAndSupport.dart similarity index 97% rename from lib/Feed Module/Main_Screens/ProfileTab/Settings/HelpAndSupport.dart rename to lib/Main_Screens/ProfileTab/Settings/HelpAndSupport.dart index 2b12ccf..a669ec7 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/Settings/HelpAndSupport.dart +++ b/lib/Main_Screens/ProfileTab/Settings/HelpAndSupport.dart @@ -3,7 +3,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:regroup/Common/CommonWidget.dart'; import 'package:regroup/Utils/Common/CommonAppbar.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; + import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/texts.dart'; import 'package:regroup/resources/routes/route_name.dart'; @@ -80,8 +80,7 @@ class _HelpAndSupportState extends State { ), ), accounTypeLogin == '1' - ? Column( - children: [ + ? Column(children: [ commonDivider(), GestureDetector( onTap: () { diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Settings/Model/FetchBlockUser.dart b/lib/Main_Screens/ProfileTab/Settings/Model/FetchBlockUser.dart similarity index 100% rename from lib/Feed Module/Main_Screens/ProfileTab/Settings/Model/FetchBlockUser.dart rename to lib/Main_Screens/ProfileTab/Settings/Model/FetchBlockUser.dart diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Settings/Model/FetchNotification.dart b/lib/Main_Screens/ProfileTab/Settings/Model/FetchNotification.dart similarity index 100% rename from lib/Feed Module/Main_Screens/ProfileTab/Settings/Model/FetchNotification.dart rename to lib/Main_Screens/ProfileTab/Settings/Model/FetchNotification.dart diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Settings/PrivacyPolicy.dart b/lib/Main_Screens/ProfileTab/Settings/PrivacyPolicy.dart similarity index 94% rename from lib/Feed Module/Main_Screens/ProfileTab/Settings/PrivacyPolicy.dart rename to lib/Main_Screens/ProfileTab/Settings/PrivacyPolicy.dart index 609776d..143bd0a 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/Settings/PrivacyPolicy.dart +++ b/lib/Main_Screens/ProfileTab/Settings/PrivacyPolicy.dart @@ -2,9 +2,10 @@ import 'package:flutter/material.dart'; import 'package:flutter_html/flutter_html.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profileGetmethod.dart'; +import 'package:regroup/Main_Screens/ProfileTab/view_model/profileGetmethod.dart'; + import 'package:regroup/Utils/Common/CommonAppbar.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; + import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/texts.dart'; @@ -20,17 +21,17 @@ class _PrivacyPolicyState extends State { Widget build(BuildContext context) { return Scaffold( // key: _scaffoldKey1, - backgroundColor: Color(0xFF222935), + backgroundColor: const Color(0xFF222935), extendBody: true, resizeToAvoidBottomInset: false, - appBar: CommonAppbar( + appBar: const CommonAppbar( titleTxt: "Privacy policy", ), body: FutureBuilder( future: Profilegetmethod().getPrivacypolicy(), builder: (ctx, snapshot) { if (snapshot.data == null) { - return Center(child: CircularProgressIndicator()); + return const Center(child: CircularProgressIndicator()); } if (snapshot.connectionState == ConnectionState.done) { if (snapshot.hasError) { diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Settings/ReportABug.dart b/lib/Main_Screens/ProfileTab/Settings/ReportABug.dart similarity index 95% rename from lib/Feed Module/Main_Screens/ProfileTab/Settings/ReportABug.dart rename to lib/Main_Screens/ProfileTab/Settings/ReportABug.dart index 083adbd..905c70a 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/Settings/ReportABug.dart +++ b/lib/Main_Screens/ProfileTab/Settings/ReportABug.dart @@ -7,12 +7,12 @@ import 'package:get/get.dart'; import 'package:regroup/Common/CommonButton.dart'; import 'package:regroup/Common/CommonDropDown.dart'; import 'package:regroup/Common/base_manager.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profilePostmethod.dart'; +import 'package:regroup/Main_Screens/ProfileTab/view_model/profilePostmethod.dart'; import 'package:regroup/Utils/Common/CommonAppbar.dart'; import 'package:regroup/Utils/Common/CommonDropdown.dart'; import 'package:regroup/Utils/Common/CustomNextButton.dart'; import 'package:regroup/Utils/Common/CustomTextformfield.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; + import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/dialogs.dart'; import 'package:regroup/Utils/texts.dart'; @@ -69,9 +69,9 @@ class _ReportABugState extends State { child: Scaffold( // key: _scaffoldKey1, resizeToAvoidBottomInset: false, - backgroundColor: Color(0xFF222935), + backgroundColor: const Color(0xFF222935), extendBody: true, - appBar: CommonAppbar( + appBar: const CommonAppbar( titleTxt: "Report a bug", ), body: Stack(children: [ @@ -82,7 +82,7 @@ class _ReportABugState extends State { fit: BoxFit.fill)), ), SingleChildScrollView( - physics: ScrollPhysics(), + physics: const ScrollPhysics(), child: Padding( padding: EdgeInsets.symmetric(horizontal: 16.w), child: Form( @@ -104,7 +104,7 @@ class _ReportABugState extends State { ), sizedBoxHeight(15.h), CustomTextFormField( - leadingIcon: Container( + leadingIcon: SizedBox( height: 25.h, width: 15.w, child: Center( @@ -118,7 +118,7 @@ class _ReportABugState extends State { ), validator: (value) { if (value!.isEmpty) { - return 'Enter your decice os'; + return 'Enter your device os'; } return null; }, @@ -145,7 +145,7 @@ class _ReportABugState extends State { ), sizedBoxHeight(15.h), CustomTextFormField( - leadingIcon: Container( + leadingIcon: SizedBox( height: 23.h, width: 23.w, child: Center( @@ -174,7 +174,7 @@ class _ReportABugState extends State { text16400white("Email address"), sizedBoxHeight(15.h), CustomTextFormField( - leadingIcon: Container( + leadingIcon: SizedBox( height: 17.h, width: 24.w, child: Center( diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Settings/Settings.dart b/lib/Main_Screens/ProfileTab/Settings/Settings.dart similarity index 86% rename from lib/Feed Module/Main_Screens/ProfileTab/Settings/Settings.dart rename to lib/Main_Screens/ProfileTab/Settings/Settings.dart index 2cc16c7..42c1ee7 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/Settings/Settings.dart +++ b/lib/Main_Screens/ProfileTab/Settings/Settings.dart @@ -1,14 +1,13 @@ import 'package:flutter/material.dart'; -import 'package:flutter/widgets.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; -import 'package:glassmorphism/glassmorphism.dart'; import 'package:regroup/Common/CommonGlassmorphism.dart'; import 'package:regroup/Common/CommonWidget.dart'; import 'package:regroup/Common/base_manager.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profilePostmethod.dart'; +import 'package:regroup/Global.dart'; +import 'package:regroup/Main_Screens/ProfileTab/view_model/profilePostmethod.dart'; import 'package:regroup/Utils/Common/CommonAppbar.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; + import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/dialogs.dart'; import 'package:regroup/Utils/texts.dart'; @@ -23,8 +22,8 @@ class Settings extends StatefulWidget { } class _SettingsState extends State { - String? accountTypeValue; - String? accounTypeLogin; + // String? accountTypeValue; + // String? accounTypeLogin; @override void initState() { @@ -33,14 +32,15 @@ class _SettingsState extends State { } setValues() async { - SharedPreferences prefs = await SharedPreferences.getInstance(); - // Update state variables and trigger UI update with setState - setState(() { - accounTypeLogin = prefs.getString('accountTypefromLogin'); - print('account type login is $accounTypeLogin'); - accountTypeValue = prefs.getString('accountTypeValue'); - print('account type value is $accountTypeValue'); - }); + // globalAccountType; + // SharedPreferences prefs = await SharedPreferences.getInstance(); + // // Update state variables and trigger UI update with setState + // setState(() { + // accounTypeLogin = prefs.getString('accountTypefromLogin'); + // print('account type login is $accounTypeLogin'); + // accountTypeValue = prefs.getString('accountTypeValue'); + // print('account type value is $accountTypeValue'); + // }); } Uploadata() async { @@ -75,10 +75,10 @@ class _SettingsState extends State { Widget build(BuildContext context) { return Scaffold( // key: _scaffoldKey1, - backgroundColor: Color(0xFF222935), + backgroundColor: const Color(0xFF222935), extendBody: true, resizeToAvoidBottomInset: false, - appBar: CommonAppbar( + appBar: const CommonAppbar( titleTxt: "Settings", ), body: Stack(children: [ @@ -109,7 +109,7 @@ class _SettingsState extends State { ), ), commonDivider(), - accounTypeLogin == '1' + globalAccountType == '1' ? Column( children: [ GestureDetector( @@ -124,7 +124,7 @@ class _SettingsState extends State { commonDivider(), ], ) - : SizedBox(), + : const SizedBox(), GestureDetector( onTap: () { Get.toNamed(RouteName.helpandsupport); @@ -156,8 +156,8 @@ class _SettingsState extends State { ), ), commonDivider(), - accounTypeLogin == '1' - ? SizedBox() + globalAccountType == '1' + ? const SizedBox() : Column( children: [ GestureDetector( @@ -199,8 +199,8 @@ class _SettingsState extends State { ), sizedBoxWidth(12.w), text16w400_FCFCFC(text), - Spacer(), - Icon( + const Spacer(), + const Icon( Icons.arrow_forward_ios, color: Colors.white, size: 20, @@ -212,13 +212,13 @@ class _SettingsState extends State { dialogwidget() { Get.dialog(Dialog( backgroundColor: Colors.transparent, - child: commonGlassContainer( + child: commonGlassUI( width: double.infinity, height: 200.h, - borderradius: 14, + borderRadius: BorderRadius.circular(14), opacity1: 0.09, opacity2: 0.13, - border: 0.8, + borderwidth: 0.8, customWidget: Padding( padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 20.h), child: Column( @@ -239,21 +239,21 @@ class _SettingsState extends State { // Get.offAllNamed(RouteName.loginScreen); Uploadata(); }, - child: commonGlassContainer( + child: commonGlassUI( width: 130.w, height: 40.h, - borderradius: 30.r, + borderRadius: BorderRadius.circular(30.r), opacity1: 0.05, opacity2: 0.07, customWidget: Center(child: text14400white("Yes, I want to")), - border: 1), + borderwidth: 1), ), Container( height: 40.h, width: 130.w, decoration: BoxDecoration( - color: Color(0xFFD90B2E), + color: const Color(0xFFD90B2E), borderRadius: BorderRadius.circular(30.r), ), child: Center(child: text14400white("Keep using App")), diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Settings/TermsCondition.dart b/lib/Main_Screens/ProfileTab/Settings/TermsCondition.dart similarity index 93% rename from lib/Feed Module/Main_Screens/ProfileTab/Settings/TermsCondition.dart rename to lib/Main_Screens/ProfileTab/Settings/TermsCondition.dart index 96c8a2d..30d9c9b 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/Settings/TermsCondition.dart +++ b/lib/Main_Screens/ProfileTab/Settings/TermsCondition.dart @@ -2,7 +2,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_html/flutter_html.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profileGetmethod.dart'; +import 'package:regroup/Main_Screens/ProfileTab/view_model/profileGetmethod.dart'; + import 'package:regroup/Utils/Common/CommonAppbar.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; @@ -18,7 +19,7 @@ class _TermsConditionState extends State { Widget build(BuildContext context) { return Scaffold( // key: _scaffoldKey1, - backgroundColor: Color(0xFF222935), + backgroundColor: const Color(0xFF222935), extendBody: true, resizeToAvoidBottomInset: false, appBar: const CommonAppbar( @@ -28,7 +29,7 @@ class _TermsConditionState extends State { future: Profilegetmethod().getTermsConditions(), builder: (ctx, snapshot) { if (snapshot.data == null) { - return Center(child: CircularProgressIndicator()); + return const Center(child: CircularProgressIndicator()); } if (snapshot.connectionState == ConnectionState.done) { if (snapshot.hasError) { diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Settings/VerifyCode.dart b/lib/Main_Screens/ProfileTab/Settings/VerifyCode.dart similarity index 90% rename from lib/Feed Module/Main_Screens/ProfileTab/Settings/VerifyCode.dart rename to lib/Main_Screens/ProfileTab/Settings/VerifyCode.dart index efa0b8c..3722179 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/Settings/VerifyCode.dart +++ b/lib/Main_Screens/ProfileTab/Settings/VerifyCode.dart @@ -3,14 +3,12 @@ import 'package:flutter/services.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:pin_code_fields/pin_code_fields.dart'; -import 'package:regroup/Common/CommonGlassmorphism.dart'; import 'package:regroup/Common/base_manager.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profilePostmethod.dart'; import 'package:regroup/Global.dart'; +import 'package:regroup/Main_Screens/ProfileTab/view_model/profilePostmethod.dart'; import 'package:regroup/Utils/Common/CommonAppbar.dart'; import 'package:regroup/Utils/Common/CustomNextButton.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; -import 'package:regroup/Utils/Common/googleOAuthService.dart'; + import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/dialogs.dart'; import 'package:regroup/Utils/texts.dart'; @@ -41,7 +39,6 @@ class _VerifyCodeState extends State { final res = await Profilepostmethod().postChangepassverifyotp(updata); if (res.status == ResponseStatus.SUCCESS) { Get.back(); - print("verification done"); Get.back(); Get.back(); @@ -49,7 +46,6 @@ class _VerifyCodeState extends State { return utils.showToast(res.message); } else { Get.back(); - print("change pass not done"); return utils.showToast(res.message); } } @@ -64,7 +60,6 @@ class _VerifyCodeState extends State { final data = await Profilepostmethod().postChangepassword(updata); if (data.status == ResponseStatus.SUCCESS) { Get.back(); - print("otp done"); setState(() { pincodeController.clear(); @@ -73,7 +68,6 @@ class _VerifyCodeState extends State { return utils.showToast(data.message); } else { Get.back(); - print("otp not done"); return utils.showToast(data.message); } } @@ -82,7 +76,7 @@ class _VerifyCodeState extends State { Widget build(BuildContext context) { return Scaffold( backgroundColor: const Color(0xFF222935), - appBar: CommonAppbar(titleTxt: ""), + appBar: const CommonAppbar(titleTxt: ""), resizeToAvoidBottomInset: false, body: Stack( children: [ @@ -124,29 +118,27 @@ class _VerifyCodeState extends State { obscureText: false, animationType: AnimationType.fade, pinTheme: PinTheme( - selectedFillColor: Color(0xFF434A53), - inactiveFillColor: Color(0xFF434A53), - inactiveColor: Color(0xFF434A53), - activeColor: Color(0xFF434A53), - selectedColor: Color(0xFF434A53), + selectedFillColor: const Color(0xFF434A53), + inactiveFillColor: const Color(0xFF434A53), + inactiveColor: const Color(0xFF434A53), + activeColor: const Color(0xFF434A53), + selectedColor: const Color(0xFF434A53), shape: PinCodeFieldShape.underline, borderRadius: BorderRadius.circular(5), fieldHeight: 70, fieldWidth: 70, activeFillColor: // Colors.white - Color(0xFF303030).withOpacity(0.4), + const Color(0xFF303030).withOpacity(0.4), // textStyle: TextStyle(color: Colors.white, fontSize: 20), // Change text color and font size ), - animationDuration: Duration(milliseconds: 300), + animationDuration: const Duration(milliseconds: 300), enableActiveFill: true, autovalidateMode: AutovalidateMode.onUserInteraction, controller: pincodeController, onCompleted: (v) { - print("Completed"); }, onChanged: (value) { - print(value); setState(() { // currentText = value; }); @@ -158,7 +150,6 @@ class _VerifyCodeState extends State { fontFamily: 'Helvetica', ), beforeTextPaste: (text) { - print("Allowing to paste $text"); return true; }, appContext: context, @@ -166,9 +157,9 @@ class _VerifyCodeState extends State { sizedBoxHeight(10.h), Center( child: TimerButton( - disabledTextStyle: TextStyle(color: Colors.red), - activeTextStyle: TextStyle(color: Colors.white), - disabledColor: Color(0XFF222935).withOpacity(0.10), + disabledTextStyle: const TextStyle(color: Colors.red), + activeTextStyle: const TextStyle(color: Colors.white), + disabledColor: const Color(0XFF222935).withOpacity(0.10), buttonType: ButtonType.textButton, label: "Resend OTP", timeOutInSeconds: 6, @@ -179,7 +170,7 @@ class _VerifyCodeState extends State { }); }, // disabledColor: Colors.white, - color: Color(0XFF222935).withOpacity(0.10), + color: const Color(0XFF222935).withOpacity(0.10), ), ), // ), diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Settings/View/BlockedUsers.dart b/lib/Main_Screens/ProfileTab/Settings/View/BlockedUsers.dart similarity index 98% rename from lib/Feed Module/Main_Screens/ProfileTab/Settings/View/BlockedUsers.dart rename to lib/Main_Screens/ProfileTab/Settings/View/BlockedUsers.dart index edfb5b6..454f001 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/Settings/View/BlockedUsers.dart +++ b/lib/Main_Screens/ProfileTab/Settings/View/BlockedUsers.dart @@ -8,8 +8,8 @@ import 'package:get/get.dart'; import 'package:regroup/Common/CommonGlassmorphism.dart'; import 'package:regroup/Common/CommonWidget.dart'; import 'package:regroup/Common/base_manager.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Settings/Model/FetchBlockUser.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Settings/ViewModel/BlockedUserApi.dart'; +import 'package:regroup/Main_Screens/ProfileTab/Settings/Model/FetchBlockUser.dart'; +import 'package:regroup/Main_Screens/ProfileTab/Settings/ViewModel/BlockedUserApi.dart'; import 'package:regroup/Utils/Common/CommonAppbar.dart'; import 'package:regroup/Utils/Common/CustomTextformfield.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; @@ -436,10 +436,10 @@ class _BlockedUsersState extends State { Get.dialog(Dialog( backgroundColor: Colors.transparent, surfaceTintColor: Colors.transparent, - child: commonGlassContainer( + child: commonGlassUI( width: double.infinity, height: 200.h, - borderradius: 14, + borderRadius: BorderRadius.circular(14), opacity1: 0.09, opacity2: 0.13, customWidget: Padding( @@ -458,14 +458,14 @@ class _BlockedUsersState extends State { onTap: () { Get.back(); }, - child: commonGlassContainer( + child: commonGlassUI( width: 110.w, height: 40.h, - borderradius: 30.r, + borderRadius: BorderRadius.circular( 30.r), opacity1: 0.05, opacity2: 0.07, customWidget: Center(child: text14400white("No")), - border: 1), + borderwidth: 1), ), InkWell( onTap: () { @@ -490,7 +490,7 @@ class _BlockedUsersState extends State { ], ), ), - border: 0.8))); + borderwidth: 0.8))); } Widget blockedUser({ diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Settings/View/Notification.dart b/lib/Main_Screens/ProfileTab/Settings/View/Notification.dart similarity index 97% rename from lib/Feed Module/Main_Screens/ProfileTab/Settings/View/Notification.dart rename to lib/Main_Screens/ProfileTab/Settings/View/Notification.dart index 98dd755..c00e370 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/Settings/View/Notification.dart +++ b/lib/Main_Screens/ProfileTab/Settings/View/Notification.dart @@ -4,9 +4,9 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:regroup/Common/CommonWidget.dart'; import 'package:regroup/Common/base_manager.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Settings/ViewModel/NotificationApi.dart'; +import 'package:regroup/Main_Screens/ProfileTab/Settings/ViewModel/NotificationApi.dart'; import 'package:regroup/Utils/Common/CommonAppbar.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; + import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/dialogs.dart'; import 'package:regroup/Utils/texts.dart'; diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Settings/ViewModel/BlockedUserApi.dart b/lib/Main_Screens/ProfileTab/Settings/ViewModel/BlockedUserApi.dart similarity index 95% rename from lib/Feed Module/Main_Screens/ProfileTab/Settings/ViewModel/BlockedUserApi.dart rename to lib/Main_Screens/ProfileTab/Settings/ViewModel/BlockedUserApi.dart index 10b0369..74c9400 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/Settings/ViewModel/BlockedUserApi.dart +++ b/lib/Main_Screens/ProfileTab/Settings/ViewModel/BlockedUserApi.dart @@ -3,7 +3,7 @@ import 'dart:async'; import 'package:regroup/Common/api_urls.dart'; import 'package:regroup/Common/base_manager.dart'; import 'package:regroup/Common/controller/data/network/network_api.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Settings/Model/FetchBlockUser.dart'; +import 'package:regroup/Main_Screens/ProfileTab/Settings/Model/FetchBlockUser.dart'; FetchBlockedUser? fetchblockuserobj; diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Settings/ViewModel/NotificationApi.dart b/lib/Main_Screens/ProfileTab/Settings/ViewModel/NotificationApi.dart similarity index 94% rename from lib/Feed Module/Main_Screens/ProfileTab/Settings/ViewModel/NotificationApi.dart rename to lib/Main_Screens/ProfileTab/Settings/ViewModel/NotificationApi.dart index 6f53d7c..569374a 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/Settings/ViewModel/NotificationApi.dart +++ b/lib/Main_Screens/ProfileTab/Settings/ViewModel/NotificationApi.dart @@ -1,7 +1,7 @@ import 'package:regroup/Common/api_urls.dart'; import 'package:regroup/Common/base_manager.dart'; import 'package:regroup/Common/controller/data/network/network_api.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Settings/Model/FetchNotification.dart'; +import 'package:regroup/Main_Screens/ProfileTab/Settings/Model/FetchNotification.dart'; FetchNotification? fetchNoti; diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Share profile/ShareProfile.dart b/lib/Main_Screens/ProfileTab/Share profile/ShareProfile.dart similarity index 96% rename from lib/Feed Module/Main_Screens/ProfileTab/Share profile/ShareProfile.dart rename to lib/Main_Screens/ProfileTab/Share profile/ShareProfile.dart index ee9b84a..92e54a3 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/Share profile/ShareProfile.dart +++ b/lib/Main_Screens/ProfileTab/Share profile/ShareProfile.dart @@ -6,7 +6,7 @@ import 'package:regroup/Common/CommonGlassmorphism.dart'; import 'package:regroup/Common/CommonWidget.dart'; import 'package:regroup/Utils/Common/CommonAppbar.dart'; import 'package:regroup/Utils/Common/CustomTextformfield.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; + import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/texts.dart'; @@ -65,7 +65,8 @@ class _ShareProfileState extends State { Container( decoration: const BoxDecoration( image: DecorationImage( - image: AssetImage("assets/images/png/Ellipse 1496.png"), fit: BoxFit.fill)), + image: AssetImage("assets/images/png/Ellipse 1496.png"), + fit: BoxFit.fill)), ), SingleChildScrollView( child: Column(children: [ @@ -148,9 +149,9 @@ class _ShareProfileState extends State { ], ), Spacer(), - commonGlassContainer( - border: 1, - borderradius: 2, + commonGlassUI( + borderwidth: 1, + borderRadius: BorderRadius.circular( 2), height: 23.h, width: 23.w, opacity1: 0.24, diff --git a/lib/Main_Screens/ProfileTab/TimeLine/AddTimeline.dart b/lib/Main_Screens/ProfileTab/TimeLine/AddTimeline.dart new file mode 100644 index 0000000..2fa1a54 --- /dev/null +++ b/lib/Main_Screens/ProfileTab/TimeLine/AddTimeline.dart @@ -0,0 +1,1002 @@ +import 'dart:developer'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:regroup/Common/CommonGlassmorphism.dart'; +import 'package:regroup/Common/CommonWidget.dart'; +import 'package:regroup/Common/base_manager.dart'; +import 'package:regroup/Main_Screens/ProfileTab/Model/timelineabilityModel.dart' + as timelineabilist; +import 'package:regroup/Main_Screens/ProfileTab/view_model/gettimelineability.dart'; +// import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Model/timelineabilityModel.dart' +// as timelineabilist; +import 'package:regroup/Main_Screens/ProfileTab/view_model/profileGetmethod.dart'; +import 'package:regroup/Main_Screens/ProfileTab/view_model/profilePostmethod.dart'; + +import 'package:regroup/Utils/Common/CommonAppbar.dart'; +import 'package:regroup/Utils/Common/CommonDropdown.dart'; +import 'package:regroup/Utils/Common/CustomNextButton.dart'; +import 'package:regroup/Utils/Common/CustomTextformfield.dart'; +import 'package:regroup/Utils/Common/sized_box.dart'; +import 'package:regroup/Utils/dialogs.dart'; +import 'package:regroup/Utils/texts.dart'; +import 'package:regroup/resources/routes/route_name.dart'; +import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart'; +import 'package:intl/intl.dart'; +import 'package:async/src/future_group.dart'; + +class AddTimeline extends StatefulWidget { + const AddTimeline({super.key}); + + @override + State createState() => _AddTimelineState(); +} + +class _AddTimelineState extends State { + TextEditingController dateController = TextEditingController(); + TextEditingController dateController2 = TextEditingController(); + TextEditingController clubNameController = TextEditingController(); + TextEditingController rollnameController = TextEditingController(); + TextEditingController teamnameController = TextEditingController(); + + int id = Get.arguments["id"]; + bool edited = Get.arguments["edit"]; + + RxBool isChecked = false.obs; + + timelineabilist.TimelineAbilityListModel? abilityModel; + List timeline = []; + List _abilitydrop = []; + + Future fetchABilitylist() async { + TimelineAbilityListApi abilityLsitAPI = TimelineAbilityListApi(); + ResponseData response = await abilityLsitAPI.getAbilitylistApi(); + + if (response.status == ResponseStatus.SUCCESS) { + abilityModel = + timelineabilist.TimelineAbilityListModel.fromJson(response.data!); + setState(() { + timeline = abilityModel!.data ?? []; // Store the fetched cities + _abilitydrop = + timeline.map((platform) => platform.name.toString()).toList(); + }); + log(timeline.toString()); + } else {} + } + + List selectedabilityid = []; + + void getCatIdFromName(List selectedAbilities) { + selectedabilityid.clear(); // Clear existing selections + for (var name in selectedAbilities) { + for (var i = 0; i < timeline.length; i++) { + if (name == timeline[i].name) { + selectedabilityid.add(timeline[i].id!); + break; // Assuming each name is unique, we break after finding a match + } + } + } + } + + // late Future myfuture; + FutureGroup futureGroup = FutureGroup(); + RxBool isloading = true.obs; + List seelctedNameList = []; + @override + void initState() { + // TODO: implement initState + + if (edited == true) { + // futureGroup.add( + Profilegetmethod().getEditTimeline(id).then((value) { + clubNameController.text = + edittimelineobj!.data!.timelineData!.clubName ?? ""; + rollnameController.text = + edittimelineobj!.data!.timelineData!.roleName ?? ""; + teamnameController.text = + edittimelineobj!.data!.timelineData!.teamName ?? ""; + ""; + dateController.text = + edittimelineobj!.data!.timelineData!.startDate ?? ""; + dateController2.text = + edittimelineobj!.data!.timelineData!.endDate ?? ""; + + log(_abilityMap.length.toString()); + // futureGroup.add( + fetchABilitylist().then((value) { + String abilitiesXids = + edittimelineobj!.data!.timelineData!.abilitiesXids ?? ""; + abilitiesIds = abilitiesXids + .split(',') + .map((e) => int.tryParse(e.trim()) ?? 0) // Trim spaces around IDs + .toList(); + selectedabilityid = abilitiesIds; + + for (int i = 0; i < _abilitydrop.length; i++) { + _abilityMap.add({ + "id": i + 1, + "name": _abilitydrop[i], + }); + } + getSelectedNames(selectedabilityid).then((value) { + seelctedNameList = value; + isloading = false.obs; + }); + }); + // ); + }); + } else { + fetchABilitylist().then((value) { + isloading = false.obs; + }); + } + + super.initState(); + } + + List abilitiesIds = []; + + UploadData() async { + // SharedPreferences prefs = await SharedPreferences.getInstance(); + utils.loader(); + String abilitiesIds = selectedabilityid.join(','); + Map updata = { + "club_name": clubNameController.text, + "role_name": rollnameController.text, + "team_name": teamnameController.text, + "start_date": dateController.text, + "end_date": dateController2.text, + "abilities_xids": abilitiesIds, + }; + final data = await Profilepostmethod().postTimeline(updata); + if (data.status == ResponseStatus.SUCCESS) { + Get.back(); + // Get.back(); + // await EditProfileApi().getEditProfileIndividual().then((value) { + // Get.back(); + // }); + Get.toNamed(RouteName.mainscreen, arguments: 4); + + return utils.showToast(data.message); + } else { + Get.back(); + return utils.showToast(data.message); + } + } + + EdituploadData() async { + utils.loader(); + String abilitiesIds = selectedabilityid.join(','); + Map updata = { + "club_name": clubNameController.text, + "role_name": rollnameController.text, + "team_name": teamnameController.text, + "start_date": dateController.text, + "end_date": dateController2.text, + "abilities_xids": abilitiesIds, + "timeline_id": id, + }; + final data = await Profilepostmethod().postEditTimeline(updata); + if (data.status == ResponseStatus.SUCCESS) { + Get.back(); + // await EditProfileApi().getEditProfileIndividual().then((value) { + // Get.back(); + // }); + + // utils.showToast(data.message); + // await Future.delayed( + // Duration(milliseconds: 500)); // Add a small delay if needed + // Get.toNamed(RouteName.mainscreen, arguments: 4); + Get.toNamed(RouteName.mainscreen, arguments: 4); + } else { + Get.back(); + return utils.showToast(data.message); + } + } + +// List> _abilityMap = []; + List> _abilityMap = []; + List listData = []; + +// Function to get names from selected IDs + Future> getSelectedNames(List selectedIds) async { + List selectedNames = []; + for (int id in selectedIds) { + for (Map ability in _abilityMap) { + if (ability["id"] == id) { + selectedNames.add(ability["name"]); + break; + } + } + _abilitydrop = + _abilityMap.map((ability) => ability["name"] as String).toList(); + } + + return selectedNames; + } + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: () => FocusManager.instance.primaryFocus?.unfocus(), + child: Scaffold( + // resizeToAvoidBottomInset: false, + // key: _scaffoldKey1, + backgroundColor: const Color(0xFF222935), + extendBody: true, + appBar: const CommonAppbar( + titleTxt: "Add timeline", + ), + body: Obx(() + // { + => + isloading.value + ? const Center( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + CircularProgressIndicator(), + ], + )) + : edited == true + ? Stack(children: [ + Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage( + "assets/images/png/Ellipse 1496.png"), + fit: BoxFit.fill)), + ), + ListView( + physics: const ScrollPhysics(), + children: [ + Padding( + padding: EdgeInsets.symmetric( + horizontal: 16.w), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + sizedBoxHeight(20.h), + text16400white("Club name"), + sizedBoxHeight(15.h), + CustomTextFormField( + textEditingController: + clubNameController, + texttype: TextInputType.text, + hintText: 'Enter club name', + validator: (value) { + if (value!.isEmpty) { + return 'Enter your club name '; + } + return null; + }, + inputFormatters: [ + // LengthLimitingTextInputFormatter(20), + RemoveEmojiInputFormatter(), + FilteringTextInputFormatter + .allow(RegExp('[a-zA-Z ]')) + ], + ), + sizedBoxHeight(25.h), + text16400white("Role in "), + sizedBoxHeight(15.h), + CustomTextFormField( + textEditingController: + rollnameController, + texttype: TextInputType.text, + hintText: + 'Enter role in the club', + validator: (value) { + if (value!.isEmpty) { + return 'Enter role in the club'; + } + return null; + }, + inputFormatters: [ + // LengthLimitingTextInputFormatter(20), + RemoveEmojiInputFormatter(), + FilteringTextInputFormatter + .allow(RegExp('[a-zA-Z ]')) + ], + ), + sizedBoxHeight(25.h), + text16400white("Team name"), + sizedBoxHeight(15.h), + CustomTextFormField( + textEditingController: + teamnameController, + texttype: TextInputType.text, + hintText: 'Enter team name', + validator: (value) { + if (value!.isEmpty) { + return 'Enter your team name '; + } + return null; + }, + inputFormatters: [ + // LengthLimitingTextInputFormatter(20), + RemoveEmojiInputFormatter(), + FilteringTextInputFormatter + .allow(RegExp( + '[a-zA-ZS0-9 ]')), + ], + ), + sizedBoxHeight(25.h), + Row( + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + text16400white( + "Start date "), + sizedBoxHeight(10.h), + GestureDetector( + onTap: () => datePicker( + context, + dateController), + child: AbsorbPointer( + child: + CustomTextFormField( + textEditingController: + dateController, + leadingIcon: + Container( + height: 20.h, + width: 20.w, + child: Center( + child: + Image.asset( + "assets/images/png/calender.png", + height: 20.h, + width: 20.w, + ), + ), + ), + ), + ), + ) + ], + ), + ), + sizedBoxWidth(10.h), + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + text16400white( + "End date"), + sizedBoxHeight(10.h), + GestureDetector( + onTap: () => datePicker( + context, + dateController2), + child: AbsorbPointer( + child: + CustomTextFormField( + textEditingController: + dateController2, + leadingIcon: + Container( + height: 20.h, + width: 20.w, + child: Center( + child: + Image.asset( + "assets/images/png/calender.png", + height: 20.h, + width: 20.w, + ), + ), + ), + ), + ), + ), + sizedBoxHeight(10.h), + Row( + children: [ + Obx(() { + return commonGlassContainer( + border: 1, + borderradius: 2, + height: 20.h, + width: 20.w, + opacity1: 0.24, + opacity2: 0.24, + customWidget: + Transform + .scale( + scale: 1.2, + child: Checkbox( + side: const BorderSide( + color: Color( + 0xFF434A53)), + value: + isChecked + .value, + activeColor: + Colors + .transparent, + checkColor: + Colors + .white, + onChanged: + ((value) { + // isChecked.value = value!; + isChecked + .value = + value!; + if (isChecked + .value) { + // Set end date to today's date + dateController2 + .text = DateFormat( + 'yyyy-MM-dd') + .format( + DateTime.now()); + } else { + // Clear end date when checkbox is unchecked + dateController2 + .clear(); + } + }), + ), + ), + ); + }), + sizedBoxWidth(8.w), + text10400white( + "Present") + ], + ), + ], + ), + ) + ], + ), + text16400white("Ability"), + sizedBoxHeight(15.h), + // CustomDropDownCheckBoxTimeline( + // header: 'Select ability', + // title: '', + // listData: _abilitydrop, + // onItemSelected: getCatIdFromName, + // initiallySelected: abilitiesIds + // .map((id) => id.toString()) + // .toList(), + // ), + CustomDropDownCheckBoxTimeline( + header: 'Select ability', + title: '', + listData: _abilitydrop, + // _abilityMap.map((ability) => ability["name"]).toList(), + onItemSelected: getCatIdFromName, + // (selectedNames) { + // // Convert selected names back to IDs if needed + // List selectedIds = []; + // for (String name in selectedNames) { + // for (Map ability + // in _abilityMap) { + // if (ability["name"] == name) { + // selectedIds.add(ability["id"]); + // break; + // } + // } + // } + // // Use selectedIds as needed + // print(selectedIds); + // }, + initiallySelected: + seelctedNameList, // Pass initially selected names + ), + sizedBoxHeight(80.h), + Padding( + padding: EdgeInsets.symmetric( + horizontal: 20.w), + child: CustomButton( + text: "Add timeline", + onPressed: () { + if (clubNameController.text.isBlank! || + rollnameController + .text.isBlank! || + teamnameController + .text.isBlank! || + dateController + .text.isBlank! || + dateController2 + .text.isBlank! || + selectedabilityid + .isEmpty) { + utils.showToast( + 'Please fill all fields'); + } else { + EdituploadData(); + } + }, + ), + ), + ]), + ) + ]) + ]) + : Stack(children: [ + Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage( + "assets/images/png/Ellipse 1496.png"), + fit: BoxFit.fill)), + ), + ListView( + physics: const ScrollPhysics(), + children: [ + Padding( + padding: EdgeInsets.symmetric( + horizontal: 16.w), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + sizedBoxHeight(20.h), + text16400white("Club name"), + sizedBoxHeight(15.h), + CustomTextFormField( + textEditingController: + clubNameController, + texttype: TextInputType.text, + hintText: 'Enter club name', + validator: (value) { + if (value!.isEmpty) { + return 'Enter your full name '; + } + return null; + }, + inputFormatters: [ + // LengthLimitingTextInputFormatter(20), + RemoveEmojiInputFormatter(), + FilteringTextInputFormatter + .allow(RegExp('[a-zA-Z ]')) + ], + ), + sizedBoxHeight(25.h), + text16400white("Role in the club"), + sizedBoxHeight(15.h), + CustomTextFormField( + textEditingController: + rollnameController, + texttype: TextInputType.text, + hintText: + 'Enter role in the club', + validator: (value) { + if (value!.isEmpty) { + return 'Enter role in the club'; + } + return null; + }, + inputFormatters: [ + // LengthLimitingTextInputFormatter(20), + RemoveEmojiInputFormatter(), + FilteringTextInputFormatter + .allow(RegExp('[a-zA-Z ]')) + ], + ), + sizedBoxHeight(25.h), + text16400white("Team name"), + sizedBoxHeight(15.h), + CustomTextFormField( + textEditingController: + teamnameController, + texttype: TextInputType.text, + hintText: 'Enter team name', + validator: (value) { + if (value!.isEmpty) { + return 'Enter your team name '; + } + return null; + }, + inputFormatters: [ + // LengthLimitingTextInputFormatter(20), + RemoveEmojiInputFormatter(), + FilteringTextInputFormatter + .allow(RegExp( + '[a-zA-ZS0-9 ]')), + ], + ), + sizedBoxHeight(25.h), + Row( + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + text16400white( + "Start date "), + sizedBoxHeight(10.h), + GestureDetector( + onTap: () => datePicker( + context, + dateController), + child: AbsorbPointer( + child: + CustomTextFormField( + textEditingController: + dateController, + leadingIcon: + Container( + height: 20.h, + width: 20.w, + child: Center( + child: + Image.asset( + "assets/images/png/calender.png", + height: 20.h, + width: 20.w, + ), + ), + ), + ), + ), + ) + ], + ), + ), + sizedBoxWidth(10.h), + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + text16400white( + "End date"), + sizedBoxHeight(10.h), + GestureDetector( + onTap: () => datePicker( + context, + dateController2), + child: AbsorbPointer( + child: + CustomTextFormField( + textEditingController: + dateController2, + leadingIcon: + Container( + height: 20.h, + width: 20.w, + child: Center( + child: + Image.asset( + "assets/images/png/calender.png", + height: 20.h, + width: 20.w, + ), + ), + ), + ), + ), + ), + sizedBoxHeight(10.h), + Row( + children: [ + Obx(() { + return commonGlassContainer( + border: 1, + borderradius: 2, + height: 20.h, + width: 20.w, + opacity1: 0.24, + opacity2: 0.24, + customWidget: + Transform + .scale( + scale: 1.2, + child: Checkbox( + side: const BorderSide( + color: Color( + 0xFF434A53)), + value: + isChecked + .value, + activeColor: + Colors + .transparent, + checkColor: + Colors + .white, + onChanged: + ((value) { + // isChecked.value = value!; + isChecked + .value = + value!; + if (isChecked + .value) { + // Set end date to today's date + dateController2 + .text = DateFormat( + 'yyyy-MM-dd') + .format( + DateTime.now()); + } else { + // Clear end date when checkbox is unchecked + dateController2 + .clear(); + } + }), + ), + ), + ); + }), + sizedBoxWidth(8.w), + text10400white( + "Present") + ], + ), + ], + ), + ) + ], + ), + text16400white("Ability"), + sizedBoxHeight(15.h), + CustomDropDownChexkBox( + header: 'Select ability', + title: '', + listData: _abilitydrop, + onItemSelected: getCatIdFromName, + initiallySelected: [], // or pass initial values if needed + ), + sizedBoxHeight(80.h), + Padding( + padding: EdgeInsets.symmetric( + horizontal: 20.w), + child: CustomButton( + text: "Add timeline", + onPressed: () { + if (clubNameController.text.isBlank! || + rollnameController + .text.isBlank! || + teamnameController + .text.isBlank! || + dateController + .text.isBlank! || + dateController2 + .text.isBlank! || + selectedabilityid + .isEmpty) { + utils.showToast( + 'Please fill all fields'); + } else { + UploadData(); + } + }, + ), + ), + ]), + ) + ]) + ]) + + // } + )), + ); + } +} + +class CustomDropDownCheckBoxTimeline extends StatefulWidget { + const CustomDropDownCheckBoxTimeline({ + Key? key, + required this.header, + required this.title, + required this.listData, + required this.onItemSelected, + this.leadingImage, + this.showOtherOption = false, + required this.initiallySelected, + }) : super(key: key); + + final String header; + final String title; + final List listData; + final Function(List) onItemSelected; + final Widget? leadingImage; + final bool showOtherOption; + final List initiallySelected; + + @override + State createState() => + _CustomDropDownCheckBoxTimelineState(); +} + +class _CustomDropDownCheckBoxTimelineState + extends State { + RxBool onDropTap = false.obs; + RxList selectedValues = [].obs; + final TextEditingController _textController = TextEditingController(); + + @override + void initState() { + super.initState(); + selectedValues + .addAll(widget.initiallySelected); // Initialize selectedValues + } + + List> _buildDropdownMenuItems() { + return widget.listData.asMap().entries.map((entry) { + int index = entry.key; + String item = entry.value; + return DropdownMenuItem( + value: item, + child: InkWell( + onTap: () { + setState(() { + if (selectedValues.contains(item)) { + selectedValues.remove(item); + } else { + selectedValues.add(item); + } + _textController.clear(); + widget.onItemSelected(selectedValues.toList()); + }); + }, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Row( + children: [ + Obx(() { + return Checkbox( + value: selectedValues.contains(item), + activeColor: Colors.white, + checkColor: const Color(0xFFD90B2E), + onChanged: (bool? value) { + setState(() { + if (value == true) { + selectedValues.add(item); + } else { + selectedValues.remove(item); + } + _textController.clear(); + widget.onItemSelected(selectedValues.toList()); + }); + }, + ); + }), + const SizedBox(width: 8), + Expanded( + child: Text( + item, + style: const TextStyle( + color: Colors.white, + fontSize: 16, + fontFamily: 'Helvetica', + fontWeight: FontWeight.w500, + ), + maxLines: 1, // Adjust as needed + overflow: TextOverflow.ellipsis, + ), + ), + ], + ), + if (index != widget.listData.length - 1) + const Divider(thickness: 1, color: Color(0xFF434A53)), + ], + ), + ), + ); + }).toList(); + } + + @override + Widget build(BuildContext context) { + return Obx( + () => Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + GestureDetector( + onTap: () { + onDropTap.value = !onDropTap.value; + }, + child: Container( + width: double.infinity, + // height: 50, + padding: const EdgeInsets.only( + right: 22, left: 12, top: 15, bottom: 15), + decoration: BoxDecoration( + color: const Color(0xFFFFFFFF).withOpacity(0.10), + borderRadius: onDropTap.value + ? const BorderRadius.vertical( + top: Radius.circular(30), + ) + : const BorderRadius.all(Radius.circular(30)), + gradient: LinearGradient( + begin: Alignment.topLeft, + end: Alignment.bottomRight, + colors: [ + const Color(0xFFffffff).withOpacity(0.50), + const Color(0xFFFFFFFF).withOpacity(0.50), + ], + ), + border: Border.all(color: const Color(0xFF434A53)), + ), + child: Center( + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + widget.leadingImage == null + ? const SizedBox() + : widget.leadingImage!, + const SizedBox(width: 12), + Expanded( + child: Text( + selectedValues.isEmpty + ? widget.header + : selectedValues.join(', '), + style: const TextStyle( + color: Colors.white, + fontSize: 16, + fontFamily: 'Helvetica', + fontWeight: FontWeight.w400, + ), + // overflow: TextOverflow.ellipsis, + ), + ), + // const Spacer(), + onDropTap.value + ? Image.asset('assets/images/png/arrowup.png') + : Image.asset('assets/images/png/arrowdown.png'), + ], + ), + ), + ), + ), + if (onDropTap.value) + Scrollbar( + child: Container( + width: double.infinity, + decoration: BoxDecoration( + color: const Color(0xFFFFFFFF).withOpacity(0.10), + borderRadius: const BorderRadius.vertical( + bottom: Radius.circular(30), + ), + border: Border.all(color: const Color(0xFF434A53)), + gradient: LinearGradient( + begin: Alignment.topLeft, + end: Alignment.bottomRight, + colors: [ + const Color(0xFFffffff).withOpacity(0.50), + const Color(0xFFFFFFFF).withOpacity(0.50), + ], + ), + ), + child: Column( + children: _buildDropdownMenuItems(), + ), + ), + ), + ], + ), + ); + } +} diff --git a/lib/Feed Module/Main_Screens/ProfileTab/view_model/gettimelineability.dart b/lib/Main_Screens/ProfileTab/view_model/gettimelineability.dart similarity index 90% rename from lib/Feed Module/Main_Screens/ProfileTab/view_model/gettimelineability.dart rename to lib/Main_Screens/ProfileTab/view_model/gettimelineability.dart index 37223ee..cea1867 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/view_model/gettimelineability.dart +++ b/lib/Main_Screens/ProfileTab/view_model/gettimelineability.dart @@ -4,7 +4,7 @@ import 'package:regroup/Common/api_urls.dart'; import 'package:regroup/Common/base_manager.dart'; import 'package:regroup/Common/controller/data/network/network_api.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Model/timelineabilityModel.dart'; +import 'package:regroup/Main_Screens/ProfileTab/Model/timelineabilityModel.dart'; class TimelineAbilityListApi { TimelineAbilityListApi(); diff --git a/lib/Feed Module/Main_Screens/ProfileTab/view_model/profileGetmethod.dart b/lib/Main_Screens/ProfileTab/view_model/profileGetmethod.dart similarity index 81% rename from lib/Feed Module/Main_Screens/ProfileTab/view_model/profileGetmethod.dart rename to lib/Main_Screens/ProfileTab/view_model/profileGetmethod.dart index 15eb216..02c4e0e 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/view_model/profileGetmethod.dart +++ b/lib/Main_Screens/ProfileTab/view_model/profileGetmethod.dart @@ -4,15 +4,15 @@ import 'dart:developer'; import 'package:regroup/Common/api_urls.dart'; import 'package:regroup/Common/base_manager.dart'; import 'package:regroup/Common/controller/data/network/network_api.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Model/accountSessionModel.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Model/certificateModel.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Model/editTimelineModel.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Model/faqModel.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Model/followersModel.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Model/followingModel.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Model/privacyPolicyModel.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Model/termsconditionsModel.dart'; -// import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Model/timelineabilityModel.dart'; +import 'package:regroup/Main_Screens/ProfileTab/Model/accountSessionModel.dart'; +import 'package:regroup/Main_Screens/ProfileTab/Model/certificateModel.dart'; +import 'package:regroup/Main_Screens/ProfileTab/Model/editTimelineModel.dart'; +import 'package:regroup/Main_Screens/ProfileTab/Model/faqModel.dart'; +import 'package:regroup/Main_Screens/ProfileTab/Model/followersModel.dart'; +import 'package:regroup/Main_Screens/ProfileTab/Model/followingModel.dart'; +import 'package:regroup/Main_Screens/ProfileTab/Model/privacyPolicyModel.dart'; +import 'package:regroup/Main_Screens/ProfileTab/Model/termsconditionsModel.dart'; +// import 'package:regroup/Main_Screens/ProfileTab/Model/timelineabilityModel.dart'; FaqModel? faqobj; PrivacypolicyModel? privacyobj; @@ -121,7 +121,7 @@ class Profilegetmethod { if (response.status == ResponseStatus.SUCCESS) { certificateobj = CertificateuserModel.fromJson(response.data); log(certificateobj!.data.toString()); - } + } return response; } } diff --git a/lib/Feed Module/Main_Screens/ProfileTab/view_model/profilePostmethod.dart b/lib/Main_Screens/ProfileTab/view_model/profilePostmethod.dart similarity index 78% rename from lib/Feed Module/Main_Screens/ProfileTab/view_model/profilePostmethod.dart rename to lib/Main_Screens/ProfileTab/view_model/profilePostmethod.dart index 0fc9289..2323265 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/view_model/profilePostmethod.dart +++ b/lib/Main_Screens/ProfileTab/view_model/profilePostmethod.dart @@ -17,112 +17,82 @@ class Profilepostmethod { utf8.encode('RegroupUserName:71%@L%es^bUX94`J9XT*@bh,._WWM{\$%^^&&')); Future> postContactus(updata) async { - print("updata is $updata"); final response = await NetworkApiServices().postApi( updata, ApiUrls.postcontactus, ); - print("response is ${response.data}"); - print("response message is ${response.message}"); return response; } Future> postReportandbug(updata) async { - print("updata is $updata"); final response = await NetworkApiServices().postApi( updata, ApiUrls.postreportbug, ); - print("response is ${response.data}"); - print("response message is ${response.message}"); return response; } Future> postBlockuser(updata) async { - print("updata is $updata"); final response = await NetworkApiServices().postApi( updata, ApiUrls.postblock, ); - print("response is ${response.data}"); - print("response message is ${response.message}"); return response; } Future> postunfollowuser(updata) async { - print("updata is $updata"); final response = await NetworkApiServices().postApi( updata, ApiUrls.postunfollow, ); - print("response is ${response.data}"); - print("response message is ${response.message}"); return response; } Future> postRemoveuser(updata) async { - print("updata is $updata"); final response = await NetworkApiServices().postApi( updata, ApiUrls.postremoveuser, ); - print("response is ${response.data}"); - print("response message is ${response.message}"); return response; } Future> postChangepassword(updata) async { - print("updata is $updata"); final response = await NetworkApiServices().postApi( updata, ApiUrls.postchangepassword, ); - print("response is ${response.data}"); - print("response message is ${response.message}"); return response; } Future> postChangepassverifyotp(updata) async { - print("updata is $updata"); final response = await NetworkApiServices().postApi( updata, ApiUrls.postchangepassverify, ); - print("response is ${response.data}"); - print("response message is ${response.message}"); return response; } Future> postTimeline(updata) async { - print("updata is $updata"); final response = await NetworkApiServices().postApi( updata, ApiUrls.posttimeline, ); - print("response is ${response.data}"); - print("response message is ${response.message}"); return response; } Future> postAccountvisibility(updata) async { - print("updata is $updata"); final response = await NetworkApiServices().postApi( updata, ApiUrls.postaccountvisibility, ); - print("response is ${response.data}"); - print("response message is ${response.message}"); return response; } Future> postDeleteaccount(updata) async { - print("updata is $updata"); final response = await NetworkApiServices().postApi( updata, ApiUrls.postdeleteaccount, ); - print("response is ${response.data}"); - print("response message is ${response.message}"); return response; } @@ -179,7 +149,6 @@ class Profilepostmethod { return ResponseData("success", ResponseStatus.SUCCESS, data: response.data); } else if (response.statusCode == 203) { - print(response.data); return ResponseData("success", ResponseStatus.PRIVATE, data: response.data); } else { @@ -194,46 +163,34 @@ class Profilepostmethod { } Future> postEditTimeline(updata) async { - print("updata is $updata"); final response = await NetworkApiServices().postApi( updata, ApiUrls.postedittimeline, ); - print("response is ${response.data}"); - print("response message is ${response.message}"); return response; } Future> postRemoveTimeline(updata) async { - print("updata is $updata"); final response = await NetworkApiServices().postApi( updata, ApiUrls.postremovetimeline, ); - print("response is ${response.data}"); - print("response message is ${response.message}"); return response; } Future> postRemoveCertification(updata) async { - print("updata is $updata"); final response = await NetworkApiServices().postApi( updata, ApiUrls.postremovecertification, ); - print("response is ${response.data}"); - print("response message is ${response.message}"); return response; } Future> postCertification(updata) async { - print("updata is $updata"); final response = await NetworkApiServices().postApi( updata, ApiUrls.postcertification, ); - print("response is ${response.data}"); - print("response message is ${response.message}"); return response; } diff --git a/lib/Feed Module/Notification/View/notification.dart b/lib/Notifications/notification.dart similarity index 79% rename from lib/Feed Module/Notification/View/notification.dart rename to lib/Notifications/notification.dart index 619f56b..9848a5e 100644 --- a/lib/Feed Module/Notification/View/notification.dart +++ b/lib/Notifications/notification.dart @@ -3,7 +3,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:glassmorphism/glassmorphism.dart'; import 'package:regroup/Utils/Common/CommonAppbar.dart'; import 'package:regroup/Utils/Common/CustomNextButton.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; + import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/texts.dart'; @@ -58,47 +58,14 @@ class _NotificationPageState extends State { body: Stack( children: [ // const CommonBlurLeftRed(), - const Positioned(top: 10, left: -30, child: CommonBlurLeftSecond()), - // const CommonBlurRightRed(), - // const CommonBlurLeft(), - const Positioned(top: 150, right: -30, child: CommonBlurRightSecond()), - const Positioned(top: 350, left: -30, child: CommonBlurLeftBlue()), - GlassmorphicContainer( - width: MediaQuery.of(context).size.width, - height: - // 500.h, - MediaQuery.of(context).size.height, - borderRadius: 2, - blur: 6, - alignment: Alignment.bottomLeft, - border: 2, - linearGradient: LinearGradient( - begin: Alignment.topCenter, - end: Alignment.bottomCenter, - colors: [ - const Color(0XFF222935).withOpacity(0.60), - const Color(0XFF222935).withOpacity(0.60), - const Color(0XFF222935).withOpacity(0.60), - const Color(0XFF222935).withOpacity(0.60), - - // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50), - // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50), - // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50), - // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50), - ], - ), - borderGradient: LinearGradient( - begin: Alignment.topCenter, - end: Alignment.bottomCenter, - colors: [ - // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50), - // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50), - const Color(0XFF222935).withOpacity(0.60), - - const Color(0XFF222935).withOpacity(0.60), - ], - ), - child: Column( + + Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage("assets/images/png/Ellipse 1496.png"), + fit: BoxFit.fill)), + ), + Column( children: [ ListView.separated( separatorBuilder: (context, index) { @@ -121,9 +88,9 @@ class _NotificationPageState extends State { }, ), ], - )), - ], - ), + )]), + + ); } } diff --git a/lib/Utils/Common/CommonAppbar.dart b/lib/Utils/Common/CommonAppbar.dart index 614fd4b..2bb1bb9 100644 --- a/lib/Utils/Common/CommonAppbar.dart +++ b/lib/Utils/Common/CommonAppbar.dart @@ -35,34 +35,36 @@ class CommonAppbar extends StatelessWidget implements PreferredSizeWidget { @override Size get preferredSize => Size.fromHeight(height); - const CommonAppbar({ - Key? key, - required this.titleTxt, - this.showLeading = true, - this.customActionWidget, - this.onCustomActionPressed, - this.showEdit = false, - this.customBack, - this.editPageName, - this.height = 80, - }) : super(key: key); + const CommonAppbar( + {Key? key, + required this.titleTxt, + this.showLeading = true, + this.customActionWidget, + this.onCustomActionPressed, + this.showEdit = false, + this.customBack = false, + this.editPageName, + this.height = 80, + this.customRouteName}) + : super(key: key); final String titleTxt; final bool? showLeading; final Widget? customActionWidget; final VoidCallback? onCustomActionPressed; final bool? showEdit; - final bool? customBack; + final bool customBack; final String? editPageName; final double height; - + final String? customRouteName; @override Widget build(BuildContext context) { return PreferredSize( - preferredSize: Size.fromHeight(80), + preferredSize: const Size.fromHeight(80), child: AppBar( + centerTitle: false, scrolledUnderElevation: 0.0, - backgroundColor: Color(0xFF222935).withOpacity(0.50), + backgroundColor: const Color(0xFF222935).withOpacity(0.50), elevation: 0, automaticallyImplyLeading: false, titleSpacing: 0, @@ -86,7 +88,7 @@ class CommonAppbar extends StatelessWidget implements PreferredSizeWidget { fontFamily: 'Helvetica', fontSize: 20.sp, fontWeight: FontWeight.w400, - color: Color(0xFFFCFCFC), + color: const Color(0xFFFCFCFC), ), ), ), @@ -96,7 +98,7 @@ class CommonAppbar extends StatelessWidget implements PreferredSizeWidget { ) : SingleChildScrollView( scrollDirection: Axis.horizontal, - padding: EdgeInsets.only(top: 10), + padding: const EdgeInsets.only(top: 10), child: Row( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, @@ -112,7 +114,7 @@ class CommonAppbar extends StatelessWidget implements PreferredSizeWidget { fontFamily: 'Helvetica', fontSize: 20.sp, fontWeight: FontWeight.w400, - color: Color(0xFFFCFCFC), + color: const Color(0xFFFCFCFC), ), ), ), @@ -124,16 +126,20 @@ class CommonAppbar extends StatelessWidget implements PreferredSizeWidget { padding: EdgeInsets.only(top: 10.h), child: InkWell( onTap: () { - Get.back(); + if (customBack) { + Get.back(result: true); + } else { + Get.back(); + } }, child: Row( children: [ sizedBoxWidth(10.w), - commonGlassContainer( - border: 0.5, + commonGlassUI( + borderwidth: 0.5, width: 40.w, height: 40.h, - borderradius: 100, + borderRadius: BorderRadius.circular(100), opacity1: 0.24, opacity2: 0.24, customWidget: Center( diff --git a/lib/Utils/Common/CommonDropdown.dart b/lib/Utils/Common/CommonDropdown.dart index 9e4648f..8a9b9d5 100644 --- a/lib/Utils/Common/CommonDropdown.dart +++ b/lib/Utils/Common/CommonDropdown.dart @@ -539,10 +539,12 @@ class _CustomDropDownRadioState extends State { value: item, child: InkWell( onTap: () { - selectedValue.value = item; - _textController.clear(); - widget.onItemSelected(item); - onDropTap.value = !onDropTap.value; + setState(() { + selectedValue.value = item; + _textController.clear(); + widget.onItemSelected(item); + onDropTap.value = false; // Close the dropdown + }); }, child: Column( mainAxisAlignment: MainAxisAlignment.start, @@ -555,9 +557,12 @@ class _CustomDropDownRadioState extends State { activeColor: Colors.white, groupValue: selectedValue.value, onChanged: (value) { - selectedValue.value = value!; - _textController.clear(); - widget.onItemSelected(value); + setState(() { + selectedValue.value = value!; + _textController.clear(); + widget.onItemSelected(value); + onDropTap.value = false; // Close the dropdown + }); }, ); }), @@ -597,9 +602,12 @@ class _CustomDropDownRadioState extends State { activeColor: Colors.white, groupValue: selectedValue.value, onChanged: (value) { - selectedValue.value = value!; - _textController.clear(); - widget.onItemSelected(value); + setState(() { + selectedValue.value = value!; + _textController.clear(); + widget.onItemSelected(value); + onDropTap.value = false; // Close the dropdown + }); }, ); }), @@ -633,8 +641,11 @@ class _CustomDropDownRadioState extends State { TextButton( onPressed: () { if (_textController.text.trim().isNotEmpty) { - selectedValue.value = _textController.text; - widget.onItemSelected(_textController.text); + setState(() { + selectedValue.value = _textController.text; + widget.onItemSelected(_textController.text); + onDropTap.value = false; // Close the dropdown + }); } }, child: const Text( @@ -667,7 +678,9 @@ class _CustomDropDownRadioState extends State { children: [ GestureDetector( onTap: () { - onDropTap.value = !onDropTap.value; + setState(() { + onDropTap.value = !onDropTap.value; + }); }, child: Container( width: double.infinity, @@ -1031,7 +1044,7 @@ class CustomDropDownCheckBox extends StatefulWidget { final String header; final String title; final List listData; - final Function(String) onItemSelected; + final Function(List) onItemSelected; final List images; final Widget? leadingImage; @@ -1135,7 +1148,7 @@ class _CustomDropDownCheckBoxState extends State { } else { selectedValues.add(item); } - widget.onItemSelected(selectedValues.join(', ')); + widget.onItemSelected(selectedValues); }, child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -1182,7 +1195,7 @@ class _CustomDropDownCheckBoxState extends State { selectedValues.remove(item); } widget.onItemSelected( - selectedValues.join(', ')); + selectedValues); }, ), ], diff --git a/lib/Utils/Common/CustomTextformfield.dart b/lib/Utils/Common/CustomTextformfield.dart index 470840a..ad76c16 100644 --- a/lib/Utils/Common/CustomTextformfield.dart +++ b/lib/Utils/Common/CustomTextformfield.dart @@ -31,7 +31,7 @@ class CustomTextFormField extends StatefulWidget { this.onTap, this.suffixIcon, this.opacity1 = 0.04, - this.opacity2 = 0.05, + this.opacity2 = 0.05, this.focusNode, }) : super(key: key); dynamic validator; @@ -52,7 +52,7 @@ class CustomTextFormField extends StatefulWidget { final Widget? suffixIcon; final double opacity1; final double opacity2; - + final FocusNode? focusNode; String? validationMessage; @override @@ -81,7 +81,7 @@ class _CustomTextFormFieldState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ GlassContainer( - height: 50.h, + height: 52.h, width: double.infinity, gradient: LinearGradient( begin: Alignment.topLeft, @@ -97,8 +97,9 @@ class _CustomTextFormFieldState extends State { blur: 6, opacity: 1, borderRadius: BorderRadius.circular(30.r), - border: Border.all(color: Color(0xff434A53), width: 0.8), + border: Border.all(color: const Color(0xff434A53), width: 0.8), child: TextFormField( + focusNode: widget.focusNode, style: TextStyle( fontSize: 16.sp, color: Colors.white, fontFamily: 'Helvetica'), cursorColor: Colors.red, @@ -116,7 +117,7 @@ class _CustomTextFormFieldState extends State { constraints: const BoxConstraints(minHeight: 50), hintStyle: TextStyle( fontSize: 16.sp, - color: Colors.white, + color: const Color.fromARGB(255, 130, 128, 128), fontWeight: FontWeight.w400, fontFamily: 'Helvetica'), prefixIcon: widget.leadingIcon == null @@ -153,9 +154,7 @@ class _CustomTextFormFieldState extends State { ], ), ) - : widget.suffixIcon == null - ? null - : widget.suffixIcon!, + : widget.suffixIcon, border: InputBorder.none, contentPadding: EdgeInsets.symmetric(horizontal: 20.h, vertical: 13.w), @@ -237,8 +236,8 @@ class _CustomTextFormField2State extends State { void validateField(String value) { setState(() { - widget.validationMessage = widget.validator?.call(value) ?? - (value.isEmpty ? "Empty value" : null); + widget.validationMessage = + widget.validator?.call(value) ?? (value.isEmpty ? "" : null); }); } @@ -284,13 +283,12 @@ class _CustomTextFormField2State extends State { hintStyle: TextStyle( fontSize: 16.sp, - color: Colors.white, + color: const Color.fromARGB(255, 130, 128, 128), fontWeight: FontWeight.w400, fontFamily: 'hiragino'), // ignore: prefer_null_aware_operators - prefixIcon: - widget.leadingIcon, + prefixIcon: widget.leadingIcon, suffixIcon: widget.isInputPassword ? GestureDetector( onTap: () => setState(() => obscureText = !obscureText), @@ -334,15 +332,18 @@ class _CustomTextFormField2State extends State { inputFormatters: widget.inputFormatters, onChanged: (value) { widget.onInput?.call(value); + validateField(value); }, ), ), sizedBoxHeight(5.h), - Text( - widget.validationMessage ?? '', - style: TextStyle(color: Colors.red, fontSize: 12.sp), - overflow: TextOverflow.ellipsis, - ), + widget.validationMessage == null + ? const SizedBox() + : Text( + widget.validationMessage ?? '', + style: TextStyle(color: Colors.red, fontSize: 12.sp), + overflow: TextOverflow.ellipsis, + ), ], ); } @@ -464,7 +465,7 @@ class _CustomtextFormFieldPasswordState decoration: InputDecoration( hintStyle: TextStyle( fontSize: 16.sp, - color: Colors.white, + color: const Color.fromARGB(255, 130, 128, 128), fontWeight: FontWeight.w400, fontFamily: 'Helvetica'), labelStyle: const TextStyle(color: Colors.white), @@ -640,7 +641,7 @@ class _SearchTextFormFieldState extends State { constraints: const BoxConstraints(minHeight: 50), hintStyle: TextStyle( fontSize: 16.sp, - color: Colors.white, + color: const Color.fromARGB(255, 130, 128, 128), fontWeight: FontWeight.w400, fontFamily: 'Helvetica'), prefixIcon: diff --git a/lib/Utils/Common/ShimmerCommon.dart b/lib/Utils/Common/ShimmerCommon.dart index 8c2ce55..392b225 100644 --- a/lib/Utils/Common/ShimmerCommon.dart +++ b/lib/Utils/Common/ShimmerCommon.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:shimmer/shimmer.dart'; class ShimmerCommon extends StatelessWidget { @@ -12,15 +13,17 @@ class ShimmerCommon extends StatelessWidget { // Build shimmer effect for the body Widget _buildShimmerBody() { - return ListView.builder( + return ListView.separated( + separatorBuilder: (context, index) { + return SizedBox( + height: 10.h, + ); + }, shrinkWrap: true, scrollDirection: Axis.vertical, itemCount: 4, itemBuilder: (context, index) { - return SizedBox( - height: MediaQuery.of(context).size.height > 700 ? 220 : 270, - child: _buildShimmerInsightWidget(), - ); + return _buildShimmerInsightWidget(); }, ); } @@ -28,36 +31,121 @@ class ShimmerCommon extends StatelessWidget { // Build shimmer UI for InsightWidget Widget _buildShimmerInsightWidget() { return Shimmer.fromColors( - baseColor: Colors.grey[500]!, - highlightColor: Colors.grey[300]!, + baseColor: Colors.white12, + highlightColor: Colors.white24, child: Container( padding: const EdgeInsets.all(16.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Container( - width: double.infinity, - height: 20, - color: Colors.grey[500], + Row( + children: [ + CircleAvatar( + radius: 25.r, + backgroundColor: Colors.grey[300], + ), + SizedBox(width: 12.w), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: 100.w, + height: 16.h, + color: Colors.grey[300], + ), + SizedBox(height: 5.h), + Row( + children: [ + Container( + width: 14.w, + height: 14.w, + color: Colors.grey[300], + ), + SizedBox(width: 7.w), + Container( + width: 60.w, + height: 12.h, + color: Colors.grey[300], + ), + SizedBox(width: 7.w), + Container( + width: 4.sp, + height: 4.sp, + color: Colors.grey[300], + ), + SizedBox(width: 6.w), + Container( + width: 30.w, + height: 12.h, + color: Colors.grey[300], + ), + ], + ) + ], + ), + Spacer(), + Container( + width: 16.w, + height: 18.h, + color: Colors.grey[300], + ), + SizedBox(width: 5.w), + ], ), - const SizedBox(height: 8), + SizedBox(height: 20.h), Container( + height: 360.h, width: double.infinity, - height: 20, - color: Colors.grey[500], - ), - const SizedBox(height: 8), - Container( - width: double.infinity, - height: 20, - color: Colors.grey[500], - ), - const SizedBox(height: 8), - Container( - width: double.infinity, - height: 20, - color: Colors.grey[500], + color: Colors.grey[300], ), + SizedBox(height: 20.h), + Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + // Container( + // width: 30.w, + // height: 30.h, + // color: Colors.grey[300], + // ), + CircleAvatar( + radius: 20.r, + backgroundColor: Colors.grey[300], + ), + SizedBox(width: 12.w), + Container( + width: 60.w, + height: 14.h, + color: Colors.grey[300], + ), + SizedBox(width: 20.w), + CircleAvatar( + radius: 20.r, + backgroundColor: Colors.grey[300], + ), + SizedBox(width: 12.w), + Container( + width: 60.w, + height: 14.h, + color: Colors.grey[300], + ), + SizedBox(width: 12.w), + CircleAvatar( + radius: 20.r, + backgroundColor: Colors.grey[300], + ), + ], + ), + SizedBox(height: 12.h), + Container( + height: 1.h, + width: double.infinity, + color: Colors.grey[300], + ), + SizedBox(height: 12.h), + ], + ) ], ), ), diff --git a/lib/Utils/Helper.dart b/lib/Utils/Helper.dart index 7424236..78c737c 100644 --- a/lib/Utils/Helper.dart +++ b/lib/Utils/Helper.dart @@ -7,6 +7,7 @@ import 'package:flutter/services.dart'; import 'package:image_gallery_saver/image_gallery_saver.dart'; import 'package:path_provider/path_provider.dart'; import 'package:shared_preferences/shared_preferences.dart'; +import 'package:path/path.dart' as path; class Helper { static Future networkImageToMultipartFile( @@ -16,14 +17,24 @@ class Helper { Response response = await dio.get(imageUrl, options: Options(responseType: ResponseType.bytes)); + final cleanedFileName = _cleanFileName(imageUrl); + MultipartFile multipartFile = MultipartFile.fromBytes( response.data!, - filename: imageUrl.substring(imageUrl.lastIndexOf("/") + 1), + filename: cleanedFileName, + // imageUrl.substring(imageUrl.lastIndexOf("/") + 1), ); return multipartFile; } +static String _cleanFileName(String url) { + // Parse the URL and extract the path + final uri = Uri.parse(url); + // Extract the base name from the path, removing any query parameters + return path.basename(uri.path); +} + static Future assetImageToMultipartFile( String assetImagePath, String fileName) async { ByteData assetByteData = await rootBundle.load(assetImagePath); @@ -66,4 +77,19 @@ class Helper { ); } } + + static Future networkImageToFile(String imageUrl) async { + Dio dio = Dio(); + Response response = await dio.get(imageUrl, + options: Options(responseType: ResponseType.bytes)); + + final directory = await getTemporaryDirectory(); + final filePath = '${directory.path}/${imageUrl.split('/').last}'; + + final file = File(filePath); + await file.writeAsBytes(response.data!); + + return file; +} + } diff --git a/lib/Utils/texts.dart b/lib/Utils/texts.dart index e9f3a99..147da88 100644 --- a/lib/Utils/texts.dart +++ b/lib/Utils/texts.dart @@ -45,9 +45,10 @@ Widget text20400white(String text) { ); } -Widget text20400FCFCFC(String text) { +Widget text20400FCFCFC(String text, {TextAlign? textAlign}) { return Text( text, + textAlign: textAlign, style: TextStyle( fontSize: 20.sp, color: const Color(0xFFFCFCFC), @@ -91,10 +92,10 @@ Widget text16400whiteblur(String text) { ); } -Widget text25700white(String text) { +Widget text25700white(String text, {TextAlign? textAlign}) { return Text( text, - // textAlign: TextAlign.center, + textAlign: textAlign, style: TextStyle( fontSize: 25.sp, color: AppColors.white, @@ -172,6 +173,18 @@ Widget text144005DFD63(String text) { ); } +Widget text13400A7A7A7(String text) { + return Text( + text, + // textAlign: TextAlign.center, + style: TextStyle( + fontSize: 13.sp, + color: const Color(0xFFA7A7A7), + fontWeight: FontWeight.w400, + fontFamily: 'Helvetica'), + ); +} + Widget text14400whiteblur(String text, {TextAlign? textAlign}) { return Text( text, @@ -382,9 +395,10 @@ Widget txt20Black(txt) { ); } -Widget text16w400_FCFCFC(String text) { +Widget text16w400_FCFCFC(String text, {TextAlign? textAlign}) { return Text( text, + textAlign: textAlign, style: TextStyle( fontSize: 16.sp, color: const Color(0xFFFCFCFC), @@ -393,6 +407,20 @@ Widget text16w400_FCFCFC(String text) { ); } +Widget text16w700_FCFCFCItalic(String text, {TextAlign? textAlign}) { + return Text( + text, + textAlign: textAlign, + style: TextStyle( + fontSize: 16.sp, + color: const Color(0xFFFCFCFC), + fontFamily: 'Helvetica', + fontWeight: FontWeight.w700, + fontStyle: FontStyle.italic, + ), + ); +} + Widget text16w400_FF0000(String text) { return Text( text, @@ -414,6 +442,7 @@ Widget text10400white(String text) { fontWeight: FontWeight.w400), ); } + Widget text9400white(String text) { return Text( text, @@ -447,9 +476,10 @@ Widget text10400whiteblur(String text) { ); } -Widget text16w700_FCFCFC(String text) { +Widget text16w700_FCFCFC(String text, {TextAlign? textAlign}) { return Text( text, + textAlign: textAlign, style: TextStyle( fontSize: 16.sp, color: const Color(0xFFFCFCFC), @@ -458,6 +488,20 @@ Widget text16w700_FCFCFC(String text) { ); } +Widget text16w700_FCFCFC_line(String text, {TextAlign? textAlign}) { + return Text( + text, + textAlign: textAlign, + style: TextStyle( + decoration: TextDecoration.underline, + decorationColor: Colors.white, + fontSize: 16.sp, + color: const Color(0xFFFCFCFC), + fontFamily: 'Helvetica', + fontWeight: FontWeight.w700), + ); +} + Widget text16w700_D90B2E(String text, {TextDecoration? decoration}) { return Text( text, @@ -471,6 +515,19 @@ Widget text16w700_D90B2E(String text, {TextDecoration? decoration}) { ); } +Widget text14w400_D90B2E(String text, {TextDecoration? decoration}) { + return Text( + text, + style: TextStyle( + decoration: decoration, + decorationColor: const Color(0xFFD90B2E), + fontSize: 14.sp, + color: const Color(0xFFD90B2E), + fontFamily: 'Helvetica', + fontWeight: FontWeight.w400), + ); +} + Widget text16w700_FCFCFCblur(String text) { return Text( text, @@ -540,6 +597,7 @@ Widget text12w400_FCFCFC(String text) { fontWeight: FontWeight.w400), ); } + Widget text12w400_8E8E8E(String text) { return Text( text, @@ -697,6 +755,18 @@ Widget text14w400_FCFCFC(String text, {TextAlign? textAlign}) { ); } +Widget text13w400_FCFCFC(String text, {TextAlign? textAlign}) { + return Text( + text, + textAlign: textAlign, + style: TextStyle( + fontSize: 13.sp, + color: const Color(0xFFFCFCFC), + fontFamily: 'Helvetica', + fontWeight: FontWeight.w400), + ); +} + Widget text14w400_FCFCFCblur(String text) { return Text( text, diff --git a/lib/main.dart b/lib/main.dart index 325010a..171c6cc 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,5 +1,6 @@ import 'dart:async'; import 'dart:io'; + import 'package:connectivity_plus/connectivity_plus.dart'; import 'package:device_info_plus/device_info_plus.dart'; import 'package:firebase_core/firebase_core.dart'; @@ -9,7 +10,6 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:permission_handler/permission_handler.dart'; import 'package:regroup/Utils/dialogs.dart'; -import 'package:regroup/Utils/Common/NoInternet.dart'; import 'package:regroup/firebase_options.dart'; import 'package:regroup/resources/routes/route_name.dart'; import 'package:regroup/resources/routes/routes.dart'; @@ -115,6 +115,7 @@ class _MyAppState extends State with WidgetsBindingObserver { @override Widget build(BuildContext context) { return ScreenUtilInit( + //useInheritedMediaQuery: true, builder: (BuildContext context, Widget? child) => GetMaterialApp( title: 'Regroup', theme: ThemeData( @@ -122,7 +123,10 @@ class _MyAppState extends State with WidgetsBindingObserver { fontFamily: 'Cambria', ), debugShowCheckedModeBanner: false, + // initialRoute: RouteName.individualactivitystep2, + initialRoute: RouteName.splashScreen, + getPages: AppRoutes.appRoutes(), ), designSize: const Size(390, 844), diff --git a/lib/onboarding/Signup/Model/GetUserdetailsModel.dart b/lib/onboarding/Signup/Model/GetUserdetailsModel.dart index 581faf6..3ecb32b 100644 --- a/lib/onboarding/Signup/Model/GetUserdetailsModel.dart +++ b/lib/onboarding/Signup/Model/GetUserdetailsModel.dart @@ -14,10 +14,10 @@ class GetuserdetailsModel { } Map toJson() { - final Map data = new Map(); - data['status'] = this.status; - data['status_code'] = this.statusCode; - data['message'] = this.message; + final Map data = {}; + data['status'] = status; + data['status_code'] = statusCode; + data['message'] = message; if (this.data != null) { data['data'] = this.data!.toJson(); } @@ -52,15 +52,15 @@ class Data { Map toJson() { final Map data = new Map(); - if (this.userData != null) { - data['userData'] = this.userData!.toJson(); + if (userData != null) { + data['userData'] = userData!.toJson(); } - if (this.userCommunity != null) { + if (userCommunity != null) { data['userCommunity'] = - this.userCommunity!.map((v) => v.toJson()).toList(); + userCommunity!.map((v) => v.toJson()).toList(); } - if (this.userGroups != null) { - data['userGroups'] = this.userGroups!.map((v) => v.toJson()).toList(); + if (userGroups != null) { + data['userGroups'] = userGroups!.map((v) => v.toJson()).toList(); } return data; } @@ -129,24 +129,24 @@ class UserData { Map toJson() { final Map data = new Map(); - data['id'] = this.id; - data['principal_type_xid'] = this.principalTypeXid; - data['google_id'] = this.googleId; - data['apple_id'] = this.appleId; - data['user_name'] = this.userName; - data['full_name'] = this.fullName; - data['gender'] = this.gender; - data['date_of_birth'] = this.dateOfBirth; - data['phone_number'] = this.phoneNumber; - data['email_address'] = this.emailAddress; - data['address_line1'] = this.addressLine1; - data['address_line2'] = this.addressLine2; - data['post_code'] = this.postCode; - data['last_login_datetime'] = this.lastLoginDatetime; - data['profile_photo'] = this.profilePhoto; - data['is_profile_updated'] = this.isProfileUpdated; - data['is_active'] = this.isActive; - data['created_at'] = this.createdAt; + data['id'] = id; + data['principal_type_xid'] = principalTypeXid; + data['google_id'] = googleId; + data['apple_id'] = appleId; + data['user_name'] = userName; + data['full_name'] = fullName; + data['gender'] = gender; + data['date_of_birth'] = dateOfBirth; + data['phone_number'] = phoneNumber; + data['email_address'] = emailAddress; + data['address_line1'] = addressLine1; + data['address_line2'] = addressLine2; + data['post_code'] = postCode; + data['last_login_datetime'] = lastLoginDatetime; + data['profile_photo'] = profilePhoto; + data['is_profile_updated'] = isProfileUpdated; + data['is_active'] = isActive; + data['created_at'] = createdAt; return data; } } @@ -180,13 +180,13 @@ class UserCommunity { Map toJson() { final Map data = new Map(); - data['id'] = this.id; - data['iam_principal_xid'] = this.iamPrincipalXid; - data['manage_community_xid'] = this.manageCommunityXid; - data['joined_at'] = this.joinedAt; - data['is_active'] = this.isActive; - if (this.communityData != null) { - data['community_data'] = this.communityData!.toJson(); + data['id'] = id; + data['iam_principal_xid'] = iamPrincipalXid; + data['manage_community_xid'] = manageCommunityXid; + data['joined_at'] = joinedAt; + data['is_active'] = isActive; + if (communityData != null) { + data['community_data'] = communityData!.toJson(); } return data; } @@ -231,16 +231,16 @@ class CommunityData { Map toJson() { final Map data = new Map(); - data['id'] = this.id; - data['community_profile_photo'] = this.communityProfilePhoto; - data['community_banner_image'] = this.communityBannerImage; - data['community_name'] = this.communityName; - data['community_location'] = this.communityLocation; - data['community_description'] = this.communityDescription; - data['community_type_xid'] = this.communityTypeXid; - data['activity_xid'] = this.activityXid; - data['is_active'] = this.isActive; - data['created_at'] = this.createdAt; + data['id'] = id; + data['community_profile_photo'] = communityProfilePhoto; + data['community_banner_image'] = communityBannerImage; + data['community_name'] = communityName; + data['community_location'] = communityLocation; + data['community_description'] = communityDescription; + data['community_type_xid'] = communityTypeXid; + data['activity_xid'] = activityXid; + data['is_active'] = isActive; + data['created_at'] = createdAt; return data; } } @@ -271,12 +271,12 @@ class UserGroups { Map toJson() { final Map data = new Map(); - data['id'] = this.id; - data['iam_principal_xid'] = this.iamPrincipalXid; - data['manage_group_xid'] = this.manageGroupXid; - data['created_at'] = this.createdAt; - if (this.groupData != null) { - data['group_data'] = this.groupData!.toJson(); + data['id'] = id; + data['iam_principal_xid'] = iamPrincipalXid; + data['manage_group_xid'] = manageGroupXid; + data['created_at'] = createdAt; + if (groupData != null) { + data['group_data'] = groupData!.toJson(); } return data; } @@ -318,15 +318,15 @@ class GroupData { Map toJson() { final Map data = new Map(); - data['id'] = this.id; - data['manage_group_type_xid'] = this.manageGroupTypeXid; - data['title'] = this.title; - data['background_image'] = this.backgroundImage; - data['group_image'] = this.groupImage; - data['link'] = this.link; - data['description'] = this.description; - data['is_active'] = this.isActive; - data['created_at'] = this.createdAt; + data['id'] = id; + data['manage_group_type_xid'] = manageGroupTypeXid; + data['title'] = title; + data['background_image'] = backgroundImage; + data['group_image'] = groupImage; + data['link'] = link; + data['description'] = description; + data['is_active'] = isActive; + data['created_at'] = createdAt; return data; } } diff --git a/lib/onboarding/Signup/Model/Onboarding/Individual/CommunitiesModel.dart b/lib/onboarding/Signup/Model/Onboarding/Individual/CommunitiesModel.dart index cd7bcd7..d464c9f 100644 --- a/lib/onboarding/Signup/Model/Onboarding/Individual/CommunitiesModel.dart +++ b/lib/onboarding/Signup/Model/Onboarding/Individual/CommunitiesModel.dart @@ -13,16 +13,16 @@ class GetcommunitiesModel { if (json['data'] != null) { data = []; json['data'].forEach((v) { - data!.add(new Data.fromJson(v)); + data!.add(Data.fromJson(v)); }); } } Map toJson() { - final Map data = new Map(); - data['status'] = this.status; - data['status_code'] = this.statusCode; - data['message'] = this.message; + final Map data = {}; + data['status'] = status; + data['status_code'] = statusCode; + data['message'] = message; if (this.data != null) { data['data'] = this.data!.map((v) => v.toJson()).toList(); } @@ -62,15 +62,15 @@ class Data { } Map toJson() { - final Map data = new Map(); - data['id'] = this.id; - data['community_profile_photo'] = this.communityProfilePhoto; - data['community_banner_image'] = this.communityBannerImage; - data['community_name'] = this.communityName; - data['community_location'] = this.communityLocation; - data['community_description'] = this.communityDescription; - data['community_type_xid'] = this.communityTypeXid; - data['activity_xid'] = this.activityXid; + final Map data = {}; + data['id'] = id; + data['community_profile_photo'] = communityProfilePhoto; + data['community_banner_image'] = communityBannerImage; + data['community_name'] = communityName; + data['community_location'] = communityLocation; + data['community_description'] = communityDescription; + data['community_type_xid'] = communityTypeXid; + data['activity_xid'] = activityXid; return data; } } diff --git a/lib/onboarding/Signup/View/Business/View/busSignupScreen.dart b/lib/onboarding/Signup/View/Business/View/busSignupScreen.dart new file mode 100644 index 0000000..449af88 --- /dev/null +++ b/lib/onboarding/Signup/View/Business/View/busSignupScreen.dart @@ -0,0 +1,587 @@ +import 'dart:io'; + +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter/widgets.dart'; +import 'package:flutter_facebook_auth/flutter_facebook_auth.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:regroup/Common/CommonGlassmorphism.dart'; +import 'package:regroup/Common/base_manager.dart'; +import 'package:regroup/Global.dart'; +import 'package:regroup/Login/ViewModel/LoginApi.dart'; +import 'package:regroup/Utils/Common/AppleOAuthService.dart'; +import 'package:regroup/Utils/Common/CommonDropdown.dart'; +import 'package:regroup/Utils/Common/CustomTextformfield.dart'; +import 'package:regroup/Utils/Common/CustomNextButton.dart'; +import 'package:regroup/Utils/Common/googleOAuthService.dart'; +import 'package:regroup/Utils/Common/sized_box.dart'; +import 'package:regroup/Utils/dialogs.dart'; +import 'package:regroup/Utils/texts.dart'; +import 'package:regroup/onboarding/Signup/view_model/postmethod.dart'; +import 'package:regroup/resources/routes/route_name.dart'; +import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart'; +import 'package:shared_preferences/shared_preferences.dart'; + +class BusSignUpScreen extends StatefulWidget { + const BusSignUpScreen({super.key}); + + @override + State createState() => _BusSignUpScreenState(); +} + +class _BusSignUpScreenState extends State { + TextEditingController emailidcontroller = TextEditingController(); + TextEditingController passwordController = TextEditingController(); + TextEditingController confirmpasscontroller = TextEditingController(); + AccessToken? _accessToken; + + final GlobalKey _formKey = GlobalKey(); + GoogleAuthService googleSigninController = Get.put(GoogleAuthService()); + + final Map _accountTypeMap = { + 'Individual': 1, + 'Business': 2, + }; + + String _selectedAccountType = ''; + + void _onItemSelected(String value) { + setState(() { + _selectedAccountType = value; + }); + } + + _loginWithApple() { + AppleOAuthService().logIn(); + } + + _loginWithGoogle() { + googleSigninController.handleGoogleSignIn().then((value) async { + final resp = await LoginAPI().storeGoogleSignin( + {"google_access_token": value, "one_signal_player_id": "ABCD"}); + if (value != 'Google Sign-In canceled') { + if (resp.message == "go-to-signin-via-oauth") { + Get.toNamed(RouteName.verifygoogleapplepage, + arguments: {"email": resp.data}); + } else if (value == null) { + Get.snackbar( + 'Error', + resp.data["message"][0], + duration: const Duration(seconds: 2), + snackPosition: SnackPosition.BOTTOM, + backgroundColor: Colors.red, + colorText: Colors.white, + ); + } else { + Get.snackbar( + "Success!", + 'Login successful!', + duration: const Duration(seconds: 2), + colorText: Colors.white, + backgroundColor: Colors.green, + margin: const EdgeInsets.all(8), + snackStyle: SnackStyle.FLOATING, + snackPosition: SnackPosition.BOTTOM, + ); + //Get.toNamed(RouteName.mainscreen); + logger.d("go to login"); + } + } else { + Get.snackbar( + 'Error', + resp.data["message"][0], + snackPosition: SnackPosition.BOTTOM, + backgroundColor: Colors.red, + colorText: Colors.white, + ); + } + }); + } + + _checkIfisLoggedIn() async { + await _logout(); + final accessToken = await FacebookAuth.instance.accessToken; + if (accessToken != null) { + print("/////////////////////////////////////////xcheck"); + + final userData = await FacebookAuth.instance.getUserData(); + + logger.i(accessToken.token); + logger.i(userData.toString()); + } else { + print("/////////////////////////////////////////check"); + _login(); + } + } + + _login() async { + final LoginResult result = await FacebookAuth.instance.login(); + + if (result.status == LoginStatus.success) { + _accessToken = result.accessToken; + + final userData = await FacebookAuth.instance.getUserData(); + logger.i(userData['email']); + logger.i(userData['id']); + + await LoginAPI().storeFacebookSignin( + {"facebook_auth_token": userData['id']}, + emailReceived: userData['email']); + } else { + print(result.status); + print(result.message); + } + } + + _logout() async { + await FacebookAuth.instance.logOut(); + _accessToken = null; + setState(() {}); + } + + Uploadata() async { + SharedPreferences prefs = await SharedPreferences.getInstance(); + utils.loader(); + int accountTypeValue = _accountTypeMap[_selectedAccountType] ?? 0; + Map updata = { + "email_address": emailidcontroller.text, + "password": passwordController.text, + "account_type": "2", + }; + + final data = await Onboard().Postregisteration(updata); + if (data.status == ResponseStatus.SUCCESS) { + Get.back(); + print("Sign up done"); + globalAccountType = "2"; + + String selectedCategory = _selectedAccountType; + + Get.toNamed(RouteName.verifyusercreen, arguments: { + "emailid": emailidcontroller.text, + "password": passwordController.text, + "accounttype": "Business", + 'accountypenumber': 2 + }); + + return utils.showToast(data.message); + } else { + Get.back(); + print("registration not done"); + return utils.showToast(data.message); + } + } + + @override + void initState() { + super.initState(); + } + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: () => FocusManager.instance.primaryFocus?.unfocus(), + child: Scaffold( + resizeToAvoidBottomInset: false, + backgroundColor: const Color.fromARGB(255, 18, 32, 47), + body: Stack( + children: [ + Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage("assets/images/png/background.png"), + fit: BoxFit.fill)), + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + sizedBoxHeight(80.h), + Padding( + padding: EdgeInsets.symmetric(horizontal: 16.w), + child: Row( + children: [ + InkWell( + onTap: () { + Get.back(); + }, + child: commonGlassUI( + borderwidth: 0.5, + width: 40.w, + height: 40.h, + borderRadius: BorderRadius.circular(100), + opacity1: 0.24, + opacity2: 0.24, + customWidget: Center( + child: Image.asset( + 'assets/images/png/ph_arrow-up-thin.png', + height: 25.h, + width: 25.w, + )), + ), + ), + sizedBoxWidth(16.w), + text14400whiteblur( + "Back to individual account creation") + ], + ), + ), + sizedBoxHeight(50.h), + Center(child: text22400white('Create business account')), + Expanded( + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: 16.w, vertical: 35.h), + child: SingleChildScrollView( + child: Form( + key: _formKey, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + text16400white('Email address'), + sizedBoxHeight(10.h), + CustomTextFormField( + textEditingController: emailidcontroller, + hintText: "Enter your email address", + leadingIcon: + // const Icon(Icons.mail_outline), + SizedBox( + width: 22.w, + height: 17.h, + child: Image.asset( + 'assets/images/png/mail.png', + width: 22.w, + height: 17.h, + ), + ), + // validatorText: "Email Id", + validator: (value) { + if (value!.isEmpty) { + return 'Enter your e-mail address'; + } + if (!RegExp( + r'^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$') + .hasMatch(value)) { + return 'Enter a valid e-mail address'; + } + return null; + }, + inputFormatters: [ + LengthLimitingTextInputFormatter(50), + RemoveEmojiInputFormatter() + ], + ), + sizedBoxHeight(10.h), + text16400white('Password'), + sizedBoxHeight(10.h), + CustomTextFormField( + isInputPassword: true, + textEditingController: passwordController, + hintText: 'Enter your password', + leadingIcon: Image.asset( + 'assets/images/png/lock.png', + width: 22.w, + height: 17.h, + ), + // const Icon(Icons.lock_outline), + // validationMessage: "Enter your password", + validator: (val) { + if (val == null || val.isEmpty) { + return 'Please enter your password'; + } + return null; + }, + inputFormatters: [ + LengthLimitingTextInputFormatter(50), + RemoveEmojiInputFormatter() + ], + ), + sizedBoxHeight(10.h), + text16400white('Confirm password'), + sizedBoxHeight(10.h), + CustomTextFormField( + isInputPassword: true, + textEditingController: confirmpasscontroller, + hintText: "Enter your password", + leadingIcon: Image.asset( + 'assets/images/png/lock.png', + width: 22.w, + height: 17.h, + ), + // const Icon(Icons.lock_outline), + // validatorText: "Enter your password", + validator: (val) { + if (val == null || val.isEmpty) { + return 'Please enter your password'; + } + if (val != passwordController.text) { + return 'Password does not match'; + } + return null; + }, + inputFormatters: [ + LengthLimitingTextInputFormatter(50), + RemoveEmojiInputFormatter() + ], + ), + sizedBoxHeight(10.h), + // Row( + // children: [ + // text16400white('Account type'), + // sizedBoxWidth(5.w), + // Image.asset( + // 'assets/images/png/informationicon.png') + // ], + // ), + // sizedBoxHeight(10.h), + // CustomDropDownRadio( + // header: 'Select account type', + // title: '', + // listData: const [ + // 'Individual', + // 'Business', + // ], + // onItemSelected: _onItemSelected, + // leadingImage: Image.asset( + // 'assets/images/png/user.png', + // ), + // ), + sizedBoxHeight(30.h), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + SizedBox( + width: 320.w, + // height: 42.h, + child: Text.rich( + TextSpan( + children: [ + TextSpan( + text: + 'By signing up to ReGroup you agree to our ', + style: TextStyle( + color: const Color(0xCCFCFCFC), + fontSize: 14.sp, + fontFamily: 'Helvetica', + fontWeight: FontWeight.w400, + ), + ), + TextSpan( + text: 'Terms and Conditions', + style: TextStyle( + color: const Color(0xCCFCFCFC), + fontSize: 14.sp, + fontFamily: 'Helvetica', + fontWeight: FontWeight.w700, + decoration: + TextDecoration.underline, + decorationColor: + const Color(0xffFCFCFC) + .withOpacity(0.80), + ), + ), + TextSpan( + text: ' and ', + style: TextStyle( + color: const Color(0xCCFCFCFC), + fontSize: 14.sp, + fontFamily: 'Helvetica', + fontWeight: FontWeight.w400, + ), + ), + TextSpan( + text: 'Privacy Policy', + style: TextStyle( + color: const Color(0xCCFCFCFC), + fontSize: 14.sp, + fontFamily: 'Helvetica', + fontWeight: FontWeight.w700, + decoration: + TextDecoration.underline, + decorationColor: + const Color(0xffFCFCFC) + .withOpacity(0.80), + ), + ), + ], + ), + textAlign: TextAlign.center, + ), + ), + ], + ), + sizedBoxHeight(20.h), + CustomButton( + text: "Continue", + onPressed: () { + // _Signincheck(); + final isValid = + _formKey.currentState?.validate(); + if ( + // isValid! + emailidcontroller.text.isBlank! || + passwordController.text.isBlank! || + confirmpasscontroller.text.isBlank! + // && _selectedAccountType.isEmpty + ) { + print(emailidcontroller.text); + print(passwordController.text); + print(_selectedAccountType.toString()); + utils.showToast('Please fill all fields'); + } else { + Uploadata(); + } + }), + sizedBoxHeight(20.h), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + width: 160, + decoration: const ShapeDecoration( + shape: RoundedRectangleBorder( + side: BorderSide( + width: 0.50, + strokeAlign: + BorderSide.strokeAlignCenter, + color: Color(0xFF434A53), + ), + ), + ), + ), + sizedBoxWidth(6.w), + text14400white('Or'), + sizedBoxWidth(6.w), + Container( + width: 160, + decoration: const ShapeDecoration( + shape: RoundedRectangleBorder( + side: BorderSide( + width: 0.50, + strokeAlign: + BorderSide.strokeAlignCenter, + color: Color(0xFF434A53), + ), + ), + ), + ), + ], + ), + sizedBoxHeight(20.h), + Center( + child: SizedBox( + width: 220.w, + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceAround, + children: [ + if (Platform.isIOS) + GestureDetector( + onTap: () { + _loginWithApple(); + }, + child: Container( + width: 55, + height: 55, + decoration: ShapeDecoration( + gradient: LinearGradient( + begin: const Alignment( + 0.71, -0.70), + end: const Alignment( + -0.71, 0.7), + colors: [ + Colors.white.withOpacity( + 0.07999999821186066), + Colors.white.withOpacity( + 0.12999999523162842) + ], + ), + shape: const OvalBorder( + side: BorderSide( + width: 0.50, + color: Color(0xFF434A53)), + ), + image: const DecorationImage( + image: AssetImage( + 'assets/images/png/login2.png'))), + ), + ), + if (Platform.isAndroid) + GestureDetector( + onTap: () { + _loginWithGoogle(); + }, + child: Container( + width: 55, + height: 55, + decoration: ShapeDecoration( + gradient: LinearGradient( + begin: const Alignment( + 0.71, -0.70), + end: const Alignment( + -0.71, 0.7), + colors: [ + Colors.white.withOpacity( + 0.07999999821186066), + Colors.white.withOpacity( + 0.12999999523162842) + ], + ), + shape: const OvalBorder( + side: BorderSide( + width: 0.50, + color: Color(0xFF434A53)), + ), + image: const DecorationImage( + image: AssetImage( + 'assets/images/png/login3.png'))), + ), + ), + GestureDetector( + onTap: () async { + _checkIfisLoggedIn(); + }, + child: Container( + width: 55, + height: 55, + decoration: ShapeDecoration( + gradient: LinearGradient( + begin: const Alignment( + 0.71, -0.70), + end: + const Alignment(-0.71, 0.7), + colors: [ + Colors.white.withOpacity( + 0.07999999821186066), + Colors.white.withOpacity( + 0.12999999523162842) + ], + ), + shape: const OvalBorder( + side: BorderSide( + width: 0.50, + color: Color(0xFF434A53)), + ), + image: const DecorationImage( + image: AssetImage( + 'assets/images/png/login4.png'))), + ), + ), + ], + ), + ), + ), + sizedBoxHeight(20.h), + ], + ), + ), + ), + ), + ) + ], + ), + ], + )), + ); + } +} diff --git a/lib/onboarding/Signup/View/Business/View/step1Letusunderstandbetter.dart b/lib/onboarding/Signup/View/Business/View/step1Letusunderstandbetter.dart index f60173a..44d681e 100644 --- a/lib/onboarding/Signup/View/Business/View/step1Letusunderstandbetter.dart +++ b/lib/onboarding/Signup/View/Business/View/step1Letusunderstandbetter.dart @@ -8,7 +8,7 @@ import 'package:glassmorphism/glassmorphism.dart'; import 'package:regroup/Common/base_manager.dart'; import 'package:regroup/Utils/Common/CustomNextButton.dart'; import 'package:regroup/Utils/Common/ImageUpload.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; + import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/dialogs.dart'; import 'package:regroup/Utils/texts.dart'; @@ -98,23 +98,25 @@ class _LetusUnderstandState extends State { Get.snackbar( "Success!", 'success!', - duration: Duration(seconds: 2), + duration: const Duration(seconds: 2), colorText: Colors.white, backgroundColor: Colors.green, - margin: EdgeInsets.all(8), + margin: const EdgeInsets.all(8), snackStyle: SnackStyle.FLOATING, snackPosition: SnackPosition.BOTTOM, ); - Get.toNamed(RouteName.individualgroupstep3); + // Get.toNamed(RouteName.individualgroupstep3); + + Get.toNamed(RouteName.individualcommunitystep4); } else if (data.status == ResponseStatus.FAILED) { Get.snackbar( "Error!", data.message, - duration: Duration(seconds: 2), + duration: const Duration(seconds: 2), colorText: Colors.white, backgroundColor: Colors.red, - margin: EdgeInsets.all(8), + margin: const EdgeInsets.all(8), snackStyle: SnackStyle.FLOATING, snackPosition: SnackPosition.BOTTOM, ); @@ -124,10 +126,10 @@ class _LetusUnderstandState extends State { Get.snackbar( "Error!", data.data['message'], - duration: Duration(seconds: 2), + duration: const Duration(seconds: 2), colorText: Colors.white, backgroundColor: Colors.red, - margin: EdgeInsets.all(8), + margin: const EdgeInsets.all(8), snackStyle: SnackStyle.FLOATING, snackPosition: SnackPosition.BOTTOM, ); @@ -153,7 +155,7 @@ class _LetusUnderstandState extends State { Widget durationPickerDialog() { int selectedHour = 1; return AlertDialog( - title: Text('Select Duration'), + title: const Text('Select Duration'), content: Container( width: double.minPositive, child: Container( @@ -178,7 +180,7 @@ class _LetusUnderstandState extends State { ), actions: [ TextButton( - child: Text('Cancel'), + child: const Text('Cancel'), onPressed: () { Navigator.of(context).pop(); }, @@ -190,7 +192,7 @@ class _LetusUnderstandState extends State { @override Widget build(BuildContext context) { return Scaffold( - backgroundColor: Color.fromARGB(255, 18, 32, 47), + backgroundColor: const Color.fromARGB(255, 18, 32, 47), body: Stack( children: [ // Positioned(top: 70, left: -30, child: CommonBlurLeftSecond()), @@ -274,7 +276,8 @@ class _LetusUnderstandState extends State { height: 25.h, decoration: ShapeDecoration( shape: RoundedRectangleBorder( - side: BorderSide(width: 1, color: Color(0xFF434A53)), + side: const BorderSide( + width: 1, color: Color(0xFF434A53)), borderRadius: BorderRadius.circular(30), ), ), @@ -287,7 +290,7 @@ class _LetusUnderstandState extends State { width: 15, height: 15, decoration: ShapeDecoration( - gradient: LinearGradient( + gradient: const LinearGradient( begin: Alignment(0.98, -0.21), end: Alignment(-0.98, 0.21), colors: [ @@ -311,7 +314,7 @@ class _LetusUnderstandState extends State { Center( child: Container( width: 154.w, - decoration: ShapeDecoration( + decoration: const ShapeDecoration( shape: RoundedRectangleBorder( side: BorderSide( width: 1, @@ -488,8 +491,8 @@ class _LetusUnderstandState extends State { inputFormatters: [ // LengthLimitingTextInputFormatter(20), RemoveEmojiInputFormatter(), - FilteringTextInputFormatter.allow( - RegExp('[a-zA-ZS0-9 ]')), + // FilteringTextInputFormatter.allow( + // RegExp('[a-zA-ZS0-9 ]')), ], ), // sizedBoxHeight(10.h), @@ -518,8 +521,8 @@ class _LetusUnderstandState extends State { inputFormatters: [ // LengthLimitingTextInputFormatter(20), RemoveEmojiInputFormatter(), - FilteringTextInputFormatter.allow( - RegExp('[a-zA-ZS0-9 ]')), + // FilteringTextInputFormatter.allow( + // RegExp('[a-zA-ZS0-9 ]')), ], ), // sizedBoxHeight(10.h), @@ -566,8 +569,8 @@ class _LetusUnderstandState extends State { height: 115, decoration: ShapeDecoration( gradient: LinearGradient( - begin: Alignment(0.98, -0.21), - end: Alignment(-0.98, 0.21), + begin: const Alignment(0.98, -0.21), + end: const Alignment(-0.98, 0.21), colors: [ Colors.white .withOpacity(0.30000001192092896), @@ -576,7 +579,7 @@ class _LetusUnderstandState extends State { ], ), shape: RoundedRectangleBorder( - side: BorderSide( + side: const BorderSide( width: 0.50, color: Color(0xFF7E7E7E)), borderRadius: BorderRadius.circular(10), ), @@ -604,13 +607,13 @@ class _LetusUnderstandState extends State { width: 27, height: 27, decoration: ShapeDecoration( - color: Color(0xFF7E7E7E), + color: const Color(0xFF7E7E7E), shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular( 5)), ), - child: Icon( + child: const Icon( Icons.delete_outline_outlined, color: Colors.white, ) @@ -644,8 +647,8 @@ class _LetusUnderstandState extends State { height: 115, decoration: ShapeDecoration( gradient: LinearGradient( - begin: Alignment(0.98, -0.21), - end: Alignment(-0.98, 0.21), + begin: const Alignment(0.98, -0.21), + end: const Alignment(-0.98, 0.21), colors: [ Colors.white .withOpacity(0.30000001192092896), @@ -654,7 +657,7 @@ class _LetusUnderstandState extends State { ], ), shape: RoundedRectangleBorder( - side: BorderSide( + side: const BorderSide( width: 0.50, color: Color(0xFF7E7E7E)), borderRadius: BorderRadius.circular(10), @@ -688,8 +691,8 @@ class _LetusUnderstandState extends State { height: 115, decoration: ShapeDecoration( gradient: LinearGradient( - begin: Alignment(0.98, -0.21), - end: Alignment(-0.98, 0.21), + begin: const Alignment(0.98, -0.21), + end: const Alignment(-0.98, 0.21), colors: [ Colors.white .withOpacity(0.30000001192092896), @@ -698,7 +701,7 @@ class _LetusUnderstandState extends State { ], ), shape: RoundedRectangleBorder( - side: BorderSide( + side: const BorderSide( width: 0.50, color: Color(0xFF7E7E7E)), borderRadius: BorderRadius.circular(10), ), @@ -726,13 +729,13 @@ class _LetusUnderstandState extends State { width: 27, height: 27, decoration: ShapeDecoration( - color: Color(0xFF7E7E7E), + color: const Color(0xFF7E7E7E), shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular( 5)), ), - child: Icon( + child: const Icon( Icons.delete_outline_outlined, color: Colors.white, ) @@ -766,8 +769,8 @@ class _LetusUnderstandState extends State { height: 115, decoration: ShapeDecoration( gradient: LinearGradient( - begin: Alignment(0.98, -0.21), - end: Alignment(-0.98, 0.21), + begin: const Alignment(0.98, -0.21), + end: const Alignment(-0.98, 0.21), colors: [ Colors.white .withOpacity(0.30000001192092896), @@ -776,7 +779,7 @@ class _LetusUnderstandState extends State { ], ), shape: RoundedRectangleBorder( - side: BorderSide( + side: const BorderSide( width: 0.50, color: Color(0xFF7E7E7E)), borderRadius: BorderRadius.circular(10), diff --git a/lib/onboarding/Signup/View/Business/View/step2Selectgroup.dart b/lib/onboarding/Signup/View/Business/View/step2Selectgroup.dart index 514e86c..85da716 100644 --- a/lib/onboarding/Signup/View/Business/View/step2Selectgroup.dart +++ b/lib/onboarding/Signup/View/Business/View/step2Selectgroup.dart @@ -29,46 +29,14 @@ class _SelectgroupStep2State extends State { backgroundColor: Color.fromARGB(255, 18, 32, 47), body: Stack( children: [ - Positioned(top: 70, left: -30, child: CommonBlurLeftSecond()), - Positioned(top: 400, right: -30, child: CommonBlurRightSecond()), - Positioned(top: 630, left: -30, child: CommonBlurLeftBlue()), - SingleChildScrollView( - child: GlassmorphicContainer( - width: MediaQuery.of(context).size.width, - height: - // 500.h, - MediaQuery.of(context).size.height, - borderRadius: 2, - blur: 6, - alignment: Alignment.bottomLeft, - border: 2, - linearGradient: LinearGradient( - begin: Alignment.topCenter, - end: Alignment.bottomCenter, - colors: [ - Color(0XFF222935).withOpacity(0.60), - Color(0XFF222935).withOpacity(0.60), - Color(0XFF222935).withOpacity(0.60), - Color(0XFF222935).withOpacity(0.60), - - // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50), - // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50), - // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50), - // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50), - ], - ), - borderGradient: LinearGradient( - begin: Alignment.topCenter, - end: Alignment.bottomCenter, - colors: [ - // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50), - // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50), - Color(0XFF222935).withOpacity(0.60), - - Color(0XFF222935).withOpacity(0.60), - ], - ), - child: Padding( + Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage("assets/images/png/Ellipse 1496.png"), + fit: BoxFit.fill)), + ), + + Padding( padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 50.h), child: Column( @@ -241,10 +209,10 @@ class _SelectgroupStep2State extends State { }) ], ), - )), - ), - ], - )); + )],), + + + ); } } diff --git a/lib/onboarding/Signup/View/Business/View/step3SelectCommunity.dart b/lib/onboarding/Signup/View/Business/View/step3SelectCommunity.dart index 9a678d8..4f16c3f 100644 --- a/lib/onboarding/Signup/View/Business/View/step3SelectCommunity.dart +++ b/lib/onboarding/Signup/View/Business/View/step3SelectCommunity.dart @@ -29,46 +29,13 @@ class _SelectBusinessCommunityState extends State { backgroundColor: const Color.fromARGB(255, 18, 32, 47), body: Stack( children: [ - const Positioned(top: 70, left: -30, child: CommonBlurLeftSecond()), - const Positioned(top: 400, right: -30, child: CommonBlurRightSecond()), - const Positioned(top: 630, left: -30, child: CommonBlurLeftBlue()), - SingleChildScrollView( - child: GlassmorphicContainer( - width: MediaQuery.of(context).size.width, - height: - // 500.h, - MediaQuery.of(context).size.height, - borderRadius: 2, - blur: 6, - alignment: Alignment.bottomLeft, - border: 2, - linearGradient: LinearGradient( - begin: Alignment.topCenter, - end: Alignment.bottomCenter, - colors: [ - const Color(0XFF222935).withOpacity(0.60), - const Color(0XFF222935).withOpacity(0.60), - const Color(0XFF222935).withOpacity(0.60), - const Color(0XFF222935).withOpacity(0.60), - - // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50), - // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50), - // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50), - // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50), - ], - ), - borderGradient: LinearGradient( - begin: Alignment.topCenter, - end: Alignment.bottomCenter, - colors: [ - // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50), - // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50), - const Color(0XFF222935).withOpacity(0.60), - - const Color(0XFF222935).withOpacity(0.60), - ], - ), - child: Padding( + Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage("assets/images/png/Ellipse 1496.png"), + fit: BoxFit.fill)), + ), + Padding( padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 50.h), child: Column( @@ -242,10 +209,10 @@ class _SelectBusinessCommunityState extends State { }) ], ), - )), - ), - ], - )); + )]), + + + ); } } diff --git a/lib/onboarding/Signup/View/Business/View/tellusbusiness.dart b/lib/onboarding/Signup/View/Business/View/tellusbusiness.dart index 73fe783..cbcddb9 100644 --- a/lib/onboarding/Signup/View/Business/View/tellusbusiness.dart +++ b/lib/onboarding/Signup/View/Business/View/tellusbusiness.dart @@ -4,10 +4,11 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:glassmorphism/glassmorphism.dart'; import 'package:regroup/Common/base_manager.dart'; +import 'package:regroup/Global.dart'; import 'package:regroup/Utils/Common/CommonDropdown.dart'; import 'package:regroup/Utils/Common/CustomNextButton.dart'; import 'package:regroup/Utils/Common/CustomTextformfield.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; + import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/dialogs.dart'; import 'package:regroup/Utils/texts.dart'; @@ -83,7 +84,7 @@ class _TellusaboutBusinessState extends State { Map updata = { "business_name": businessNameController.text, "business_owner_name": businessownerController.text, - "business_location": businessownerController.text, + "business_location": businesslocationController.text, "business_type_xid": businessTypeId, }; final data = await BusinessAPI().tellUsBusinessApi(updata); @@ -98,6 +99,7 @@ class _TellusaboutBusinessState extends State { snackStyle: SnackStyle.FLOATING, snackPosition: SnackPosition.BOTTOM, ); + mainWelcomeName = businessownerController.text; Get.toNamed(RouteName.businessletusunderstandstep1); } else if (data.status == ResponseStatus.FAILED) { @@ -129,12 +131,11 @@ class _TellusaboutBusinessState extends State { @override Widget build(BuildContext context) { return WillPopScope( - onWillPop: ()async { + onWillPop: () async { // SystemNavigator.pop(); - Navigator.pop(context); + Navigator.pop(context); return true; - }, child: GestureDetector( onTap: () => FocusManager.instance.primaryFocus?.unfocus(), diff --git a/lib/onboarding/Signup/View/Individual/FindCommunityPage.dart b/lib/onboarding/Signup/View/Individual/FindCommunityPage.dart new file mode 100644 index 0000000..b8581e7 --- /dev/null +++ b/lib/onboarding/Signup/View/Individual/FindCommunityPage.dart @@ -0,0 +1,44 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:regroup/Common/CommonButton.dart'; +import 'package:regroup/Utils/Common/sized_box.dart'; +import 'package:regroup/Utils/texts.dart'; +import 'package:regroup/resources/routes/route_name.dart'; + +class FindCommunityPage extends StatelessWidget { + const FindCommunityPage({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: Color(0xFF222935), + body: SingleChildScrollView( + child: Padding( + padding: EdgeInsets.symmetric( + vertical: 60.h, + ), + child: Column(children: [ + sizedBoxHeight(40.h), + Image.asset("assets/images/png/Organizing projects-pana 1.png"), + sizedBoxHeight(30.h), + Padding( + padding: EdgeInsets.symmetric(horizontal: 10.w), + child: Column(children: [ + text20400FCFCFC( + '''ReGroup helps organise individuals into groups, and groups within communities. For example, an individual is part of a local football club, while all the football clubs in the city form a wider football community. If you already know which communities you're interested in, you can search for them here.''', + textAlign: TextAlign.center), + sizedBoxHeight(20.h), + CommonBtn( + text: "Find communities", + onTap: () { + // individualcommunitystep4 + // Get.toNamed(RouteName.individualgroupstep3); + Get.toNamed(RouteName.individualcommunitystep4); + }), + ]), + ), + ])), + )); + } +} diff --git a/lib/onboarding/Signup/View/Individual/step1Selectprofile.dart b/lib/onboarding/Signup/View/Individual/step1Selectprofile.dart index 097b0e0..430ec5c 100644 --- a/lib/onboarding/Signup/View/Individual/step1Selectprofile.dart +++ b/lib/onboarding/Signup/View/Individual/step1Selectprofile.dart @@ -2,9 +2,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:get/get.dart'; -import 'package:glassmorphism/glassmorphism.dart'; import 'package:regroup/Utils/Common/CustomNextButton.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/texts.dart'; import 'package:regroup/resources/routes/route_name.dart'; @@ -26,45 +24,14 @@ class _SelectIndividualProfileState extends State { backgroundColor: const Color.fromARGB(255, 18, 32, 47), body: Stack( children: [ - const Positioned(top: 70, left: -30, child: CommonBlurLeftSecond()), - const Positioned(top: 310, right: -30, child: CommonBlurRightSecond()), - const Positioned(top: 540, left: -30, child: CommonBlurLeftBlue()), - GlassmorphicContainer( - width: MediaQuery.of(context).size.width, - height: - // 500.h, - MediaQuery.of(context).size.height, - borderRadius: 2, - blur: 6, - alignment: Alignment.bottomLeft, - border: 2, - linearGradient: LinearGradient( - begin: Alignment.topCenter, - end: Alignment.bottomCenter, - colors: [ - const Color(0XFF222935).withOpacity(0.60), - const Color(0XFF222935).withOpacity(0.60), - const Color(0XFF222935).withOpacity(0.60), - const Color(0XFF222935).withOpacity(0.60), - - // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50), - // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50), - // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50), - // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50), - ], - ), - borderGradient: LinearGradient( - begin: Alignment.topCenter, - end: Alignment.bottomCenter, - colors: [ - // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50), - // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50), - const Color(0XFF222935).withOpacity(0.60), - - const Color(0XFF222935).withOpacity(0.60), - ], - ), - child: Padding( + Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage("assets/images/png/Ellipse 1496.png"), + fit: BoxFit.fill)), + ), + + Padding( padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 50.h), child: Column( @@ -181,7 +148,7 @@ class _SelectIndividualProfileState extends State { }) ], ), - )), + ) ], )); } diff --git a/lib/onboarding/Signup/View/Individual/step2Selectactivity.dart b/lib/onboarding/Signup/View/Individual/step2Selectactivity.dart index 97a11dd..15ffd3b 100644 --- a/lib/onboarding/Signup/View/Individual/step2Selectactivity.dart +++ b/lib/onboarding/Signup/View/Individual/step2Selectactivity.dart @@ -1,15 +1,11 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:flutter_svg/flutter_svg.dart'; import 'package:get/get.dart'; -import 'package:glassmorphism/glassmorphism.dart'; -import 'package:regroup/Common/CommonDropDown.dart'; +import 'package:regroup/Common/CommonButton.dart'; import 'package:regroup/Common/base_manager.dart'; -import 'package:regroup/Utils/Common/CommonDropdown.dart'; import 'package:regroup/Utils/Common/CustomNextButton.dart'; import 'package:regroup/Utils/Common/CustomTextformfield.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/dialogs.dart'; import 'package:regroup/Utils/texts.dart'; @@ -18,6 +14,43 @@ import 'package:regroup/onboarding/Signup/view_model/postmethod.dart'; import 'package:regroup/resources/routes/route_name.dart'; import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart'; +class ActivityController extends GetxController { + var selectedIndices = [].obs; + var firstSelectedIndex = Rxn(); + var isFirstSelectionActive = false.obs; + + void onContainerTap(int index) { + if (selectedIndices.contains(index)) { + selectedIndices.remove(index); + if (firstSelectedIndex.value == index) { + // If the first selected container is unselected, reset the active state + firstSelectedIndex.value = null; + isFirstSelectionActive.value = false; + selectedIndices.clear(); + } + } else { + if (firstSelectedIndex.value == null) { + // The first item is being selected + firstSelectedIndex.value = index; + isFirstSelectionActive.value = true; + } + selectedIndices.add(index); + } + } + + Color getGradientColor(int index) { + if (selectedIndices.isEmpty) { + return Colors.transparent; + } else if (firstSelectedIndex.value == index && + isFirstSelectionActive.value) { + return Color(0XFFD90B2E); + } else if (selectedIndices.contains(index)) { + return Color(0xFF009DAB); + } + return Colors.transparent; + } +} + class SelectIndividualActivity extends StatefulWidget { const SelectIndividualActivity({super.key}); @@ -27,8 +60,8 @@ class SelectIndividualActivity extends StatefulWidget { } class _SelectIndividualActivityState extends State { - final List _selectedIndices = []; TextEditingController otheractivitycontroller = TextEditingController(); + final ActivityController controller = Get.put(ActivityController()); // to select only two containers // void _onContainerTap(int index) { @@ -45,15 +78,15 @@ class _SelectIndividualActivityState extends State { // }); // } - void _onContainerTap(int id) { - setState(() { - if (_selectedIndices.contains(id)) { - _selectedIndices.remove(id); - } else { - _selectedIndices.add(id); - } - }); - } + // void _onContainerTap(int id) { + // setState(() { + // if (_selectedIndices.contains(id)) { + // _selectedIndices.remove(id); + // } else { + // _selectedIndices.add(id); + // } + // }); + // } // to give two different colors for selectedd two containers // Color _getGradientColor(int index) { @@ -72,33 +105,33 @@ class _SelectIndividualActivityState extends State { // return Colors.transparent; // } - Color _getGradientColor(int id) { - if (_selectedIndices.contains(id)) { - return const Color(0XFFD90B2E); // Selected color - } - return Colors.transparent; // Default color - } + // Color _getGradientColor(int id) { + // if (_selectedIndices.contains(id)) { + // return const Color(0XFFD90B2E); // Selected color + // } + // return Colors.transparent; // Default color + // } Uploadata() async { utils.loader(); - String selectedIndicesString = '[${_selectedIndices.join(',')}]'; - print('Selected Indices: $selectedIndicesString'); + String selectedIndicesString = '[${controller.selectedIndices.join(',')}]'; Map updata = { "manage_interest_xid": selectedIndicesString, "other_interest": otheractivitycontroller.text, }; - print('Payload: $updata'); final data = await Onboard().PostIndividualActivity(updata); if (data.status == ResponseStatus.SUCCESS) { Get.back(); + controller.selectedIndices.clear(); + otheractivitycontroller.clear(); print("Activities selected"); - Get.toNamed(RouteName.individualgroupstep3); + // Get.toNamed(RouteName.individualgroupstep3); + Get.toNamed(RouteName.findcommunitypage); return utils.showToast(data.message); } else { Get.back(); - print("Not done"); return utils.showToast(data.message); } } @@ -106,310 +139,285 @@ class _SelectIndividualActivityState extends State { @override Widget build(BuildContext context) { return GestureDetector( - onTap: () => FocusManager.instance.primaryFocus?.unfocus(), - child: Scaffold( - backgroundColor: const Color.fromARGB(255, 18, 32, 47), - bottomNavigationBar: Padding( - padding: const EdgeInsets.only(bottom: 10, left: 16, right: 16), - child: CustomButton( - text: "Continue", - onPressed: () { - if (_selectedIndices.isEmpty && - otheractivitycontroller.text.isEmpty) { - utils.showToast('Please select activity'); - } else { - print(_selectedIndices.toString()); - // String selectedIndicesString = - // _selectedIndices.join(','); - // print( - // 'Selected Indices: [$selectedIndicesString]'); - Uploadata(); - } - // Get.toNamed( - // RouteName.individualgroupstep3); - }), - ), - body: SafeArea( - child: FutureBuilder( - future: Getonboard().getIndividualactivity(), - builder: (ctx, snapshot) { - if (snapshot.data == null) { - return const Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [Center(child: CircularProgressIndicator())], - ); - } - if (snapshot.connectionState == ConnectionState.done) { - if (snapshot.hasError) { - return Center( - child: Text( - '${snapshot.error} occured', - style: TextStyle(fontSize: 18.spMin), - ), + onTap: () => FocusManager.instance.primaryFocus?.unfocus(), + child: Scaffold( + backgroundColor: const Color.fromARGB(255, 18, 32, 47), + bottomNavigationBar: Padding( + padding: const EdgeInsets.only(bottom: 10, left: 16, right: 16), + child: CustomButton( + text: "Continue", + onPressed: () { + if (controller.selectedIndices.isEmpty && + otheractivitycontroller.text.isEmpty) { + utils.showToast('Please select interests'); + } else { + print(controller.selectedIndices.toString()); + // String selectedIndicesString = + // _selectedIndices.join(','); + // print( + // 'Selected Indices: [$selectedIndicesString]'); + Uploadata(); + } + // Get.toNamed( + // RouteName.individualgroupstep3); + }), + ), + body: SafeArea( + child: FutureBuilder( + future: Getonboard().getIndividualactivity(), + builder: (ctx, snapshot) { + if (snapshot.data == null) { + return const Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [Center(child: CircularProgressIndicator())], ); } - } + if (snapshot.connectionState == ConnectionState.done) { + if (snapshot.hasError) { + return Center( + child: Text( + '${snapshot.error} occured', + style: TextStyle(fontSize: 18.spMin), + ), + ); + } + } - return Stack( - children: [ - Container( - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage( - "assets/images/png/Ellipse 1496.png"), - fit: BoxFit.fill)), - ), - Padding( - padding: - EdgeInsets.symmetric(horizontal: 16.w, vertical: 0.h), - child: SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Align( - alignment: Alignment.topRight, - child: GestureDetector( - onTap: () { - Get.toNamed(RouteName.communitycommitscreen); - }, - child: Text( - 'Skip', - style: TextStyle( - color: Colors.white, - fontSize: 16.sp, - fontFamily: 'Helvetica', - fontWeight: FontWeight.w400, - decoration: TextDecoration.underline, - decorationColor: Colors.white), + return Stack( + children: [ + Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage( + "assets/images/png/Ellipse 1496.png"), + fit: BoxFit.fill)), + ), + Padding( + padding: + EdgeInsets.symmetric(horizontal: 16.w, vertical: 0.h), + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Align( + alignment: Alignment.topRight, + child: GestureDetector( + onTap: () { + Get.toNamed(RouteName.communitycommitscreen); + }, + child: Text( + 'Skip', + style: TextStyle( + color: Colors.white, + fontSize: 16.sp, + fontFamily: 'Helvetica', + fontWeight: FontWeight.w400, + decoration: TextDecoration.underline, + decorationColor: Colors.white), + ), ), ), - ), - sizedBoxHeight(30.h), - Align( - alignment: Alignment.center, - child: text16400white('Step 1 of 3')), - sizedBoxHeight(20.h), - Container( - width: double.infinity, - height: 25.h, - decoration: ShapeDecoration( - shape: RoundedRectangleBorder( - side: const BorderSide( - width: 1, color: Color(0xFF434A53)), - borderRadius: BorderRadius.circular(30), + sizedBoxHeight(30.h), + Align( + alignment: Alignment.center, + child: text16400white('Step 1 of 3')), + sizedBoxHeight(20.h), + Container( + width: double.infinity, + height: 25.h, + decoration: ShapeDecoration( + shape: RoundedRectangleBorder( + side: const BorderSide( + width: 1, color: Color(0xFF434A53)), + borderRadius: BorderRadius.circular(30), + ), ), - ), - child: Padding( - padding: EdgeInsets.symmetric( - horizontal: 8.w, vertical: 2.h), - child: Row( - children: [ - Container( - width: 120.w, - height: 15.h, - decoration: ShapeDecoration( - gradient: const LinearGradient( - begin: Alignment(0.98, -0.21), - end: Alignment(-0.98, 0.21), - colors: [ - Color(0xA5D90B2E), - Color(0x42D90B2E) - ], - ), - shape: RoundedRectangleBorder( - borderRadius: - BorderRadius.circular(30), - ), - ), - child: Row( - mainAxisAlignment: - MainAxisAlignment.end, - children: [ - Container( - width: 15, - height: 15, - decoration: ShapeDecoration( - gradient: const LinearGradient( - begin: Alignment(0.98, -0.21), - end: Alignment(-0.98, 0.21), - colors: [ - Color(0xFFD90B2E), - Color(0x60D90B2E) - ], - ), - shape: RoundedRectangleBorder( - borderRadius: - BorderRadius.circular(30), - ), - ), - ) - ], - )) - ], - ), - ), - ), - sizedBoxHeight(40.h), - indiactivityobj!.data == null || - indiactivityobj!.data!.isEmpty - ? _buildNoDataBody(context) - : Column( - crossAxisAlignment: CrossAxisAlignment.start, + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: 8.w, vertical: 2.h), + child: Row( children: [ - Center( - child: _selectedIndices.isEmpty - ? text20400white( - 'What is your main activity ?') - : text20400white( - 'What else do you do?')), - sizedBoxHeight(10.w), - Center( - child: Container( - width: 154.w, - decoration: const ShapeDecoration( + Container( + width: 100.w, + height: 15.h, + decoration: ShapeDecoration( + gradient: const LinearGradient( + begin: Alignment(0.98, -0.21), + end: Alignment(-0.98, 0.21), + colors: [ + Color(0xA5D90B2E), + Color(0x42D90B2E) + ], + ), shape: RoundedRectangleBorder( - side: BorderSide( - width: 1, - strokeAlign: - BorderSide.strokeAlignCenter, - color: Color(0xFF858585), - ), + borderRadius: + BorderRadius.circular(30), ), ), - ), - ), - sizedBoxHeight(30.h), - GridView.builder( - physics: const ScrollPhysics(), - shrinkWrap: true, - gridDelegate: - SliverGridDelegateWithFixedCrossAxisCount( - crossAxisCount: - 3, // Number of items in each row - crossAxisSpacing: 12 - .w, // Horizontal spacing between items - mainAxisSpacing: 12 - .h, // Vertical spacing between items - ), - itemCount: indiactivityobj!.data!.length, - itemBuilder: (context, index) { - return ActivityContainer( - index: - indiactivityobj!.data![index].id!, - titleString: indiactivityobj! - .data![index].name!, - image: indiactivityobj! - .data![index].image, - // 'assets/images/svg/individualact7.svg', - isSelected: _selectedIndices.contains( - indiactivityobj! - .data![index].id!), - gradientColor: _getGradientColor( - indiactivityobj! - .data![index].id!), - onTap: _onContainerTap, - ); - }, - ), - - sizedBoxHeight(30.h), - text20400FCFCFC("Add other activity"), - sizedBoxHeight(25.h), - CustomTextFormField( - textEditingController: - otheractivitycontroller, - texttype: TextInputType.text, - hintText: "Enter other activity", - // leadingIcon: - // // const Icon(Icons.mail_outline), - // Image.asset( - // width: 22.w, - // height: 17.h, - // 'assets/images/png/user.png', - // ), - // validatorText: "Enter your full name", - validator: (value) { - if (value!.isEmpty) { - return 'Enter your full name '; - } - return null; - }, - inputFormatters: [ - // LengthLimitingTextInputFormatter(20), - RemoveEmojiInputFormatter(), - FilteringTextInputFormatter.allow( - RegExp('[a-zA-Z ]')) - ], - ), - // CustomDropDownRadio( - // header: "", - // title: "", - // listData: [ - // "American football", - // "Archery", - // "Athletics", - // "Baseball", - // "Basketball", - // "Boxing", - // "Canoeing", - // "Clay pigeon shooting", - // "Climbing", - // "Combat sports", - // "Cricket", - // "Dodgeball", - // "Equestrian", - // "Fencing", - // "Gaelic football", - // "Golf", - // "Gymnastics", - // "Handball", - // "Hockey", - // "Lacrosse", - // "Modern biathlon and pentathlon", - // "Netball", - // "Orienteering", - // "Pool and snooker", - // "Powerlifting", - // "Rifle", - // "Rugby league", - // "Rugby union", - // "Sailing", - // "Snowsports", - // "Squash", - // "Surfing", - // "Swimming", - // "Softball", - // "Table tennis", - // "Tennis", - // "Touch rugby", - // "Trampoline", - // "Triathlon", - // "Ultimate frisbee", - // "Volleyball", - // "Water polo", - // "Windsurfing" - // ], - // onItemSelected: (p0) {}, - // leadingImage: SizedBox()), - // // Spacer(flex: 1), - - sizedBoxHeight(35.h), + child: Row( + mainAxisAlignment: + MainAxisAlignment.end, + children: [ + Container( + width: 15, + height: 15, + decoration: ShapeDecoration( + gradient: const LinearGradient( + begin: Alignment(0.98, -0.21), + end: Alignment(-0.98, 0.21), + colors: [ + Color(0xFFD90B2E), + Color(0x60D90B2E) + ], + ), + shape: RoundedRectangleBorder( + borderRadius: + BorderRadius.circular(30), + ), + ), + ) + ], + )) ], - ) - ], + ), + ), + ), + sizedBoxHeight(40.h), + indiactivityobj!.data == null || + indiactivityobj!.data!.isEmpty + ? _buildNoDataBody(context) + : Column( + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + text20400white( + 'What are your interests?'), + // sizedBoxHeight(5.w), + Obx(() { + return text13400A7A7A7(controller + .isFirstSelectionActive.value + ? 'Select your secondary interests' + : 'Select your primary interest'); + }), + + // Container( + // width: 154.w, + // decoration: const ShapeDecoration( + // shape: RoundedRectangleBorder( + // side: BorderSide( + // width: 1, + // strokeAlign: + // BorderSide.strokeAlignCenter, + // color: Color(0xFF858585), + // ), + // ), + // ), + // ), + sizedBoxHeight(30.h), + GridView.builder( + physics: const ScrollPhysics(), + shrinkWrap: true, + gridDelegate: + SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: + 3, // Number of items in each row + crossAxisSpacing: 12 + .w, // Horizontal spacing between items + mainAxisSpacing: 12 + .h, // Vertical spacing between items + ), + itemCount: + indiactivityobj!.data!.length, + itemBuilder: (context, index) { + return ActivityContainer( + index: indiactivityobj! + .data![index].id!, + titleString: indiactivityobj! + .data![index].name!, + image: indiactivityobj! + .data![index].image, + // 'assets/images/svg/individualact7.svg', + controller: controller, + ); + }, + ), + + sizedBoxHeight(30.h), + // text20400FCFCFC("Add other activity"), + // sizedBoxHeight(25.h), + // CustomTextFormField( + // textEditingController: + // otheractivitycontroller, + // texttype: TextInputType.text, + // hintText: "Enter other activity", + // // leadingIcon: + // // // const Icon(Icons.mail_outline), + // // Image.asset( + // // width: 22.w, + // // height: 17.h, + // // 'assets/images/png/user.png', + // // ), + // // validatorText: "Enter your full name", + // validator: (value) { + // if (value!.isEmpty) { + // return 'Enter your full name '; + // } + // return null; + // }, + // inputFormatters: [ + // // LengthLimitingTextInputFormatter(20), + // RemoveEmojiInputFormatter(), + // FilteringTextInputFormatter.allow( + // RegExp('[a-zA-Z ]')) + // ], + // ), + + sizedBoxHeight(35.h), + ], + ) + ], + ), ), ), - ), - ], - ); - }, + ], + ); + }, + ), ), - ), - - // - ), - ); + floatingActionButton: Stack( + alignment: Alignment.center, + clipBehavior: Clip.none, // Ensure the Positioned widget is visible + children: [ + FloatingActionButton( + onPressed: () { + interestdialogwidget(); + }, + backgroundColor: const Color(0xFFD90B2E), + autofocus: true, + shape: const CircleBorder(), + child: Icon( + Icons.add, + color: Colors.white, + size: 27.sp, + ), + ), + Positioned( + right: 60.w, + child: Container( + width: 212.w, + height: 35.h, + decoration: BoxDecoration( + color: Color(0xFF363636), + borderRadius: BorderRadius.circular(20), + border: + Border.all(color: Color(0xFFD90B2E), width: 1.w)), + child: Center( + child: text16400white("Can’t find your interest"))), + ) + ], + ), + )); } Widget _buildNoDataBody(context) { @@ -418,98 +426,218 @@ class _SelectIndividualActivityState extends State { children: [Text("No Data Found")], ); } + + interestdialogwidget() { + Get.dialog(Dialog( + // backgroundColor: Colors.transparent, + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10.r), + color: const Color(0xFF222935)), + child: Padding( + padding: EdgeInsets.only( + right: 16.w, left: 16.w, top: 20.h, bottom: 40.h), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Spacer(), + InkWell( + onTap: () { + Get.back(); + }, + child: Image.asset( + "assets/images/png/x-circle.png", + height: 28.h, + width: 28.w, + ), + ) + ], + ), + text16w700_FCFCFC("Suggest interest"), + sizedBoxHeight(16.h), + Center( + child: CustomTextFormField( + textEditingController: otheractivitycontroller, + hintText: "Please type your interest", + texttype: TextInputType.text, + validator: (value) { + if (value!.isEmpty) { + return 'Enter your interest'; + } + return null; + }, + inputFormatters: [ + // LengthLimitingTextInputFormatter(20), + RemoveEmojiInputFormatter(), + FilteringTextInputFormatter.allow(RegExp('[a-zA-Z ]')) + ], + )), + sizedBoxHeight(10.h), + text10w400_FCFCFC_blur("We will surely make this happen"), + sizedBoxHeight(20.h), + Align( + alignment: Alignment.center, + child: SizedBox( + width: 177.w, + child: CommonBtn( + text: "Suggest", + onTap: () { + Get.back(); + thankdialogwidget(); + })), + ) + ], + ), + ), + ), + ], + ), + )); + } + + thankdialogwidget() { + Get.dialog(Dialog( + // backgroundColor: Colors.transparent, + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10.r), + color: const Color(0xFF222935)), + child: Padding( + padding: EdgeInsets.only( + right: 16.w, left: 16.w, top: 20.h, bottom: 40.h), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Row( + children: [ + Spacer(), + Image.asset( + "assets/images/png/x-circle.png", + height: 28.h, + width: 28.w, + ) + ], + ), + Image.asset( + "assets/images/png/correct 1.png", + height: 72.h, + width: 72.w, + ), + sizedBoxHeight(20.h), + text16w700_FCFCFC( + "Thank You! \n for adding one more to the club", + textAlign: TextAlign.center), + sizedBoxHeight(16.h), + ], + ), + ), + ), + ], + ), + )); + } } class ActivityContainer extends StatelessWidget { final int index; final String titleString; final String? image; - final bool isSelected; - final Color gradientColor; - final Function(int) onTap; + final ActivityController controller; ActivityContainer({ required this.index, required this.titleString, required this.image, - required this.isSelected, - required this.gradientColor, - required this.onTap, + required this.controller, }); @override Widget build(BuildContext context) { - return GestureDetector( - onTap: () => onTap(index), - child: Container( - // width: 110.w, - // height: 120.h, - decoration: ShapeDecoration( - gradient: LinearGradient( - begin: const Alignment(0.98, -0.21), - end: const Alignment(-0.98, 0.21), - colors: isSelected - ? [ - gradientColor.withOpacity(0.80), - gradientColor.withOpacity(0.77), - gradientColor.withOpacity(0.66), - gradientColor.withOpacity(0.18), - ] - : [ - Colors.white.withOpacity(0.06), - Colors.white.withOpacity(0.08), - ], - ), - shape: RoundedRectangleBorder( - side: const BorderSide(width: 1, color: Color(0xFF434A53)), - borderRadius: BorderRadius.circular(10), - ), - ), - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 0.w, vertical: 10.h), - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - // image.isEmpty - // ? SvgPicture.asset( - // "assets/images/svg/individualact7.svg", - // width: 50.w, - // height: 50.h, - // ) - // : Image.network(image), - image == null || image!.isEmpty - ? Image.asset( - 'assets/images/png/redregroup.png', - color: Colors.white, - width: 50.w, - height: 50.h, - ) - // SvgPicture.asset( - // "assets/images/svg/individualact7.svg", - // width: 50.w, - // height: 50.h, - // ) - : Image.network( - image!, - width: 50.w, - height: 50.h, - ), - const Spacer(flex: 3), - SizedBox( - child: Text( - titleString, - style: TextStyle( - fontSize: 14.sp, - color: Colors.white, - fontWeight: FontWeight.w400, - ), - textAlign: TextAlign.center, - ), + return Obx( + () { + bool isSelected = controller.selectedIndices.contains(index); + Color gradientColor = controller.getGradientColor(index); + + return GestureDetector( + onTap: () => controller.onContainerTap(index), + child: Container( + decoration: ShapeDecoration( + gradient: LinearGradient( + begin: const Alignment(0.98, 0.10), + end: const Alignment(-0.40, -0.70), + colors: isSelected + ? controller.firstSelectedIndex.value == index && + controller.isFirstSelectionActive.value + ? [ + Color(0xFF009DAB).withOpacity(0.80), + Color(0xFF009DAB).withOpacity(0.77), + gradientColor.withOpacity(0.70), + gradientColor.withOpacity(0.50), + ] + : [ + Colors.white.withOpacity(0.06), + Colors.white.withOpacity(0.08), + ] + : [ + Colors.white.withOpacity(0.06), + Colors.white.withOpacity(0.08), + ], ), - ], + shape: RoundedRectangleBorder( + side: isSelected + ? controller.firstSelectedIndex.value == index && + controller.isFirstSelectionActive.value + ? BorderSide(width: 0.4.w, color: Colors.transparent) + : BorderSide(width: 3.w, color: gradientColor) + : BorderSide(width: 2.w, color: Color(0xFF434A53)), + borderRadius: BorderRadius.circular(10), + ), + ), + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 0.w, vertical: 10.h), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + image == null || image!.isEmpty + ? Image.asset( + 'assets/images/png/redregroup.png', + color: Colors.white, + width: 50.w, + height: 50.h, + ) + : Image.network( + image!, + width: 50.w, + height: 50.h, + ), + const Spacer(flex: 3), + SizedBox( + child: Text( + titleString, + style: TextStyle( + fontSize: 14.sp, + color: Colors.white, + fontWeight: FontWeight.w400, + ), + textAlign: TextAlign.center, + ), + ), + ], + ), + ), ), - ), - ), + ); + }, ); } } diff --git a/lib/onboarding/Signup/View/Individual/step3Selectyourgroup.dart b/lib/onboarding/Signup/View/Individual/step3Selectyourgroup.dart index 447b062..45b92c7 100644 --- a/lib/onboarding/Signup/View/Individual/step3Selectyourgroup.dart +++ b/lib/onboarding/Signup/View/Individual/step3Selectyourgroup.dart @@ -1,14 +1,13 @@ import 'dart:async'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; -import 'package:glassmorphism/glassmorphism.dart'; +import 'package:regroup/Common/CommonButton.dart'; import 'package:regroup/Common/base_manager.dart'; import 'package:regroup/Utils/Common/CustomNextButton.dart'; import 'package:regroup/Utils/Common/CustomTextformfield.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; + import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/dialogs.dart'; import 'package:regroup/Utils/texts.dart'; @@ -65,9 +64,10 @@ class _SelectIndividualGroupState extends State { final data = await Onboard().postGroups(updata); if (data.status == ResponseStatus.SUCCESS) { - Get.back(); + // Get.back(); print("groups selected"); - Get.toNamed(RouteName.individualcommunitystep4); + // Get.toNamed(RouteName.individualcommunitystep4); + Get.toNamed(RouteName.communitycommitscreen); return utils.showToast(data.message); } else { @@ -82,7 +82,7 @@ class _SelectIndividualGroupState extends State { return GestureDetector( onTap: () => FocusManager.instance.primaryFocus?.unfocus(), child: Scaffold( - backgroundColor: Color.fromARGB(255, 18, 32, 47), + backgroundColor: const Color.fromARGB(255, 18, 32, 47), body: Stack( children: [ Container( @@ -117,14 +117,15 @@ class _SelectIndividualGroupState extends State { sizedBoxHeight(30.h), Align( alignment: Alignment.center, - child: text16400white('Step 2 of 3')), + child: text16400white('Step 3 of 3')), sizedBoxHeight(20.h), Container( width: double.infinity, height: 25.h, decoration: ShapeDecoration( shape: RoundedRectangleBorder( - side: BorderSide(width: 1, color: Color(0xFF434A53)), + side: const BorderSide( + width: 1, color: Color(0xFF434A53)), borderRadius: BorderRadius.circular(30), ), ), @@ -133,45 +134,47 @@ class _SelectIndividualGroupState extends State { horizontal: 8.w, vertical: 2.h), child: Row( children: [ - Container( - width: 216.w, - height: 15.h, - decoration: ShapeDecoration( - gradient: LinearGradient( - begin: Alignment(0.98, -0.21), - end: Alignment(-0.98, 0.21), - colors: [ - Color(0xA5D90B2E), - Color(0x42D90B2E) + Expanded( + child: Container( + // width: 216.w, + height: 15.h, + decoration: ShapeDecoration( + gradient: const LinearGradient( + begin: Alignment(0.98, -0.21), + end: Alignment(-0.98, 0.21), + colors: [ + Color(0xA5D90B2E), + Color(0x42D90B2E) + ], + ), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(30), + ), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Container( + width: 15, + height: 15, + decoration: ShapeDecoration( + gradient: const LinearGradient( + begin: Alignment(0.98, -0.21), + end: Alignment(-0.98, 0.21), + colors: [ + Color(0xFFD90B2E), + Color(0x60D90B2E) + ], + ), + shape: RoundedRectangleBorder( + borderRadius: + BorderRadius.circular(30), + ), + ), + ) ], - ), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(30), - ), - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Container( - width: 15, - height: 15, - decoration: ShapeDecoration( - gradient: LinearGradient( - begin: Alignment(0.98, -0.21), - end: Alignment(-0.98, 0.21), - colors: [ - Color(0xFFD90B2E), - Color(0x60D90B2E) - ], - ), - shape: RoundedRectangleBorder( - borderRadius: - BorderRadius.circular(30), - ), - ), - ) - ], - )) + )), + ) ], ), ), @@ -183,14 +186,19 @@ class _SelectIndividualGroupState extends State { children: [ text20400white('Find your group'), sizedBoxWidth(5.w), - Image.asset('assets/images/png/informationicon.png') + InkWell( + onTap: () { + groupBottomsheet(); + }, + child: Image.asset( + 'assets/images/png/informationicon.png')) ], )), sizedBoxHeight(10.w), Center( child: Container( width: 108.w, - decoration: ShapeDecoration( + decoration: const ShapeDecoration( shape: RoundedRectangleBorder( side: BorderSide( width: 1, @@ -215,7 +223,7 @@ class _SelectIndividualGroupState extends State { // ), Padding( padding: EdgeInsets.symmetric(horizontal: 16.w), - child: Icon( + child: const Icon( Icons.search, size: 35, color: Colors.white, @@ -241,13 +249,14 @@ class _SelectIndividualGroupState extends State { if (snapshot.connectionState == ConnectionState.waiting) { // Display shimmer effect while waiting for data - return Center(child: CircularProgressIndicator()); + return const Center( + child: CircularProgressIndicator()); } else if (snapshot.hasError) { // Handle error state return Center( child: Text( '${snapshot.error} occurred', - style: TextStyle(fontSize: 18), + style: const TextStyle(fontSize: 18), ), ); } else { @@ -256,9 +265,9 @@ class _SelectIndividualGroupState extends State { ? _buildNoDataBody(context) : Expanded( child: GridView.builder( - physics: ScrollPhysics(), + physics: const ScrollPhysics(), gridDelegate: - SliverGridDelegateWithFixedCrossAxisCount( + const SliverGridDelegateWithFixedCrossAxisCount( crossAxisCount: 2, crossAxisSpacing: 12.0, mainAxisSpacing: 12.0, @@ -292,7 +301,7 @@ class _SelectIndividualGroupState extends State { onPressed: () { // Get.toNamed(RouteName.individualcommunitystep4); if (_selectedIndices.isEmpty) { - utils.showToast('Please select activity'); + utils.showToast('Please select group'); } else { print(_selectedIndices.toString()); // String selectedIndicesString = @@ -328,6 +337,53 @@ class _SelectIndividualGroupState extends State { ), ); } + + void groupBottomsheet() { + Get.bottomSheet( + isScrollControlled: true, + Container( + // height: 700.h, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(14.r), + color: const Color(0xFF222935)), + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 20.h), + child: Column(mainAxisSize: MainAxisSize.min, children: [ + // sizedBoxHeight(20.h), + Row( + children: [ + Spacer(), + Image.asset( + "assets/images/png/x-circle.png", + height: 28.h, + width: 28.w, + ), + ], + ), + Image.asset( + "assets/images/png/Group 1000004385.png", + height: 185.h, + width: 185.w, + ), + + sizedBoxHeight(20.h), + text16w400_FCFCFC( + '''Use this screen to find specific groups within your area. Groups span any club, society or hobbyist group e.g. sports clubs, social clubs, service clubs, musical groups or voluntary societies. If you are still exploring your options, you can skip this step. You can always join or create new groups later.''', + textAlign: TextAlign.center), + sizedBoxHeight(20.h), + + SizedBox( + width: 239.w, + child: CommonBtn( + text: "Understood", + onTap: () { + Get.back(); + }, + )), + + // sizedBoxHeight(40.h) + ])))); + } } class GroupSelect extends StatelessWidget { @@ -348,13 +404,13 @@ class GroupSelect extends StatelessWidget { @override Widget build(BuildContext context) { - return Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + return Column(crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( - width: 169, - height: 74, + width: 72.w, + height: 72.h, decoration: ShapeDecoration( image: image == null || image!.isEmpty - ? DecorationImage( + ? const DecorationImage( image: AssetImage("assets/images/png/groupindividual3.png"), fit: BoxFit.fill, ) @@ -362,26 +418,42 @@ class GroupSelect extends StatelessWidget { image: NetworkImage(image!), fit: BoxFit.fill, ), - shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(5)), + shape: + RoundedRectangleBorder(borderRadius: BorderRadius.circular(100)), ), ), - SizedBox(height: 15.0), + const SizedBox(height: 15.0), Text( titleString, - style: TextStyle( + style: const TextStyle( color: Colors.white, fontSize: 12.0, overflow: TextOverflow.ellipsis), ), - SizedBox(height: 15.0), + const SizedBox(height: 15.0), GestureDetector( onTap: () => onTap(index), child: Container( - width: 169, - height: 23, + width: 169.w, + height: 23.h, decoration: ShapeDecoration( + gradient: isSelected + ? LinearGradient(colors: [ + Color(0xFFD90B2E), + Color(0xFFD90B2E), + ]) + : LinearGradient( + begin: Alignment(0.98, -0.21), + end: Alignment(-0.98, 0.21), + colors: [ + Colors.white.withOpacity(0.04), + Colors.white.withOpacity(0.05) + ], + ), shape: RoundedRectangleBorder( - side: BorderSide(width: 1, color: Color(0xFFFF002B)), + side: isSelected + ? BorderSide(width: 1.w, color: Colors.transparent) + : BorderSide(width: 1.w, color: Color(0xFF434A53)), borderRadius: BorderRadius.circular(30), ), ), @@ -389,10 +461,8 @@ class GroupSelect extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.center, children: [ isSelected - ? Text('Regrouping', - style: TextStyle(color: Colors.white, fontSize: 10.0)) - : Text('Join', - style: TextStyle(color: Colors.white, fontSize: 10.0)) + ? text10400white("Leave group") + : text10400white("Join") ], ), ), diff --git a/lib/onboarding/Signup/View/Individual/step4Selectyourcommunity.dart b/lib/onboarding/Signup/View/Individual/step4Selectyourcommunity.dart index 78b3bd9..b4b85cb 100644 --- a/lib/onboarding/Signup/View/Individual/step4Selectyourcommunity.dart +++ b/lib/onboarding/Signup/View/Individual/step4Selectyourcommunity.dart @@ -2,13 +2,13 @@ import 'dart:async'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:flutter/widgets.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; -import 'package:glassmorphism/glassmorphism.dart'; +import 'package:regroup/Common/CommonButton.dart'; import 'package:regroup/Common/base_manager.dart'; import 'package:regroup/Utils/Common/CustomNextButton.dart'; import 'package:regroup/Utils/Common/CustomTextformfield.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/dialogs.dart'; import 'package:regroup/Utils/texts.dart'; @@ -65,10 +65,13 @@ class _SelectIndividualCommunityState extends State { print('Payload: $updata'); final data = await Onboard().postCommunities(updata); + if (data.status == ResponseStatus.SUCCESS) { // Get.back(); print("groups selected"); - Get.toNamed(RouteName.communitycommitscreen); + Get.back(); + // Get.toNamed(RouteName.communitycommitscreen); + Get.toNamed(RouteName.individualgroupstep3); return utils.showToast(data.message); } else { @@ -118,14 +121,15 @@ class _SelectIndividualCommunityState extends State { sizedBoxHeight(30.h), Align( alignment: Alignment.center, - child: text16400white('Step 3 of 3')), + child: text16400white('Step 2 of 3')), sizedBoxHeight(20.h), Container( width: double.infinity, height: 25.h, decoration: ShapeDecoration( shape: RoundedRectangleBorder( - side: const BorderSide(width: 1, color: Color(0xFF434A53)), + side: const BorderSide( + width: 1, color: Color(0xFF434A53)), borderRadius: BorderRadius.circular(30), ), ), @@ -134,46 +138,45 @@ class _SelectIndividualCommunityState extends State { horizontal: 8.w, vertical: 2.h), child: Row( children: [ - Expanded( - child: Container( - // width: 216.w, - height: 15.h, - decoration: ShapeDecoration( - gradient: const LinearGradient( - begin: Alignment(0.98, -0.21), - end: Alignment(-0.98, 0.21), - colors: [ - Color(0xA5D90B2E), - Color(0x42D90B2E) - ], + Container( + width: 170.w, + height: 15.h, + decoration: ShapeDecoration( + gradient: const LinearGradient( + begin: Alignment(0.98, -0.21), + end: Alignment(-0.98, 0.21), + colors: [ + Color(0xA5D90B2E), + Color(0x42D90B2E) + ], + ), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(30), + ), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Container( + width: 15, + height: 15, + decoration: ShapeDecoration( + gradient: const LinearGradient( + begin: Alignment(0.98, -0.21), + end: Alignment(-0.98, 0.21), + colors: [ + Color(0xFFD90B2E), + Color(0x60D90B2E) + ], + ), + shape: RoundedRectangleBorder( + borderRadius: + BorderRadius.circular(30), + ), ), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(30), - ), - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Container( - width: 15, - height: 15, - decoration: ShapeDecoration( - gradient: const LinearGradient( - begin: Alignment(0.98, -0.21), - end: Alignment(-0.98, 0.21), - colors: [ - Color(0xFFD90B2E), - Color(0x60D90B2E) - ], - ), - shape: RoundedRectangleBorder( - borderRadius: - BorderRadius.circular(30), - ), - ), - ) - ], - ))) + ) + ], + )) ], ), ), @@ -185,8 +188,13 @@ class _SelectIndividualCommunityState extends State { children: [ text20400white('Find your community'), sizedBoxWidth(5.w), - Image.asset( - 'assets/images/png/informationicon.png', + InkWell( + onTap: () { + communityBottomsheet(); + }, + child: Image.asset( + 'assets/images/png/informationicon.png', + ), ) ], )), @@ -244,7 +252,8 @@ class _SelectIndividualCommunityState extends State { if (snapshot.connectionState == ConnectionState.waiting) { // Display shimmer effect while waiting for data - return const Center(child: CircularProgressIndicator()); + return const Center( + child: CircularProgressIndicator()); } else if (snapshot.hasError) { // Handle error state return Center( @@ -297,7 +306,7 @@ class _SelectIndividualCommunityState extends State { onPressed: () { // Get.toNamed(RouteName.individualcommunitystep4); if (_selectedIndices.isEmpty) { - utils.showToast('Please select activity'); + utils.showToast('Please select community'); } else { print(_selectedIndices.toString()); // String selectedIndicesString = @@ -333,6 +342,54 @@ class _SelectIndividualCommunityState extends State { ), ); } + + void communityBottomsheet() { + Get.bottomSheet( + isScrollControlled: true, + Container( + // height: 700.h, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(14.r), + color: const Color(0xFF222935)), + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 20.h), + child: Column(mainAxisSize: MainAxisSize.min, children: [ + // sizedBoxHeight(20.h), + Row( + children: [ + Spacer(), + Image.asset( + "assets/images/png/x-circle.png", + height: 28.h, + width: 28.w, + ), + ], + ), + Image.asset( + "assets/images/png/Connected world-amico 1.png", + height: 185.h, + width: 185.w, + ), + + sizedBoxHeight(20.h), + text16w400_FCFCFC( + '''Use this screen to find interesting communities near you. Communities are +a collection of groups, individuals and businesses that share common interests. e.g. 'London football clubs' or 'Cambridge rowing clubs'. If you aren't sure of which communities you'd like to be a part of or already know the specific club you'd like to join, you can skip this step. Don't worry, you can always join new communities later.''', + textAlign: TextAlign.center), + sizedBoxHeight(20.h), + + SizedBox( + width: 239.w, + child: CommonBtn( + text: "Understood", + onTap: () { + Get.back(); + }, + )), + + // sizedBoxHeight(40.h) + ])))); + } } class CommunitySelect extends StatelessWidget { @@ -355,8 +412,8 @@ class CommunitySelect extends StatelessWidget { Widget build(BuildContext context) { return Column(crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( - width: 73.w, - height: 73.h, + width: 170.w, + height: 74.h, decoration: ShapeDecoration( image: image == null || image!.isEmpty ? const DecorationImage( @@ -368,7 +425,7 @@ class CommunitySelect extends StatelessWidget { fit: BoxFit.fill, ), shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(100), + borderRadius: BorderRadius.circular(5.r), ), ), ), @@ -384,11 +441,26 @@ class CommunitySelect extends StatelessWidget { GestureDetector( onTap: () => onTap(index), child: Container( - width: 169, - height: 23, + width: 169.w, + height: 23.h, decoration: ShapeDecoration( + gradient: isSelected + ? LinearGradient(colors: [ + Color(0xFFD90B2E), + Color(0xFFD90B2E), + ]) + : LinearGradient( + begin: Alignment(0.98, -0.21), + end: Alignment(-0.98, 0.21), + colors: [ + Colors.white.withOpacity(0.04), + Colors.white.withOpacity(0.05) + ], + ), shape: RoundedRectangleBorder( - side: const BorderSide(width: 1, color: Color(0xFFFF002B)), + side: isSelected + ? BorderSide(width: 1.w, color: Colors.transparent) + : BorderSide(width: 1.w, color: Color(0xFF434A53)), borderRadius: BorderRadius.circular(30), ), ), @@ -396,10 +468,8 @@ class CommunitySelect extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.center, children: [ isSelected - ? const Text('Regrouping', - style: TextStyle(color: Colors.white, fontSize: 10.0)) - : const Text('Join', - style: TextStyle(color: Colors.white, fontSize: 10.0)) + ? text10400white("Leave community") + : text10400white("Join") ], ), ), diff --git a/lib/onboarding/Signup/View/Individual/tellusindividual.dart b/lib/onboarding/Signup/View/Individual/tellusindividual.dart index 32364f3..f768a8f 100644 --- a/lib/onboarding/Signup/View/Individual/tellusindividual.dart +++ b/lib/onboarding/Signup/View/Individual/tellusindividual.dart @@ -1,4 +1,3 @@ -import 'dart:developer'; import 'dart:io'; import 'package:dio/dio.dart'; @@ -6,22 +5,21 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart' hide MultipartFile, FormData; -import 'package:glassmorphism/glassmorphism.dart'; +import 'package:path/path.dart' as path; import 'package:regroup/Common/CommonWidget.dart'; import 'package:regroup/Common/base_manager.dart'; import 'package:regroup/Common/controller/profileimagecontroller.dart'; +import 'package:regroup/Global.dart'; import 'package:regroup/Utils/Common/CommonDropdown.dart'; import 'package:regroup/Utils/Common/CustomNextButton.dart'; import 'package:regroup/Utils/Common/CustomTextformfield.dart'; import 'package:regroup/Utils/Common/ImageUpload.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/dialogs.dart'; import 'package:regroup/Utils/texts.dart'; import 'package:regroup/onboarding/Signup/view_model/postmethod.dart'; import 'package:regroup/resources/routes/route_name.dart'; import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart'; -import 'package:path/path.dart' as path; class TellusaboutIndividual extends StatefulWidget { const TellusaboutIndividual({super.key}); @@ -35,6 +33,7 @@ class _TellusaboutIndividualState extends State { TextEditingController userNameController = TextEditingController(); TextEditingController datecontroller = TextEditingController(); TextEditingController locationcontroller = TextEditingController(); + TextEditingController imageFile = TextEditingController(); DateTime? _selectedDate; final photographController = TextEditingController(); @@ -131,7 +130,7 @@ class _TellusaboutIndividualState extends State { void TellusUploadData() async { utils.loader(); - var imageFile; + MultipartFile? imageFile; if (editProfileImage.profilePicPath.value.isNotEmpty) { imageFile = await MultipartFile.fromFile( editProfileImage.profilePicPath.value, @@ -151,10 +150,12 @@ class _TellusaboutIndividualState extends State { final data = await Onboard().PosttellusIndividual(formData); if (data.status == ResponseStatus.SUCCESS) { Get.back(); + mainWelcomeName = fullNameController.text; Get.toNamed(RouteName.individualactivitystep2); + editProfileImage.profilePicPath.value = ''; } else { Get.back(); - utils.showToast(data.message); + utils.showToast(data.message); } } @@ -162,14 +163,11 @@ class _TellusaboutIndividualState extends State { Widget build(BuildContext context) { return WillPopScope( onWillPop: () async { - SystemNavigator.pop(); + SystemNavigator.pop(); // Navigator.pop(context); - return true; - }, - child: GestureDetector( onTap: () => FocusManager.instance.primaryFocus?.unfocus(), child: Scaffold( @@ -179,7 +177,8 @@ class _TellusaboutIndividualState extends State { Container( decoration: const BoxDecoration( image: DecorationImage( - image: AssetImage("assets/images/png/Ellipse 1496.png"), + image: + AssetImage("assets/images/png/Ellipse 1496.png"), fit: BoxFit.fill)), ), ListView(physics: const ScrollPhysics(), children: [ @@ -319,7 +318,8 @@ class _TellusaboutIndividualState extends State { inputFormatters: [ // LengthLimitingTextInputFormatter(20), RemoveEmojiInputFormatter(), - FilteringTextInputFormatter.allow(RegExp('[a-zA-Z ]')) + FilteringTextInputFormatter.allow( + RegExp('[a-zA-Z ]')) ], ), sizedBoxHeight(10.h), @@ -346,7 +346,8 @@ class _TellusaboutIndividualState extends State { inputFormatters: [ // LengthLimitingTextInputFormatter(20), RemoveEmojiInputFormatter(), - FilteringTextInputFormatter.allow(RegExp('[a-zA-Z ]')) + FilteringTextInputFormatter.allow( + RegExp('[a-zA-ZS0-9 ]')), ], ), sizedBoxHeight(10.h), @@ -416,26 +417,33 @@ class _TellusaboutIndividualState extends State { inputFormatters: [ // LengthLimitingTextInputFormatter(20), RemoveEmojiInputFormatter(), - FilteringTextInputFormatter.allow(RegExp('[a-zA-Z ]')) + FilteringTextInputFormatter.allow( + RegExp('[a-zA-Z ]')) ], ), sizedBoxHeight(20.h), CustomButton( text: "Continue", onPressed: () { - if (fullNameController.text.isBlank! || - userNameController.text.isBlank! || - datecontroller.text.isBlank! || - _selectedgendertype.isEmpty || - locationcontroller.text.isBlank! || - editProfileImage.profilePicPath.value == '') { - utils.showToast('Please fill all fields'); + if (editProfileImage.profilePicPath.value == '') { + utils + .showToast('Please Upload Profile Picture'); + } else if (fullNameController.text.isBlank!) { + utils.showToast('Please enter full name'); + } else if (userNameController.text.isBlank!) { + utils.showToast('Please enter user name'); + } else if (datecontroller.text.isBlank!) { + utils.showToast('Please select date of birth'); + } else if (_selectedgendertype.isEmpty) { + utils.showToast('Please select gender'); + } else if (locationcontroller.text.isBlank!) { + utils.showToast('Please enter location'); } else { TellusUploadData(); } // if (_selectedgendertype.isNotEmpty) { // Get.toNamed(RouteName.individualprofilestep1); - + // // Get.to(() => BusinessPage()); // } else { // // Handle case where no selection is made diff --git a/lib/onboarding/Signup/View/communitycommitment.dart b/lib/onboarding/Signup/View/communitycommitment.dart index 7c441c5..f159ae1 100644 --- a/lib/onboarding/Signup/View/communitycommitment.dart +++ b/lib/onboarding/Signup/View/communitycommitment.dart @@ -1,9 +1,9 @@ import 'package:flutter/material.dart'; +import 'package:flutter/widgets.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; -import 'package:glassmorphism/glassmorphism.dart'; import 'package:regroup/Utils/Common/CustomNextButton.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; + import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/texts.dart'; import 'package:regroup/resources/routes/route_name.dart'; @@ -107,7 +107,8 @@ class _CommunitycommitmentState extends State { CustomButton2( text: 'Decline', onPressed: () { - Get.offAllNamed(RouteName.loginScreen); + alertdialogwidget(); + // Get.offAllNamed(RouteName.loginScreen); }) ], ), @@ -115,4 +116,130 @@ class _CommunitycommitmentState extends State { ], )); } + + alertdialogwidget() { + Get.dialog(Dialog( + // backgroundColor: Colors.transparent, + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10.r), + color: const Color(0xFF222935)), + child: Padding( + padding: EdgeInsets.only( + right: 16.w, left: 16.w, top: 20.h, bottom: 40.h), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + text16w400_FCFCFC("Are you sure you don’t want to be \nNice?", + textAlign: TextAlign.center), + sizedBoxHeight(16.h), + Row( + children: [ + InkWell( + onTap: () { + Get.back(); + dialogwidget(); + + Future.delayed(Duration(seconds: 2), () { + Get.back(); + Get.toNamed(RouteName.signupendpage); + }); + }, + child: Container( + // width: 120.w, + height: 40.h, + decoration: BoxDecoration( + gradient: LinearGradient( + begin: Alignment.centerLeft, + end: Alignment.centerRight, + colors: [ + Color.fromRGBO(255, 255, 255, 0.036), + Color.fromRGBO(255, 255, 255, 0.048), + ], + ), + border: Border.all( + color: Color(0xFF434A53), + width: 1.0, + ), + borderRadius: BorderRadius.circular(30.r)), + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 10.w), + child: + Center(child: text14400white("Yes, I am evil")), + ), + ), + ), + Spacer(), + GestureDetector( + onTap: () { + Get.toNamed(RouteName.signupendpage); + }, + child: Container( + // height: 40.h, + // width: 120.w, + decoration: BoxDecoration( + color: Color(0xFFD90B2E), + borderRadius: BorderRadius.circular(30.r), + ), + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 20.w), + child: Center( + child: text14w400_FCFCFC( + "No, I want \nto be Nice")), + ), + ), + ) + ], + ) + ], + ), + ), + ), + ], + ), + )); + } + + dialogwidget() { + Get.dialog(Dialog( + // backgroundColor: Colors.transparent, + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10.r), + color: const Color(0xFF222935)), + child: Padding( + padding: EdgeInsets.only( + right: 80.w, left: 80.w, top: 20.h, bottom: 40.h), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + "assets/images/png/Group 1000004420.png", + height: 66.h, + width: 66.w, + ), + sizedBoxHeight(14.w), + SizedBox( + width: 182.w, + child: text16w400_FCFCFC( + "Nah, I know you’re nice person...", + textAlign: TextAlign.center), + ), + sizedBoxHeight(16.h), + ], + ), + ), + ), + ], + ), + )); + } } diff --git a/lib/onboarding/Signup/View/signupendpage.dart b/lib/onboarding/Signup/View/signupendpage.dart index 0fed976..80d19e8 100644 --- a/lib/onboarding/Signup/View/signupendpage.dart +++ b/lib/onboarding/Signup/View/signupendpage.dart @@ -1,7 +1,9 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; +import 'package:regroup/Global.dart'; import 'package:regroup/Utils/Common/CustomNextButton.dart'; +import 'package:regroup/Utils/Common/googleOAuthService.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/texts.dart'; import 'package:regroup/resources/routes/route_name.dart'; @@ -27,54 +29,43 @@ class _SignupendPageState extends State { fit: BoxFit.fill)), ), Center( - child: Container( - width: 358.w, - height: 519.h, - decoration: ShapeDecoration( - gradient: LinearGradient( - begin: const Alignment(0.98, -0.21), - end: const Alignment(-0.98, 0.21), - colors: [ - Colors.white.withOpacity(0.05999999865889549), - Colors.white.withOpacity(0.07999999821186066) - ], - ), - shape: RoundedRectangleBorder( - side: const BorderSide(width: 0.80, color: Color(0xFF434A53)), - borderRadius: BorderRadius.circular(5), - ), - ), - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 30.h), - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Image.asset('assets/images/png/regroupredtexticon.png'), - sizedBoxHeight(30.h), - text25700white('Welcome Edward '), - sizedBoxHeight(20.h), - // text16400white( - // '''Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.'''), - Text( - '''Congratulations, your account has been successfully created. Get ready to regroup with your community''', - textAlign: TextAlign.center, - style: TextStyle( - color: const Color(0xCCFCFCFC), - fontSize: 16.sp, - fontFamily: 'Helvetica', - fontWeight: FontWeight.w400, - ), + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 30.h), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image.asset('assets/images/png/regroupredtexticon.png'), + sizedBoxHeight(30.h), + Center( + child: text25700white( + " Welcome $mainWelcomeName" ?? 'Welcome Edward ', + textAlign: TextAlign.center)), + sizedBoxHeight(20.h), + // text16400white( + // '''Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.'''), + SizedBox( + width: 246.w, + child: Text( + '''Your account is now active. Welcome to the ReGroup community''', + textAlign: TextAlign.center, + style: TextStyle( + color: const Color(0xCCFCFCFC), + fontSize: 16.sp, + fontFamily: 'Helvetica', + fontWeight: FontWeight.w400, ), - sizedBoxHeight(20.h), - CustomButton( - text: "Let's begin", - onPressed: () { - Get.toNamed(RouteName.mainscreen); - }) - ], + ), ), - )), + sizedBoxHeight(20.h), + CustomButton( + text: "Let's begin", + onPressed: () { + Get.toNamed(RouteName.mainscreen); + }) + ], + ), + ), ) ], )); diff --git a/lib/onboarding/Signup/View/signupscreen.dart b/lib/onboarding/Signup/View/signupscreen.dart index f7f30d0..5f8ecd9 100644 --- a/lib/onboarding/Signup/View/signupscreen.dart +++ b/lib/onboarding/Signup/View/signupscreen.dart @@ -7,6 +7,7 @@ import 'package:flutter_facebook_auth/flutter_facebook_auth.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:regroup/Common/base_manager.dart'; +import 'package:regroup/Global.dart'; import 'package:regroup/Login/ViewModel/LoginApi.dart'; import 'package:regroup/Utils/Common/AppleOAuthService.dart'; import 'package:regroup/Utils/Common/CommonDropdown.dart'; @@ -139,30 +140,30 @@ class _SignupScreenState extends State { } Uploadata() async { - SharedPreferences prefs = await SharedPreferences.getInstance(); + SharedPreferences prefs = await SharedPreferences.getInstance(); utils.loader(); int accountTypeValue = _accountTypeMap[_selectedAccountType] ?? 0; Map updata = { "email_address": emailidcontroller.text, "password": passwordController.text, - "account_type": accountTypeValue, + "account_type": "1", }; final data = await Onboard().Postregisteration(updata); if (data.status == ResponseStatus.SUCCESS) { Get.back(); print("Sign up done"); + globalAccountType = "1"; String selectedCategory = _selectedAccountType; Get.toNamed(RouteName.verifyusercreen, arguments: { "emailid": emailidcontroller.text, "password": passwordController.text, - "accounttype": selectedCategory, - 'accountypenumber': accountTypeValue + "accounttype": "Individual", + 'accountypenumber': 1, }); - - + return utils.showToast(data.message); } else { Get.back(); @@ -171,6 +172,11 @@ class _SignupScreenState extends State { } } + @override + void initState() { + super.initState(); + } + @override Widget build(BuildContext context) { return GestureDetector( @@ -291,27 +297,27 @@ class _SignupScreenState extends State { ], ), sizedBoxHeight(10.h), - Row( - children: [ - text16400white('Account type'), - sizedBoxWidth(5.w), - Image.asset( - 'assets/images/png/informationicon.png') - ], - ), - sizedBoxHeight(10.h), - CustomDropDownRadio( - header: 'Select account type', - title: '', - listData: const [ - 'Individual', - 'Business', - ], - onItemSelected: _onItemSelected, - leadingImage: Image.asset( - 'assets/images/png/user.png', - ), - ), + // Row( + // children: [ + // text16400white('Account type'), + // sizedBoxWidth(5.w), + // Image.asset( + // 'assets/images/png/informationicon.png') + // ], + // ), + // sizedBoxHeight(10.h), + // CustomDropDownRadio( + // header: 'Select account type', + // title: '', + // listData: const [ + // 'Individual', + // 'Business', + // ], + // onItemSelected: _onItemSelected, + // leadingImage: Image.asset( + // 'assets/images/png/user.png', + // ), + // ), sizedBoxHeight(30.h), Row( mainAxisAlignment: MainAxisAlignment.center, @@ -385,11 +391,12 @@ class _SignupScreenState extends State { _formKey.currentState?.validate(); if ( // isValid! - emailidcontroller.text.isBlank! && - passwordController.text.isBlank! && + emailidcontroller.text.isBlank! || + passwordController.text.isBlank! || confirmpasscontroller - .text.isBlank! && - _selectedAccountType.isEmpty) { + .text.isBlank! + // && _selectedAccountType.isEmpty + ) { print(emailidcontroller.text); print(passwordController.text); print(_selectedAccountType.toString()); @@ -513,7 +520,7 @@ class _SignupScreenState extends State { decoration: ShapeDecoration( gradient: LinearGradient( begin: const Alignment( - 0.71, -0.70), + 0.71, -0.70), end: const Alignment(-0.71, 0.7), colors: [ @@ -538,6 +545,68 @@ class _SignupScreenState extends State { ), ), sizedBoxHeight(20.h), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + SizedBox( + width: 320.w, + // height: 42.h, + child: Text.rich( + TextSpan( + children: [ + TextSpan( + text: + 'Are you a business looking to join ', + style: TextStyle( + color: const Color(0xFFFCFCFC), + fontSize: 14.sp, + fontFamily: 'Helvetica', + fontWeight: FontWeight.w400, + ), + ), + TextSpan( + text: 'Regroup?', + style: TextStyle( + color: const Color(0xFFD90B2E), + fontSize: 14.sp, + fontFamily: 'Helvetica', + fontWeight: FontWeight.w400, + ), + ), + ], + ), + textAlign: TextAlign.center, + ), + ), + ], + ), + sizedBoxHeight(25.h), + InkWell( + onTap: () { + Get.toNamed(RouteName.bussignupScreen); + }, + child: Container( + width: double.infinity, + height: 50.h, + decoration: BoxDecoration( + gradient: LinearGradient( + begin: Alignment.centerLeft, + end: Alignment.centerRight, + colors: [ + Color.fromRGBO(255, 255, 255, 0.036), + Color.fromRGBO(255, 255, 255, 0.048), + ], + ), + borderRadius: BorderRadius.circular(30.r), + border: Border.all( + color: Color(0xFF434A53), + width: 1, + ), + ), + child: Center( + child: text16w400_FCFCFC("Sign up here")), + ), + ), ], ), ), diff --git a/lib/onboarding/Signup/view_model/getUserprofile.dart b/lib/onboarding/Signup/view_model/getUserprofile.dart index effc8b2..344240b 100644 --- a/lib/onboarding/Signup/view_model/getUserprofile.dart +++ b/lib/onboarding/Signup/view_model/getUserprofile.dart @@ -36,11 +36,18 @@ class Getuserdetails { 'phone', getuserobj?.data?.userData?.phoneNumber ?? ""); await prefs.setString('accountTypefromLogin', getuserobj?.data?.userData?.principalTypeXid.toString() ?? ""); + await prefs.setString( + 'userId', getuserobj?.data?.userData?.id.toString() ?? ""); + emailid = prefs.getString('email'); myusername = prefs.getString('username'); fullname = prefs.getString('fullname'); phonenumber = prefs.getString('phone'); globalAccountType = prefs.getString('accountTypefromLogin'); + userIdGlobal = prefs.getString('userId') ?? "0"; + + globalAccountType = + getuserobj?.data?.userData?.principalTypeXid.toString(); } else if (responseData is String) { Map jsonMap; try { diff --git a/lib/onboarding/SplashScreen.dart b/lib/onboarding/SplashScreen.dart index 841450c..8918a68 100644 --- a/lib/onboarding/SplashScreen.dart +++ b/lib/onboarding/SplashScreen.dart @@ -10,8 +10,9 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_svg/svg.dart'; import 'package:get/get.dart'; import 'package:regroup/Common/base_manager.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/EditProfile/ViewModel/InterestApiList.dart'; import 'package:regroup/Global.dart'; +import 'package:regroup/Main_Screens/Community/ViewModel/getmethod.dart'; +import 'package:regroup/Main_Screens/ProfileTab/EditProfile/ViewModel/InterestApiList.dart'; import 'package:regroup/Utils/Common/NoInternet.dart'; import 'package:regroup/Utils/dialogs.dart'; import 'package:regroup/onboarding/Signup/view_model/getUserprofile.dart'; @@ -46,6 +47,7 @@ class _SplashScreenState extends State { if (token == null || token!.isEmpty) { Get.toNamed(RouteName.onboarding1); } else { + await Communityallgetmethod().getLikeicons(); await InterestListApi().getinterestlistApi(); await Uploadata(deviceName); await Getuserdetails().Getuser().then((value) { diff --git a/lib/onboarding/forgotPass/View/ForgotOtp.dart b/lib/onboarding/forgotPass/View/ForgotOtp.dart index 918b4e3..6b3a7a2 100644 --- a/lib/onboarding/forgotPass/View/ForgotOtp.dart +++ b/lib/onboarding/forgotPass/View/ForgotOtp.dart @@ -2,12 +2,10 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; -import 'package:glassmorphism/glassmorphism.dart'; import 'package:pin_code_fields/pin_code_fields.dart'; import 'package:regroup/Common/base_manager.dart'; import 'package:regroup/Utils/Common/CommonAppbar.dart'; import 'package:regroup/Utils/Common/CustomNextButton.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/texts.dart'; import 'package:regroup/onboarding/forgotPass/ViewModel/ForgotPassAPI.dart'; @@ -22,11 +20,11 @@ class ForgotOtp extends StatefulWidget { } class _ForgotOtpState extends State { -TextEditingController? pincode = TextEditingController(); + TextEditingController? pincode = TextEditingController(); final String emailAddress = Get.arguments; double? principleId; - + get utils => null; // principleId = prefs.getString('email').toString(); @@ -48,14 +46,14 @@ TextEditingController? pincode = TextEditingController(); Get.snackbar( "Success!", 'OTP verification successful!', - duration: Duration(seconds: 2), + duration: const Duration(seconds: 2), colorText: Colors.white, backgroundColor: Colors.green, - margin: EdgeInsets.all(8), + margin: const EdgeInsets.all(8), snackStyle: SnackStyle.FLOATING, snackPosition: SnackPosition.BOTTOM, ); - Future.delayed(Duration(seconds: 1), () { + Future.delayed(const Duration(seconds: 1), () { Get.toNamed(RouteName.newpassword, arguments: emailAddress); }); // print('success'); @@ -65,10 +63,10 @@ TextEditingController? pincode = TextEditingController(); Get.snackbar( "Error!", data.data['message'], - duration: Duration(seconds: 2), + duration: const Duration(seconds: 2), colorText: Colors.white, backgroundColor: Colors.red, - margin: EdgeInsets.all(8), + margin: const EdgeInsets.all(8), snackStyle: SnackStyle.FLOATING, snackPosition: SnackPosition.BOTTOM, ); @@ -76,56 +74,23 @@ TextEditingController? pincode = TextEditingController(); } } - - @override Widget build(BuildContext context) { return Scaffold( - backgroundColor: Color.fromARGB(255, 18, 32, 47), - appBar: CommonAppbar( + backgroundColor: const Color.fromARGB(255, 18, 32, 47), + appBar: const CommonAppbar( titleTxt: '', ), body: Stack( children: [ - // CommonBlurLeftSecond(), - Positioned(top: 150, right: -30, child: CommonBlurRightSecond()), - Positioned(top: 350, left: -30, child: CommonBlurLeftBlue()), - GlassmorphicContainer( - width: MediaQuery.of(context).size.width, - height: - // 500.h, - MediaQuery.of(context).size.height, - borderRadius: 2, - blur: 6, - alignment: Alignment.bottomLeft, - border: 2, - linearGradient: LinearGradient( - begin: Alignment.topCenter, - end: Alignment.bottomCenter, - colors: [ - Color(0XFF222935).withOpacity(0.60), - Color(0XFF222935).withOpacity(0.60), - Color(0XFF222935).withOpacity(0.60), - Color(0XFF222935).withOpacity(0.60), - - // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50), - // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50), - // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50), - // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50), - ], - ), - borderGradient: LinearGradient( - begin: Alignment.topCenter, - end: Alignment.bottomCenter, - colors: [ - // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50), - // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50), - Color(0XFF222935).withOpacity(0.60), - - Color(0XFF222935).withOpacity(0.60), - ], - ), - child: Padding( + Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage("assets/images/png/Ellipse 1496.png"), + fit: BoxFit.fill)), + ), + + Padding( padding: EdgeInsets.symmetric(horizontal: 16.w), child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -157,29 +122,27 @@ TextEditingController? pincode = TextEditingController(); obscureText: false, animationType: AnimationType.fade, pinTheme: PinTheme( - selectedFillColor: Color(0xFF434A53), - inactiveFillColor: Color(0xFF434A53), - inactiveColor: Color(0xFF434A53), - activeColor: Color(0xFF434A53), - selectedColor: Color(0xFF434A53), + selectedFillColor: const Color(0xFF434A53), + inactiveFillColor: const Color(0xFF434A53), + inactiveColor: const Color(0xFF434A53), + activeColor: const Color(0xFF434A53), + selectedColor: const Color(0xFF434A53), shape: PinCodeFieldShape.underline, borderRadius: BorderRadius.circular(5), fieldHeight: 70, fieldWidth: 70, activeFillColor: // Colors.white - Color(0xFF303030).withOpacity(0.4), + const Color(0xFF303030).withOpacity(0.4), // textStyle: TextStyle(color: Colors.white, fontSize: 20), // Change text color and font size ), - animationDuration: Duration(milliseconds: 300), + animationDuration: const Duration(milliseconds: 300), enableActiveFill: true, autovalidateMode: AutovalidateMode.onUserInteraction, controller: pincode, onCompleted: (v) { - print("Completed"); }, onChanged: (value) { - print(value); setState(() { // currentText = value; }); @@ -191,7 +154,6 @@ TextEditingController? pincode = TextEditingController(); fontFamily: 'Helvetica', ), beforeTextPaste: (text) { - print("Allowing to paste $text"); return true; }, appContext: context, @@ -220,9 +182,9 @@ TextEditingController? pincode = TextEditingController(); ), ], ), - )), - ], - ), - );; + )],), + + ); + } -} \ No newline at end of file +} diff --git a/lib/onboarding/forgotPass/ViewModel/ForgotPassAPI.dart b/lib/onboarding/forgotPass/ViewModel/ForgotPassAPI.dart index 6303873..8e3a8dc 100644 --- a/lib/onboarding/forgotPass/ViewModel/ForgotPassAPI.dart +++ b/lib/onboarding/forgotPass/ViewModel/ForgotPassAPI.dart @@ -1,7 +1,6 @@ import 'package:regroup/Common/api_urls.dart'; import 'package:regroup/Common/base_manager.dart'; import 'package:regroup/Common/controller/data/network/network_api.dart'; -import 'package:shared_preferences/shared_preferences.dart'; class ForgotPassAPI { ForgotPassAPI(); diff --git a/lib/resources/routes/route_name.dart b/lib/resources/routes/route_name.dart index 49dfdfd..28a6607 100644 --- a/lib/resources/routes/route_name.dart +++ b/lib/resources/routes/route_name.dart @@ -14,9 +14,13 @@ class RouteName { static const String individualactivitystep2 = '/individualactivitystep2'; static const String individualgroupstep3 = '/individualgroupstep3'; static const String individualcommunitystep4 = '/individualcommunitystep4'; + static const String findcommunitypage = '/findcommunitypage'; + static const String communitycommitscreen = '/communitycommitscreen'; static const String signupendpage = '/signupendpage'; + + static const String bussignupScreen = '/bussignupScreen'; static const String businessletusunderstandstep1 = '/businessletusunderstand'; static const String businessSelectgroupstep2 = '/businessselectgroup'; static const String businessSelectcommunitystep3 = '/businessselectcommunity'; @@ -25,7 +29,7 @@ class RouteName { static const String mainscreen = '/mainscreen'; static const String sidemenu = '/sidemenu'; static const String savedposts = '/savedposts'; - static const String cyclescreen = '/cyclescreen'; + static const String tagdetailscreen = '/tagdetailscreen'; static const String postscreen = '/postscreen'; static const String reactionview = '/reactionview'; static const String postdetailsScreen = '/postdetailsScreen'; @@ -34,6 +38,8 @@ class RouteName { static const String communityInfo = '/communityInfo'; static const String announcement = '/announcement'; static const String watchlist = '/watchlist'; + static const String requestscreen = '/requestscreen'; + static const String group = '/group'; static const String communitysetting = '/communitysetting'; @@ -133,5 +139,17 @@ class RouteName { static const String addcertificate = '/addusercertificate'; + static const String viewalltags = '/viewalltags'; + + static const String viewallcommunitiespinned = '/viewallcommunitiespinned'; + + static const String viewalluserspinned = '/viewallusersspinned'; + + static const String communitymembers = '/communitymembers'; + + + + + } diff --git a/lib/resources/routes/routes.dart b/lib/resources/routes/routes.dart index 12a47a7..e8be143 100644 --- a/lib/resources/routes/routes.dart +++ b/lib/resources/routes/routes.dart @@ -1,100 +1,104 @@ import 'package:flutter/material.dart'; import 'package:get/get_navigation/src/routes/get_route.dart'; +import 'package:regroup/Main_Screens/CalenderTab/AddEvent/AddEvent.dart'; +import 'package:regroup/Main_Screens/CalenderTab/AddUsers/AddUsers.dart'; +import 'package:regroup/Main_Screens/CalenderTab/Availabillity.dart'; +import 'package:regroup/Main_Screens/CalenderTab/EventDetails.dart'; +import 'package:regroup/Main_Screens/CalenderTab/ManageMenmbers/ManageMembersCal.dart'; +import 'package:regroup/Main_Screens/CalenderTab/Resource%20Pool/ResourcePool.dart'; +import 'package:regroup/Main_Screens/CalenderTab/SetAvailabillity.dart'; +import 'package:regroup/Main_Screens/Chats/View/groupchat.dart'; +import 'package:regroup/Main_Screens/Chats/View/newchatpage.dart'; +import 'package:regroup/Main_Screens/Chats/View/newgroup.dart'; +import 'package:regroup/Main_Screens/Chats/View/userchat.dart'; +import 'package:regroup/Main_Screens/Community_HomePage/Community.dart'; +import 'package:regroup/Main_Screens/Community_HomePage/TagsdDetailScreen.dart'; +import 'package:regroup/Main_Screens/Community_HomePage/PostDetailScreen/View/PostDetailScreen.dart'; +import 'package:regroup/Main_Screens/Community_HomePage/PostDetailScreen/View/ReactionView.dart'; +import 'package:regroup/Main_Screens/Community_HomePage/PostScreen.dart'; +import 'package:regroup/Main_Screens/ExploreDesign/DetailExplore.dart'; +import 'package:regroup/Main_Screens/ExploreDesign/ExploreScreen.dart'; +import 'package:regroup/Main_Screens/ExploreDesign/SearchGroup.dart'; +import 'package:regroup/Main_Screens/GroupTab/View/ConnectCommunity.dart'; +import 'package:regroup/Main_Screens/GroupTab/View/GoupSettings.dart'; +import 'package:regroup/Main_Screens/GroupTab/View/GroupDetail.dart'; +import 'package:regroup/Main_Screens/GroupTab/View/GroupEvent.dart'; +import 'package:regroup/Main_Screens/GroupTab/View/GroupInfo.dart'; +import 'package:regroup/Main_Screens/GroupTab/View/GroupManage.dart'; +import 'package:regroup/Main_Screens/GroupTab/View/GroupTab.dart'; +import 'package:regroup/Main_Screens/GroupTab/View/NewPost.dart'; +import 'package:regroup/Main_Screens/GroupTab/View/RequestedGroups.dart'; +import 'package:regroup/Main_Screens/GroupTab/View/Sessions.dart'; +import 'package:regroup/Main_Screens/GroupTab/View/SubGroup/EditSubgroupInfo.dart'; +import 'package:regroup/Main_Screens/GroupTab/View/SubGroup/SubGroupInfo.dart'; +import 'package:regroup/Main_Screens/GroupTab/View/SubGroup/SubgroupSetting.dart'; +import 'package:regroup/Main_Screens/GroupTab/View/SubGroup/Subgroups.dart'; +import 'package:regroup/Main_Screens/ProfileTab/Badges/Badges.dart'; +import 'package:regroup/Main_Screens/ProfileTab/Certificate/AddCertificate.dart'; +import 'package:regroup/Main_Screens/ProfileTab/Certificate/Certificate.dart'; +import 'package:regroup/Main_Screens/ProfileTab/Clubs/Clubs.dart'; +import 'package:regroup/Main_Screens/ProfileTab/EditProfile/View/BusEditProfile.dart'; +import 'package:regroup/Main_Screens/ProfileTab/EditProfile/View/EditProfile.dart'; +import 'package:regroup/Main_Screens/ProfileTab/EditProfile/View/ProfileTab.dart'; +import 'package:regroup/Main_Screens/ProfileTab/Followers/Followers.dart'; +import 'package:regroup/Main_Screens/ProfileTab/Following/Following.dart'; +import 'package:regroup/Main_Screens/ProfileTab/Guest%20User/View/Business/ProfileTabBusGuest.dart'; +import 'package:regroup/Main_Screens/ProfileTab/Guest%20User/View/Individual/ProfileTabIndGuest.dart'; +import 'package:regroup/Main_Screens/ProfileTab/My%20Network/MyNetwork.dart'; +import 'package:regroup/Main_Screens/ProfileTab/Settings/AccountSessions.dart'; +import 'package:regroup/Main_Screens/ProfileTab/Settings/AccountSetting.dart'; +import 'package:regroup/Main_Screens/ProfileTab/Settings/ChangePassword.dart'; +import 'package:regroup/Main_Screens/ProfileTab/Settings/ContactUs.dart'; +import 'package:regroup/Main_Screens/ProfileTab/Settings/DeleteAccount.dart'; +import 'package:regroup/Main_Screens/ProfileTab/Settings/FaqScreen.dart'; +import 'package:regroup/Main_Screens/ProfileTab/Settings/HelpAndSupport.dart'; +import 'package:regroup/Main_Screens/ProfileTab/Settings/PrivacyPolicy.dart'; +import 'package:regroup/Main_Screens/ProfileTab/Settings/ReportABug.dart'; +import 'package:regroup/Main_Screens/ProfileTab/Settings/Settings.dart'; +import 'package:regroup/Main_Screens/ProfileTab/Settings/TermsCondition.dart'; +import 'package:regroup/Main_Screens/ProfileTab/Settings/VerifyCode.dart'; +import 'package:regroup/Main_Screens/ProfileTab/Settings/View/BlockedUsers.dart'; +import 'package:regroup/Main_Screens/ProfileTab/Settings/View/Notification.dart'; +import 'package:regroup/Main_Screens/ProfileTab/Share%20profile/ShareProfile.dart'; +import 'package:regroup/Main_Screens/ProfileTab/TimeLine/AddTimeline.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/CalenderTab/AddEvent/AddEvent.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/CalenderTab/AddUsers/AddUsers.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/CalenderTab/Availabillity.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/CalenderTab/EventDetails.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/CalenderTab/ManageMenmbers/ManageMembersCal.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/CalenderTab/Resource%20Pool/ResourcePool.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/CalenderTab/SetAvailabillity.dart'; +import 'package:regroup/Notifications/notification.dart'; +import 'package:regroup/onboarding/Signup/View/Business/View/busSignupScreen.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/Chats/View/groupchat.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/Chats/View/newchatpage.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/Chats/View/newgroup.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/Chats/View/userchat.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/Community/PostDetailScreen/View/ReactionView.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ExploreDesign/DetailExplore.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ExploreDesign/ExploreScreen.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ExploreDesign/SearchGroup.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/GroupTab/View/ConnectCommunity.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/GroupTab/View/GoupSettings.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/GroupTab/View/GroupDetail.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/GroupTab/View/GroupEvent.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/GroupTab/View/GroupInfo.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/GroupTab/View/GroupManage.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/GroupTab/View/GroupTab.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/GroupTab/View/NewPost.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/GroupTab/View/RequestedGroups.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/GroupTab/View/Sessions.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/GroupTab/View/SubGroup/EditSubgroupInfo.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/GroupTab/View/SubGroup/SubGroupInfo.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/GroupTab/View/SubGroup/SubgroupSetting.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/GroupTab/View/SubGroup/Subgroups.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Badges/Badges.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Certificate/AddCertificate.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Certificate/Certificate.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Clubs/Clubs.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/EditProfile/View/BusEditProfile.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/EditProfile/View/EditProfile.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/EditProfile/View/ProfileTab.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Followers/Followers.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Following/Following.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Guest%20User/View/Business/ProfileTabBusGuest.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Guest%20User/View/Individual/ProfileTabIndGuest.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/My%20Network/MyNetwork.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Settings/AccountSessions.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Settings/AccountSetting.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Settings/View/BlockedUsers.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Settings/ChangePassword.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Settings/ContactUs.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Settings/DeleteAccount.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Settings/FaqScreen.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Settings/HelpAndSupport.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Settings/View/Notification.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Settings/PrivacyPolicy.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Settings/ReportABug.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Settings/Settings.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Settings/TermsCondition.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Settings/VerifyCode.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Share%20profile/ShareProfile.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/TimeLine/AddTimeline.dart'; -import 'package:regroup/Feed%20Module/Notification/View/notification.dart'; - -import 'package:regroup/Feed%20Module/sidemenu/Community/Admin/PopupItem/Community%20settings/CommunitySetting.dart'; -import 'package:regroup/Feed%20Module/sidemenu/Community/Admin/PopupItem/Community%20settings/EditCommunity/EditCommunity.dart'; -import 'package:regroup/Feed%20Module/sidemenu/Community/Admin/PopupItem/Community%20settings/ManageGroup.dart'; -import 'package:regroup/Feed%20Module/sidemenu/Community/Admin/PopupItem/Community%20settings/ManageTags.dart/ManageTags.dart'; -import 'package:regroup/Feed%20Module/sidemenu/Community/Admin/PopupItem/Community%20settings/ManageTags.dart/NewTag/NewTag.dart'; -import 'package:regroup/Feed%20Module/sidemenu/Community/Announcements/AnnouncementRequest.dart'; -import 'package:regroup/Feed%20Module/sidemenu/Community/Announcements/ManageMembers.dart'; -import 'package:regroup/Feed%20Module/sidemenu/Community/Announcements/NewAnnouncement/NewAnnounceent.dart'; -import 'package:regroup/Feed%20Module/sidemenu/Community/MyCommunity/AddGroups.dart'; -import 'package:regroup/Feed%20Module/sidemenu/Community/MyCommunity/NewCommunity.dart'; -import 'package:regroup/Feed%20Module/sidemenu/Community/Watchlist.dart'; +import 'package:regroup/sidemenu/Community/Admin/PopupItem/Community%20settings/CommunitySetting.dart'; +import 'package:regroup/sidemenu/Community/Admin/PopupItem/Community%20settings/EditCommunity/EditCommunity.dart'; +import 'package:regroup/sidemenu/Community/Admin/PopupItem/Community%20settings/ManageGroup.dart'; +import 'package:regroup/sidemenu/Community/Admin/PopupItem/Community%20settings/ManageTags.dart/ManageInterest.dart'; +import 'package:regroup/sidemenu/Community/Admin/PopupItem/Community%20settings/ManageTags.dart/View/NewTag/NewTag.dart'; +import 'package:regroup/sidemenu/Community/Announcements/AnnouncementRequest.dart'; +import 'package:regroup/sidemenu/Community/Announcements/ManageMembers.dart'; +import 'package:regroup/sidemenu/Community/Announcements/NewAnnouncement/NewAnnounceent.dart'; +import 'package:regroup/sidemenu/Community/Members/CommunityMembers.dart'; +import 'package:regroup/sidemenu/Community/MyCommunity/AddGroups.dart'; +import 'package:regroup/sidemenu/Community/MyCommunity/NewCommunity.dart'; +import 'package:regroup/sidemenu/Community/MyCommunity/View/RequestsScreen.dart'; +import 'package:regroup/sidemenu/Community/Watchlist.dart'; import 'package:regroup/Login/View/loginscreen.dart'; import 'package:regroup/Common/controller/MainScreen.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/Community/Community.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/Community/CycleScreen.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/Community/PostDetailScreen/View/PostDetailScreen.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/Community/PostScreen.dart'; -import 'package:regroup/Feed%20Module/sidemenu/Community/Announcements/View/Announcements.dart'; -import 'package:regroup/Feed%20Module/sidemenu/Community/Group/view/Group.dart'; -import 'package:regroup/Feed%20Module/sidemenu/Community/MyCommunity/Community_Info-Page/view/communityInfo.dart'; -import 'package:regroup/Feed%20Module/sidemenu/Community/MyCommunity/View/CommunityDetails.dart'; -import 'package:regroup/Feed%20Module/sidemenu/Community/MyCommunity/View/MyCommunity.dart'; -import 'package:regroup/Feed%20Module/sidemenu/SavedPosts/SavedPosts.dart'; -import 'package:regroup/Feed%20Module/sidemenu/sidemenu.dart'; + +import 'package:regroup/sidemenu/Community/Announcements/View/Announcements.dart'; +import 'package:regroup/sidemenu/Community/Group/view/Group.dart'; +import 'package:regroup/sidemenu/Community/MyCommunity/Community_Info-Page/view/communityInfo.dart'; +import 'package:regroup/sidemenu/Community/MyCommunity/View/CommunityDetails.dart'; +import 'package:regroup/sidemenu/Community/MyCommunity/View/MyCommunity.dart'; +import 'package:regroup/sidemenu/SavedPosts/SavedPosts.dart'; +import 'package:regroup/sidemenu/communities.dart'; +import 'package:regroup/sidemenu/sidemenu.dart'; import 'package:regroup/Login/View/verifygoogleapple.dart'; import 'package:regroup/Utils/Common/NoInternet.dart'; import 'package:regroup/onboarding/NewPass/View/NewPass.dart'; import 'package:regroup/onboarding/Signup/View/Business/View/step1Letusunderstandbetter.dart'; -import 'package:regroup/onboarding/Signup/View/Business/View/step2Selectgroup.dart'; -import 'package:regroup/onboarding/Signup/View/Business/View/step3SelectCommunity.dart'; + import 'package:regroup/onboarding/Signup/View/Business/View/tellusbusiness.dart'; +import 'package:regroup/onboarding/Signup/View/Individual/FindCommunityPage.dart'; import 'package:regroup/onboarding/Signup/View/Individual/step1Selectprofile.dart'; import 'package:regroup/onboarding/Signup/View/Individual/step2Selectactivity.dart'; import 'package:regroup/onboarding/Signup/View/Individual/step3Selectyourgroup.dart'; @@ -109,6 +113,8 @@ import 'package:regroup/onboarding/forgotPass/View/ForgotPass.dart'; import 'package:regroup/onboarding/onboarding1.dart'; import 'package:regroup/onboarding/splashscreen.dart'; import 'package:regroup/resources/routes/route_name.dart'; +import 'package:regroup/sidemenu/tags.dart'; +import 'package:regroup/sidemenu/users.dart'; class AppRoutes { static appRoutes() => [ @@ -161,8 +167,8 @@ class AppRoutes { page: () => const SavedPosts(), ), GetPage( - name: RouteName.cyclescreen, - page: () => const CycleScreen(), + name: RouteName.tagdetailscreen, + page: () => const TagdetailScreen(), ), GetPage( name: RouteName.postscreen, @@ -192,10 +198,6 @@ class AppRoutes { name: RouteName.group, page: () => const Group(), ), - GetPage( - name: RouteName.individualprofilestep1, - page: () => const SelectIndividualProfile(), - ), GetPage( name: RouteName.individualactivitystep2, page: () => const SelectIndividualActivity(), @@ -208,6 +210,10 @@ class AppRoutes { name: RouteName.individualcommunitystep4, page: () => const SelectIndividualCommunity(), ), + GetPage( + name: RouteName.findcommunitypage, + page: () => const FindCommunityPage(), + ), GetPage( name: RouteName.communitycommitscreen, page: () => const Communitycommitment(), @@ -216,18 +222,14 @@ class AppRoutes { name: RouteName.signupendpage, page: () => const SignupendPage(), ), + GetPage( + name: RouteName.bussignupScreen, + page: () => const BusSignUpScreen(), + ), GetPage( name: RouteName.businessletusunderstandstep1, page: () => const LetusUnderstand(), ), - GetPage( - name: RouteName.businessSelectgroupstep2, - page: () => const SelectgroupStep2(), - ), - GetPage( - name: RouteName.businessSelectcommunitystep3, - page: () => const SelectBusinessCommunity(), - ), GetPage( name: RouteName.communitysetting, page: () => const CommunitySetting(), @@ -456,77 +458,96 @@ class AppRoutes { name: RouteName.editsubgroupinfo, page: () => const EditSubgroupInfo(), ), - GetPage( + GetPage( name: RouteName.subgroupsetting, page: () => const SubGroupSetting(), ), - GetPage( + GetPage( name: RouteName.explorescreen, page: () => const ExploreScreen(), ), - GetPage( + GetPage( name: RouteName.searchgroup, page: () => const SearchGroup(), ), - GetPage( + GetPage( name: RouteName.detailexplore, page: () => const DetailExplore(), ), - - GetPage( + GetPage( name: RouteName.certificate, page: () => const Certificate(), ), - GetPage( + GetPage( name: RouteName.availability, page: () => const Availability(), ), - - GetPage( + GetPage( name: RouteName.sessions, page: () => const Sessions(), ), - - GetPage( + GetPage( name: RouteName.forgotpass, page: () => const ForgotPass(), ), - GetPage( + GetPage( name: RouteName.newpassword, page: () => const NewPassword(), ), - GetPage( + GetPage( name: RouteName.forgotOtp, page: () => const ForgotOtp(), - ), - GetPage( - name: RouteName.verifygoogleapplepage, - page: () => Verifygoogleandapple(), ), - GetPage( + GetPage( + name: RouteName.verifygoogleapplepage, + page: () => Verifygoogleandapple(), + ), + GetPage( name: RouteName.buseditprofile, - page: () => BusEditProfile(), + page: () => const BusEditProfile(), ), GetPage( name: RouteName.profiletab, - page: () => ProfileTab(), + page: () => const ProfileTab(), + ), + GetPage( + name: RouteName.profiletabindguest, + page: () => const ProfileTabIndGuest(), + ), + GetPage( + name: RouteName.profiletabbusguest, + page: () => const profiletabBusGest(), + ), + GetPage( + name: RouteName.mynetwork, + page: () => const MyNetwork(), + ), + GetPage( + name: RouteName.addcertificate, + page: () => const AddCertificate(), + ), + GetPage( + name: RouteName.viewalltags, + page: () => const Viewtags(), + ), + GetPage( + name: RouteName.viewallcommunitiespinned, + page: () => const Communitiespinned(), + ), + GetPage( + name: RouteName.viewalluserspinned, + page: () => const Viewtusertags(), ), - GetPage( - name: RouteName.profiletabindguest, - page: () => ProfileTabIndGuest(), + GetPage( + name: RouteName.communitymembers, + page: () => const CommunityMembers(), ), - GetPage( - name: RouteName.profiletabbusguest, - page: () => profiletabBusGest(), - ), - GetPage( - name: RouteName.mynetwork, - page: () => MyNetwork(), - ), - GetPage( - name: RouteName.addcertificate, - page: () => AddCertificate(), + + + GetPage( + name: RouteName.requestscreen, + page: () => const RequestsScreen(), ), diff --git a/lib/sidemenu/Community/Admin/PopupItem/Community settings/CommunitySetting.dart b/lib/sidemenu/Community/Admin/PopupItem/Community settings/CommunitySetting.dart new file mode 100644 index 0000000..f0cbde2 --- /dev/null +++ b/lib/sidemenu/Community/Admin/PopupItem/Community settings/CommunitySetting.dart @@ -0,0 +1,98 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:regroup/Common/CommonWidget.dart'; +import 'package:regroup/Utils/Common/CommonAppbar.dart'; + +import 'package:regroup/Utils/Common/sized_box.dart'; +import 'package:regroup/Utils/texts.dart'; +import 'package:regroup/resources/routes/route_name.dart'; + +class CommunitySetting extends StatefulWidget { + const CommunitySetting({super.key}); + + @override + State createState() => _CommunitySettingState(); +} + +class _CommunitySettingState extends State { + int communityid = Get.arguments['communityid']; + @override + Widget build(BuildContext context) { + return WillPopScope( + onWillPop: () async{ + Get.back(result: true); + return true; + }, + child: Scaffold( + // key: _scaffoldKey1, + backgroundColor: Color(0xFF222935), + extendBody: true, + resizeToAvoidBottomInset: false, + appBar: CommonAppbar( + titleTxt: "Community settings", + customBack: true, + ), + body: Stack(children: [ + Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage("assets/images/png/Ellipse 1496.png"), + fit: BoxFit.fill)), + ), + Column(children: [ + sizedBoxHeight(30.h), + GestureDetector( + onTap: () { + Get.toNamed(RouteName.editcommunity, arguments: { + 'communityid': communityid, + }); + }, + child: rowTile(text: 'Edit community info')), + commonDivider(), + GestureDetector( + onTap: () { + Get.toNamed(RouteName.managemembers); + }, + child: rowTile(text: 'Manage members')), + commonDivider(), + GestureDetector( + onTap: () { + Get.toNamed(RouteName.managegroups, + arguments: { + 'communityid' : communityid, + } + ); + }, + child: rowTile(text: 'Manage groups')), + commonDivider(), + GestureDetector( + onTap: () { + Get.toNamed(RouteName.managetags, arguments: { + 'communityid': communityid, + }); + }, + child: rowTile(text: 'Manage interest')), + sizedBoxHeight(20.h), + ]) + ])), + ); + } + + Widget rowTile({ + required String text, + }) { + return Padding( + padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 20.h), + child: Row(children: [ + text18w400_FCFCFC(text), + Spacer(), + Icon( + Icons.arrow_forward_ios, + color: Colors.white, + size: 20, + ) + ]), + ); + } +} diff --git a/lib/sidemenu/Community/Admin/PopupItem/Community settings/EditCommunity/EditCommunity.dart b/lib/sidemenu/Community/Admin/PopupItem/Community settings/EditCommunity/EditCommunity.dart new file mode 100644 index 0000000..9d9c92d --- /dev/null +++ b/lib/sidemenu/Community/Admin/PopupItem/Community settings/EditCommunity/EditCommunity.dart @@ -0,0 +1,734 @@ +import 'dart:developer'; +import 'dart:io'; + +import 'package:dio/dio.dart'; +import 'package:dotted_border/dotted_border.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart' hide MultipartFile, FormData; +import 'package:regroup/Common/CommonGlassmorphism.dart'; +import 'package:regroup/Common/base_manager.dart'; +import 'package:regroup/Utils/Common/CommonAppbar.dart'; +import 'package:regroup/Utils/Common/CommonDropdown.dart'; +import 'package:regroup/Utils/Common/CustomNextButton.dart'; +import 'package:regroup/Utils/Common/ImageUpload.dart'; + +import 'package:regroup/Utils/Common/sized_box.dart'; +import 'package:regroup/Utils/Helper.dart'; +import 'package:regroup/Utils/dialogs.dart'; +import 'package:regroup/Utils/texts.dart'; +import 'package:regroup/Utils/Common/CustomTextformfield.dart'; +import 'package:regroup/sidemenu/Community/MyCommunity/Model/activitiesListModel.dart' + as primaryactlist; +import 'package:regroup/sidemenu/Community/MyCommunity/view_model/getmethod.dart'; +import 'package:regroup/sidemenu/Community/MyCommunity/view_model/postmethod.dart'; +import 'package:regroup/sidemenu/Community/MyCommunity/view_model/primaryactivity.dart'; +import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart'; +import 'package:path/path.dart' as path; + +class EditCommunity extends StatefulWidget { + const EditCommunity({super.key}); + + @override + State createState() => _EditCommunityState(); +} + +class _EditCommunityState extends State { + TextEditingController communitynameController = TextEditingController(); + TextEditingController descriptionController = TextEditingController(); + TextEditingController locationcontroller = TextEditingController(); + TextEditingController websitelinkcontroller = TextEditingController(); + + late Future myfuture; + int communityid = Get.arguments['communityid']; + + @override + void initState() { + myfuture = Getcommunity().getCommunityeditpage(communityid); + + super.initState(); + } + + List filePath = []; + List bannerPath = []; + bool isImageAdded = false; + bool isbannerAdded = false; + String? bannerimage; + bool isBannerLoaded = false; + bool isactivityLoaded = false; + + Future _loadBannerImage() async { + if (bannerimage!.isNotEmpty) { + File bannerFile = await Helper.networkImageToFile(bannerimage!); + setState(() { + bannerPath.add(bannerFile); + isbannerAdded = true; + isBannerLoaded = true; + }); + } + } + + bool isValidWebBannerLink(String link) { + RegExp urlRegExp = RegExp( + r"^(http(s)?://)?" + r"((([a-zA-Z0-9-]+)\.)+[a-zA-Z]{2,}|" + r"((\d{1,3}\.){3}\d{1,3}))" + r"(:\d{1,5})?(/([a-zA-Z0-9-._?,'+&%\$#=~])*)?$", + ); + + return urlRegExp.hasMatch(link); + } + + final Map _typeCommunityMap = { + 'Public': 1, + 'Private - Request to join': 2, + 'Secret': 3, + }; + + String _selectedtypecommunity = ''; + + void _onItemSelected(String value) { + setState(() { + _selectedtypecommunity = value; + print('selected community is $_selectedtypecommunity'); + }); + } + + primaryactlist.ActivitiesListsModel? abilityModel; + List activity = []; + List _activitydrop = []; + + String? selectedActivityName = ''; + + bool isDataLoaded = false; + + List> _abilityMap = []; + + Future fetchActivitylist() async { + PrimaryActivityListApi abilityListAPI = PrimaryActivityListApi(); + ResponseData response = await abilityListAPI.getActivitylistApi(); + + if (response.status == ResponseStatus.SUCCESS) { + abilityModel = + primaryactlist.ActivitiesListsModel.fromJson(response.data!); + setState(() { + activity = abilityModel!.data ?? []; + _activitydrop = + activity.map((platform) => platform.title.toString()).toList(); + _abilityMap = activity.map((platform) { + return { + "id": platform.id, + "name": platform.title.toString(), + }; + }).toList(); + }); + + // Debugging log for _abilityMap + print('Ability Map: $_abilityMap'); + + if (communityeditobj != null && communityeditobj!.data != null) { + int abilitiesXids = communityeditobj!.data!.communityData!.activityXid!; + selectedactivityid = abilitiesXids; + + String? name = await getSelectedName(selectedactivityid!); + setState(() { + selectedActivityName = name ?? ''; + isactivityLoaded = true; + isDataLoaded = true; // Mark data as loaded + }); + + // Debugging log for selectedActivityName + print('Selected activity ID is $selectedactivityid'); + print('Selected activity name is $selectedActivityName'); + } + } else { + print('Failed to fetch activities'); + setState(() { + isDataLoaded = false; // Ensure loader is not hidden in case of error + }); + } + } + + Future getSelectedName(int selectedId) async { + print('Searching for ID: $selectedId in _abilityMap'); + + for (Map ability in _abilityMap) { + if (ability["id"] == selectedId) { + print('Found ability: ${ability["name"]}'); + return ability["name"] as String; + } + } + return null; + } + + int? selectedactivityid; + + void getCatIdFromName(String selectedAbility) { + selectedactivityid = activity + .firstWhere((item) => item.title == selectedAbility, + orElse: () => activity.first) + .id; + print('Selected activity ID is $selectedactivityid'); + } + + String _cleanFileName(String filePath) { + return path + .basename(filePath) + .split('?') + .first; + } + + Uploadata() async { + utils.loader(); + List bannermedialist = []; + List profielpicturelist = []; + MultipartFile? imageFile; + + // for (var file in bannerPath.where((file) => file != null)) { + // bannermedialist.add( + // await MultipartFile.fromFile( + // file!.path, + // filename: path.basename(file.path), + // ), + // ); + // } + + for (var file in bannerPath.where((file) => file != null)) { + final filePath = file!.path; + final cleanedFileName = _cleanFileName(filePath); + + print('Original File Path: $filePath'); + print('Cleaned File Name: $cleanedFileName'); + + bannermedialist.add( + await MultipartFile.fromFile( + filePath, + filename: cleanedFileName, + ), + ); + } + + if (filePath.isNotEmpty && filePath[0] != null) { + var profileFile = filePath[0]; + if (profileFile!.path.isNotEmpty) { + // Convert local file to MultipartFile + imageFile = await MultipartFile.fromFile( + profileFile.path, + filename: path.basename(profileFile.path), + ); + } else { + // Handle case where file path is empty + imageFile = await Helper.networkImageToMultipartFile( + communityeditobj!.data!.communityData!.communityProfilePhoto!, + ); + } + } else if (communityeditobj!.data!.communityData!.communityProfilePhoto != + null) { + // Handle case where no file is provided, fallback to network image + imageFile = await Helper.networkImageToMultipartFile( + communityeditobj!.data!.communityData!.communityProfilePhoto!, + ); + } else { + // Handle case where no profile picture is provided + print('No profile picture provided.'); + return; + } + + int communityTypeValue = _typeCommunityMap[_selectedtypecommunity] ?? 0; + print('Image File: ${imageFile.filename}'); + print( + 'Banner Media List: ${bannermedialist.map((file) => file.filename).toList()}'); + + FormData formdata = FormData.fromMap({ + "community_profile_photo": imageFile, + "community_banner_image": bannermedialist[0], + "community_name": communitynameController.text, + "community_location": locationcontroller.text, + "community_description": descriptionController.text, + 'community_type_xid': communityTypeValue, + 'activity_xid': selectedactivityid, + 'community_id': communityid, + }); + print('updata is ${formdata.toString()}'); + log('log is ${formdata.toString()}'); + final data = await PostMethodCommunity().postEditcommunity(formdata); + if (data.status == ResponseStatus.SUCCESS) { + Get.back(); + print("community updated"); + // Get.toNamed(RouteName.mycommunity); + Get.back(); + return utils.showToast(data.message); + } else { + Get.back(); + print("community not updated"); + return utils.showToast(data.message); + } + } + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: () => FocusManager.instance.primaryFocus?.unfocus(), + child: Scaffold( + // key: _scaffoldKey1, + backgroundColor: Color(0xFF222935), + extendBody: true, + appBar: CommonAppbar( + titleTxt: "Edit community info", + ), + resizeToAvoidBottomInset: true, + body: FutureBuilder( + future: myfuture, + builder: (ctx, snapshot) { + if (snapshot.data == null) { + return const Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Center( + child: CircularProgressIndicator( + color: Color(0xFFC18948), + ), + ) + ], + ); + } + if (snapshot.connectionState == ConnectionState.done) { + if (snapshot.hasError) { + return Center( + child: Text( + '${snapshot.error} occured', + style: TextStyle(fontSize: 18.spMin), + ), + ); + } + } + if (!isBannerLoaded) { + bannerimage = communityeditobj! + .data!.communityData!.communityBannerImage!; + _loadBannerImage(); // Call only if not already loaded + } + communitynameController.text = + communityeditobj!.data!.communityData!.communityName!; + descriptionController.text = + communityeditobj!.data!.communityData!.communityDescription!; + locationcontroller.text = + communityeditobj!.data!.communityData!.communityLocation!; + websitelinkcontroller.text = + communityeditobj!.data!.communityData!.communityDescription!; + var communityType = communityeditobj! + .data!.communityData!.communityTypeData!.name; + if (_selectedtypecommunity.isEmpty) { + _selectedtypecommunity = communityType ?? 'Public'; + } + if (!isactivityLoaded) { + fetchActivitylist(); + } + if (!isDataLoaded) { + // Show a loader or a placeholder until data is fully loaded + return const Center( + child: CircularProgressIndicator( + color: Color(0xFFC18948), + ), + ); + } + + return Stack(children: [ + Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: + AssetImage("assets/images/png/Ellipse 1496.png"), + fit: BoxFit.fill)), + ), + SingleChildScrollView( + child: Column(children: [ + // sizedBoxHeight(30.h), + Stack( + clipBehavior: Clip.none, + children: [ + Container( + height: 100.h, + width: 100.w, + decoration: BoxDecoration( + shape: BoxShape.circle, + border: Border.all( + color: Color(0xFF434A53), width: 0.5.w), + ), + child: Center( + child: filePath.isNotEmpty + ? ClipOval( + child: SizedBox.fromSize( + size: Size.fromRadius(50.r), + child: filePath.isNotEmpty + ? Image.file( + filePath[0]!, + fit: BoxFit.cover, + width: double.infinity, + ) + : Image.asset( + 'assets/images/png/Ellipse 37.png', + fit: BoxFit.cover), + ), + ) + : ClipOval( + child: SizedBox.fromSize( + size: Size.fromRadius(50.r), + child: communityeditobj! + .data! + .communityData! + .communityProfilePhoto! + .isNotEmpty + ? Image.network( + communityeditobj! + .data! + .communityData! + .communityProfilePhoto!, + fit: BoxFit.cover, + errorBuilder: (context, error, + stackTrace) { + // Error handling when image fails to load + return Image.asset( + "assets/images/png/Ellipse 37.png", + fit: BoxFit.cover, + ); + }, + ) + : Image.asset( + 'assets/images/png/Ellipse 37.png', + fit: BoxFit.cover), + ), + )), + ), + Positioned( + right: -10, + bottom: 0, + child: InkWell( + onTap: () { + ImageUploadBottomSheet().showModal( + context, + false, + (result) { + if (result != null && result.isNotEmpty) { + var file = File(result); + filePath.cast(); + filePath.add(file); + isImageAdded = true; + setState(() {}); + if (Platform.isAndroid) { + Get.back(); + } + } else { + filePath.clear(); + isImageAdded = false; + setState(() {}); + } + }, + ); + }, + child: Container( + height: 35.h, + width: 35.w, + decoration: BoxDecoration( + color: Color(0xFFD90B2E), + shape: BoxShape.circle, + border: Border.all( + color: Color(0xFFD90B2E), + width: 0.5.w)), + child: Center( + child: Image.asset( + 'assets/images/png/cameraicon.png', + height: 14.h, + width: 15.w, + ), + ), + ), + )) + ], + ), + sizedBoxHeight(25.h), + text16w400_white("Edit community profile picture"), + sizedBoxHeight(30.h), + Padding( + padding: EdgeInsets.symmetric(horizontal: 16.w), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + text16w400_FCFCFC("Community banner image"), + sizedBoxHeight(16.h), + DottedBorder( + strokeWidth: 1, + dashPattern: [7, 4], + borderType: BorderType.RRect, + radius: Radius.circular(14.r), + color: Color(0xFF434A53), + child: commonGlassUI( + borderwidth: 0, + width: double.infinity, + height: 150.h, + borderRadius: BorderRadius.circular(10.r), + customWidget: + bannerPath.isNotEmpty && isbannerAdded + ? Stack( + children: [ + Image.file( + bannerPath[0]!, + fit: BoxFit.cover, + width: double.infinity, + ), + ], + ) + : GestureDetector( + onTap: () { + ImageUploadBottomSheet().showModal( + context, + false, + (result) { + if (result != null && + result.isNotEmpty) { + var file = File(result); + + // Check if the file size exceeds 10 MB + int fileSizeInBytes = + file.lengthSync(); + double fileSizeInMB = + fileSizeInBytes / + (1024 * 1024); + + if (fileSizeInMB > 10) { + // Show toast message if the file size exceeds 10 MB + utils.showToast( + "The selected file is too large. Max file size is 10 MB."); + } else { + // Clear the existing image and add the new one + bannerPath.clear(); + bannerPath.add(file); + isbannerAdded = true; + setState(() {}); + } + } else { + // Handle case where no image is selected + bannerPath.clear(); + isbannerAdded = false; + setState(() {}); + } + if (Platform.isAndroid) { + Get.back(); + } + }, + ); + }, + child: Padding( + padding: EdgeInsets.symmetric( + vertical: 16.h), + child: Column( + children: [ + Image.asset( + "assets/images/png/cameraicon2.png", + height: 36.h, + width: 36.w, + ), + SizedBox(height: 10.h), + text14w400white( + 'Upload banner image'), + SizedBox(height: 8.h), + SizedBox( + width: 270.w, + child: Center( + child: text8w400_8A8A8A( + "Allowed file extensions: jpg, png, gif Max file size: 10 MB"), + ), + ), + ], + ), + ), + ), + ), + ), + sizedBoxHeight(16.w), + bannerPath.isNotEmpty && isbannerAdded + ? commonGlassUI( + width: double.infinity, + height: 60.h, + borderRadius: BorderRadius.circular(10.r), + customWidget: Center( + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: 12.w), + child: Row( + children: [ + // Conditionally render image or placeholder + if (bannerPath.isNotEmpty && + isbannerAdded) + Container( + height: 40.h, + width: 40.w, + decoration: BoxDecoration( + borderRadius: + BorderRadius.circular(5.r), + ), + child: Image.file( + bannerPath[0]!, + fit: BoxFit.cover, + width: double.infinity, + ), + ) + else + Container( + height: 40.h, + width: 40.w, + decoration: BoxDecoration( + borderRadius: + BorderRadius.circular(5.r), + ), + child: Image.asset( + 'assets/images/png/img2.png', + fit: BoxFit.cover, + width: double.infinity, + ), + ), + SizedBox(width: 8.w), + Spacer(), + InkWell( + onTap: () { + setState(() { + // Clear the image and update the state + bannerPath.clear(); + isbannerAdded = false; + }); + // Optionally debug state values + print("bannerPath: $bannerPath"); + print( + "isbannerAdded: $isbannerAdded"); + }, + child: Image.asset( + 'assets/images/png/cancelicon.png', + height: 20.h, + width: 20.w, + ), + ), + ], + ), + ), + ), + borderwidth: 1, + ) + : SizedBox(), + sizedBoxHeight(25.h), + text16w400_FCFCFC("Community name*"), + sizedBoxHeight(14.h), + CustomTextFormField( + textEditingController: communitynameController, + validator: (val) { + if (val == null || val.isEmpty) { + return 'Enter Community name'; + } + return null; + }, + inputFormatters: [ + RemoveEmojiInputFormatter(), + FilteringTextInputFormatter.allow(RegExp('[a-zA-Z ]')) + ], + hintText: 'Enter type of community', + ), + sizedBoxHeight(25.h), + text16w400_FCFCFC("Group description"), + sizedBoxHeight(14.h), + CustomTextFormField( + // maxlines: 3, + hintText: 'Enter description', + inputFormatters: [ + RemoveEmojiInputFormatter(), + // FilteringTextInputFormatter.allow(RegExp('[a-zA-Z ]')) + ], + textEditingController: descriptionController, + ), + sizedBoxHeight(25.h), + text16w400_FCFCFC("Type of community*"), + sizedBoxHeight(14.h), + CustomDropDownRadio( + header: "", + title: "", + listData: _typeCommunityMap.keys.toList(), + onItemSelected: _onItemSelected, + leadingImage: SizedBox(), + initialSelectedValue: _selectedtypecommunity, + ), + sizedBoxHeight(25.h), + text16w400_FCFCFC("Location*"), + sizedBoxHeight(14.h), + CustomTextFormField( + textEditingController: locationcontroller, + inputFormatters: [ + RemoveEmojiInputFormatter(), + FilteringTextInputFormatter.allow(RegExp('[a-zA-Z ]')) + // FilteringTextInputFormatter.allow(RegExp('[a-zA-Z ]')) + ], + hintText: 'Enter location', + validator: (val) { + if (val == null || val.isEmpty) { + return 'Enter location'; + } + return null; + }, + ), + sizedBoxHeight(25.h), + text16w400_FCFCFC("Primary activity*"), + sizedBoxHeight(14.h), + CustomDropDownRadio( + showOtherOption: false, + header: "", + title: "", + listData: _activitydrop, + onItemSelected: getCatIdFromName, + leadingImage: SizedBox(), + initialSelectedValue: selectedActivityName ?? '', + ), + sizedBoxHeight(25.h), + // text16w400_FCFCFC("Website link"), + // sizedBoxHeight(14.h), + // CustomTextFormField( + // textEditingController: websitelinkcontroller, + // validator: (val) { + // if (!isValidWebBannerLink(val)) { + // return 'Please enter a valid web banner link.'; + // } + // return null; + // }, + // hintText: 'Enter website link', + // ), + // sizedBoxHeight(25.h), + sizedBoxHeight(50.h), + CustomButton( + text: 'Save changes', + onPressed: () { + if (bannerPath.isEmpty || + communitynameController.text.isEmpty || + _selectedtypecommunity.isEmpty || + locationcontroller.text.isEmpty || + selectedactivityid.isBlank!) { + utils.showToast('Please fill all fields'); + } + // else if (filePath.isEmpty) { + // utils.showToast( + // 'Please add community profile picture'); + // } + else { + print('done'); + + Uploadata(); + } + }), + sizedBoxHeight(50.h), + ], + ), + ) + ]), + ) + ]); + }, + )), + ); + } +} diff --git a/lib/sidemenu/Community/Admin/PopupItem/Community settings/ManageGroup.dart b/lib/sidemenu/Community/Admin/PopupItem/Community settings/ManageGroup.dart new file mode 100644 index 0000000..dd14cb2 --- /dev/null +++ b/lib/sidemenu/Community/Admin/PopupItem/Community settings/ManageGroup.dart @@ -0,0 +1,463 @@ +import 'dart:async'; +import 'dart:io'; + +import 'package:cached_network_image/cached_network_image.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/widgets.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:regroup/Common/CommonGlassmorphism.dart'; +import 'package:regroup/Common/CommonWidget.dart'; +import 'package:regroup/Common/base_manager.dart'; +import 'package:regroup/Utils/Common/CommonAppbar.dart'; +import 'package:regroup/Utils/Common/CustomTextformfield.dart'; + +import 'package:regroup/Utils/Common/sized_box.dart'; +import 'package:regroup/Utils/dialogs.dart'; +import 'package:regroup/Utils/texts.dart'; +import 'package:regroup/resources/routes/route_name.dart'; +import 'package:regroup/sidemenu/Community/MyCommunity/Model/communitymanageGroupsModel.dart'; +import 'package:regroup/sidemenu/Community/MyCommunity/view_model/getmethod.dart'; +import 'package:regroup/sidemenu/Community/MyCommunity/view_model/postmethod.dart'; +import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart'; + +class ManageGroups extends StatefulWidget { + const ManageGroups({super.key}); + + @override + State createState() => _ManageGroupsState(); +} + +class _ManageGroupsState extends State { + int communityid = Get.arguments['communityid']; + StreamController searchcontroller = + StreamController(); + + @override + void initState() { + print(communityid); + var updata = communityid; + var updata2 = ""; + Getcommunity().getCommunityManageGroupssearch(updata, updata2, + streamController: searchcontroller); + + super.initState(); + } + + @override + void dispose() { + searchcontroller.close(); + super.dispose(); + } + + int? removeid; + + RemoveUploadata(int remove) async { + utils.loader(); + Map updata = { + "manage_community_xid": communityid, + "manage_group_xid": removeid, + }; + final data = await PostMethodCommunity().postGroupsRemove(updata); + if (data.status == ResponseStatus.SUCCESS) { + Get.back(); + print("remove done"); + return utils.showToast(data.message); + } else { + Get.back(); + print("remove not done"); + return utils.showToast(data.message); + } + } + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: () => FocusManager.instance.primaryFocus?.unfocus(), + child: Scaffold( + // key: _scaffoldKey1, + backgroundColor: Color(0xFF222935), + extendBody: true, + resizeToAvoidBottomInset: false, + appBar: CommonAppbar( + titleTxt: "Manage groups", + // customActionWidget: InkWell( + // onTap: () {}, + // child: Container( + // height: 35.h, + // width: 35.w, + // decoration: BoxDecoration( + // color: Color(0xFFD90B2E), + // shape: BoxShape.circle, + // boxShadow: [ + // BoxShadow( + // color: Color(0x40000000), + // offset: Offset(0, 6), + // blurRadius: 8, + // spreadRadius: 0, + // ), + // ], + // ), + // child: Icon(Icons.add, color: Colors.white, weight: 2), + // ), + // ), + ), + body: Stack(children: [ + Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage("assets/images/png/Ellipse 1496.png"), + fit: BoxFit.fill)), + ), + Column(children: [ + Padding( + padding: EdgeInsets.symmetric(horizontal: 16.w), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + sizedBoxHeight(20.h), + CustomTextFormField( + leadingIcon: SizedBox( + height: 23, + width: 23, + child: Center( + child: Image.asset( + "assets/images/png/ion_search-outline.png", + height: 23, + width: 23, + ), + ), + ), + hintText: "Search groups", + inputFormatters: [ + RemoveEmojiInputFormatter(), + ], + onInput: (value) { + Getcommunity().getCommunityManageGroupssearch( + communityid, value, + streamController: searchcontroller); + }, + ), + sizedBoxHeight(25.h), + Row( + children: [ + commonGlassUI( + opacity1: 0.24, + opacity2: 0.24, + width: 50.w, + height: 50.h, + borderRadius: BorderRadius.circular(100), + customWidget: Center( + child: Image.asset( + "assets/images/png/Black.png", + height: 30.h, + width: 30.w, + )), + borderwidth: 0.5), + sizedBoxWidth(8.w), + text18w400_FCFCFC("Create group"), + Spacer(), + Icon( + Icons.arrow_forward_ios_outlined, + color: Colors.white, + size: 14.sp, + ), + ], + ), + sizedBoxHeight(30.h), + GestureDetector( + onTap: () async { + List filePath = []; + List bannerPath = []; + var result = + await Get.toNamed(RouteName.addgroup, arguments: { + 'communityname': "", + 'communitylocation': "", + 'communitydescription': "", + 'communitytype': 0, + 'activityid': 0, + 'communityprofilephoto': filePath, + 'communitybannerimage': bannerPath, + 'isedited': true, + 'communityid': communityid.toString(), + }); + if (result != null && result) { + setState(() { + Getcommunity().getCommunityManageGroupssearch( + communityid, '', + streamController: searchcontroller); + }); + } + }, + child: Row( + children: [ + commonGlassUI( + opacity1: 0.24, + opacity2: 0.24, + width: 50.w, + height: 50.h, + borderRadius: BorderRadius.circular(100), + customWidget: Center( + child: Image.asset( + "assets/images/png/ion_add.png", + height: 30.h, + width: 30.w, + )), + borderwidth: 0.5), + sizedBoxWidth(8.w), + text18w400_FCFCFC("Add existing groups"), + Spacer(), + Icon( + Icons.arrow_forward_ios_outlined, + color: Colors.white, + size: 14.sp, + ), + ], + ), + ), + sizedBoxHeight(30.h), + text18w700white("Groups"), + sizedBoxHeight(20.h), + ]), + ), + Expanded( + child: StreamBuilder( + stream: searchcontroller.stream, + builder: (ctx, snapshot) { + if (snapshot.connectionState == ConnectionState.waiting) { + // Display shimmer effect while waiting for data + return const Center(child: CircularProgressIndicator()); + } else if (snapshot.hasError) { + // Handle error state + return Center( + child: Text( + '${snapshot.error} occurred', + style: const TextStyle(fontSize: 18), + ), + ); + } else { + // Data has been loaded, show actual UI + return communitymanagegroupsobj!.data.isEmpty + ? _buildNoDataBody(context) + : ListView.separated( + physics: const ScrollPhysics(), + shrinkWrap: true, + itemCount: communitymanagegroupsobj!.data.length, + separatorBuilder: + (BuildContext context, int index) { + return commonDivider(); + }, + itemBuilder: (context, index) { + var mainGroupsData = + communitymanagegroupsobj!.data[index]; + return Column( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 16.h, horizontal: 16.w), + child: Row( + children: [ + mainGroupsData.groupsData! + .groupImage == + null || + mainGroupsData.groupsData! + .groupImage!.isEmpty + ? CircleAvatar( + backgroundImage: AssetImage( + 'assets/images/png/img45.png'), + radius: 20.r, + ) + : CircleAvatar( + backgroundImage: + CachedNetworkImageProvider( + mainGroupsData.groupsData! + .groupImage!, + ), + radius: 25.r, + child: CachedNetworkImage( + cacheKey: mainGroupsData + .groupsData!.id + .toString(), + maxHeightDiskCache: 100, + maxWidthDiskCache: 100, + imageUrl: mainGroupsData + .groupsData! + .groupImage!, + placeholder: + (context, url) => + Container(), + errorWidget: + (context, url, error) => + Icon(Icons.error), + imageBuilder: (context, + imageProvider) => + CircleAvatar( + backgroundImage: + imageProvider, + radius: 25.r, + ), + ), + ), + + sizedBoxWidth(10.w), + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + mainGroupsData.groupsData! + .title == + null || + mainGroupsData + .groupsData! + .title! + .isEmpty + ? text16w400_FCFCFC( + 'ReGroup') + : + // text16w400_FCFCFC( mainGroupsData.groupsData!.title!), + Text( + mainGroupsData + .groupsData!.title!, + overflow: TextOverflow + .ellipsis, + style: TextStyle( + fontSize: 16.sp, + color: const Color( + 0xFFFCFCFC), + fontFamily: + 'Helvetica', + fontWeight: + FontWeight + .w400), + ), + sizedBoxHeight(4.h), + mainGroupsData.groupsData! + .description == + null || + mainGroupsData + .groupsData! + .description! + .isEmpty + ? text12w400_FCFCFC_blur( + 'ReGroup') + : Text( + mainGroupsData + .groupsData! + .description!, + overflow: TextOverflow + .ellipsis, + style: TextStyle( + fontSize: 12.sp, + color: const Color( + 0xFFFCFCFC) + .withOpacity( + 0.8), + fontFamily: + 'Helvetica', + fontWeight: + FontWeight + .w400), + ), + ], + ), + ), + Spacer(), + InkWell( + onTap: () async { + setState(() { + removeid = + communitymanagegroupsobj! + .data[index] + .manageGroupXid ?? + 0; + communitymanagegroupsobj!.data + .removeWhere((item) => + item.manageGroupXid == + removeid); + print(removeid.toString()); + + RemoveUploadata(removeid!); + }); + }, + child: Image.asset( + 'assets/images/png/Group 1000004149.png', + ), + ) + // Icon( + // Icons.clear, + // color: Color(0xFFFFFFFF), + // weight: 1.88, + // ) + ], + ), + ), + commonDivider(), + ], + ); + }, + ); + } + }, + ), + ), + ]) + ])), + ); + } +} + +Widget _buildNoDataBody(context) { + return Center( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + "No Groups Found", + style: TextStyle( + color: Colors.white, + fontSize: 16.sp, + fontWeight: FontWeight.w600), + ) + ], + ), + ); +} + +Widget groupWidget({ + required String imagePath, + required String title, + required String subtitle, +}) { + return Padding( + padding: EdgeInsets.symmetric(vertical: 16.h, horizontal: 16.w), + child: Row( + children: [ + CircleAvatar( + backgroundImage: AssetImage(imagePath), + radius: 20.r, + ), + sizedBoxWidth(10.w), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + text16w400_FCFCFC(title), + sizedBoxHeight(4.h), + text12w400_FCFCFC_blur(subtitle) + ], + ), + Spacer(), + Image.asset( + 'assets/images/png/Group 1000004149.png', + ) + // Icon( + // Icons.clear, + // color: Color(0xFFFFFFFF), + // weight: 1.88, + // ) + ], + ), + ); +} diff --git a/lib/sidemenu/Community/Admin/PopupItem/Community settings/ManageTags.dart/ManageInterest.dart b/lib/sidemenu/Community/Admin/PopupItem/Community settings/ManageTags.dart/ManageInterest.dart new file mode 100644 index 0000000..166bda7 --- /dev/null +++ b/lib/sidemenu/Community/Admin/PopupItem/Community settings/ManageTags.dart/ManageInterest.dart @@ -0,0 +1,539 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/widgets.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:glassmorphism/glassmorphism.dart'; +import 'package:regroup/Common/CommonGlassmorphism.dart'; +import 'package:regroup/Common/CommonTabBar.dart'; +import 'package:regroup/Common/CommonWidget.dart'; +import 'package:regroup/Common/base_manager.dart'; +import 'package:regroup/Utils/Common/CommonAppbar.dart'; +import 'package:regroup/Utils/Common/ShimmerCommon.dart'; + +import 'package:regroup/Utils/Common/sized_box.dart'; +import 'package:regroup/Utils/dialogs.dart'; +import 'package:regroup/Utils/texts.dart'; +import 'package:regroup/resources/routes/route_name.dart'; +import 'package:regroup/sidemenu/Community/Admin/PopupItem/Community%20settings/ManageTags.dart/ViewModel/maanageInterestApi.dart'; + +var communityid; + +class ManageTags extends StatefulWidget { + const ManageTags({super.key}); + + @override + State createState() => _ManageTagsState(); +} + +class _ManageTagsState extends State { + @override + Widget build(BuildContext context) { + communityid = Get.arguments['communityid']; + return Scaffold( + // key: _scaffoldKey1, + backgroundColor: const Color(0xFF222935), + extendBody: true, + appBar: const CommonAppbar( + titleTxt: "Manage interest", + ), + resizeToAvoidBottomInset: false, + body: Stack(children: [ + Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage("assets/images/png/Ellipse 1496.png"), + fit: BoxFit.fill)), + ), + SingleChildScrollView( + child: Column(children: [ + sizedBoxHeight(20.h), + DefaultTabController( + length: 2, + // initialIndex: selectedIndex.value, + child: Column(children: [ + const CommonTabBar(tabs: [ + Tab( + text: 'Interest', + ), + Tab( + text: 'Tag requests', + ), + ]), + SizedBox( + height: 600.h, + child: const TabBarView( + children: [ + InterestTab(), + TagRequestTab(), + ], + ), + ), + ])) + ])) + ]), + floatingActionButtonLocation: CustomFloatingActionButtonLocation(60.0), + floatingActionButton: Container( + height: 55.h, + width: 55.w, + decoration: const BoxDecoration( + shape: BoxShape.circle, + boxShadow: [ + BoxShadow( + color: Color(0x40000000), // Hex color with 40% opacity + offset: Offset(0, 6), + blurRadius: 8, + ), + ], + ), + child: FloatingActionButton( + onPressed: () { + Get.toNamed(RouteName.newtag, arguments: { + 'communityid': communityid, + }); + }, + backgroundColor: const Color(0xFFD90B2E), + autofocus: true, + shape: const CircleBorder(), + child: Image.asset( + "assets/images/png/iconamoon_edit-thin.png", + height: 30.h, + width: 30.w, + ), + ), + )); + } +} + +class InterestTab extends StatefulWidget { + const InterestTab({super.key}); + + @override + State createState() => _InterestTabState(); +} + +class _InterestTabState extends State { + List tags = ['Cycle', 'Sports', 'Fitness', 'Kayaking', 'Sports club']; + late Future interestfuture; + @override + void initState() { + communityid = Get.arguments['communityid']; + interestfuture = ManageInterestApi().getInterests(communityid); + + // TODO: implement initState + super.initState(); + } + + @override + Widget build(BuildContext context) { + return FutureBuilder( + future: interestfuture, + builder: (ctx, snapshot) { + if (snapshot.connectionState == ConnectionState.waiting) { + return const Center(child: CircularProgressIndicator()); + } + + if (snapshot.hasError) { + return Center( + child: Text( + '${snapshot.error} occurred', + style: TextStyle(fontSize: 18.spMin), + ), + ); + } + + if (snapshot.connectionState == ConnectionState.done && + snapshot.hasData) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + sizedBoxHeight(25.h), + Padding( + padding: EdgeInsets.symmetric(horizontal: 16.w), + child: text16400white("Special Announcement Interest"), + ), + sizedBoxHeight(15.h), + Expanded( + child: fetchinterestobj!.data!.acceptedTags.isEmpty || + fetchinterestobj!.data!.acceptedTags + .every((tag) => tag.isSpecial != 0) + ? Center( + child: Text( + "No announcement interest found", // Updated message + style: TextStyle( + color: Colors.white, + fontSize: 16.sp, + fontWeight: FontWeight.w600), + ), + ) + : ListView.builder( + shrinkWrap: true, + itemCount: + fetchinterestobj!.data!.acceptedTags.length, + itemBuilder: (context, index) { + if (fetchinterestobj! + .data!.acceptedTags[index].isSpecial == + 0) { + return Column( + children: [ + rowTagsTile( + text: fetchinterestobj! + .data!.acceptedTags[index].name ?? + ''), + if (index != + fetchinterestobj!.data!.acceptedTags + .where( + (tag) => tag.isSpecial == 0) + .toList() + .length - + 1) + commonDivider(), + ], + ); + } + return const SizedBox + .shrink(); // Skip rendering if isSpecial is not 0 + }, + ), + ), + sizedBoxHeight(40.h), + Padding( + padding: EdgeInsets.symmetric(horizontal: 16.w), + child: text16400white("Standard interest"), + ), + sizedBoxHeight(15.h), + Expanded( + child: fetchinterestobj!.data!.acceptedTags.isEmpty || + fetchinterestobj!.data!.acceptedTags + .every((tag) => tag.isSpecial != 1 && tag != 1) + ? Center( + child: Text( + "No standard interest found", + style: TextStyle( + color: Colors.white, + fontSize: 16.sp, + fontWeight: FontWeight.w600), + ), + ) + : ListView.builder( + shrinkWrap: true, + itemCount: + fetchinterestobj!.data!.acceptedTags.length, + itemBuilder: (context, index) { + if (fetchinterestobj! + .data!.acceptedTags[index].isSpecial == + 1) { + return Column( + children: [ + rowTagsTile( + text: fetchinterestobj! + .data!.acceptedTags[index].name ?? + ''), + if (index != + fetchinterestobj! + .data!.acceptedTags.length - + 1) + commonDivider(), + ], + ); + } + return const SizedBox + .shrink(); // Return an empty widget if the condition is not met + }, + ), + ) + ], + ); + } + return Container(); + }); + } +} + +Widget rowTagsTile({ + required String text, +}) { + return Padding( + padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 18.h), + child: Row(children: [ + text16w700_FCFCFCItalic(text), + const Spacer(), + Image.asset( + "assets/images/png/Group 1000004071.png", + width: 5.w, + height: 22.h, + ) + ]), + ); +} + +class TagRequestTab extends StatefulWidget { + const TagRequestTab({super.key}); + + @override + State createState() => _TagRequestTabState(); +} + +class _TagRequestTabState extends State { + late Future taginterestfuture; + + List tagrequest = [ + 'Running', + 'Fit fam friday', + ]; + + @override + void initState() { + // TODO: implement initState + + communityid = Get.arguments['communityid']; + taginterestfuture = ManageInterestApi().getInterests(communityid); + + super.initState(); + } + + @override + Widget build(BuildContext context) { + return FutureBuilder( + future: taginterestfuture, + builder: (ctx, snapshot) { + if (snapshot.connectionState == ConnectionState.waiting) { + return const Center(child: CircularProgressIndicator()); + } + + if (snapshot.hasError) { + return Center( + child: Text( + '${snapshot.error} occurred', + style: TextStyle(fontSize: 18.spMin), + ), + ); + } + + if (snapshot.connectionState == ConnectionState.done && + snapshot.hasData) { + return fetchinterestobj!.data!.requestedTags.isEmpty + ? Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Center( + child: Column( + children: [ + Text( + "No Posts Available", + style: TextStyle( + color: Colors.white, + fontSize: 16.sp, + fontWeight: FontWeight.w600), + ) + ], + ), + ), + ]) + : Column( + children: [ + sizedBoxHeight(30.h), + Expanded( + child: ListView.builder( + shrinkWrap: true, + itemCount: + fetchinterestobj!.data!.requestedTags.length, + itemBuilder: (context, index) { + return Column( + children: [ + Padding( + padding: + EdgeInsets.symmetric(horizontal: 16.w), + child: commonGlassUI( + width: double.infinity, + height: 60.h, + borderRadius: BorderRadius.circular(10.r), + customWidget: Center( + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: 16.w), + child: Row(children: [ + text16w700_FCFCFC(fetchinterestobj! + .data! + .requestedTags[index] + .name ?? + ""), + const Spacer(), + GestureDetector( + onTap: () async { + Map updata = { + "tag_xid": fetchinterestobj! + .data! + .requestedTags[index] + .id, + "is_accepted": "0", + }; + final data = + await ManageInterestApi() + .postAcceptReject(updata); + if (data.status == + ResponseStatus.SUCCESS) { + print("success"); + setState(() { + fetchinterestobj! + .data!.requestedTags + .removeAt(index); + }); + return utils + .showToast(data.message); + } else { + Get.back(); + print("Failed"); + return utils + .showToast(data.message); + } + }, + child: commonGlassUI( + width: 35.w, + height: 35.h, + opacity1: 0.24, + opacity2: 0.24, + borderRadius: + BorderRadius.circular(100), + customWidget: const Center( + child: Icon( + Icons.clear, + size: 20, + color: Colors.white, + weight: 1, + )), + borderwidth: 0.5), + ), + sizedBoxWidth(16.w), + GestureDetector( + onTap: () async { + Map updata = { + "tag_xid": fetchinterestobj! + .data! + .requestedTags[index] + .id, + "is_accepted": "1", + }; + final data = + await ManageInterestApi() + .postAcceptReject(updata); + if (data.status == + ResponseStatus.SUCCESS) { + print("success"); + setState(() { + fetchinterestobj! + .data!.requestedTags + .removeAt(index); + }); + return utils + .showToast(data.message); + } else { + Get.back(); + print("Failed"); + return utils + .showToast(data.message); + } + }, + child: Container( + height: 35.h, + width: 35.w, + decoration: const BoxDecoration( + color: Color(0xFFD90B2E), + shape: BoxShape.circle, + ), + child: const Icon( + Icons.check, + size: 20, + color: Colors.white, + weight: 1, + ), + ), + ) + ]), + ), + ), + ), + ), + sizedBoxHeight(20.h) + ], + ); + }, + ), + ) + ], + ); + } + return Container(); + }); + } +} + +Widget rowTagRequestTile({ + required String title, +}) { + return Padding( + padding: EdgeInsets.symmetric(horizontal: 16.w), + child: commonGlassUI( + width: double.infinity, + height: 60.h, + borderRadius: BorderRadius.circular(10.r), + customWidget: Center( + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 16.w), + child: Row(children: [ + text16w700_FCFCFC(title), + const Spacer(), + commonGlassUI( + width: 35.w, + height: 35.h, + opacity1: 0.24, + opacity2: 0.24, + borderRadius: BorderRadius.circular(100), + customWidget: const Center( + child: Icon( + Icons.clear, + size: 20, + color: Colors.white, + weight: 1, + )), + borderwidth: 0.5), + sizedBoxWidth(16.w), + Container( + height: 35.h, + width: 35.w, + decoration: const BoxDecoration( + color: Color(0xFFD90B2E), + shape: BoxShape.circle, + ), + child: const Icon( + Icons.check, + size: 20, + color: Colors.white, + weight: 1, + ), + ) + ]), + ), + ), + borderwidth: 1), + ); +} + +class CustomFloatingActionButtonLocation extends FloatingActionButtonLocation { + final double offset; + + CustomFloatingActionButtonLocation(this.offset); + + @override + Offset getOffset(ScaffoldPrelayoutGeometry scaffoldGeometry) { + // Calculate the position + double fabX = scaffoldGeometry.scaffoldSize.width - + scaffoldGeometry.floatingActionButtonSize.width - + 16.0; + double fabY = scaffoldGeometry.scaffoldSize.height - + scaffoldGeometry.floatingActionButtonSize.height - + 16.0 - + offset; + return Offset(fabX, fabY); + } +} diff --git a/lib/sidemenu/Community/Admin/PopupItem/Community settings/ManageTags.dart/Model/FetchInterestModel.dart b/lib/sidemenu/Community/Admin/PopupItem/Community settings/ManageTags.dart/Model/FetchInterestModel.dart new file mode 100644 index 0000000..696c88c --- /dev/null +++ b/lib/sidemenu/Community/Admin/PopupItem/Community settings/ManageTags.dart/Model/FetchInterestModel.dart @@ -0,0 +1,74 @@ +class FetchInterestModel { + FetchInterestModel({ + required this.status, + required this.statusCode, + required this.message, + required this.data, + }); + + final String? status; + final int? statusCode; + final String? message; + final Data? data; + + factory FetchInterestModel.fromJson(Map json){ + return FetchInterestModel( + status: json["status"], + statusCode: json["status_code"], + message: json["message"], + data: json["data"] == null ? null : Data.fromJson(json["data"]), + ); + } + +} + +class Data { + Data({ + required this.acceptedTags, + required this.requestedTags, + }); + + final List acceptedTags; + final List requestedTags; + + factory Data.fromJson(Map json){ + return Data( + acceptedTags: json["accepted_tags"] == null ? [] : List.from(json["accepted_tags"]!.map((x) => TedTag.fromJson(x))), + requestedTags: json["requested_tags"] == null ? [] : List.from(json["requested_tags"]!.map((x) => TedTag.fromJson(x))), + ); + } + +} + +class TedTag { + TedTag({ + required this.id, + required this.name, + required this.isSpecial, + required this.isRequested, + required this.isAccepted, + required this.isActive, + required this.isPinned, + }); + + final int? id; + final String? name; + final int? isSpecial; + final int? isRequested; + final int? isAccepted; + final int? isActive; + final bool? isPinned; + + factory TedTag.fromJson(Map json){ + return TedTag( + id: json["id"], + name: json["name"], + isSpecial: json["is_special"], + isRequested: json["is_requested"], + isAccepted: json["is_accepted"], + isActive: json["is_active"], + isPinned: json["is_pinned"], + ); + } + +} diff --git a/lib/sidemenu/Community/Admin/PopupItem/Community settings/ManageTags.dart/View/NewTag/NewTag.dart b/lib/sidemenu/Community/Admin/PopupItem/Community settings/ManageTags.dart/View/NewTag/NewTag.dart new file mode 100644 index 0000000..697c3f0 --- /dev/null +++ b/lib/sidemenu/Community/Admin/PopupItem/Community settings/ManageTags.dart/View/NewTag/NewTag.dart @@ -0,0 +1,143 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:regroup/Common/base_manager.dart'; +import 'package:regroup/Utils/Common/CommonAppbar.dart'; +import 'package:regroup/Utils/Common/CustomNextButton.dart'; +import 'package:regroup/Utils/Common/CustomTextformfield.dart'; + +import 'package:regroup/Utils/Common/sized_box.dart'; +import 'package:regroup/Utils/dialogs.dart'; +import 'package:regroup/Utils/texts.dart'; +import 'package:regroup/sidemenu/Community/Admin/PopupItem/Community%20settings/ManageTags.dart/ViewModel/maanageInterestApi.dart'; + +enum Interests { tag1, tag2 } + +class NewTag extends StatefulWidget { + const NewTag({super.key}); + + @override + State createState() => _NewTagState(); +} + +class _NewTagState extends State { + int communityid = Get.arguments['communityid']; + Interests? _tags = Interests.tag1; + final interestController = TextEditingController(); + + addSuccess() async { + String isSpecialValue = _tags == Interests.tag1 ? "0" : "1"; + Map updata = { + "manage_community_xid": communityid.toString(), + "name": interestController.text, + "is_special": isSpecialValue, + }; + final data = await ManageInterestApi().postNewInterest(updata); + if (data.status == ResponseStatus.SUCCESS) { + print("success"); + Get.back(); + + return utils.showToast(data.message); + } else { + // Get.back(); + print("Failed"); + return utils.showToast(data.message); + } + } + + @override + Widget build(BuildContext context) { + return Scaffold( + // key: _scaffoldKey1, + backgroundColor: const Color(0xFF222935), + extendBody: true, + appBar: const CommonAppbar( + titleTxt: "New interest", + ), + resizeToAvoidBottomInset: false, + body: Stack(children: [ + Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage("assets/images/png/Ellipse 1496.png"), + fit: BoxFit.fill)), + ), + SingleChildScrollView( + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.end, + children: [ + sizedBoxHeight(30.h), + text16w400_FCFCFC("Interest name"), + sizedBoxHeight(16.h), + CustomTextFormField( + textEditingController: interestController, + hintText: "", + validator: (val) { + if (val == null || val.isEmpty) { + return 'Enter a interest name'; + } + return null; + }, + ), + sizedBoxHeight(40.h), + text16w400_FCFCFC("Nature of interest"), + sizedBoxHeight(40.h), + Row( + children: [ + Transform.scale( + scale: 1.2, + child: Radio( + fillColor: + const MaterialStatePropertyAll(Color(0xFFD90B2E)), + activeColor: const Color(0xFFD90B2E), + value: Interests.tag1, + groupValue: _tags, + onChanged: (Interests? val) { + setState(() { + _tags = val; + }); + }, + ), + ), + text18w400white("Special Announcement Tag") + ], + ), + sizedBoxHeight(10.h), + Row( + children: [ + Transform.scale( + scale: 1.2, + child: Radio( + fillColor: + const MaterialStatePropertyAll(Color(0xFFD90B2E)), + activeColor: const Color(0xFFD90B2E), + value: Interests.tag2, + groupValue: _tags, + onChanged: (Interests? val) { + setState(() { + _tags = val; + }); + }, + ), + ), + text18w400white("Standard Tag") + ], + ), + sizedBoxHeight(80.h), + CustomButton( + text: "Add", + onPressed: () { + if (interestController.text.isBlank!) { + utils.showToast("Enter your interest"); + } else { + addSuccess(); + } + }) + ]), + )) + ])); + } +} diff --git a/lib/sidemenu/Community/Admin/PopupItem/Community settings/ManageTags.dart/ViewModel/maanageInterestApi.dart b/lib/sidemenu/Community/Admin/PopupItem/Community settings/ManageTags.dart/ViewModel/maanageInterestApi.dart new file mode 100644 index 0000000..8ebf8d5 --- /dev/null +++ b/lib/sidemenu/Community/Admin/PopupItem/Community settings/ManageTags.dart/ViewModel/maanageInterestApi.dart @@ -0,0 +1,78 @@ +// InviteComModel ? inviteComobj; + +import 'dart:developer'; + +import 'package:regroup/Common/api_urls.dart'; +import 'package:regroup/Common/base_manager.dart'; +import 'package:regroup/Common/controller/data/network/network_api.dart'; +import 'package:regroup/Utils/dialogs.dart'; +import 'package:regroup/sidemenu/Community/Admin/PopupItem/Community%20settings/ManageTags.dart/Model/FetchInterestModel.dart'; + +FetchInterestModel? fetchinterestobj; + +class ManageInterestApi { + Future> postNewInterest(updata) async { + print("updata is $updata"); + final response = await NetworkApiServices().postApi( + updata, + ApiUrls.postnewinterest, + ); + if (response.status == ResponseStatus.SUCCESS) { + if (response.data["status"] == "success") { + // likepostobj = LikepostModel.fromJson(response.data); + } + + return ResponseData( + response.data['message'], ResponseStatus.SUCCESS, + data: response.data); + } else if (response.status == ResponseStatus.FAILED) { + if (response.data["status"] == "error") { + utils.showToast(response.message); + } + + return ResponseData( + response.data['message'], ResponseStatus.FAILED, + data: response.data); + } else { + return ResponseData( + response.data['message'], ResponseStatus.FAILED); + } + } + + + Future> getInterests(updata) async { + final response = await NetworkApiServices().getApi( + "${ApiUrls.getinterests}?manage_community_xid=$updata" + + + ); + if (response.status == ResponseStatus.SUCCESS) { + fetchinterestobj = FetchInterestModel.fromJson(response.data); + log(fetchinterestobj!.data.toString()); + } + return response; + } + + + Future> postAcceptReject(updata) async { + print("updata is $updata"); + final response = await NetworkApiServices().postApi( + updata, + ApiUrls.postacceptreject, + ); + if (response.status == ResponseStatus.SUCCESS) { + // if (response.data["status"] == "success") { + // // likepostobj = LikepostModel.fromJson(response.data); + // } + + return ResponseData( + response.data['message'], ResponseStatus.SUCCESS, + data: response.data); + + } else { + return ResponseData( + response.data['message'], ResponseStatus.FAILED); + } + } + +} diff --git a/lib/Feed Module/sidemenu/Community/Announcements/AnnouncementRequest.dart b/lib/sidemenu/Community/Announcements/AnnouncementRequest.dart similarity index 81% rename from lib/Feed Module/sidemenu/Community/Announcements/AnnouncementRequest.dart rename to lib/sidemenu/Community/Announcements/AnnouncementRequest.dart index 6299508..dbb5b1f 100644 --- a/lib/Feed Module/sidemenu/Community/Announcements/AnnouncementRequest.dart +++ b/lib/sidemenu/Community/Announcements/AnnouncementRequest.dart @@ -3,7 +3,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:regroup/Common/CommonGlassmorphism.dart'; import 'package:regroup/Utils/Common/CommonAppbar.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; + import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/texts.dart'; import 'package:regroup/resources/routes/route_name.dart'; @@ -27,23 +27,24 @@ class _AnnouncementRequestState extends State { titleTxt: "Announcement requests", ), body: Stack(children: [ - Container( + Container( decoration: const BoxDecoration( image: DecorationImage( image: AssetImage("assets/images/png/Ellipse 1496.png"), fit: BoxFit.fill)), - ), SingleChildScrollView( - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 16), - child: Column( - children: [ - sizedBoxHeight(25.h), - Announcementtile( - profileImg: "assets/images/png/Ellipse 43.png", - title: "title", - mainImg: "assets/images/png/Rectangle 22.png") - ], - ))) + ), + SingleChildScrollView( + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 16), + child: Column( + children: [ + sizedBoxHeight(25.h), + Announcementtile( + profileImg: "assets/images/png/Ellipse 43.png", + title: "title", + mainImg: "assets/images/png/Rectangle 22.png") + ], + ))) ])); } @@ -52,11 +53,11 @@ class _AnnouncementRequestState extends State { required String title, required String mainImg, }) { - return commonGlassContainer( + return commonGlassUI( width: double.infinity, height: 400.h, - borderradius: 10.r, - border: 1, + borderRadius: BorderRadius.circular( 10.r), + borderwidth: 1, customWidget: Padding( padding: const EdgeInsets.symmetric(horizontal: 16), child: Column(children: [ @@ -103,14 +104,14 @@ class _AnnouncementRequestState extends State { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - commonGlassContainer( + commonGlassUI( width: 149.w, height: 30.h, opacity1: 0.05, opacity2: 0.07, - borderradius: 30.r, + borderRadius: BorderRadius.circular( 30.r), customWidget: Center(child: text12w400_FCFCFC("Decline")), - border: 1), + borderwidth: 1), Container( height: 30.h, width: 150.h, diff --git a/lib/Feed Module/sidemenu/Community/Announcements/ManageMembers.dart b/lib/sidemenu/Community/Announcements/ManageMembers.dart similarity index 88% rename from lib/Feed Module/sidemenu/Community/Announcements/ManageMembers.dart rename to lib/sidemenu/Community/Announcements/ManageMembers.dart index 64c2bb4..b6efbf5 100644 --- a/lib/Feed Module/sidemenu/Community/Announcements/ManageMembers.dart +++ b/lib/sidemenu/Community/Announcements/ManageMembers.dart @@ -7,7 +7,7 @@ import 'package:regroup/Common/CommonTabBar.dart'; import 'package:regroup/Common/CommonWidget.dart'; import 'package:regroup/Utils/Common/CommonAppbar.dart'; import 'package:regroup/Utils/Common/CustomTextformfield.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; + import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/texts.dart'; @@ -58,47 +58,46 @@ class _ManageMembersState extends State { ), ), body: Stack(children: [ - Container( + Container( decoration: const BoxDecoration( image: DecorationImage( image: AssetImage("assets/images/png/Ellipse 1496.png"), fit: BoxFit.fill)), - ), Column( - crossAxisAlignment: CrossAxisAlignment.start, + ), + Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + sizedBoxHeight(20.h), + DefaultTabController( + length: 4, + child: Column( children: [ - sizedBoxHeight(20.h), - DefaultTabController( - length: 4, - child: Column( - children: [ - CommonTabBar(tabs: const [ - Tab( - text: 'Members', - ), - Tab( - text: 'Admins', - ), - Tab( - text: 'Requests', - ), - Tab( - text: 'Invites', - ), - ]), - SizedBox( - height: 655.h, - child: TabBarView( - children: [ - membersTab(), - AdminsTab(), - RequestsTab(), - InvitesTab(), - ], - ), - ), - ], - )) - ]) + CommonTabBar(tabs: const [ + Tab( + text: 'Members', + ), + Tab( + text: 'Admins', + ), + Tab( + text: 'Requests', + ), + Tab( + text: 'Invites', + ), + ]), + SizedBox( + height: 655.h, + child: TabBarView( + children: [ + membersTab(), + AdminsTab(), + RequestsTab(), + InvitesTab(), + ], + ), + ), + ], + )) + ]) ])); } @@ -144,10 +143,10 @@ class _ManageMembersState extends State { hintText: "Start date - End date", )), Spacer(), - commonGlassContainer( + commonGlassUI( width: 40.w, height: 40.h, - borderradius: 100, + borderRadius: BorderRadius.circular( 100), opacity1: 0.24, opacity2: 0.24, customWidget: Center( @@ -157,7 +156,7 @@ class _ManageMembersState extends State { width: 23.w, ), ), - border: 0.5) + borderwidth: 0.5) ], ), ], @@ -237,32 +236,32 @@ class _ManageMembersState extends State { sizedBoxHeight(16.h), Row( children: [ - commonGlassContainer( + commonGlassUI( width: 40.w, height: 40.h, - borderradius: 100, + borderRadius: BorderRadius.circular( 100), opacity1: 0.24, opacity2: 0.24, customWidget: Center(child: text16w400_FCFCFC("M")), - border: 0.5), + borderwidth: 0.5), sizedBoxWidth(15.w), - commonGlassContainer( + commonGlassUI( width: 40.w, height: 40.h, - borderradius: 100, + borderRadius: BorderRadius.circular( 100), opacity1: 0.24, opacity2: 0.24, customWidget: Center(child: text16w400_FCFCFC("Tu")), - border: 0.5), + borderwidth: 0.5), sizedBoxWidth(15.w), - commonGlassContainer( + commonGlassUI( width: 40.w, height: 40.h, - borderradius: 100, + borderRadius: BorderRadius.circular( 100), opacity1: 0.24, opacity2: 0.24, customWidget: Center(child: text16w400_FCFCFC("W")), - border: 0.5), + borderwidth: 0.5), Spacer(), Row( children: [ @@ -282,32 +281,32 @@ class _ManageMembersState extends State { sizedBoxHeight(20.h), Row( children: [ - commonGlassContainer( + commonGlassUI( width: 40.w, height: 40.h, - borderradius: 100, + borderRadius: BorderRadius.circular(100), opacity1: 0.24, opacity2: 0.24, customWidget: Center(child: text16w400_FCFCFC("Th")), - border: 0.5), + borderwidth: 0.5), sizedBoxWidth(15.w), - commonGlassContainer( + commonGlassUI( width: 40.w, height: 40.h, - borderradius: 100, + borderRadius: BorderRadius.circular( 100), opacity1: 0.24, opacity2: 0.24, customWidget: Center(child: text16w400_FCFCFC("F")), - border: 0.5), + borderwidth: 0.5), sizedBoxWidth(15.w), - commonGlassContainer( + commonGlassUI( width: 40.w, height: 40.h, - borderradius: 100, + borderRadius: BorderRadius.circular(100), opacity1: 0.24, opacity2: 0.24, customWidget: Center(child: text16w400_FCFCFC("Sa")), - border: 0.5), + borderwidth: 0.5), Spacer(), Row( children: [ @@ -416,10 +415,10 @@ class _ManageMembersState extends State { hintText: "Start date - End date", )), Spacer(), - commonGlassContainer( + commonGlassUI( width: 40.w, height: 40.h, - borderradius: 100, + borderRadius: BorderRadius.circular( 100), opacity1: 0.24, opacity2: 0.24, customWidget: Center( @@ -429,7 +428,7 @@ class _ManageMembersState extends State { width: 23.w, ), ), - border: 0.5) + borderwidth: 0.5) ], ), ], @@ -540,10 +539,10 @@ class _ManageMembersState extends State { hintText: "Start date - End date", )), Spacer(), - commonGlassContainer( + commonGlassUI( width: 40.w, height: 40.h, - borderradius: 100, + borderRadius: BorderRadius.circular(100), opacity1: 0.24, opacity2: 0.24, customWidget: Center( @@ -553,7 +552,7 @@ class _ManageMembersState extends State { width: 23.w, ), ), - border: 0.5) + borderwidth: 0.5) ], ), ], diff --git a/lib/Feed Module/sidemenu/Community/Announcements/NewAnnouncement/NewAnnounceent.dart b/lib/sidemenu/Community/Announcements/NewAnnouncement/NewAnnounceent.dart similarity index 90% rename from lib/Feed Module/sidemenu/Community/Announcements/NewAnnouncement/NewAnnounceent.dart rename to lib/sidemenu/Community/Announcements/NewAnnouncement/NewAnnounceent.dart index a99b5bd..e4429e4 100644 --- a/lib/Feed Module/sidemenu/Community/Announcements/NewAnnouncement/NewAnnounceent.dart +++ b/lib/sidemenu/Community/Announcements/NewAnnouncement/NewAnnounceent.dart @@ -4,7 +4,7 @@ import 'package:get/get.dart'; import 'package:regroup/Common/CommonGlassmorphism.dart'; import 'package:regroup/Utils/Common/CommonAppbar.dart'; import 'package:regroup/Utils/Common/CustomNextButton.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; + import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/texts.dart'; import 'package:regroup/resources/routes/route_name.dart'; @@ -28,30 +28,31 @@ class _NewAnnouncementState extends State { ), resizeToAvoidBottomInset: false, body: Stack(children: [ - Container( + Container( decoration: const BoxDecoration( image: DecorationImage( image: AssetImage("assets/images/png/Ellipse 1496.png"), fit: BoxFit.fill)), - ), SingleChildScrollView( - child: Padding( + ), + SingleChildScrollView( + child: Padding( padding: const EdgeInsets.symmetric(horizontal: 16), child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ sizedBoxHeight(20.h), text16w400_FCFCFC("Description"), sizedBoxHeight(30.h), - commonGlassContainer( + commonGlassUI( width: double.infinity, height: 150.h, - borderradius: 10.r, + borderRadius: BorderRadius.circular( 10.r), customWidget: Padding( padding: EdgeInsets.symmetric(horizontal: 12.w, vertical: 12.h), child: text14w400_FCFCFCblur( "Lorem Ipsum has been the industry's standard dummy text ever since the 1500s . . .Lorem Ipsum has been the industry's standard dummy text ever since the 1500s . . ."), ), - border: 1), + borderwidth: 1), sizedBoxHeight(80.h), CustomButton( text: "Post", diff --git a/lib/Feed Module/sidemenu/Community/Announcements/View/Announcements.dart b/lib/sidemenu/Community/Announcements/View/Announcements.dart similarity index 97% rename from lib/Feed Module/sidemenu/Community/Announcements/View/Announcements.dart rename to lib/sidemenu/Community/Announcements/View/Announcements.dart index 2b2493a..0973ce2 100644 --- a/lib/Feed Module/sidemenu/Community/Announcements/View/Announcements.dart +++ b/lib/sidemenu/Community/Announcements/View/Announcements.dart @@ -3,7 +3,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:regroup/Common/CommonGlassmorphism.dart'; import 'package:regroup/Utils/Common/CommonAppbar.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; + import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/texts.dart'; import 'package:regroup/resources/routes/route_name.dart'; @@ -130,10 +130,10 @@ Widget announcementWidget({ required String date, required String subtitle, }) { - return commonGlassContainer( + return commonGlassUI( width: double.infinity, height: 120.h, - borderradius: 10.r, + borderRadius: BorderRadius.circular( 10.r), customWidget: Padding( padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 12.h), child: Column( @@ -155,5 +155,5 @@ Widget announcementWidget({ ], ), ), - border: 1); + borderwidth: 1); } diff --git a/lib/Feed Module/sidemenu/Community/Group/view/Group.dart b/lib/sidemenu/Community/Group/view/Group.dart similarity index 55% rename from lib/Feed Module/sidemenu/Community/Group/view/Group.dart rename to lib/sidemenu/Community/Group/view/Group.dart index 11ba615..16c2b61 100644 --- a/lib/Feed Module/sidemenu/Community/Group/view/Group.dart +++ b/lib/sidemenu/Community/Group/view/Group.dart @@ -1,14 +1,13 @@ import 'package:flutter/material.dart'; -import 'package:flutter/widgets.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:regroup/Common/CommonGlassmorphism.dart'; import 'package:regroup/Common/CommonWidget.dart'; -import 'package:regroup/Feed%20Module/sidemenu/view_model/getmethod.dart'; import 'package:regroup/Utils/Common/CommonAppbar.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/texts.dart'; +import 'package:regroup/sidemenu/Community/MyCommunity/view_model/getmethod.dart'; +import 'package:regroup/sidemenu/view_model/getmethod.dart'; class Group extends StatefulWidget { const Group({super.key}); @@ -18,35 +17,11 @@ class Group extends StatefulWidget { } class _GroupState extends State { - List GroupData = [ - { - "imagepath": "assets/images/png/img45.png", - "title": "Cardio crusaders circle", - "subtitle": "Iron titans fitness crew", - "members": "7 members" - }, - { - "imagepath": "assets/images/png/Rectangle 25.png", - "title": "Strength squad syndicate", - "subtitle": "Iron titans fitness crew", - "members": "7 members" - }, - { - "imagepath": "assets/images/png/img2.png", - "title": "Flexibility faction force", - "subtitle": "Iron titans fitness crew", - "members": "7 members" - }, - ]; - - late Future myfuture; int id = Get.arguments["id"]; + bool iscommunity = Get.arguments["iscommunity"]; @override void initState() { - // TODO: implement initState - - myfuture = Sidegetmethod().getJoinedusergroups(id); super.initState(); } @@ -60,37 +35,69 @@ class _GroupState extends State { titleTxt: "Groups", ), resizeToAvoidBottomInset: false, - body: FutureBuilder( - future: myfuture, - builder: (ctx, snapshot) { - if (snapshot.data == null) { - return const Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Center( - child: CircularProgressIndicator( - color: Color(0xFFC18948), - ), - ) - ], - ); - } - if (snapshot.connectionState == ConnectionState.done) { - if (snapshot.hasError) { - return Center( - child: Text( - '${snapshot.error} occured', - style: TextStyle(fontSize: 18.spMin), - ), - ); - } - } - return joinedgroupsobj!.data!.isEmpty - ? _buildNoDataBody(context) - : _buildBody(context); - }, - ), + body: iscommunity == true + ? FutureBuilder( + future: Getcommunity().getCommunitygroups(id), + builder: (ctx, snapshot) { + if (snapshot.data == null) { + return const Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Center( + child: CircularProgressIndicator( + color: Color(0xFFC18948), + ), + ) + ], + ); + } + if (snapshot.connectionState == ConnectionState.done) { + if (snapshot.hasError) { + return Center( + child: Text( + '${snapshot.error} occured', + style: TextStyle(fontSize: 18.spMin), + ), + ); + } + } + return communitygroupspobj!.data.isEmpty + ? _buildNoDataBody(context) + : _communitybuildBody(context); + }, + ) + : FutureBuilder( + future: Sidegetmethod().getJoinedusergroups(id), + builder: (ctx, snapshot) { + if (snapshot.data == null) { + return const Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Center( + child: CircularProgressIndicator( + color: Color(0xFFC18948), + ), + ) + ], + ); + } + if (snapshot.connectionState == ConnectionState.done) { + if (snapshot.hasError) { + return Center( + child: Text( + '${snapshot.error} occured', + style: TextStyle(fontSize: 18.spMin), + ), + ); + } + } + return joinedgroupsobj!.data!.isEmpty + ? _buildNoDataBody(context) + : _buildBody(context); + }, + ), ); } @@ -134,11 +141,11 @@ class _GroupState extends State { padding: EdgeInsets.only(bottom: 25.h), child: GestureDetector( onTap: () {}, - child: commonGlassContainer( - border: 0.9, + child: commonGlassUI( + borderwidth: 0.9, width: double.infinity, height: 162.h, - borderradius: 10.r, + borderRadius: BorderRadius.circular(10.r), customWidget: Padding( padding: EdgeInsets.symmetric( horizontal: 16.w, vertical: 16.h), @@ -236,11 +243,12 @@ class _GroupState extends State { ), Spacer(), PopupMenuButton( - surfaceTintColor: Color(0xFF222935), + surfaceTintColor: + const Color(0xFF222935), constraints: BoxConstraints.tightFor( width: 200.w), - offset: Offset(0, 30), - color: Color(0xFF222935), + offset: const Offset(0, 30), + color: const Color(0xFF222935), tooltip: "", itemBuilder: (BuildContext context) => [ @@ -252,8 +260,8 @@ class _GroupState extends State { child: Row( children: [ text14w400_FCFCFC( - "Mute community"), - Spacer(), + "Mute group"), + const Spacer(), Image.asset( "assets/images/png/Black (1).png", height: 18.h, @@ -263,7 +271,7 @@ class _GroupState extends State { ), ), ), - PopupMenuDivider(), + const PopupMenuDivider(), PopupMenuItem( onTap: () {}, child: Padding( @@ -272,10 +280,30 @@ class _GroupState extends State { child: Row( children: [ text14w400_FCFCFC( - "Hide post"), - Spacer(), + "Pin group"), + const Spacer(), Image.asset( - "assets/images/png/mingcute_eye-close-line.png", + "assets/images/png/f7_pin-fill (2).png", + height: 27.h, + width: 27.w, + ) + ], + ), + ), + ), + const PopupMenuDivider(), + PopupMenuItem( + onTap: () {}, + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: 8.w), + child: Row( + children: [ + text14w400_FCFCFC( + "Make primary"), + const Spacer(), + Image.asset( + "assets/images/png/leave group.png", height: 20.h, width: 20.w, ) @@ -283,7 +311,7 @@ class _GroupState extends State { ), ), ), - PopupMenuDivider(), + const PopupMenuDivider(), PopupMenuItem( onTap: () {}, child: Padding( @@ -291,30 +319,12 @@ class _GroupState extends State { horizontal: 8.w), child: Row( children: [ - text14w400_FCFCFC("Pin"), - Spacer(), + // text14w400_FCFCFC("Leave group"), + text14w400_D90B2E( + "Leave group"), + const Spacer(), Image.asset( - "assets/images/png/f7_pin-fill (2).png", - height: 25.h, - width: 25.w, - ) - ], - ), - ), - ), - PopupMenuDivider(), - PopupMenuItem( - onTap: () {}, - child: Padding( - padding: EdgeInsets.symmetric( - horizontal: 8.w), - child: Row( - children: [ - text14w400_FCFCFC( - "Leave community"), - Spacer(), - Image.asset( - "assets/images/png/logout 1 (traced).png", + "assets/images/png/LightGray22.png", height: 18.h, width: 18.w, ) @@ -325,8 +335,8 @@ class _GroupState extends State { ], child: Image.asset( "assets/images/png/Group 1000004071.png", - height: 13.h, - width: 3.w, + height: 18.h, + width: 20.w, )), ], ), @@ -335,7 +345,6 @@ class _GroupState extends State { sizedBoxHeight(10.h), Row( children: [ - stackContainersGroups( number: joinedgroupsobj! .data![index].membersCount @@ -369,6 +378,263 @@ class _GroupState extends State { ]); } + Widget _communitybuildBody(context) { + return Stack(children: [ + Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage("assets/images/png/Ellipse 1496.png"), + fit: BoxFit.fill)), + ), + Padding( + padding: EdgeInsets.symmetric(horizontal: 16), + child: SingleChildScrollView( + child: Column( + children: [ + ListView.builder( + shrinkWrap: true, + physics: ScrollPhysics(), + itemCount: communitygroupspobj!.data.length, + itemBuilder: (context, index) { + return Padding( + padding: EdgeInsets.only(bottom: 25.h), + child: GestureDetector( + onTap: () {}, + child: commonGlassUI( + borderwidth: 0.9, + width: double.infinity, + height: 162.h, + borderRadius: BorderRadius.circular(10.r), + customWidget: Padding( + padding: EdgeInsets.symmetric( + horizontal: 16.w, vertical: 16.h), + child: Column( + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + height: 65.h, + width: 65.h, + decoration: BoxDecoration( + shape: BoxShape.circle, + // color: Colors.amber, + ), + child: + // Center( + // child: Image.asset(imagepath, fit: BoxFit.cover)), + communitygroupspobj! + .data[index] + .groups! + .groupImage == + null || + communitygroupspobj! + .data[index] + .groups! + .groupImage! + .isEmpty + ? CircleAvatar( + backgroundImage: AssetImage( + 'assets/images/png/img45.png', + ), + ) + : CircleAvatar( + backgroundImage: + NetworkImage( + communitygroupspobj! + .data[index] + .groups! + .groupImage!), + )), + sizedBoxWidth(13.w), + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + // Container( + // // width: 250.w, + // // color: Colors.red, + // width: double.infinity, + // child: + communitygroupspobj!.data[index].groups! + .title == + null || + communitygroupspobj!.data[index] + .groups!.title!.isEmpty + ? text18w700_FCFCFC('Regroup') + : SizedBox( + width: 200.w, + child: text18w700_FCFCFC( + communitygroupspobj! + .data[index] + .groups! + .title!), + ), + // ), + sizedBoxHeight(10.h), + communitygroupspobj!.data[index] + .communityData == + null || + communitygroupspobj! + .data[index] + .communityData! + .communityName! + .isEmpty + ? SizedBox() + : Row( + children: [ + Image.asset( + 'assets/images/png/community 1 (traced).png', + width: 18.w, + height: 18.h, + ), + sizedBoxWidth(4.w), + text14w400_FCFCFCblur( + communitygroupspobj! + .data[index] + .communityData! + .communityName!) + ], + ), + ], + ), + Spacer(), + PopupMenuButton( + surfaceTintColor: + const Color(0xFF222935), + constraints: BoxConstraints.tightFor( + width: 200.w), + offset: const Offset(0, 30), + color: const Color(0xFF222935), + tooltip: "", + itemBuilder: (BuildContext context) => + [ + PopupMenuItem( + onTap: () {}, + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: 8.w), + child: Row( + children: [ + text14w400_FCFCFC( + "Mute group"), + const Spacer(), + Image.asset( + "assets/images/png/Black (1).png", + height: 18.h, + width: 18.w, + ) + ], + ), + ), + ), + const PopupMenuDivider(), + PopupMenuItem( + onTap: () {}, + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: 8.w), + child: Row( + children: [ + text14w400_FCFCFC( + "Pin group"), + const Spacer(), + Image.asset( + "assets/images/png/f7_pin-fill (2).png", + height: 27.h, + width: 27.w, + ) + ], + ), + ), + ), + const PopupMenuDivider(), + PopupMenuItem( + onTap: () {}, + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: 8.w), + child: Row( + children: [ + text14w400_FCFCFC( + "Make primary"), + const Spacer(), + Image.asset( + "assets/images/png/group.png", + height: 20.h, + width: 20.w, + ) + ], + ), + ), + ), + const PopupMenuDivider(), + PopupMenuItem( + onTap: () {}, + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: 8.w), + child: Row( + children: [ + // text14w400_FCFCFC("Leave group"), + text14w400_D90B2E( + "Leave group"), + const Spacer(), + Image.asset( + "assets/images/png/LightGray22.png", + height: 18.h, + width: 18.w, + ) + ], + ), + ), + ), + ], + child: Image.asset( + "assets/images/png/Group 1000004071.png", + height: 18.h, + width: 20.w, + )), + ], + ), + sizedBoxHeight(16.h), + commonDivider(), + sizedBoxHeight(10.h), + Row( + children: [ + stackContainersGroups( + number: communitygroupspobj! + .data[index].groups!.totalMember + .toString(), + containerImages: communitygroupspobj! + .data[index].groups!.sevenMemberImage + .map((photo) => photo + .iamPrincipalData!.profilePhoto!) + .toList(), + ), + sizedBoxWidth(75.w), + communitygroupspobj!.data[index].groups == + null || + communitygroupspobj!.data[index] + .groups!.totalMember.isBlank! + ? SizedBox() + : text16w400_FCFCFC_blur( + '${communitygroupspobj!.data[index].groups!.totalMember} members', + ), + ], + ) + ], + ), + )), + ), + ); + }, + ) + ], + ))) + ]); + } + // Widget groupCard({ // required String? imagepath, // required String? title, diff --git a/lib/sidemenu/Community/Members/CommunityMembers.dart b/lib/sidemenu/Community/Members/CommunityMembers.dart new file mode 100644 index 0000000..a6222e7 --- /dev/null +++ b/lib/sidemenu/Community/Members/CommunityMembers.dart @@ -0,0 +1,270 @@ +import 'dart:async'; + +import 'package:cached_network_image/cached_network_image.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/widgets.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:regroup/Common/CommonWidget.dart'; +import 'package:regroup/Common/controller/CommonTextFormField.dart'; +import 'package:regroup/Utils/Common/CommonAppbar.dart'; +import 'package:regroup/Utils/Common/sized_box.dart'; +import 'package:regroup/Utils/texts.dart'; +import 'package:regroup/resources/routes/route_name.dart'; +import 'package:regroup/sidemenu/Community/MyCommunity/Model/communityMebersModel.dart'; +import 'package:regroup/sidemenu/Community/MyCommunity/view_model/getmethod.dart'; +import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart'; + +class CommunityMembers extends StatefulWidget { + const CommunityMembers({super.key}); + + @override + State createState() => _CommunityMembersState(); +} + +class _CommunityMembersState extends State { + StreamController searchcontroller = StreamController(); + + int communityid = Get.arguments["communityid"]; + + @override + void initState() { + print(communityid); + var updata = communityid; + var updata2 = ""; + Getcommunity().getCommunityMemberssearch(updata, updata2, + streamController: searchcontroller); + + super.initState(); + } + + @override + void dispose() { + searchcontroller.close(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: () => FocusManager.instance.primaryFocus?.unfocus(), + child: Scaffold( + backgroundColor: const Color(0xFF222935), + extendBody: true, + appBar: const CommonAppbar( + titleTxt: "Members", + ), + resizeToAvoidBottomInset: false, + body: Stack(children: [ + Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage("assets/images/png/Ellipse 1496.png"), + fit: BoxFit.fill)), + ), + SingleChildScrollView( + child: Column(children: [ + Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + Padding( + padding: EdgeInsets.symmetric(horizontal: 16.w), + child: CustomTextFormField( + leadingIcon: SizedBox( + height: 23, + width: 23, + child: Center( + child: Image.asset( + "assets/images/png/ion_search-outline.png", + height: 23, + width: 23, + ), + ), + ), + texttype: TextInputType.text, + inputFormatters: [ + RemoveEmojiInputFormatter(), + ], + onInput: (value) { + Getcommunity().getCommunityMemberssearch(communityid, value, + streamController: searchcontroller); + }, + hintText: "Search people", + ), + ), + sizedBoxHeight(25.h), + StreamBuilder( + stream: searchcontroller.stream, + builder: (ctx, snapshot) { + if (snapshot.connectionState == ConnectionState.waiting) { + // Display shimmer effect while waiting for data + return const Center(child: CircularProgressIndicator()); + } else if (snapshot.hasError) { + // Handle error state + return Center( + child: Text( + '${snapshot.error} occurred', + style: const TextStyle(fontSize: 18), + ), + ); + } else { + // Data has been loaded, show actual UI + return communitymembersobj!.data.isEmpty + ? _buildNoDataBody(context) + : ListView.separated( + physics: const ScrollPhysics(), + shrinkWrap: true, + itemCount: communitymembersobj!.data.length, + separatorBuilder: + (BuildContext context, int index) { + return commonDivider(); + }, + itemBuilder: (context, index) { + var mainFollowersData = + communitymembersobj!.data[index]; + return GestureDetector( + onTap: () { + mainFollowersData + .iamPrincipal!.principalTypeXid == + 1 + ? Get.toNamed( + RouteName.profiletabindguest, + arguments: { + "FolloweridIndex": + mainFollowersData + .iamPrincipalXid!, + }) + : Get.toNamed( + RouteName.profiletabbusguest, + arguments: { + "FolloweridIndex": + mainFollowersData + .iamPrincipalXid!, + }); + }, + child: Column( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 16.h, horizontal: 16.w), + child: Row( + children: [ + mainFollowersData.iamPrincipal! + .profilePhoto == + null || + mainFollowersData + .iamPrincipal! + .profilePhoto! + .isEmpty + ? CircleAvatar( + backgroundImage: const AssetImage( + 'assets/images/png/Ellipse 43.png'), + radius: 25.r, + ) + : CircleAvatar( + backgroundImage: + CachedNetworkImageProvider( + mainFollowersData + .iamPrincipal! + .profilePhoto!, + ), + + // NetworkImage( + // mainFollowersData + // .iamPrincipal! + // .profilePhoto!), + radius: 25.r, + child: CachedNetworkImage( + cacheKey: mainFollowersData + .iamPrincipalXid + .toString(), + maxHeightDiskCache: 100, + maxWidthDiskCache: 100, + imageUrl: mainFollowersData + .iamPrincipal! + .profilePhoto!, + placeholder: + (context, url) => + Container(), + errorWidget: + (context, url, error) => + Icon(Icons.error), + imageBuilder: (context, + imageProvider) => + CircleAvatar( + backgroundImage: + imageProvider, + radius: 25.r, + ), + ), + ), + sizedBoxWidth(10.w), + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + mainFollowersData.iamPrincipal! + .fullName == + null || + mainFollowersData + .iamPrincipal! + .fullName! + .isEmpty == + true + ? text16w400_FCFCFC("Regroup") + : text16w400_FCFCFC( + mainFollowersData + .iamPrincipal! + .fullName!), + sizedBoxHeight(4.h), + mainFollowersData.iamPrincipal! + .userName == + null || + mainFollowersData + .iamPrincipal! + .userName! + .isEmpty == + true + ? text12w400_FCFCFC_blur( + "regroup") + : text12w400_FCFCFC_blur( + mainFollowersData + .iamPrincipal! + .userName!) + ], + ), + ], + ), + ) + ], + ), + ); + }, + ); + } + }, + ), + ]) + ]), + ) + ]), + ), + ); + } + + Widget _buildNoDataBody(context) { + return Center( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + "No Members Found", + style: TextStyle( + color: Colors.white, + fontSize: 16.sp, + fontWeight: FontWeight.w600), + ) + ], + ), + ); + } +} diff --git a/lib/sidemenu/Community/MyCommunity/AddGroups.dart b/lib/sidemenu/Community/MyCommunity/AddGroups.dart new file mode 100644 index 0000000..a4f139f --- /dev/null +++ b/lib/sidemenu/Community/MyCommunity/AddGroups.dart @@ -0,0 +1,453 @@ +import 'dart:async'; +import 'dart:developer'; +import 'dart:io'; + +import 'package:cached_network_image/cached_network_image.dart'; +import 'package:dio/dio.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/widgets.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart' hide MultipartFile, FormData; +import 'package:regroup/Common/CommonButton.dart'; +import 'package:regroup/Common/CommonGlassmorphism.dart'; +import 'package:regroup/Common/CommonWidget.dart'; +import 'package:regroup/Common/base_manager.dart'; +import 'package:regroup/Utils/Common/CommonAppbar.dart'; +import 'package:regroup/Utils/Common/CustomNextButton.dart'; +import 'package:regroup/Utils/Common/CustomTextformfield.dart'; + +import 'package:regroup/Utils/Common/sized_box.dart'; +import 'package:regroup/Utils/dialogs.dart'; +import 'package:regroup/Utils/texts.dart'; +import 'package:regroup/resources/routes/route_name.dart'; +import 'package:path/path.dart' as path; +import 'package:regroup/sidemenu/Community/MyCommunity/Model/communityaddgroupsModel.dart'; +import 'package:regroup/sidemenu/Community/MyCommunity/view_model/getmethod.dart'; +import 'package:regroup/sidemenu/Community/MyCommunity/view_model/postmethod.dart'; + +class AddGroup extends StatefulWidget { + const AddGroup({super.key}); + + @override + State createState() => _AddGroupState(); +} + +class _AddGroupState extends State { + List isCheckedList = [false, false, false, false].obs; + + List groupData = [ + { + "imagePath": "assets/images/png/img45.png", + "title": "Iron titans fitness crew", + "subtitle": "Lorem ipsum dummy text", + }, + { + "imagePath": "assets/images/png/Rectangle 25.png", + "title": "Body blitz brigade", + "subtitle": "Lorem ipsum dummy text", + }, + { + "imagePath": "assets/images/png/img2.png", + "title": "Fit fusion squad", + "subtitle": "Lorem ipsum dummy text", + }, + { + "imagePath": "assets/images/png/img2.png", + "title": "Power pulse posse", + "subtitle": "Lorem ipsum dummy text", + }, + ]; + + int communitytype = Get.arguments["communitytype"]; + int activitytype = Get.arguments["activityid"]; + String communityname = Get.arguments["communityname"]; + String communitylocation = Get.arguments["communitylocation"]; + String communitydescription = Get.arguments["communitydescription"]; + List filepath = Get.arguments['communityprofilephoto']; + List bannerPath = Get.arguments['communitybannerimage']; + bool edited = Get.arguments['isedited']; + String communityid = Get.arguments['communityid']; + + StreamController searchcontroller = + StreamController(); + + @override + void initState() { + var updata = ""; + Getcommunity().getCommunityAddGroupsearch(updata, communityid, + streamController: searchcontroller); + + super.initState(); + } + + @override + void dispose() { + searchcontroller.close(); + super.dispose(); + } + + final List _selectedIndices = []; + + void _onContainerTap(int id) { + setState(() { + if (_selectedIndices.contains(id)) { + _selectedIndices.remove(id); + } else { + _selectedIndices.add(id); + } + }); + } + + Uploadata() async { + utils.loader(); + List bannermedialist = []; + List profielpicturelist = []; + + for (var file in bannerPath.where((file) => file != null)) { + bannermedialist.add( + await MultipartFile.fromFile( + file!.path, + filename: path.basename(file.path), + ), + ); + } + + for (var file in filepath.where((file) => file != null)) { + profielpicturelist.add( + await MultipartFile.fromFile( + file!.path, + filename: path.basename(file.path), + ), + ); + } + + String selectedIndicesString = '[${_selectedIndices.join(',')}]'; + print('Selected Indices: $selectedIndicesString'); + + FormData formdata = FormData.fromMap({ + "community_profile_photo": profielpicturelist[0], + "community_banner_image": bannermedialist[0], + "community_name": communityname, + "community_location": communitylocation, + "community_description": communitydescription, + 'community_type_xid': communitytype, + 'activity_xid': activitytype, + 'manage_groups_xid': + selectedIndicesString.isEmpty ? null : selectedIndicesString, + }); + print('updata is ${formdata.toString()}'); + log('log is ${formdata.toString()}'); + final data = await PostMethodCommunity().postCreatecommunity(formdata); + if (data.status == ResponseStatus.SUCCESS) { + Get.back(); + print("community created"); + // Get.toNamed(RouteName.mycommunity); + Get.back(); + Get.back( + result: true + ); + return utils.showToast(data.message); + } else { + Get.back(); + print("community not created"); + return utils.showToast(data.message); + } + } + + ManageGroupsUploadata() async { + utils.loader(); + String selectedIndicesString = '[${_selectedIndices.join(',')}]'; + print('Selected Indices: $selectedIndicesString'); + Map updata = { + "manage_community_xid": communityid, + "manage_groups_xid": selectedIndicesString, + }; + print('updata is ${updata.toString()}'); + log('log is ${updata.toString()}'); + final data = await PostMethodCommunity().postmanageaddgroupscommunity(updata); + if (data.status == ResponseStatus.SUCCESS) { + Get.back(); + print("groups added"); + // Get.back(); + return utils.showToast(data.message); + } else { + Get.back(); + print("groups not added"); + return utils.showToast(data.message); + } + } + + @override + Widget build(BuildContext context) { + return WillPopScope( + onWillPop: () async { + edited == true ? Get.back(result: true) : Get.back(); + return true; + }, + child: GestureDetector( + onTap: () => FocusManager.instance.primaryFocus?.unfocus(), + child: Scaffold( + // key: _scaffoldKey1, + backgroundColor: Color(0xFF222935), + extendBody: true, + appBar: CommonAppbar( + titleTxt: "Add groups", + ), + resizeToAvoidBottomInset: false, + bottomNavigationBar: Padding( + padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 10.h), + child: CustomButton( + text: "Add", + onPressed: () { + // Get.toNamed(RouteName.mycommunity); + print('selected groups are ${_selectedIndices.toString()}'); + + edited == true ? ManageGroupsUploadata() : Uploadata(); + }, + ), + ), + body: Stack(children: [ + Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage("assets/images/png/Ellipse 1496.png"), + fit: BoxFit.fill)), + ), + SingleChildScrollView( + child: Column(children: [ + Padding( + padding: EdgeInsets.symmetric(horizontal: 16.w), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + sizedBoxHeight(20.h), + CustomTextFormField( + leadingIcon: SizedBox( + height: 23, + width: 23, + child: Center( + child: Image.asset( + "assets/images/png/ion_search-outline.png", + height: 23, + width: 23, + ), + ), + ), + hintText: "Search groups", + onInput: (value) { + Getcommunity().getCommunityAddGroupsearch( + value, communityid, + streamController: searchcontroller); + }, + ), + sizedBoxHeight(25.h), + // Row( + // children: [ + // commonGlassUI( + // opacity1: 0.24, + // opacity2: 0.24, + // width: 50.w, + // height: 50.h, + // borderRadius: BorderRadius.circular( 100), + // customWidget: Center( + // child: Image.asset( + // "assets/images/png/Black.png", + // height: 30.h, + // width: 30.w, + // )), + // borderwidth: 0.5), + // sizedBoxWidth(8.w), + // text18w400_FCFCFC("Create group"), + // Spacer(), + // Icon( + // Icons.arrow_forward_ios_outlined, + // color: Colors.white, + // size: 14.sp, + // ), + // ], + // ), + // sizedBoxHeight(25.h), + sizedBoxHeight(30.h), + text18w700white("Existing Groups"), + sizedBoxHeight(20.h), + ]), + ), + StreamBuilder( + stream: searchcontroller.stream, + builder: (ctx, snapshot) { + if (snapshot.connectionState == + ConnectionState.waiting) { + return const Center( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + CircularProgressIndicator(), + ], + ), + ); + } else if (snapshot.hasError) { + return Center( + child: Text( + '${snapshot.error} occured', + style: TextStyle(fontSize: 18.sp), + ), + ); + } else { + return communityaddgroupobj!.data.isEmpty + ? _buildNoDataBody(context) + : ListView.builder( + shrinkWrap: true, + physics: ScrollPhysics(), + itemCount: communityaddgroupobj!.data.length, + itemBuilder: (context, index) { + final isChecked = _selectedIndices.contains( + communityaddgroupobj!.data[index].id!); + return Column( + children: [ + groupWidget( + index: communityaddgroupobj! + .data[index].id!, + imagePath: communityaddgroupobj! + .data[index].groupImage ?? + '', + title: communityaddgroupobj! + .data[index].title!, + subtitle: communityaddgroupobj! + .data[index].description!, + isChecked: isChecked, + // isCheckedList[index], + onCheckedChanged: (bool? value) { + // isCheckedList[index] = value ?? false; + _onContainerTap( + communityaddgroupobj! + .data[index].id!); + }, + ), + commonDivider(), + ], + ); + }, + ); + } + }), + sizedBoxHeight(50.h), + ]), + ) + ])), + ), + ); + } + + Widget _buildNoDataBody(context) { + return Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + "No Groups Found", + style: TextStyle( + color: Colors.white, + fontSize: 16.sp, + fontWeight: FontWeight.w600), + ) + ], + ), + ); + } + + Widget groupWidget({ + required int index, + required String? imagePath, + required String? title, + required String? subtitle, + required bool isChecked, + required ValueChanged onCheckedChanged, + }) { + return Padding( + padding: EdgeInsets.symmetric(vertical: 16.h, horizontal: 16.w), + child: Row( + children: [ + imagePath == null || imagePath.isEmpty + ? CircleAvatar( + backgroundImage: AssetImage('assets/images/png/img2.png'), + radius: 20.r, + ) + : + // CircleAvatar( + // backgroundImage: NetworkImage(imagePath), + // radius: 20.r, + // ), + CircleAvatar( + backgroundImage: CachedNetworkImageProvider(imagePath), + radius: 20.r, + child: CachedNetworkImage( + cacheKey: index.toString(), + maxHeightDiskCache: 100, + maxWidthDiskCache: 100, + imageUrl: imagePath, + placeholder: (context, url) => Container(), + errorWidget: (context, url, error) => Icon(Icons.error), + imageBuilder: (context, imageProvider) => CircleAvatar( + backgroundImage: imageProvider, + radius: 25.r, + ), + ), + ), + sizedBoxWidth(10.w), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + title == null || title.isEmpty + ? text16w400_FCFCFC('ReGroup') + : Text( + title, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 16.sp, + color: const Color(0xFFFCFCFC), + fontFamily: 'Helvetica', + fontWeight: FontWeight.w400), + ), + sizedBoxHeight(4.h), + subtitle == null || subtitle.isEmpty + ? text12w400_FCFCFC_blur('ReGroup') + : Text( + subtitle, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 12.sp, + color: const Color(0xFFFCFCFC).withOpacity(0.8), + fontFamily: 'Helvetica', + fontWeight: FontWeight.w400), + ), + ], + ), + ), + Spacer(), + commonGlassUI( + borderwidth: isChecked ? 1.2 : 0.9, + borderRadius: BorderRadius.circular(2), + height: 23.h, + width: 23.w, + opacity1: 0.24, + opacity2: 0.24, + borderColor: isChecked ? Color(0xFFD90B2E) : Color(0xFF434A53), + customWidget: Transform.scale( + scale: 1, + child: Checkbox( + side: BorderSide(color: Colors.transparent), + value: isChecked, + activeColor: Colors.transparent, + checkColor: Color(0xFFD90B2E), + onChanged: onCheckedChanged, + ), + ), + ), + ], + ), + ); + } +} diff --git a/lib/Feed Module/sidemenu/Community/MyCommunity/Community_Info-Page/view/communityInfo.dart b/lib/sidemenu/Community/MyCommunity/Community_Info-Page/view/communityInfo.dart similarity index 60% rename from lib/Feed Module/sidemenu/Community/MyCommunity/Community_Info-Page/view/communityInfo.dart rename to lib/sidemenu/Community/MyCommunity/Community_Info-Page/view/communityInfo.dart index 8be3ddf..f6ca4a6 100644 --- a/lib/Feed Module/sidemenu/Community/MyCommunity/Community_Info-Page/view/communityInfo.dart +++ b/lib/sidemenu/Community/MyCommunity/Community_Info-Page/view/communityInfo.dart @@ -4,7 +4,7 @@ import 'package:get/get.dart'; import 'package:regroup/Common/CommonGlassmorphism.dart'; import 'package:regroup/Common/CommonWidget.dart'; import 'package:regroup/Utils/Common/CommonAppbar.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; + import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/texts.dart'; import 'package:regroup/resources/routes/route_name.dart'; @@ -16,7 +16,27 @@ class CommunityInfo extends StatefulWidget { State createState() => _CommunityInfoState(); } +String? bannerImg; +String? comPhoto; +String? comName; +String? comDes; +String? comLocation; +String? comType; + class _CommunityInfoState extends State { + @override + void initState() { + // TODO: implement initState + bannerImg = Get.arguments["bannerimage"]; + comPhoto = Get.arguments["communityphoto"]; + comName = Get.arguments["communityname"]; + comDes = Get.arguments["communitydescription"]; + comLocation = Get.arguments["communitylocation"]; + comType = Get.arguments["communitytype"]; + + super.initState(); + } + @override Widget build(BuildContext context) { return Scaffold( @@ -28,26 +48,36 @@ class _CommunityInfoState extends State { ), resizeToAvoidBottomInset: false, body: Stack(children: [ - Container( + Container( decoration: const BoxDecoration( image: DecorationImage( image: AssetImage("assets/images/png/Ellipse 1496.png"), fit: BoxFit.fill)), - ), SingleChildScrollView( - child: Column(children: [ + ), + SingleChildScrollView( + child: Column(children: [ Stack(clipBehavior: Clip.none, children: [ GestureDetector( onTap: () { Get.toNamed(RouteName.communityInfo); }, - child: SizedBox( - height: 130.h, - width: double.infinity, - child: Image.asset( - "assets/images/png/img1.png", - fit: BoxFit.cover, - ), - ), + child: bannerImg != null + ? SizedBox( + height: 130.h, + width: double.infinity, + child: Image.network( + bannerImg ?? '', // Replace with your API image URL + fit: BoxFit.cover, + ), + ) + : SizedBox( + height: 130.h, + width: double.infinity, + child: Image.asset( + "assets/images/png/img1.png", + fit: BoxFit.cover, + ), + ), ), Positioned( bottom: -35.h, @@ -69,10 +99,19 @@ class _CommunityInfoState extends State { ), ], ), - child: CircleAvatar( - radius: 42.5.r, - foregroundImage: AssetImage("assets/images/png/img2.png"), - ), + child: comPhoto != null + ? CircleAvatar( + radius: 42.5.r, + foregroundImage: NetworkImage( + comPhoto!), // Replace with your API image URL + backgroundColor: Colors + .transparent, // Optional: If the image fails to load, a transparent background is shown + ) + : CircleAvatar( + radius: 42.5.r, + foregroundImage: + const AssetImage("assets/images/png/img2.png"), + ), )) ]), sizedBoxHeight(50.h), @@ -81,21 +120,20 @@ class _CommunityInfoState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - text20w700_FCFCFC("Active alliance network"), + text20w700_FCFCFC(comName ?? ""), sizedBoxHeight(20.h), commonDivider(), sizedBoxHeight(20.h), text16w400_FCFCFC("About community"), sizedBoxHeight(20.h), - text14w400_FCFCFCblur( - "Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book."), + text14w400_FCFCFCblur(comDes ?? ""), sizedBoxHeight(30.h), Row( children: [ - commonGlassContainer( + commonGlassUI( width: 35.w, height: 35.h, - borderradius: 100.r, + borderRadius: BorderRadius.circular(100.r), customWidget: Center( child: Image.asset( "assets/images/png/Group 58645.png", @@ -103,18 +141,18 @@ class _CommunityInfoState extends State { width: 13.w, ), ), - border: 0.5), + borderwidth: 0.5), sizedBoxWidth(8.w), - text16w400_white("Elm street london, United Kingdom") + text16w400_white(comLocation ?? "") ], ), sizedBoxHeight(15.h), Row( children: [ - commonGlassContainer( + commonGlassUI( width: 35.w, height: 35.h, - borderradius: 100.r, + borderRadius: BorderRadius.circular(100.r), customWidget: Center( child: Image.asset( "assets/images/png/puzzle-pieces 1 (traced).png", @@ -122,9 +160,9 @@ class _CommunityInfoState extends State { width: 20.w, ), ), - border: 0.5), + borderwidth: 0.5), sizedBoxWidth(8.w), - text16w400_white("Sports") + text16w400_white(comType ?? "") ], ) ]), diff --git a/lib/sidemenu/Community/MyCommunity/Model/ComDetailModel.dart b/lib/sidemenu/Community/MyCommunity/Model/ComDetailModel.dart new file mode 100644 index 0000000..e0fb174 --- /dev/null +++ b/lib/sidemenu/Community/MyCommunity/Model/ComDetailModel.dart @@ -0,0 +1,209 @@ +class ComDetailModel { + ComDetailModel({ + required this.status, + required this.statusCode, + required this.message, + required this.data, + }); + + final String? status; + final int? statusCode; + final String? message; + final Data? data; + + factory ComDetailModel.fromJson(Map json){ + return ComDetailModel( + status: json["status"], + statusCode: json["status_code"], + message: json["message"], + data: json["data"] == null ? null : Data.fromJson(json["data"]), + ); + } + +} + +class Data { + Data({ + required this.id, + required this.isCommunityPinned, + required this.totalGroup, + required this.totalAnnouncements, + required this.communityProfilePhoto, + required this.communityBannerImage, + required this.communityName, + required this.communityLocation, + required this.communityDescription, + required this.communityTypeXid, + required this.activityXid, + required this.userLinkInCommunity, + required this.accessType, + required this.activityData, + }); + + final int? id; + final bool? isCommunityPinned; + final int? totalGroup; + final int? totalAnnouncements; + final String? communityProfilePhoto; + final String? communityBannerImage; + final String? communityName; + final String? communityLocation; + final String? communityDescription; + final int? communityTypeXid; + final int? activityXid; + final UserLinkInCommunity? userLinkInCommunity; + final AccessType? accessType; + final ActivityData? activityData; + + factory Data.fromJson(Map json){ + return Data( + id: json["id"], + isCommunityPinned: json["is_community_pinned"], + totalGroup: json["total_group"], + totalAnnouncements: json["total_announcements"], + communityProfilePhoto: json["community_profile_photo"], + communityBannerImage: json["community_banner_image"], + communityName: json["community_name"], + communityLocation: json["community_location"], + communityDescription: json["community_description"], + communityTypeXid: json["community_type_xid"], + activityXid: json["activity_xid"], + userLinkInCommunity: json["user_link_in_community"] == null ? null : UserLinkInCommunity.fromJson(json["user_link_in_community"]), + accessType: json["access_type"] == null ? null : AccessType.fromJson(json["access_type"]), + activityData: json["activity_data"] == null ? null : ActivityData.fromJson(json["activity_data"]), + ); + } + +} + +class AccessType { + AccessType({ + required this.id, + required this.name, + }); + + final int? id; + final String? name; + + factory AccessType.fromJson(Map json){ + return AccessType( + id: json["id"], + name: json["name"], + ); + } + +} + +class ActivityData { + ActivityData({ + required this.id, + required this.title, + required this.description, + required this.image, + }); + + final int? id; + final String? title; + final String? description; + final String? image; + + factory ActivityData.fromJson(Map json){ + return ActivityData( + id: json["id"], + title: json["title"], + description: json["description"], + image: json["image"], + ); + } + +} + +class UserLinkInCommunity { + UserLinkInCommunity({ + required this.id, + required this.iamPrincipalXid, + required this.totalCommunityMember, + required this.fourMemberImages, + required this.manageCommunityXid, + required this.joinedAt, + required this.userTypeXid, + required this.isRequested, + required this.isMute, + }); + + final int? id; + final int? iamPrincipalXid; + final int? totalCommunityMember; + final List fourMemberImages; + final int? manageCommunityXid; + final DateTime? joinedAt; + final AccessType? userTypeXid; + final int? isRequested; + final int? isMute; + + factory UserLinkInCommunity.fromJson(Map json){ + return UserLinkInCommunity( + id: json["id"], + iamPrincipalXid: json["iam_principal_xid"], + totalCommunityMember: json["total_community_member"], + fourMemberImages: json["four_member_images"] == null ? [] : List.from(json["four_member_images"]!.map((x) => FourMemberImage.fromJson(x))), + manageCommunityXid: json["manage_community_xid"], + joinedAt: DateTime.tryParse(json["joined_at"] ?? ""), + userTypeXid: json["user_type_xid"] == null ? null : AccessType.fromJson(json["user_type_xid"]), + isRequested: json["is_requested"], + isMute: json["is_mute"], + ); + } + +} + +class FourMemberImage { + FourMemberImage({ + required this.iamPrincipalXid, + required this.manageCommunityXid, + required this.iamPrincipal, + }); + + final int? iamPrincipalXid; + final int? manageCommunityXid; + final IamPrincipal? iamPrincipal; + + factory FourMemberImage.fromJson(Map json){ + return FourMemberImage( + iamPrincipalXid: json["iam_principal_xid"], + manageCommunityXid: json["manage_community_xid"], + iamPrincipal: json["iam_principal"] == null ? null : IamPrincipal.fromJson(json["iam_principal"]), + ); + } + +} + +class IamPrincipal { + IamPrincipal({ + required this.id, + required this.principalTypeXid, + required this.userName, + required this.fullName, + required this.profilePhoto, + required this.isUserPinned, + }); + + final int? id; + final int? principalTypeXid; + final String? userName; + final String? fullName; + final String? profilePhoto; + final bool? isUserPinned; + + factory IamPrincipal.fromJson(Map json){ + return IamPrincipal( + id: json["id"], + principalTypeXid: json["principal_type_xid"], + userName: json["user_name"], + fullName: json["full_name"], + profilePhoto: json["profile_photo"], + isUserPinned: json["is_user_pinned"], + ); + } + +} diff --git a/lib/sidemenu/Community/MyCommunity/Model/ComPostModel.dart b/lib/sidemenu/Community/MyCommunity/Model/ComPostModel.dart new file mode 100644 index 0000000..4b348b7 --- /dev/null +++ b/lib/sidemenu/Community/MyCommunity/Model/ComPostModel.dart @@ -0,0 +1,522 @@ +class ComPostModel { + ComPostModel({ + required this.status, + required this.statusCode, + required this.message, + required this.data, + }); + + final String? status; + final int? statusCode; + final String? message; + final List data; + + factory ComPostModel.fromJson(Map json) { + return ComPostModel( + status: json["status"], + statusCode: json["status_code"], + message: json["message"], + data: json["data"] == null + ? [] + : List.from(json["data"]!.map((x) => Datum.fromJson(x))), + ); + } +} + +class Datum { + Datum({ + required this.id, + required this.iamPrincipalXid, + required this.postIn, + required this.caption, + required this.image, + required this.manageTagsXids, + required this.postAs, + required this.isUploadedByBussinessUser, + required this.ctaTitle, + required this.ctaLink, + required this.isActive, + required this.createdBy, + required this.modifiedBy, + required this.deletedAt, + required this.createdAt, + required this.updatedAt, + required this.likecount, + required this.isILiked, + required this.isIFollow, + required this.isISaved, + required this.likeIcon, + required this.totalComment, + required this.totalSave, + required this.tagsXid, + required this.totalViewCount, + required this.totalReactionCount, + required this.totalCommentCount, + required this.totalImpressionCount, + required this.totalPopularScore, + required this.totalHoursAgo, + required this.iamPrincipal, + required this.community, + required this.attachTags, + }); + + final int? id; + final int? iamPrincipalXid; + final int? postIn; + final String? caption; + final String? image; + final String? manageTagsXids; + final String? postAs; + final int? isUploadedByBussinessUser; + final String? ctaTitle; + final String? ctaLink; + final int? isActive; + final dynamic createdBy; + final dynamic modifiedBy; + final dynamic deletedAt; + final DateTime? createdAt; + final DateTime? updatedAt; + final int? likecount; + final bool? isILiked; + final bool? isIFollow; + final bool? isISaved; + final LikeIcon? likeIcon; + final int? totalComment; + final int? totalSave; + final List tagsXid; + final int? totalViewCount; + final int? totalReactionCount; + final int? totalCommentCount; + final int? totalImpressionCount; + final int? totalPopularScore; + final int? totalHoursAgo; + final IamPrincipal? iamPrincipal; + final Community? community; + final List attachTags; + + factory Datum.fromJson(Map json) { + return Datum( + id: json["id"], + iamPrincipalXid: json["iam_principal_xid"], + postIn: json["post_in"], + caption: json["caption"], + image: json["image"], + manageTagsXids: json["manage_tags_xids"], + postAs: json["post_as"], + isUploadedByBussinessUser: json["is_uploaded_by_bussiness_user"], + ctaTitle: json["cta_title"], + ctaLink: json["cta_link"], + isActive: json["is_active"], + createdBy: json["created_by"], + modifiedBy: json["modified_by"], + deletedAt: json["deleted_at"], + createdAt: DateTime.tryParse(json["created_at"] ?? ""), + updatedAt: DateTime.tryParse(json["updated_at"] ?? ""), + likecount: json["likecount"], + isILiked: json["is_i_liked"], + isIFollow: json["is_i_follow"], + isISaved: json["is_i_saved"], + // likeIcon: json["likeIcon"], + likeIcon: json["likeIcon"] == null ? null : LikeIcon.fromJson(json["likeIcon"]), + totalComment: json["total_comment"], + totalSave: json["total_save"], + tagsXid: json["tags_xid"] == null + ? [] + : List.from(json["tags_xid"]!.map((x) => x)), + totalViewCount: json["totalViewCount"], + totalReactionCount: json["totalReactionCount"], + totalCommentCount: json["totalCommentCount"], + totalImpressionCount: json["totalImpressionCount"], + totalPopularScore: json["totalPopularScore"], + totalHoursAgo: json["totalHoursAgo"], + iamPrincipal: json["iam_principal"] == null + ? null + : IamPrincipal.fromJson(json["iam_principal"]), + community: json["community"] == null + ? null + : Community.fromJson(json["community"]), + attachTags: json["attach_tags"] == null + ? [] + : List.from( + json["attach_tags"]!.map((x) => AttachTag.fromJson(x))), + ); + } +} + +class AttachTag { + AttachTag({ + required this.managePostXid, + required this.manageTagXid, + required this.manageTag, + }); + + final int? managePostXid; + final int? manageTagXid; + final ManageTag? manageTag; + + factory AttachTag.fromJson(Map json) { + return AttachTag( + managePostXid: json["manage_post_xid"], + manageTagXid: json["manage_tag_xid"], + manageTag: json["manage_tag"] == null + ? null + : ManageTag.fromJson(json["manage_tag"]), + ); + } +} + +class LikeIcon { + LikeIcon({ + required this.likeIconsXid, + required this.likeIcon, + }); + + final int? likeIconsXid; + final LikeIconClass? likeIcon; + + factory LikeIcon.fromJson(Map json){ + return LikeIcon( + likeIconsXid: json["like_icons_xid"], + likeIcon: json["like_icon"] == null ? null : LikeIconClass.fromJson(json["like_icon"]), + ); + } + +} + +class LikeIconClass { + LikeIconClass({ + required this.id, + required this.image, + }); + + final int? id; + final String? image; + + factory LikeIconClass.fromJson(Map json){ + return LikeIconClass( + id: json["id"], + image: json["image"], + ); + } + +} + +class ManageTag { + ManageTag({ + required this.id, + required this.isPinned, + required this.name, + }); + + final int? id; + final bool? isPinned; + final String? name; + + factory ManageTag.fromJson(Map json) { + return ManageTag( + id: json["id"], + isPinned: json["is_pinned"], + name: json["name"], + ); + } +} + +class Community { + Community({ + required this.id, + required this.communityProfilePhoto, + required this.communityBannerImage, + required this.communityName, + required this.totalGroup, + required this.totalAnnouncements, + }); + + final int? id; + final String? communityProfilePhoto; + final String? communityBannerImage; + final String? communityName; + final int? totalGroup; + final int? totalAnnouncements; + + factory Community.fromJson(Map json) { + return Community( + id: json["id"], + communityProfilePhoto: json["community_profile_photo"], + communityBannerImage: json["community_banner_image"], + communityName: json["community_name"], + totalGroup: json["total_group"], + totalAnnouncements: json["total_announcements"], + ); + } +} + +class IamPrincipal { + IamPrincipal({ + required this.id, + required this.principalTypeXid, + required this.userName, + required this.fullName, + required this.profilePhoto, + required this.isUserPinned, + }); + + final int? id; + final int? principalTypeXid; + final String? userName; + final String? fullName; + final String? profilePhoto; + final bool? isUserPinned; + + factory IamPrincipal.fromJson(Map json) { + return IamPrincipal( + id: json["id"], + principalTypeXid: json["principal_type_xid"], + userName: json["user_name"], + fullName: json["full_name"], + profilePhoto: json["profile_photo"], + isUserPinned: json["is_user_pinned"], + ); + } +} + +/* +{ + "status": "success", + "status_code": 200, + "message": "Data Fetched Successfully.", + "data": [ + { + "id": 1, + "iam_principal_xid": 24, + "post_in": 1, + "caption": "test", + "image": "https://regroup.betadelivery.com/storage/app/public/uploads/post_image/66a88f43ac269.png?d=1723806586", + "manage_tags_xids": "[2,1,3]", + "post_as": "Individual", + "is_uploaded_by_bussiness_user": 1, + "cta_title": "test", + "cta_link": "test", + "is_active": 1, + "created_by": null, + "modified_by": null, + "deleted_at": null, + "created_at": "2024-07-30T06:59:15.000000Z", + "updated_at": "2024-07-30T06:59:15.000000Z", + "likecount": 6, + "is_i_liked": false, + "is_i_follow": false, + "is_i_saved": true, + "likeIcon": null, + "total_comment": 6, + "total_save": 2, + "tags_xid": [ + 2, + 1, + 3 + ], + "totalViewCount": 10, + "totalReactionCount": 6, + "totalCommentCount": 6, + "totalImpressionCount": 0, + "totalPopularScore": 0, + "totalHoursAgo": 412, + "iam_principal": { + "id": 24, + "principal_type_xid": 1, + "user_name": "kishansjsj", + "full_name": "kishan", + "profile_photo": "https://regroup.betadelivery.com/storage/app/public/uploads/profile_photos/1720599966.jpg?d=1723806586", + "is_user_pinned": false + }, + "community": { + "id": 1, + "community_profile_photo": "https://regroup.betadelivery.com/storage/app/public/uploads/community_profile_photo/66a8c09525d87.jpg?d=1723806586", + "community_banner_image": "https://regroup.betadelivery.com/storage/app/public/uploads/community_banner_image/66a8c09527b92.jpg?d=1723806586", + "community_name": "Flutter Community", + "total_group": 5, + "total_announcements": 3 + }, + "attach_tags": [ + { + "manage_post_xid": 1, + "manage_tag_xid": 2, + "manage_tag": { + "id": 2, + "is_pinned": false, + "name": "Test 1" + } + }, + { + "manage_post_xid": 1, + "manage_tag_xid": 1, + "manage_tag": { + "id": 1, + "is_pinned": false, + "name": "Test 2" + } + }, + { + "manage_post_xid": 1, + "manage_tag_xid": 3, + "manage_tag": { + "id": 3, + "is_pinned": false, + "name": "another test 1" + } + } + ] + }, + { + "id": 2, + "iam_principal_xid": 24, + "post_in": 1, + "caption": "test", + "image": "https://regroup.betadelivery.com/storage/app/public/uploads/post_image/66ab5b2a52291.png?d=1723806586", + "manage_tags_xids": "[2,1,3]", + "post_as": "Individual", + "is_uploaded_by_bussiness_user": 0, + "cta_title": null, + "cta_link": null, + "is_active": 1, + "created_by": null, + "modified_by": null, + "deleted_at": null, + "created_at": "2024-08-01T09:53:46.000000Z", + "updated_at": "2024-08-01T09:53:46.000000Z", + "likecount": 0, + "is_i_liked": false, + "is_i_follow": false, + "is_i_saved": false, + "likeIcon": null, + "total_comment": 1, + "total_save": 0, + "tags_xid": [ + 2, + 1, + 3 + ], + "totalViewCount": 8, + "totalReactionCount": 0, + "totalCommentCount": 1, + "totalImpressionCount": 0, + "totalPopularScore": 0, + "totalHoursAgo": 361, + "iam_principal": { + "id": 24, + "principal_type_xid": 1, + "user_name": "kishansjsj", + "full_name": "kishan", + "profile_photo": "https://regroup.betadelivery.com/storage/app/public/uploads/profile_photos/1720599966.jpg?d=1723806586", + "is_user_pinned": false + }, + "community": { + "id": 1, + "community_profile_photo": "https://regroup.betadelivery.com/storage/app/public/uploads/community_profile_photo/66a8c09525d87.jpg?d=1723806586", + "community_banner_image": "https://regroup.betadelivery.com/storage/app/public/uploads/community_banner_image/66a8c09527b92.jpg?d=1723806586", + "community_name": "Flutter Community", + "total_group": 5, + "total_announcements": 3 + }, + "attach_tags": [ + { + "manage_post_xid": 2, + "manage_tag_xid": 2, + "manage_tag": { + "id": 2, + "is_pinned": false, + "name": "Test 1" + } + }, + { + "manage_post_xid": 2, + "manage_tag_xid": 1, + "manage_tag": { + "id": 1, + "is_pinned": false, + "name": "Test 2" + } + }, + { + "manage_post_xid": 2, + "manage_tag_xid": 3, + "manage_tag": { + "id": 3, + "is_pinned": false, + "name": "another test 1" + } + } + ] + }, + { + "id": 3, + "iam_principal_xid": 10, + "post_in": 1, + "caption": "this is individual caption", + "image": "https://regroup.betadelivery.com/storage/app/public/uploads/post_image/66ab5ceb8ddb5.jpg?d=1723806586", + "manage_tags_xids": "[5,7]", + "post_as": "Individual", + "is_uploaded_by_bussiness_user": 0, + "cta_title": null, + "cta_link": null, + "is_active": 1, + "created_by": null, + "modified_by": null, + "deleted_at": null, + "created_at": "2024-08-01T10:01:15.000000Z", + "updated_at": "2024-08-01T10:01:15.000000Z", + "likecount": 2, + "is_i_liked": false, + "is_i_follow": false, + "is_i_saved": false, + "likeIcon": null, + "total_comment": 0, + "total_save": 0, + "tags_xid": [ + 5, + 7 + ], + "totalViewCount": 1, + "totalReactionCount": 2, + "totalCommentCount": 0, + "totalImpressionCount": 0, + "totalPopularScore": 0, + "totalHoursAgo": 361, + "iam_principal": { + "id": 10, + "principal_type_xid": 1, + "user_name": "shubham shirva", + "full_name": "Shubham", + "profile_photo": "https://regroup.betadelivery.com/storage/app/public/uploads/profile_photos/1720599966.jpg?d=1723806586", + "is_user_pinned": false + }, + "community": { + "id": 1, + "community_profile_photo": "https://regroup.betadelivery.com/storage/app/public/uploads/community_profile_photo/66a8c09525d87.jpg?d=1723806586", + "community_banner_image": "https://regroup.betadelivery.com/storage/app/public/uploads/community_banner_image/66a8c09527b92.jpg?d=1723806586", + "community_name": "Flutter Community", + "total_group": 5, + "total_announcements": 3 + }, + "attach_tags": [ + { + "manage_post_xid": 3, + "manage_tag_xid": 5, + "manage_tag": { + "id": 5, + "is_pinned": false, + "name": "Test new" + } + }, + { + "manage_post_xid": 3, + "manage_tag_xid": 7, + "manage_tag": { + "id": 7, + "is_pinned": false, + "name": "Test new 2" + } + } + ] + } + ] +}*/ \ No newline at end of file diff --git a/lib/sidemenu/Community/MyCommunity/Model/activitiesListModel.dart b/lib/sidemenu/Community/MyCommunity/Model/activitiesListModel.dart new file mode 100644 index 0000000..5824135 --- /dev/null +++ b/lib/sidemenu/Community/MyCommunity/Model/activitiesListModel.dart @@ -0,0 +1,44 @@ +class ActivitiesListsModel { + ActivitiesListsModel({ + required this.status, + required this.statusCode, + required this.message, + required this.data, + }); + + final String? status; + final int? statusCode; + final String? message; + final List data; + + factory ActivitiesListsModel.fromJson(Map json){ + return ActivitiesListsModel( + status: json["status"], + statusCode: json["status_code"], + message: json["message"], + data: json["data"] == null ? [] : List.from(json["data"]!.map((x) => Datum.fromJson(x))), + ); + } + +} + +class Datum { + Datum({ + required this.id, + required this.title, + required this.image, + }); + + final int? id; + final String? title; + final String? image; + + factory Datum.fromJson(Map json){ + return Datum( + id: json["id"], + title: json["title"], + image: json["image"], + ); + } + +} diff --git a/lib/sidemenu/Community/MyCommunity/Model/communityMebersModel.dart b/lib/sidemenu/Community/MyCommunity/Model/communityMebersModel.dart new file mode 100644 index 0000000..f4661d4 --- /dev/null +++ b/lib/sidemenu/Community/MyCommunity/Model/communityMebersModel.dart @@ -0,0 +1,77 @@ +class CommunityMembersModel { + CommunityMembersModel({ + required this.status, + required this.statusCode, + required this.message, + required this.data, + }); + + final String? status; + final int? statusCode; + final String? message; + final List data; + + factory CommunityMembersModel.fromJson(Map json){ + return CommunityMembersModel( + status: json["status"], + statusCode: json["status_code"], + message: json["message"], + data: json["data"] == null ? [] : List.from(json["data"]!.map((x) => Datum.fromJson(x))), + ); + } + +} + +class Datum { + Datum({ + required this.id, + required this.iamPrincipalXid, + required this.manageCommunityXid, + required this.iamPrincipal, + }); + + final int? id; + final int? iamPrincipalXid; + final int? manageCommunityXid; + final IamPrincipal? iamPrincipal; + + factory Datum.fromJson(Map json){ + return Datum( + id: json["id"], + iamPrincipalXid: json["iam_principal_xid"], + manageCommunityXid: json["manage_community_xid"], + iamPrincipal: json["iam_principal"] == null ? null : IamPrincipal.fromJson(json["iam_principal"]), + ); + } + +} + +class IamPrincipal { + IamPrincipal({ + required this.id, + required this.principalTypeXid, + required this.userName, + required this.fullName, + required this.profilePhoto, + required this.isUserPinned, + }); + + final int? id; + final int? principalTypeXid; + final String? userName; + final String? fullName; + final String? profilePhoto; + final bool? isUserPinned; + + factory IamPrincipal.fromJson(Map json){ + return IamPrincipal( + id: json["id"], + principalTypeXid: json["principal_type_xid"], + userName: json["user_name"], + fullName: json["full_name"], + profilePhoto: json["profile_photo"], + isUserPinned: json["is_user_pinned"], + ); + } + +} diff --git a/lib/sidemenu/Community/MyCommunity/Model/communityaddgroupsModel.dart b/lib/sidemenu/Community/MyCommunity/Model/communityaddgroupsModel.dart new file mode 100644 index 0000000..a7f27dc --- /dev/null +++ b/lib/sidemenu/Community/MyCommunity/Model/communityaddgroupsModel.dart @@ -0,0 +1,101 @@ +class CommunityAddgroupsModel { + CommunityAddgroupsModel({ + required this.status, + required this.statusCode, + required this.message, + required this.data, + }); + + final String? status; + final int? statusCode; + final String? message; + final List data; + + factory CommunityAddgroupsModel.fromJson(Map json){ + return CommunityAddgroupsModel( + status: json["status"], + statusCode: json["status_code"], + message: json["message"], + data: json["data"] == null ? [] : List.from(json["data"]!.map((x) => Datum.fromJson(x))), + ); + } + +} + +class Datum { + Datum({ + required this.id, + required this.title, + required this.groupImage, + required this.description, + required this.totalMember, + required this.sevenMemberImage, + }); + + final int? id; + final String? title; + final String? groupImage; + final String? description; + final int? totalMember; + final List sevenMemberImage; + + factory Datum.fromJson(Map json){ + return Datum( + id: json["id"], + title: json["title"], + groupImage: json["group_image"], + description: json["description"], + totalMember: json["total_member"], + sevenMemberImage: json["seven_member_image"] == null ? [] : List.from(json["seven_member_image"]!.map((x) => SevenMemberImage.fromJson(x))), + ); + } + +} + +class SevenMemberImage { + SevenMemberImage({ + required this.id, + required this.iamPrincipalXid, + required this.manageGroupXid, + required this.iamPrincipalData, + }); + + final int? id; + final int? iamPrincipalXid; + final int? manageGroupXid; + final IamPrincipalData? iamPrincipalData; + + factory SevenMemberImage.fromJson(Map json){ + return SevenMemberImage( + id: json["id"], + iamPrincipalXid: json["iam_principal_xid"], + manageGroupXid: json["manage_group_xid"], + iamPrincipalData: json["iam_principal_data"] == null ? null : IamPrincipalData.fromJson(json["iam_principal_data"]), + ); + } + +} + +class IamPrincipalData { + IamPrincipalData({ + required this.id, + required this.principalTypeXid, + required this.profilePhoto, + required this.isUserPinned, + }); + + final int? id; + final int? principalTypeXid; + final String? profilePhoto; + final bool? isUserPinned; + + factory IamPrincipalData.fromJson(Map json){ + return IamPrincipalData( + id: json["id"], + principalTypeXid: json["principal_type_xid"], + profilePhoto: json["profile_photo"], + isUserPinned: json["is_user_pinned"], + ); + } + +} diff --git a/lib/sidemenu/Community/MyCommunity/Model/communityalldetails.dart b/lib/sidemenu/Community/MyCommunity/Model/communityalldetails.dart new file mode 100644 index 0000000..4cf1d08 --- /dev/null +++ b/lib/sidemenu/Community/MyCommunity/Model/communityalldetails.dart @@ -0,0 +1,91 @@ + + + +class CommunityAllDetailsModel { + CommunityAllDetailsModel({ + required this.status, + required this.statusCode, + required this.message, + required this.data, + }); + + final String? status; + final int? statusCode; + final String? message; + final Data? data; + + factory CommunityAllDetailsModel.fromJson(Map json) { + return CommunityAllDetailsModel( + status: json["status"], + statusCode: json["status_code"], + message: json["message"], + data: json["data"] == null ? null : Data.fromJson(json["data"]), + ); + } +} + +class Data { + Data({ + required this.id, + required this.isCommunityPinned, + required this.totalGroup, + required this.totalAnnouncements, + required this.communityProfilePhoto, + required this.communityBannerImage, + required this.communityName, + required this.communityLocation, + required this.communityDescription, + required this.communityTypeXid, + required this.userLinkInCommunity, + required this.accessType, + }); + + final int? id; + final bool? isCommunityPinned; + final int? totalGroup; + final int? totalAnnouncements; + final String? communityProfilePhoto; + final String? communityBannerImage; + final String? communityName; + final String? communityLocation; + final String? communityDescription; + final int? communityTypeXid; + final dynamic userLinkInCommunity; + final AccessType? accessType; + + factory Data.fromJson(Map json) { + return Data( + id: json["id"], + isCommunityPinned: json["is_community_pinned"], + totalGroup: json["total_group"], + totalAnnouncements: json["total_announcements"], + communityProfilePhoto: json["community_profile_photo"], + communityBannerImage: json["community_banner_image"], + communityName: json["community_name"], + communityLocation: json["community_location"], + communityDescription: json["community_description"], + communityTypeXid: json["community_type_xid"], + userLinkInCommunity: json["user_link_in_community"], + accessType: json["access_type"] == null + ? null + : AccessType.fromJson(json["access_type"]), + ); + } +} + +class AccessType { + AccessType({ + required this.id, + required this.name, + }); + + final int? id; + final String? name; + + factory AccessType.fromJson(Map json) { + return AccessType( + id: json["id"], + name: json["name"], + ); + } +} diff --git a/lib/sidemenu/Community/MyCommunity/Model/communityeditpageModel.dart b/lib/sidemenu/Community/MyCommunity/Model/communityeditpageModel.dart new file mode 100644 index 0000000..d8493e6 --- /dev/null +++ b/lib/sidemenu/Community/MyCommunity/Model/communityeditpageModel.dart @@ -0,0 +1,185 @@ +class CommunityinfopageEditModel { + CommunityinfopageEditModel({ + required this.status, + required this.statusCode, + required this.message, + required this.data, + }); + + final String? status; + final int? statusCode; + final String? message; + final Data? data; + + factory CommunityinfopageEditModel.fromJson(Map json){ + return CommunityinfopageEditModel( + status: json["status"], + statusCode: json["status_code"], + message: json["message"], + data: json["data"] == null ? null : Data.fromJson(json["data"]), + ); + } + +} + +class Data { + Data({ + required this.typesOfCommunity, + required this.communityData, + }); + + final List typesOfCommunity; + final CommunityData? communityData; + + factory Data.fromJson(Map json){ + return Data( + typesOfCommunity: json["typesOfCommunity"] == null ? [] : List.from(json["typesOfCommunity"]!.map((x) => TypesOfCommunity.fromJson(x))), + communityData: json["communityData"] == null ? null : CommunityData.fromJson(json["communityData"]), + ); + } + +} + +class CommunityData { + CommunityData({ + required this.id, + required this.communityProfilePhoto, + required this.communityBannerImage, + required this.communityName, + required this.communityLocation, + required this.communityDescription, + required this.communityTypeXid, + required this.activityXid, + required this.isActive, + required this.totalGroup, + required this.totalAnnouncements, + required this.activityData, + required this.communityTypeData, + }); + + final int? id; + final String? communityProfilePhoto; + final String? communityBannerImage; + final String? communityName; + final String? communityLocation; + final String? communityDescription; + final int? communityTypeXid; + final int? activityXid; + final int? isActive; + final int? totalGroup; + final int? totalAnnouncements; + final ActivityData? activityData; + final CommunityTypeData? communityTypeData; + + factory CommunityData.fromJson(Map json){ + return CommunityData( + id: json["id"], + communityProfilePhoto: json["community_profile_photo"], + communityBannerImage: json["community_banner_image"], + communityName: json["community_name"], + communityLocation: json["community_location"], + communityDescription: json["community_description"], + communityTypeXid: json["community_type_xid"], + activityXid: json["activity_xid"], + isActive: json["is_active"], + totalGroup: json["total_group"], + totalAnnouncements: json["total_announcements"], + activityData: json["activity_data"] == null ? null : ActivityData.fromJson(json["activity_data"]), + communityTypeData: json["community_type_data"] == null ? null : CommunityTypeData.fromJson(json["community_type_data"]), + ); + } + +} + +class ActivityData { + ActivityData({ + required this.id, + required this.title, + required this.description, + required this.image, + required this.deletedAt, + required this.createdAt, + required this.updatedAt, + }); + + final int? id; + final String? title; + final String? description; + final String? image; + final dynamic deletedAt; + final DateTime? createdAt; + final DateTime? updatedAt; + + factory ActivityData.fromJson(Map json){ + return ActivityData( + id: json["id"], + title: json["title"], + description: json["description"], + image: json["image"], + deletedAt: json["deleted_at"], + createdAt: DateTime.tryParse(json["created_at"] ?? ""), + updatedAt: DateTime.tryParse(json["updated_at"] ?? ""), + ); + } + +} + +class CommunityTypeData { + CommunityTypeData({ + required this.id, + required this.name, + required this.image, + required this.description, + required this.isActive, + required this.createdBy, + required this.modifiedBy, + required this.deletedAt, + required this.createdAt, + required this.updatedAt, + }); + + final int? id; + final String? name; + final dynamic image; + final dynamic description; + final int? isActive; + final dynamic createdBy; + final dynamic modifiedBy; + final dynamic deletedAt; + final dynamic createdAt; + final dynamic updatedAt; + + factory CommunityTypeData.fromJson(Map json){ + return CommunityTypeData( + id: json["id"], + name: json["name"], + image: json["image"], + description: json["description"], + isActive: json["is_active"], + createdBy: json["created_by"], + modifiedBy: json["modified_by"], + deletedAt: json["deleted_at"], + createdAt: json["created_at"], + updatedAt: json["updated_at"], + ); + } + +} + +class TypesOfCommunity { + TypesOfCommunity({ + required this.id, + required this.name, + }); + + final int? id; + final String? name; + + factory TypesOfCommunity.fromJson(Map json){ + return TypesOfCommunity( + id: json["id"], + name: json["name"], + ); + } + +} diff --git a/lib/sidemenu/Community/MyCommunity/Model/communitygroupsModel.dart b/lib/sidemenu/Community/MyCommunity/Model/communitygroupsModel.dart new file mode 100644 index 0000000..09fcefd --- /dev/null +++ b/lib/sidemenu/Community/MyCommunity/Model/communitygroupsModel.dart @@ -0,0 +1,161 @@ +class CommunitygroupsModel { + CommunitygroupsModel({ + required this.status, + required this.statusCode, + required this.message, + required this.data, + }); + + final String? status; + final int? statusCode; + final String? message; + final List data; + + factory CommunitygroupsModel.fromJson(Map json){ + return CommunitygroupsModel( + status: json["status"], + statusCode: json["status_code"], + message: json["message"], + data: json["data"] == null ? [] : List.from(json["data"]!.map((x) => Datum.fromJson(x))), + ); + } + +} + +class Datum { + Datum({ + required this.manageCommunityXid, + required this.manageGroupXid, + required this.groups, + required this.communityData, + }); + + final int? manageCommunityXid; + final int? manageGroupXid; + final Groups? groups; + final CommunityData? communityData; + + factory Datum.fromJson(Map json){ + return Datum( + manageCommunityXid: json["manage_community_xid"], + manageGroupXid: json["manage_group_xid"], + groups: json["groups"] == null ? null : Groups.fromJson(json["groups"]), + communityData: json["community_data"] == null ? null : CommunityData.fromJson(json["community_data"]), + ); + } + +} + +class CommunityData { + CommunityData({ + required this.id, + required this.communityName, + required this.totalGroup, + required this.totalAnnouncements, + }); + + final int? id; + final String? communityName; + final int? totalGroup; + final int? totalAnnouncements; + + factory CommunityData.fromJson(Map json){ + return CommunityData( + id: json["id"], + communityName: json["community_name"], + totalGroup: json["total_group"], + totalAnnouncements: json["total_announcements"], + ); + } + +} + +class Groups { + Groups({ + required this.id, + required this.totalMember, + required this.sevenMemberImage, + required this.manageGroupTypeXid, + required this.title, + required this.backgroundImage, + required this.groupImage, + required this.location, + required this.link, + required this.description, + }); + + final int? id; + final int? totalMember; + final List sevenMemberImage; + final int? manageGroupTypeXid; + final String? title; + final String? backgroundImage; + final String? groupImage; + final String? location; + final String? link; + final String? description; + + factory Groups.fromJson(Map json){ + return Groups( + id: json["id"], + totalMember: json["total_member"], + sevenMemberImage: json["seven_member_image"] == null ? [] : List.from(json["seven_member_image"]!.map((x) => SevenMemberImage.fromJson(x))), + manageGroupTypeXid: json["manage_group_type_xid"], + title: json["title"], + backgroundImage: json["background_image"], + groupImage: json["group_image"], + location: json["location"], + link: json["link"], + description: json["description"], + ); + } + +} + +class SevenMemberImage { + SevenMemberImage({ + required this.id, + required this.iamPrincipalXid, + required this.manageGroupXid, + required this.iamPrincipalData, + }); + + final int? id; + final int? iamPrincipalXid; + final int? manageGroupXid; + final IamPrincipalData? iamPrincipalData; + + factory SevenMemberImage.fromJson(Map json){ + return SevenMemberImage( + id: json["id"], + iamPrincipalXid: json["iam_principal_xid"], + manageGroupXid: json["manage_group_xid"], + iamPrincipalData: json["iam_principal_data"] == null ? null : IamPrincipalData.fromJson(json["iam_principal_data"]), + ); + } + +} + +class IamPrincipalData { + IamPrincipalData({ + required this.id, + required this.principalTypeXid, + required this.profilePhoto, + required this.isUserPinned, + }); + + final int? id; + final int? principalTypeXid; + final String? profilePhoto; + final bool? isUserPinned; + + factory IamPrincipalData.fromJson(Map json){ + return IamPrincipalData( + id: json["id"], + principalTypeXid: json["principal_type_xid"], + profilePhoto: json["profile_photo"], + isUserPinned: json["is_user_pinned"], + ); + } + +} diff --git a/lib/sidemenu/Community/MyCommunity/Model/communitymanageGroupsModel.dart b/lib/sidemenu/Community/MyCommunity/Model/communitymanageGroupsModel.dart new file mode 100644 index 0000000..f47a638 --- /dev/null +++ b/lib/sidemenu/Community/MyCommunity/Model/communitymanageGroupsModel.dart @@ -0,0 +1,80 @@ +class CommunityManageGroupsModel { + CommunityManageGroupsModel({ + required this.status, + required this.statusCode, + required this.message, + required this.data, + }); + + final String? status; + final int? statusCode; + final String? message; + final List data; + + factory CommunityManageGroupsModel.fromJson(Map json){ + return CommunityManageGroupsModel( + status: json["status"], + statusCode: json["status_code"], + message: json["message"], + data: json["data"] == null ? [] : List.from(json["data"]!.map((x) => Datum.fromJson(x))), + ); + } + +} + +class Datum { + Datum({ + required this.id, + required this.manageCommunityXid, + required this.manageGroupXid, + required this.groupsData, + }); + + final int? id; + final int? manageCommunityXid; + final int? manageGroupXid; + final GroupsData? groupsData; + + factory Datum.fromJson(Map json){ + return Datum( + id: json["id"], + manageCommunityXid: json["manage_community_xid"], + manageGroupXid: json["manage_group_xid"], + groupsData: json["groups_data"] == null ? null : GroupsData.fromJson(json["groups_data"]), + ); + } + +} + +class GroupsData { + GroupsData({ + required this.id, + required this.manageGroupTypeXid, + required this.title, + required this.backgroundImage, + required this.groupImage, + required this.description, + required this.totalMember, + }); + + final int? id; + final int? manageGroupTypeXid; + final String? title; + final String? backgroundImage; + final String? groupImage; + final String? description; + final int? totalMember; + + factory GroupsData.fromJson(Map json){ + return GroupsData( + id: json["id"], + manageGroupTypeXid: json["manage_group_type_xid"], + title: json["title"], + backgroundImage: json["background_image"], + groupImage: json["group_image"], + description: json["description"], + totalMember: json["total_member"], + ); + } + +} diff --git a/lib/sidemenu/Community/MyCommunity/NewCommunity.dart b/lib/sidemenu/Community/MyCommunity/NewCommunity.dart new file mode 100644 index 0000000..c7f692a --- /dev/null +++ b/lib/sidemenu/Community/MyCommunity/NewCommunity.dart @@ -0,0 +1,491 @@ +import 'dart:developer'; +import 'dart:io'; +import 'dart:async'; + +import 'package:dotted_border/dotted_border.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart' hide MultipartFile, FormData; +import 'package:regroup/Common/CommonGlassmorphism.dart'; +import 'package:regroup/Common/base_manager.dart'; +import 'package:regroup/Utils/Common/CommonAppbar.dart'; +import 'package:regroup/Utils/Common/CommonDropdown.dart'; +import 'package:regroup/Utils/Common/CustomNextButton.dart'; +import 'package:regroup/Utils/Common/CustomTextformfield.dart'; +import 'package:regroup/Utils/Common/ImageUpload.dart'; + +import 'package:regroup/Utils/Common/sized_box.dart'; +import 'package:regroup/Utils/dialogs.dart'; +import 'package:regroup/Utils/texts.dart'; +import 'package:regroup/resources/routes/route_name.dart'; +import 'package:regroup/sidemenu/Community/MyCommunity/Model/activitiesListModel.dart' + as primaryactlist; +import 'package:regroup/sidemenu/Community/MyCommunity/view_model/primaryactivity.dart'; +import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart'; +import 'package:path/path.dart' as path; + +class NewCommunity extends StatefulWidget { + const NewCommunity({super.key}); + + @override + State createState() => _NewCommunityState(); +} + +class _NewCommunityState extends State { + List filePath = []; + List bannerPath = []; + + bool isImageAdded = false; + bool isbannerAdded = false; + + TextEditingController communitycontroller = TextEditingController(); + TextEditingController locationcontroller = TextEditingController(); + TextEditingController communitydescrcontroller = TextEditingController(); + + final Map _TypecommunityMap = { + 'Public': 1, + 'Private': 2, + 'Secret': 3, + }; + + String _selectedtypecommunity = ''; + + void _onItemSelected(String value) { + setState(() { + _selectedtypecommunity = value; + }); + } + + primaryactlist.ActivitiesListsModel? abilityModel; + List activity = []; + List _activitydrop = []; + + Future fetchActivitylist() async { + PrimaryActivityListApi abilityLsitAPI = PrimaryActivityListApi(); + ResponseData response = await abilityLsitAPI.getActivitylistApi(); + + if (response.status == ResponseStatus.SUCCESS) { + abilityModel = + primaryactlist.ActivitiesListsModel.fromJson(response.data!); + setState(() { + activity = abilityModel?.data ?? []; // Store the fetched cities + _activitydrop = + activity.map((platform) => platform.title.toString()).toList(); + }); + log(activity.toString()); + } else { + print('Failed to fetch abilities'); + } + } + + int? selectedactivityid; + + void getCatIdFromName(String selectedAbility) { + // Clear existing selections + selectedactivityid = null; + + // Find and add the ID of the selected ability + for (var activityItem in activity) { + if (selectedAbility == activityItem.title) { + selectedactivityid = activityItem.id!; + break; // Stop once the matching item is found + } + } + print('selected activity is $selectedactivityid'); + } + + @override + void initState() { + // TODO: implement initState + fetchActivitylist(); + super.initState(); + } + + // Uploadata() async { + // utils.loader(); + // List bannermedialist = []; + // List profielpicturelist = []; + + // for (var file in bannerPath.where((file) => file != null)) { + // bannermedialist.add( + // await MultipartFile.fromFile( + // file!.path, + // filename: path.basename(file.path), + // ), + // ); + // } + + // for (var file in filePath.where((file) => file != null)) { + // profielpicturelist.add( + // await MultipartFile.fromFile( + // file!.path, + // filename: path.basename(file.path), + // ), + // ); + // } + + // int communityTypeValue = _TypecommunityMap[_selectedtypecommunity] ?? 0; + + // FormData formdata = FormData.fromMap({ + // "community_profile_photo": profielpicturelist[0], + // "community_banner_image": bannermedialist[0], + // "community_name": communitycontroller.text, + // "community_location": locationcontroller.text, + // "community_description": communitydescrcontroller.text, + // 'community_type_xid': communityTypeValue, + // 'activity_xid': selectedactivityid, + // }); + // final data = await PostMethodCommunity().postCreatecommunity(formdata); + // if (data.status == ResponseStatus.SUCCESS) { + // Get.back(); + // print("community created"); + // Get.toNamed(RouteName.addgroup); + + // return utils.showToast(data.message); + // } else { + // Get.back(); + // print("community not created"); + // return utils.showToast(data.message); + // } + // } + + @override + Widget build(BuildContext context) { + return WillPopScope( + onWillPop: () async { + Get.back(result: true); + return true; + }, + child: GestureDetector( + onTap: () => FocusManager.instance.primaryFocus?.unfocus(), + child: Scaffold( + // key: _scaffoldKey1, + backgroundColor: Color(0xFF222935), + extendBody: true, + resizeToAvoidBottomInset: true, + appBar: CommonAppbar( + titleTxt: "New community", + customBack: true, + ), + body: Stack(children: [ + Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: + AssetImage("assets/images/png/Ellipse 1496.png"), + fit: BoxFit.fill)), + ), + SingleChildScrollView( + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 16.w), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + sizedBoxHeight(20.h), + Center( + child: InkWell( + onTap: () { + ImageUploadBottomSheet().showModal( + context, + false, + (result) { + if (result != null && result.isNotEmpty) { + var file = File(result); + filePath.cast(); + filePath.add(file); + isImageAdded = true; + setState(() {}); + if (Platform.isAndroid) { + Get.back(); + } + } else { + // Handle case where no image is selected + filePath.clear(); + isImageAdded = false; + setState(() {}); + } + }, + ); + }, + child: commonGlassUI( + width: 95.w, + height: 95.h, + borderRadius: BorderRadius.circular(100), + opacity1: 0.24, + opacity2: 0.24, + customWidget: + filePath.isNotEmpty && isImageAdded + ? ClipOval( + child: SizedBox.fromSize( + size: Size.fromRadius(47.5.r), + child: Image.file( + filePath[0]!, + fit: BoxFit.cover, + width: double.infinity, + ), + ), + ) + : Center( + child: Image.asset( + "assets/images/png/cameraicon2.png", + height: 30.h, + width: 30.w, + ), + ), + borderwidth: 0.5), + ), + ), + sizedBoxHeight(20.h), + Center( + child: text16w400_white( + "Add community profile picture")), + sizedBoxHeight(30.h), + text16w400_FCFCFC("Banner image"), + sizedBoxHeight(15.h), + InkWell( + onTap: () { + ImageUploadBottomSheet().showModal( + context, + false, + (result) { + // var file = File(result); + + // bannerPath.add(file); + // isbannerAdded = true; + // setState(() {}); + if (result != null && result.isNotEmpty) { + var file = File(result); + + // Check if the file size exceeds 10 MB + int fileSizeInBytes = file.lengthSync(); + double fileSizeInMB = + fileSizeInBytes / (1024 * 1024); + + if (fileSizeInMB > 10) { + // Show toast message if the file size exceeds 10 MB + + utils.showToast( + "The selected file is too large. Max file size is 10 MB."); + } else { + // Clear the existing image and add the new one + bannerPath.clear(); + bannerPath.add(file); + isbannerAdded = true; + setState(() {}); + } + } else { + // Handle case where no image is selected + bannerPath.clear(); + isbannerAdded = false; + setState(() {}); + } + if (Platform.isAndroid) { + Get.back(); + } + }, + ); + }, + child: DottedBorder( + strokeWidth: 1, + dashPattern: [7, 4], + borderType: BorderType.RRect, + radius: Radius.circular(14.r), + color: Color(0xFF434A53), + child: commonGlassUI( + borderwidth: 0, + width: double.infinity, + height: 130.h, + borderRadius: BorderRadius.circular(10.r), + customWidget: bannerPath.isNotEmpty && + isbannerAdded + ? Stack(children: [ + Image.file( + bannerPath[0]!, + fit: BoxFit.cover, + width: double.infinity, + ), + Positioned( + right: 5, + bottom: 5, + child: GestureDetector( + onTap: () { + bannerPath.clear(); + isbannerAdded = false; + setState(() {}); + }, + child: Container( + width: 27, + height: 27, + decoration: ShapeDecoration( + color: Color(0xFF7E7E7E), + shape: RoundedRectangleBorder( + borderRadius: + BorderRadius.circular( + 5)), + ), + child: Icon( + Icons.delete_outline_outlined, + color: Colors.white, + ))), + ), + ]) + : Padding( + padding: + EdgeInsets.symmetric(vertical: 16.h), + child: Column( + children: [ + Image.asset( + "assets/images/png/bi_download.png", + height: 36.h, + width: 36.w, + ), + sizedBoxHeight(10.h), + text14w400white( + 'Upload banner image'), + sizedBoxHeight(8.h), + text8w400_8A8A8A( + "Allowed file extensions: jpg, png, gif Max file size: 10 MB"), + ], + ), + ), + ), + ), + ), + + sizedBoxHeight(25.h), + + text16w400_FCFCFC("Community name*"), + sizedBoxHeight(15.h), + CustomTextFormField( + textEditingController: communitycontroller, + inputFormatters: [ + RemoveEmojiInputFormatter(), + FilteringTextInputFormatter.allow(RegExp('[a-zA-Z ]')) + ], + hintText: 'Enter community name', + validator: (val) { + if (val == null || val.isEmpty) { + return 'Enter Community name'; + } + return null; + }, + ), + sizedBoxHeight(25.h), + text16w400_FCFCFC("Community description*"), + sizedBoxHeight(15.h), + CustomTextFormField( + textEditingController: communitydescrcontroller, + inputFormatters: [ + RemoveEmojiInputFormatter(), + // FilteringTextInputFormatter.allow(RegExp('[a-zA-Z ]')) + ], + hintText: 'Enter community description', + validator: (val) { + if (val == null || val.isEmpty) { + return 'Enter Community description'; + } + return null; + }, + ), + sizedBoxHeight(25.h), + text16w400_FCFCFC("Type of community*"), + sizedBoxHeight(15.h), + CustomDropDownRadio( + header: "", + title: "", + listData: const ['Public', 'Private', 'Secret'], + onItemSelected: _onItemSelected, + // (p0) {}, + leadingImage: SizedBox()), + // CommonDropdownradioBtn( + // hint: '', + // items: ['Public', 'Private', 'Secret'], + // showOtherOption: false), + sizedBoxHeight(25.h), + text16w400_FCFCFC("Location*"), + sizedBoxHeight(15.h), + CustomTextFormField( + textEditingController: locationcontroller, + inputFormatters: [ + RemoveEmojiInputFormatter(), + FilteringTextInputFormatter.allow(RegExp('[a-zA-Z ]')) + ], + hintText: 'Enter location', + validator: (val) { + if (val == null || val.isEmpty) { + return 'Enter location'; + } + return null; + }, + ), + sizedBoxHeight(25.h), + text16w400_FCFCFC("Primary activity*"), + + sizedBoxHeight(20.h), + CustomDropDownRadio( + header: "", + title: "", + listData: _activitydrop, + // [ + // 'Sports', + // 'Hobby', + // ], + showOtherOption: false, + onItemSelected: getCatIdFromName, + leadingImage: SizedBox()), + + sizedBoxHeight(25.h), + sizedBoxHeight(25.h), + CustomButton( + text: "Create community", + onPressed: () { + // Get.toNamed(RouteName.addgroup); + if (filePath.isEmpty) { + utils.showToast( + 'Please add community profile picture'); + } else if (bannerPath.isEmpty) { + utils.showToast('Please add banner image'); + } else if (communitycontroller.text.isEmpty) { + utils.showToast('Please enter community name'); + } else if (communitydescrcontroller.text.isEmpty) { + utils.showToast( + 'Please enter community description'); + } else if (_selectedtypecommunity.isEmpty) { + utils + .showToast('Please select type of community'); + } else if (locationcontroller.text.isEmpty) { + utils.showToast('Please enter location'); + } else if (selectedactivityid == null) { + utils.showToast('Please select primary activity'); + } else { + print('done'); + // indiUploadata(); + // Uploadata(); + int communityTypeValue = + _TypecommunityMap[_selectedtypecommunity] ?? + 0; + + Get.toNamed(RouteName.addgroup, arguments: { + 'communityname': communitycontroller.text, + 'communitylocation': locationcontroller.text, + 'communitydescription': + communitydescrcontroller.text, + 'communitytype': communityTypeValue, + 'activityid': selectedactivityid, + 'communityprofilephoto': filePath, + 'communitybannerimage': bannerPath, + 'isedited': false, + 'communityid': "", + }); + } + }, + ), + sizedBoxHeight(25.h), + sizedBoxHeight(150.h), + ]), + )) + ])), + )); + } +} diff --git a/lib/sidemenu/Community/MyCommunity/View/CommunityDetails.dart b/lib/sidemenu/Community/MyCommunity/View/CommunityDetails.dart new file mode 100644 index 0000000..cfe0bed --- /dev/null +++ b/lib/sidemenu/Community/MyCommunity/View/CommunityDetails.dart @@ -0,0 +1,995 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_reaction_button/flutter_reaction_button.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:regroup/Common/CommonGlassmorphism.dart'; +import 'package:regroup/Common/CommonTabBar.dart'; +import 'package:regroup/Common/CommonWidget.dart'; +import 'package:regroup/Common/ConvertServerDateToUserDate.dart'; +import 'package:regroup/Common/base_manager.dart'; +import 'package:regroup/Common/controller/NormalPostCard.dart'; +import 'package:regroup/Main_Screens/Community/Model/CommonDatumObjModel.dart'; +import 'package:regroup/Main_Screens/Community/Model/fetchicons.dart'; +import 'package:regroup/Main_Screens/Community/ViewModel/getmethod.dart'; +import 'package:regroup/Main_Screens/Community_HomePage/view_model/CountersHelper.dart'; +import 'package:regroup/Utils/Common/CommonAppbar.dart'; +import 'package:regroup/Utils/Common/sized_box.dart'; +import 'package:regroup/Utils/dialogs.dart'; +import 'package:regroup/Utils/texts.dart'; +import 'package:regroup/resources/routes/route_name.dart'; +import 'package:regroup/sidemenu/Community/MyCommunity/view_model/ComDetails.dart'; +import 'package:regroup/sidemenu/view_model/postmethod.dart'; + +var CommunityId; +int? ismute; +var communitypinid; + +class CommunityDetails extends StatefulWidget { + const CommunityDetails({super.key}); + + @override + State createState() => _CommunityDetailsState(); +} + +class _CommunityDetailsState extends State { + var additionalContent = false.obs; + + bool? iscommunitypin = false; + + late Future myfuture; + + @override + void initState() { + CommunityId = Get.arguments["CommunityID"]; + myfuture = CommunityDetail().getCommunityDetail(CommunityId); + ismute = comdetailobj?.data?.userLinkInCommunity?.isMute; + iscommunitypin = comdetailobj?.data?.isCommunityPinned; + super.initState(); + } + + void refreshData() { + setState(() { + myfuture = CommunityDetail().getCommunityDetail(CommunityId); + }); + } + + pinunpinCommunity(String communitypinid) async { + // utils.loader(); + Map updata = { + "manage_communities_xid": communitypinid, + }; + final data = await SidebarTags().postUserpin(updata); + if (data.status == ResponseStatus.SUCCESS) { + print("success"); + // Get.back(); + setState(() {}); + await CommunityDetail().getCommunityDetail(CommunityId); + iscommunitypin = !iscommunitypin!; + + return utils.showToast(data.message); + } else { + // Get.back(); + return utils.showToast(data.message); + } + } + + leaveCommunity() async { + utils.loader(); + Map updata = {}; + final data = + await CommunityDetail().postLeaveCommunity(updata, CommunityId); + if (data.status == ResponseStatus.SUCCESS) { + Get.back(); + Get.offNamed(RouteName.mycommunity); + // toggleSelectedIndex(tagid); + return utils.showToast(data.message); + } else { + Get.back(); + return utils.showToast(data.message); + } + } + + @override + Widget build(BuildContext context) { + return WillPopScope( + onWillPop: () async { + Get.back(result: true); + return true; + }, + child: Scaffold( + // key: _scaffoldKey1, + backgroundColor: const Color(0xFF222935), + extendBody: true, + resizeToAvoidBottomInset: false, + appBar: CommonAppbar( + customBack: true, + titleTxt: "", + customActionWidget: PopupMenuButton( + surfaceTintColor: const Color(0xFF222935), + constraints: BoxConstraints.tightFor(width: 190.w), + offset: const Offset(0, 40), + color: const Color(0xFF222935), + tooltip: "", + itemBuilder: (BuildContext context) { + bool isMember = comdetailobj + ?.data?.userLinkInCommunity?.userTypeXid?.name == + "Member"; + // => + return >[ + PopupMenuItem( + onTap: () {}, + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 8.w), + child: Row( + children: [ + text14w400white("Invite"), + const Spacer(), + Image.asset( + "assets/images/png/uiw_user-add.png", + height: 15.h, + width: 15.w, + ) + ], + ), + ), + ), + const PopupMenuDivider(), + PopupMenuItem( + onTap: () {}, + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 8.w), + child: Row( + children: [ + text14w400white("Share"), + const Spacer(), + Image.asset( + "assets/images/png/share.png", + height: 20.h, + width: 20.w, + ) + ], + ), + ), + ), + const PopupMenuDivider(), + PopupMenuItem( + onTap: () {}, + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 8.w), + child: Row( + children: [ + text14w400white("Search"), + const Spacer(), + Image.asset( + "assets/images/png/Frame 58575.png", + height: 18.h, + width: 18.w, + ) + ], + ), + ), + ), + const PopupMenuDivider(), + PopupMenuItem( + onTap: () async { + Map updata = { + "manage_community_xid": CommunityId, + }; + final data = await CommunityDetail() + .postMuteNotification(updata); + if (data.status == ResponseStatus.SUCCESS) { + print("success"); + setState(() {}); + await CommunityDetail() + .getCommunityDetail(CommunityId); + // Convert int to bool, toggle, and then convert back to int + bool isMuted = ismute == 1; + isMuted = !isMuted; + ismute = isMuted ? 1 : 0; + + return utils.showToast(data.message); + } else { + Get.back(); + print("Failed"); + return utils.showToast(data.message); + } + }, + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 8.w), + child: Row( + children: [ + ismute == 1 + ? text14w400white("Unmute notification") + : text14w400white("Mute notification"), + const Spacer(), + ismute == 1 + ? Image.asset( + "assets/images/png/Black1233.png", + height: 16.h, + width: 16.w, + ) + : Image.asset( + "assets/images/png/Black1233.png", + height: 16.h, + width: 16.w, + ) + ], + ), + ), + ), + const PopupMenuDivider(), + PopupMenuItem( + onTap: () async { + await pinunpinCommunity( + comdetailobj!.data!.id.toString()); + }, + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 12.w), + child: Row( + children: [ + iscommunitypin == true + ? Text( + 'Unpin', + style: TextStyle( + fontSize: 16.sp, + color: Colors.white, + fontWeight: FontWeight.w800, + fontFamily: "Nunito Sans", + ), + ) + : Text( + 'Pin', + style: TextStyle( + fontSize: 16.sp, + color: Colors.white, + fontWeight: FontWeight.w800, + fontFamily: "Nunito Sans", + ), + ), + const Spacer(), + iscommunitypin == true + ? Image.asset( + "assets/images/png/PinnedIcon.png", + height: 25.h, + width: 25.w, + ) + : Image.asset( + "assets/images/png/f7_pin-fill (2).png", + height: 25.h, + width: 25.w, + ) + ], + ), + ), + ), + // if (comdetailobj!.data!.accessType!.name == "Member") + // const PopupMenuDivider(), + // if (comdetailobj!.data!.accessType!.name == "Member") + + if (!isMember) ...[ + const PopupMenuDivider(), + PopupMenuItem( + onTap: () async { + var result = await Get.toNamed( + RouteName.communitysetting, + arguments: { + 'communityid': CommunityId, + }); + if (result != null && result) { + refreshData(); + print("Updating community details..."); + } + }, + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 8.w), + child: Row( + children: [ + text14w400white("Edit community"), + const Spacer(), + Image.asset( + "assets/images/png/setting2.png", + height: 18.h, + width: 18.w, + ) + ], + ), + ), + ), + ], + const PopupMenuDivider(), + PopupMenuItem( + onTap: () { + leaveCommunity(); + }, + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 8.w), + child: Row( + children: [ + text14w400white("Leave community"), + const Spacer(), + Image.asset( + "assets/images/png/logout 1 (traced).png", + height: 18.h, + width: 18.w, + ) + ], + ), + ), + ), + ]; + }, + child: Image.asset( + 'assets/images/png/Group 1000004071.png', + height: 20.h, + width: 20.w, + )), + ), + body: FutureBuilder( + future: myfuture, + builder: (ctx, snapshot) { + if (snapshot.data == null) { + return const Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Center( + child: CircularProgressIndicator( + color: Color(0xFFC18948), + ), + ) + ], + ); + } + if (snapshot.connectionState == ConnectionState.done) { + if (snapshot.hasError) { + return Center( + child: Text( + '${snapshot.error} occured', + style: TextStyle(fontSize: 18.spMin), + ), + ); + } + } + iscommunitypin = comdetailobj?.data?.isCommunityPinned; + ismute = comdetailobj?.data?.userLinkInCommunity?.isMute; + return Stack(children: [ + Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage( + "assets/images/png/Ellipse 1496.png"), + fit: BoxFit.fill)), + ), + Positioned.fill( + child: SingleChildScrollView( + child: Column(children: [ + Stack(clipBehavior: Clip.none, children: [ + GestureDetector( + onTap: () { + Get.toNamed(RouteName.communityInfo, arguments: { + 'bannerimage': + comdetailobj!.data!.communityBannerImage, + 'communityphoto': + comdetailobj!.data!.communityProfilePhoto, + 'communityname': comdetailobj!.data!.communityName, + 'communitydescription': + comdetailobj!.data!.communityDescription, + 'communitylocation': + comdetailobj!.data!.communityLocation, + 'communitytype': + comdetailobj!.data!.activityData!.title, + }); + }, + child: comdetailobj!.data!.communityBannerImage != null + ? SizedBox( + height: 130.h, + width: double.infinity, + child: Image.network( + comdetailobj!.data! + .communityBannerImage!, // Replace with your API image URL + fit: BoxFit.cover, + ), + ) + : SizedBox( + height: 130.h, + width: double.infinity, + child: Image.asset( + "assets/images/png/img1.png", + fit: BoxFit.cover, + ), + ), + ), + Positioned( + bottom: -35.h, + left: 20.w, + child: Container( + width: 85.r, + height: 85.r, + decoration: BoxDecoration( + shape: BoxShape.circle, + border: Border.all( + color: const Color.fromRGBO(255, 255, 255, 0.5), + width: 1, + ), + boxShadow: const [ + BoxShadow( + color: Color.fromRGBO(0, 0, 0, 0.25), + blurRadius: 12, + offset: Offset(0, 6), + ), + ], + ), + child: comdetailobj!.data!.communityProfilePhoto != + null + ? CircleAvatar( + radius: 42.5.r, + foregroundImage: NetworkImage(comdetailobj! + .data! + .communityProfilePhoto!), // Replace with your API image URL + backgroundColor: Colors + .transparent, // Optional: If the image fails to load, a transparent background is shown + ) + : CircleAvatar( + radius: 42.5.r, + foregroundImage: const AssetImage( + "assets/images/png/img2.png"), + ), + )) + ]), + sizedBoxHeight(40.h), + Padding( + padding: EdgeInsets.symmetric(horizontal: 16.w), + child: Column(children: [ + Row( + children: [ + text20w700_FCFCFC( + comdetailobj!.data!.communityName ?? ""), + const Spacer(), + commonGlassUI( + width: 35.w, + height: 35.h, + borderRadius: BorderRadius.circular(100), + opacity1: 0.24, + opacity2: 0.24, + customWidget: Center( + child: Image.asset( + "assets/images/png/img12.png", + height: 18.w, + width: 18.w, + )), + borderwidth: 0.5), + sizedBoxWidth(8.w), + text16w400_FCFCFCblur( + comdetailobj!.data!.accessType!.name ?? ""), + ], + ), + sizedBoxHeight(30.h), + InkWell( + onTap: () { + additionalContent.value = + !additionalContent.value; + setState(() {}); + }, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + text13w400_FCFCFC("Show Details"), + sizedBoxWidth(8.w), + additionalContent.value == true + ? Image.asset( + "assets/images/png/uparrow.png", + height: 15.h, + width: 15.w, + ) + : Image.asset( + "assets/images/png/downarrow.png", + height: 15.h, + width: 15.w, + ) + ], + ), + ), + Obx(() { + return additionalContent.value == true + ? Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + sizedBoxHeight(30.h), + text16w400_FCFCFC("About community"), + sizedBoxHeight(16.h), + text14w400_FCFCFCblur(comdetailobj! + .data!.communityDescription ?? + ""), + sizedBoxHeight(20.h), + Row( + children: [ + commonGlassUI( + width: 35.w, + height: 35.h, + opacity1: 0.24, + opacity2: 0.24, + borderRadius: + BorderRadius.circular(100), + customWidget: Center( + child: Image.asset( + "assets/images/png/Group 58645.png", + height: 17.h, + width: 13.w, + ), + ), + borderwidth: 0.5), + sizedBoxWidth(12.w), + text16400white(comdetailobj! + .data!.communityLocation ?? + "") + ], + ), + sizedBoxHeight(16.h), + Row( + children: [ + commonGlassUI( + width: 35.w, + height: 35.h, + opacity1: 0.24, + opacity2: 0.24, + borderRadius: + BorderRadius.circular(100), + customWidget: Center( + child: Image.asset( + "assets/images/png/puzzle-pieces 1 (traced).png", + height: 20.h, + width: 16.w, + ), + ), + borderwidth: 0.5), + sizedBoxWidth(12.w), + text16400white(comdetailobj!.data! + .activityData!.title ?? + "Sports") + ], + ), + sizedBoxHeight(20.h), + commonGlassUI( + width: double.infinity, + height: 51.h, + borderRadius: + BorderRadius.circular(10.r), + customWidget: Column( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + GestureDetector( + onTap: () { + Get.toNamed( + RouteName + .communitymembers, + arguments: { + 'communityid': + CommunityId, + }); + }, + child: Row( + children: [ + sizedBoxWidth(16.w), + stackContainersGroups( + number: + " +${comdetailobj!.data!.userLinkInCommunity!.totalCommunityMember! - 3}", + // containerImages: joinnedComData + // .fourMemberImages! + // .map((photo) => photo + // .iamPrincipal!.profilePhoto!) + // .toList(), + containerImages: comdetailobj! + .data! + .userLinkInCommunity! + .fourMemberImages + ?.map((photo) => photo + .iamPrincipal + ?.profilePhoto) + .where((profilePhoto) => + profilePhoto != + null) + .map((profilePhoto) => + profilePhoto!) // Cast from String? to String + .toList() ?? + [], + ), + sizedBoxWidth(75.w), + comdetailobj! + .data! + .userLinkInCommunity! + .totalCommunityMember == + null || + comdetailobj! + .data! + .userLinkInCommunity! + .totalCommunityMember + .isBlank! + ? const SizedBox() + : text16w400_FCFCFC_blur( + '${comdetailobj!.data!.userLinkInCommunity!.totalCommunityMember} members', + ), + + // stackContainers( + // number: "+2", + // containerImages: [ + // "assets/images/png/cimg3.png", + // "assets/images/png/cimg2.png", + // "assets/images/png/cimg3.png", + // "assets/images/png/cimg2.png", + // ], + // ), + // sizedBoxWidth(95.w), + // text16w400_white( + // '${comdetailobj!.data!.userLinkInCommunity!.totalCommunityMember} members' + // ''), + const Spacer(), + Icon( + Icons.arrow_forward, + size: 20.sp, + color: Colors.white, + ), + sizedBoxWidth(16.w), + ], + ), + ), + ], + ), + ), + sizedBoxHeight(20.h), + GestureDetector( + onTap: () { + // Get.toNamed(RouteName.addgroup); + Get.toNamed(RouteName.group, + arguments: { + 'id': CommunityId, + 'iscommunity': true, + }); + }, + child: commonGlassUI( + width: double.infinity, + height: 51.h, + borderRadius: + BorderRadius.circular(10.r), + customWidget: Padding( + padding: EdgeInsets.symmetric( + horizontal: 16.w), + child: Column( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Row(children: [ + Image.asset( + "assets/images/png/Black.png", + height: 23.h, + width: 31.w, + ), + sizedBoxWidth(15.w), + text16w400white( + '${comdetailobj!.data!.totalGroup} groups'), + const Spacer(), + Icon( + Icons.arrow_forward, + size: 20.sp, + color: Colors.white, + ), + ]), + ], + ), + ), + borderwidth: 1), + ), + ]) + : SizedBox(); + }), + + sizedBoxHeight(25.h), + GestureDetector( + onTap: () { + // Get.toNamed(RouteName.addgroup); + Get.toNamed(RouteName.group, arguments: { + 'id': CommunityId, + 'iscommunity': true, + }); + }, + child: commonGlassUI( + width: double.infinity, + height: 51.h, + borderRadius: BorderRadius.circular(10.r), + customWidget: Padding( + padding: + EdgeInsets.symmetric(horizontal: 16.w), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Row(children: [ + Image.asset( + "assets/images/png/marketing 1 (traced).png", + height: 23.h, + width: 31.w, + ), + sizedBoxWidth(15.w), + Column( + children: [ + text16w400white('Announcements'), + text11w400_F91D42( + "${comdetailobj!.data!.totalAnnouncements.toString()} New Announcements Request") + ], + ), + const Spacer(), + Container( + height: 21.h, + width: 43.w, + decoration: BoxDecoration( + color: const Color(0xFFD90B2E), + borderRadius: + BorderRadius.circular(30.r)), + child: Center( + child: text12w400_FCFCFC( + comdetailobj! + .data!.totalAnnouncements + .toString())), + ) + ]), + ], + ), + ), + borderwidth: 1), + ), + sizedBoxHeight(40.h), + // Container( + // height: 40.h, + // width: 200.w, + // decoration: BoxDecoration( + // color: const Color(0xFFD90B2E), + // borderRadius: BorderRadius.circular(30.r)), + // child: Center( + // child: text14w400white("Leave the community")), + // ), + sizedBoxHeight(50.h), + ])), + DefaultTabController( + length: 2, + // initialIndex: selectedIndex.value, + child: Column( + children: [ + const CommonTabBar(tabs: [ + Tab( + text: 'Posts', + ), + Tab( + text: 'Events', + ), + ]), + SizedBox( + height: 600.h, + child: TabBarView( + children: [ + const PostsTab(), + eventstab(), + ], + ), + ), + ], + ), + ), + ]))) + ]); + })), + ); + } +} + +class PostsTab extends StatefulWidget { + const PostsTab({super.key}); + + @override + State createState() => _PostsTabState(); +} + +class _PostsTabState extends State { + List _reactions = []; + final Map _selectedReactions = {}; + final CountersHelper countersHelper = Get.find(); + int? likeIconIdnew; + + @override + void initState() { + CommunityId = Get.arguments["CommunityID"]; + + super.initState(); + } + + _fetchIcons() { + _reactions = fetchlikeIconsModel!.data ?? []; + for (var post in commonobjmodel!.data) { + //Check if post as a like icon + if (post.likeIcon?.likeIcon?.id != null) { + likeIconIdnew = post.likeIcon!.likeIconsXid; + + final selectedReaction = _reactions.firstWhere( + (r) => r.id == likeIconIdnew, + orElse: () => _reactions.first, + ); + + _selectedReactions[post.id!] = + selectedReaction; // Set selected reaction for this post + } else { + _selectedReactions[post.id!] = null; // No reaction selected + } + } + } + + Future setValues() async { + _setModel(); + countersHelper.setListsPopular(); + _fetchIcons(); + } + + _sortTags(index) { + var tags = commonobjmodel!.data[index].attachTags + .where((tag) => tag.manageTag?.name?.isNotEmpty ?? false) + .map((tag) => tag.manageTag!) + .toList(); + + return tags; + } + + _setModel() { + commonobjmodel = null; + commonobjmodel = CommonDatumObjModel( + status: compostobj!.status, + statusCode: compostobj!.statusCode, + message: compostobj!.message, + data: compostobj!.data + .map((e) => CommonDatumObjModelData( + id: e.id, + likecount: e.likecount, + isISaved: e.isISaved, + tagsXid: e.tagsXid, + isILiked: e.isILiked, + totalComment: e.totalComment, + totalSave: e.totalSave, + iamPrincipalXid: e.iamPrincipalXid, + postIn: e.postIn, + caption: e.caption, + image: e.image, + manageTagsXids: e.manageTagsXids, + postAs: e.postAs, + ctaTitle: e.ctaTitle, + ctaLink: e.ctaLink, + createdAt: e.createdAt, + likeIcon: LikeIcon1( + likeIcon: LikeIconClass1( + id: e.likeIcon?.likeIcon?.id, + image: e.likeIcon?.likeIcon?.image), + likeIconsXid: e.likeIcon?.likeIconsXid, + ), + totalViewCount: e.totalViewCount, + totalReactionCount: e.totalReactionCount, + totalCommentCount: e.totalCommentCount, + totalImpressionCount: e.totalImpressionCount, + totalPopularScore: e.totalPopularScore, + totalHoursAgo: e.totalHoursAgo, + iamPrincipal: IamPrincipal( + id: e.iamPrincipal!.id, + isUserPinned: e.iamPrincipal!.isUserPinned, + principalTypeXid: e.iamPrincipal!.principalTypeXid, + userName: e.iamPrincipal!.userName, + fullName: e.iamPrincipal!.fullName, + profilePhoto: e.iamPrincipal!.profilePhoto), + community: Community( + id: e.community!.id, + communityProfilePhoto: e.community!.communityProfilePhoto, + communityName: e.community!.communityName), + attachTags: e.attachTags + .map((e) => AttachTag1( + managePostXid: e.managePostXid, + manageTagXid: e.manageTagXid, + manageTag: ManageTagPopular( + id: e.manageTag?.id, + isPinned: e.manageTag?.isPinned, + name: e.manageTag?.name))) + .toList())) + .toList()); + } + + Future _initialize() async { + await CommunityDetail().getComPostApi(CommunityId); + await setValues(); + } + + @override + Widget build(BuildContext context) { + return FutureBuilder( + future: _initialize(), + builder: (ctx, snapshot) { + if (snapshot.connectionState == ConnectionState.waiting) { + return const Center( + child: CircularProgressIndicator( + color: Colors.blue, + ), + ); + } + + if (snapshot.hasError) { + return Center( + child: Text( + '${snapshot.error} occurred', + style: TextStyle(fontSize: 18.spMin), + ), + ); + } + + if (snapshot.connectionState == ConnectionState.done) { + return Stack(clipBehavior: Clip.none, children: [ + Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage("assets/images/png/Ellipse 1496.png"), + fit: BoxFit.fill), + ), + ), + commonobjmodel!.data.isEmpty + ? Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Center( + child: Column( + children: [ + Text( + "No Posts Available", + style: TextStyle( + color: Colors.white, + fontSize: 16.sp, + fontWeight: FontWeight.w600), + ) + ], + ), + ), + ]) + : Column( + children: [ + sizedBoxHeight(20.h), + Expanded( + child: ListView.builder( + shrinkWrap: true, + itemCount: commonobjmodel!.data.length, + itemBuilder: (context, index) { + var timeAgo = ConvertServerDateToUserDate() + .convertServerDateToReadableFormate( + commonobjmodel!.data[index].createdAt + .toString()); + + return Column( + children: [ + NormalCardTile( + tags: _sortTags(index), + createAt: timeAgo ?? '1 hour', + commonObj: commonobjmodel!.data[index], + forWhichTab: 'popular', + reactions: _reactions, + selectedReactions: _selectedReactions, + currentIndex: index, + ), + sizedBoxHeight(20.h) + ], + ); + }, + ), + ), + ], + ) + ]); + } + return Container(); + }); + } +} + +Widget eventstab() { + return const Column( + children: [], + ); +} diff --git a/lib/sidemenu/Community/MyCommunity/View/MyCommunity.dart b/lib/sidemenu/Community/MyCommunity/View/MyCommunity.dart new file mode 100644 index 0000000..55b2019 --- /dev/null +++ b/lib/sidemenu/Community/MyCommunity/View/MyCommunity.dart @@ -0,0 +1,899 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/widgets.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:regroup/Common/CommonGlassmorphism.dart'; +import 'package:regroup/Common/CommonWidget.dart'; +import 'package:regroup/Common/base_manager.dart'; +import 'package:regroup/Utils/Common/CommonAppbar.dart'; + +import 'package:regroup/Utils/Common/sized_box.dart'; +import 'package:regroup/Utils/dialogs.dart'; +import 'package:regroup/Utils/texts.dart'; +import 'package:regroup/resources/routes/route_name.dart'; +import 'package:regroup/sidemenu/Community/MyCommunity/view_model/ComDetails.dart'; +import 'package:regroup/sidemenu/view_model/getMyCommunity.dart'; +import 'package:regroup/sidemenu/view_model/postmethod.dart'; + +class MyCommunity extends StatefulWidget { + const MyCommunity({super.key}); + + @override + State createState() => _MyCommunityState(); +} + +class _MyCommunityState extends State { + List isMuteList = []; + List isPinList = []; + + bool? iscommunitypin = false; + var selectedContainerIndices = {}.obs; + + void toggleSelectedIndex(int index) { + if (selectedContainerIndices.contains(index)) { + selectedContainerIndices.remove(index); + } else { + selectedContainerIndices.add(index); + } + } + + late Future myfuture; + + @override + void initState() { + // TODO: implement initState + myfuture = MyCommunityAPI().getMyCommunity(); + + super.initState(); + } + + void refreshData() { + setState(() { + myfuture = MyCommunityAPI().getMyCommunity(); + }); + } + + @override + Widget build(BuildContext context) { + return WillPopScope( + onWillPop: () async { + Get.toNamed(RouteName.mainscreen, arguments: 0); + return true; + }, + child: Scaffold( + // key: _scaffoldKey1, + backgroundColor: const Color(0xFF222935), + extendBody: true, + resizeToAvoidBottomInset: false, + appBar: CommonAppbar( + customBack: true, + titleTxt: "My Communities", + customActionWidget: Row( + children: [ + GestureDetector( + onTap: () async { + var result = await Get.toNamed(RouteName.newcommunity); + if (result != null && result) { + refreshData(); + // CommunityDetail().getCommunityDetail(CommunityId); + print("Updating community details..."); + // setState(() {}); + } + }, + child: Container( + height: 30.h, + width: 30.w, + decoration: const BoxDecoration( + color: Color(0xFFD90B2E), + boxShadow: [ + BoxShadow( + color: Color(0x40000000), + offset: Offset(0, 6), + blurRadius: 8, + spreadRadius: 0, + ), + ], + shape: BoxShape.circle), + child: const Icon( + Icons.add, + color: Colors.white, + ), + ), + ), + sizedBoxWidth(12.w), + Image.asset( + "assets/images/png/Frame 9.png", + height: 22.h, + width: 22.w, + ) + ], + ), + ), + body: FutureBuilder( + future: myfuture, + builder: (ctx, snapshot) { + if (snapshot.data == null) { + return const Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Center( + child: CircularProgressIndicator( + color: Color(0xFFC18948), + ), + ) + ], + ); + } + if (snapshot.connectionState == ConnectionState.done) { + if (snapshot.hasError) { + return Center( + child: Text( + '${snapshot.error} occured', + style: TextStyle(fontSize: 18.spMin), + ), + ); + } + } + // for (int i = 0; i < myCommunityobj!.data.length; i++) { + // ismute = myCommunityobj!.data[i].isMute; + // iscommunitypin = myCommunityobj! + // .data[i].joinedAndRequestedCommunity!.isCommunityPinned; + // } + for (int i = 0; i < myCommunityobj!.data.length; i++) { + // Check if the current data item and its joinedAndRequestedCommunity property are not null + + isMuteList.add(myCommunityobj!.data[i].isMute!); + + if (myCommunityobj!.data[i].joinedAndRequestedCommunity != null) { + isPinList.add(myCommunityobj! + .data[i] + .joinedAndRequestedCommunity! + .isCommunityPinned!); // Handle null with a default value if needed + } + } + + return Stack(children: [ + Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage("assets/images/png/Ellipse 1496.png"), + fit: BoxFit.fill)), + ), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 16), + child: Column(children: [ + sizedBoxHeight(20.h), + Row( + children: [ + Spacer(), + GestureDetector( + onTap: () async { + var result = + await Get.toNamed(RouteName.requestscreen); + if (result != null && result) { + refreshData(); + // CommunityDetail().getCommunityDetail(CommunityId); + print("Updating community details..."); + // setState(() {}); + } + }, + child: + text16w700_FCFCFC_line("Request and Invites")) + ], + ), + sizedBoxHeight(20.h), + myCommunityobj!.data!.isEmpty + ? _buildNoDataBody(context) + : _buildBody(context), + ])) + ]); + }, + ), + ), + ); + } + + Widget _buildNoDataBody(context) { + return Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + "No Data Found", + style: TextStyle( + color: Colors.white, + fontSize: 16.sp, + fontWeight: FontWeight.w600), + ) + ], + ), + ); + } + + Widget _buildBody(context) { + return Expanded( + child: Column(children: [ + sizedBoxHeight(20.h), + Expanded( + child: ListView.builder( + shrinkWrap: true, + physics: const ScrollPhysics(), + itemCount: myCommunityobj!.data.length, + itemBuilder: (context, index) { + var joinnedComData = myCommunityobj!.data[index]; + return Padding( + padding: EdgeInsets.only(bottom: 25.h), + child: GestureDetector( + onTap: () async { + var result = await Get.toNamed(RouteName.communityDetails, + arguments: { + "CommunityID": joinnedComData.manageCommunityXid + }); + + if (result != null && result) { + refreshData(); + print("Updating community details..."); + } + }, + child: commonGlassUI( + borderwidth: 0.9, + width: double.infinity, + height: 172.h, + borderRadius: BorderRadius.circular(10.r), + customWidget: Padding( + padding: EdgeInsets.symmetric( + horizontal: 16.w, vertical: 16.h), + child: Column( + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + height: 65.h, + width: 65.h, + decoration: const BoxDecoration( + shape: BoxShape.circle, + // color: Colors.amber, + ), + child: + // Center( + // child: Image.asset(imagepath, fit: BoxFit.cover)), + + joinnedComData + .joinedAndRequestedCommunity != + null && + joinnedComData + .joinedAndRequestedCommunity! + .communityProfilePhoto != + null && + joinnedComData + .joinedAndRequestedCommunity! + .communityProfilePhoto! + .isNotEmpty + ? CircleAvatar( + backgroundImage: NetworkImage( + joinnedComData + .joinedAndRequestedCommunity! + .communityProfilePhoto!), + ) + : const CircleAvatar( + backgroundImage: AssetImage( + 'assets/images/png/img45.png'), + )), + sizedBoxWidth(13.w), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // Container( + // // width: 250.w, + // // color: Colors.red, + // width: double.infinity, + // child: + + SizedBox( + width: 200.w, + child: Text( + joinnedComData.joinedAndRequestedCommunity != + null && + joinnedComData + .joinedAndRequestedCommunity! + .communityName != + null + ? joinnedComData + .joinedAndRequestedCommunity! + .communityName! + : "", + style: TextStyle( + fontSize: 16.sp, + color: Colors.white, + fontFamily: "Nunito Sans", + ), + maxLines: + 2, // Set the maximum number of lines + overflow: TextOverflow + .ellipsis, // Truncate the text with an ellipsis + ), + ), + + // ), + sizedBoxHeight(10.h), + joinnedComData.totalCommunityMember == + null || + joinnedComData.totalCommunityMember! + .toString() + .isEmpty + ? const SizedBox() + : sizedBoxHeight(10.h), + Row( + children: [ + Stack( + clipBehavior: Clip.none, + children: [ + commonGlassUI( + borderwidth: 0.9, + width: 30.w, + height: 30.h, + borderRadius: + BorderRadius.circular( + 100.r), + opacity1: 0.24, + opacity2: 0.24, + customWidget: Center( + child: Image.asset( + "assets/images/png/Black.png", + height: 12.h, + width: 16.w, + ), + )), + // Positioned( + // top: 0, + // right: -4, + // child: Container( + // height: 12.h, + // width: 12.w, + // decoration: + // const BoxDecoration( + // shape: + // BoxShape.circle, + // color: Color( + // 0xFFD90B2E), + // ), + // child: Center( + // child: + // text6400white( + // "2") + + // ),)) + ]), + sizedBoxWidth(15.w), + text14w400_FCFCFCblur( + "${joinnedComData.joinedAndRequestedCommunity != null && joinnedComData.joinedAndRequestedCommunity!.totalGroup != null ? joinnedComData.joinedAndRequestedCommunity!.totalGroup : ''} groups", + ), + sizedBoxWidth(50.w), + GestureDetector( + onTap: () { + toggleSelectedIndex(index); + }, + child: Container( + height: 21.h, + width: 57.w, + decoration: BoxDecoration( + borderRadius: + BorderRadius.circular(50.r), + gradient: const LinearGradient( + begin: Alignment.centerLeft, + end: Alignment.centerRight, + colors: [ + Color.fromRGBO( + 255, 255, 255, 0.06), + Color.fromRGBO( + 255, 255, 255, 0.08), + ], + stops: [-0.0497, 1.0238], + // converting degrees to radians + ), + border: Border.all( + color: const Color(0xFF434A53), + width: 1.0, + ), + ), + child: Center( + child: text10400white("Owner")), + ), + ), + ], + ), + ], + ), + const Spacer(), + PopupMenuButton( + surfaceTintColor: const Color(0xFF222935), + constraints: + BoxConstraints.tightFor(width: 200.w), + offset: const Offset(0, 30), + color: const Color(0xFF222935), + tooltip: "", + itemBuilder: (BuildContext context) => + [ + PopupMenuItem( + onTap: () async { + Map updata = { + "manage_community_xid": + joinnedComData + .manageCommunityXid, + }; + final data = + await CommunityDetail() + .postMuteNotification( + updata); + if (data.status == + ResponseStatus.SUCCESS) { + if (isMuteList[index] == 1) { + isMuteList[index] = 0; + } else { + isMuteList[index] = 1; + } + await MyCommunityAPI() + .getMyCommunity(); + // setState(() {}); + + return utils + .showToast(data.message); + } else { + Get.back(); + print("Failed"); + return utils + .showToast(data.message); + } + }, + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: 8.w), + child: Row( + children: [ + isMuteList[index] == 1 + ? text14w400white( + "Unmute community") + : text14w400white( + "Mute community"), + const Spacer(), + isMuteList[index] == 1 + ? Image.asset( + "assets/images/png/Black1233.png", + height: 16.h, + width: 16.w, + ) + : Image.asset( + "assets/images/png/Black1233.png", + height: 16.h, + width: 16.w, + ) + ], + ), + ), + ), + const PopupMenuDivider(), + PopupMenuItem( + onTap: () async { + // await pinunpinCommunity( + // myCommunityobj! + // .data[index] + // .joinedAndRequestedCommunity! + // .id + // .toString()); + Map updata = { + "manage_communities_xid": + myCommunityobj! + .data[index] + .joinedAndRequestedCommunity! + .id + .toString(), + }; + final data = await SidebarTags() + .postUserpin(updata); + if (data.status == + ResponseStatus.SUCCESS) { + isPinList[index] = + !isPinList[index]; + + await MyCommunityAPI() + .getMyCommunity(); + // setState(() {}); + print("success"); + + // // Get.back(); + // setState(() {}); + // await MyCommunityAPI().getMyCommunity(); + // iscommunitypin = !iscommunitypin!; + + return utils + .showToast(data.message); + } else { + // Get.back(); + return utils + .showToast(data.message); + } + }, + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: 12.w), + child: Row( + children: [ + isPinList[index] == true + ? Text( + 'Unpin ', + style: TextStyle( + fontSize: 16.sp, + color: Colors.white, + fontWeight: + FontWeight.w800, + fontFamily: + "Nunito Sans", + ), + ) + : Text( + 'Pin ', + style: TextStyle( + fontSize: 16.sp, + color: Colors.white, + fontWeight: + FontWeight.w800, + fontFamily: + "Nunito Sans", + ), + ), + const Spacer(), + isPinList[index] == true + ? Image.asset( + "assets/images/png/PinnedIcon.png", + height: 25.h, + width: 25.w, + ) + : Image.asset( + "assets/images/png/f7_pin-fill (2).png", + height: 25.h, + width: 25.w, + ) + ], + ), + ), + ), + const PopupMenuDivider(), + PopupMenuItem( + onTap: () async { + utils.loader(); + Map updata = {}; + final data = + await CommunityDetail() + .postLeaveCommunity( + updata, + joinnedComData + .manageCommunityXid, + ); + if (data.status == + ResponseStatus.SUCCESS) { + Get.back(); + setState(() { + myCommunityobj!.data + .removeAt(index); + }); + return utils + .showToast(data.message); + } else { + Get.back(); + return utils + .showToast(data.message); + } + }, + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: 8.w), + child: Row( + children: [ + // text14w400_FCFCFC("Leave group"), + text14w400_D90B2E( + "Leave Community"), + const Spacer(), + Image.asset( + "assets/images/png/LightGray22.png", + height: 18.h, + width: 18.w, + ) + ], + ), + ), + ), + ], + child: Image.asset( + "assets/images/png/Group 1000004071.png", + height: 18.h, + width: 20.w, + )), + ], + ), + sizedBoxHeight(16.h), + commonDivider(), + sizedBoxHeight(10.h), + Row( + children: [ + stackContainersGroups( + number: + " +${joinnedComData.totalCommunityMember! - 3}", + // containerImages: joinnedComData + // .fourMemberImages! + // .map((photo) => photo + // .iamPrincipal!.profilePhoto!) + // .toList(), + containerImages: joinnedComData + .fourMemberImages + ?.map((photo) => + photo.iamPrincipal?.profilePhoto) + .where((profilePhoto) => + profilePhoto != null) + .map((profilePhoto) => + profilePhoto!) // Cast from String? to String + .toList() ?? + [], + ), + sizedBoxWidth(75.w), + joinnedComData.totalCommunityMember == null || + joinnedComData + .totalCommunityMember.isBlank! + ? const SizedBox() + : text16w400_FCFCFC_blur( + '${joinnedComData.totalCommunityMember} members', + ), + Spacer(), + Image.asset( + "assets/images/png/arrow.png", + height: 21.h, + width: 18.w, + ), + ], + ) + ], + ), + )), + ), + ); + }, + ), + ) + ]), + ); + } + + Widget communityCard({ + required String imagepath, + required String title, + required void Function()? ontap, + required String members, + required int index, + }) { + return Padding( + padding: EdgeInsets.only(bottom: 25.h), + child: GestureDetector( + onTap: ontap, + child: commonGlassUI( + width: double.infinity, + height: 162.h, + borderwidth: 0.9, + borderRadius: BorderRadius.circular(10.r), + customWidget: Padding( + padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 16.h), + child: Column( + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + height: 65.h, + width: 65.h, + decoration: const BoxDecoration( + shape: BoxShape.circle, + // color: Colors.amber, + ), + child: + // Center( + // child: Image.asset(imagepath, fit: BoxFit.cover)), + + CircleAvatar( + backgroundImage: AssetImage( + imagepath, + ), + ), + ), + sizedBoxWidth(13.w), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + text18w700_FCFCFC(title), + sizedBoxHeight(10.h), + Row( + children: [ + Stack(clipBehavior: Clip.none, children: [ + commonGlassUI( + borderwidth: 0.9, + width: 30.w, + height: 30.h, + borderRadius: BorderRadius.circular(100.r), + opacity1: 0.24, + opacity2: 0.24, + customWidget: Center( + child: Image.asset( + "assets/images/png/Black.png", + height: 12.h, + width: 16.w, + ), + )), + Positioned( + top: 0, + right: -4, + child: Container( + height: 12.h, + width: 12.w, + decoration: const BoxDecoration( + shape: BoxShape.circle, + color: Color(0xFFD90B2E), + ), + child: Center(child: text6400white("2")), + )) + ]), + sizedBoxWidth(15.w), + text14w400_FCFCFCblur("10 groups") + ], + ), + ], + ), + const Spacer(), + PopupMenuButton( + surfaceTintColor: const Color(0xFF222935), + constraints: BoxConstraints.tightFor(width: 200.w), + offset: const Offset(0, 30), + color: const Color(0xFF222935), + tooltip: "", + itemBuilder: (BuildContext context) => + [ + PopupMenuItem( + onTap: () {}, + child: Padding( + padding: + EdgeInsets.symmetric(horizontal: 8.w), + child: Row( + children: [ + text14w400_FCFCFC("Mute community"), + const Spacer(), + Image.asset( + "assets/images/png/Black (1).png", + height: 18.h, + width: 18.w, + ) + ], + ), + ), + ), + const PopupMenuDivider(), + PopupMenuItem( + onTap: () {}, + child: Padding( + padding: + EdgeInsets.symmetric(horizontal: 8.w), + child: Row( + children: [ + text14w400_FCFCFC("Hide post"), + const Spacer(), + Image.asset( + "assets/images/png/mingcute_eye-close-line.png", + height: 20.h, + width: 20.w, + ) + ], + ), + ), + ), + const PopupMenuDivider(), + PopupMenuItem( + onTap: () {}, + child: Padding( + padding: + EdgeInsets.symmetric(horizontal: 8.w), + child: Row( + children: [ + text14w400_FCFCFC("Pin"), + const Spacer(), + Image.asset( + "assets/images/png/f7_pin-fill (2).png", + height: 25.h, + width: 25.w, + ) + ], + ), + ), + ), + const PopupMenuDivider(), + PopupMenuItem( + onTap: () {}, + child: Padding( + padding: + EdgeInsets.symmetric(horizontal: 8.w), + child: Row( + children: [ + text14w400_FCFCFC("Leave community"), + const Spacer(), + Image.asset( + "assets/images/png/logout 1 (traced).png", + height: 18.h, + width: 18.w, + ) + ], + ), + ), + ), + ], + child: Image.asset( + "assets/images/png/Group 1000004071.png", + height: 18.h, + width: 20.w, + )), + ], + ), + sizedBoxHeight(16.h), + commonDivider(), + sizedBoxHeight(10.h), + Expanded( + child: Row( + children: [ + stackContainers( + number: "+2", + containerImages: [ + "assets/images/png/cimg3.png", + "assets/images/png/cimg2.png", + "assets/images/png/cimg3.png", + "assets/images/png/cimg2.png", + ], + ), + sizedBoxWidth(95.w), + text12w400_FCFCFC_blur(members), + const Spacer(), + Obx(() { + return GestureDetector( + onTap: () { + toggleSelectedIndex(index); + }, + child: Container( + width: selectedContainerIndices.contains(index) + ? 118.w + : 100.w, + height: 30.h, + decoration: BoxDecoration( + color: + selectedContainerIndices.contains(index) + ? null + : const Color(0xFFD90B2E), + borderRadius: BorderRadius.all( + Radius.circular(30.r), + ), + border: Border.all( + color: const Color(0xFFD90B2E), + width: 1.w)), + child: Center( + child: + selectedContainerIndices.contains(index) + ? text14400white("Requested") + : text14400white("Joined")), + ), + ); + }) + ], + ), + ) + ], + ), + )), + ), + ); + } +} diff --git a/lib/sidemenu/Community/MyCommunity/View/RequestsScreen.dart b/lib/sidemenu/Community/MyCommunity/View/RequestsScreen.dart new file mode 100644 index 0000000..ccafb2d --- /dev/null +++ b/lib/sidemenu/Community/MyCommunity/View/RequestsScreen.dart @@ -0,0 +1,1001 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/widgets.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:regroup/Common/CommonGlassmorphism.dart'; +import 'package:regroup/Common/CommonTabBar.dart'; +import 'package:regroup/Common/CommonWidget.dart'; +import 'package:regroup/Common/base_manager.dart'; +import 'package:regroup/Utils/Common/CommonAppbar.dart'; +import 'package:regroup/Utils/Common/sized_box.dart'; +import 'package:regroup/Utils/dialogs.dart'; +import 'package:regroup/Utils/texts.dart'; +import 'package:regroup/sidemenu/view_model/getMyCommunity.dart'; + +class RequestsScreen extends StatefulWidget { + const RequestsScreen({super.key}); + + @override + State createState() => _RequestsScreenState(); +} + +class _RequestsScreenState extends State { + late Future myfuture; + + @override + void initState() { + // TODO: implement initState + // myfuture = MyCommunityAPI().getMyCommunity(); + super.initState(); + } + + @override + Widget build(BuildContext context) { + return WillPopScope( + onWillPop: () async { + Get.back(result: true); + return true; + }, + child: Scaffold( + // key: _scaffoldKey1, + backgroundColor: const Color(0xFF222935), + extendBody: true, + resizeToAvoidBottomInset: false, + appBar: CommonAppbar( + customBack: true, + titleTxt: "Request and Invites", + customActionWidget: Row( + children: [ + sizedBoxWidth(12.w), + Image.asset( + "assets/images/png/Frame 9.png", + height: 22.h, + width: 22.w, + ) + ], + ), + ), + body: Stack(children: [ + Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage("assets/images/png/Ellipse 1496.png"), + fit: BoxFit.fill)), + ), + Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + sizedBoxHeight(20.h), + const Expanded( + child: DefaultTabController( + length: 2, + child: Column( + children: [ + CommonTabBar(tabs: [ + Tab( + text: 'Requested', + ), + Tab( + text: 'Invited', + ), + ]), + Expanded( + child: TabBarView( + children: [ + RequestedTab(), + InvitedTab(), + ], + ), + ), + ], + )), + ) + ]) + ])), + ); + } +} + +class RequestedTab extends StatefulWidget { + const RequestedTab({super.key}); + + @override + State createState() => _RequestedTabState(); +} + +class _RequestedTabState extends State { + late Future myfuture; + + @override + void initState() { + // TODO: implement initState + myfuture = MyCommunityAPI().getRequestedCommunity(); + super.initState(); + } + + @override + Widget build(BuildContext context) { + return FutureBuilder( + future: myfuture, + builder: (ctx, snapshot) { + if (snapshot.data == null) { + return const Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Center( + child: CircularProgressIndicator( + color: Color(0xFFC18948), + ), + ) + ], + ); + } + if (snapshot.connectionState == ConnectionState.done) { + if (snapshot.hasError) { + return Center( + child: Text( + '${snapshot.error} occured', + style: TextStyle(fontSize: 18.spMin), + ), + ); + } + } + return requestedComobj!.data.isEmpty + ? _buildNoDataBody(context) + : Padding( + padding: EdgeInsets.symmetric(horizontal: 16.w), + child: Column( + children: [ + sizedBoxHeight(20.h), + Expanded( + child: ListView.builder( + shrinkWrap: true, + physics: const ScrollPhysics(), + itemCount: requestedComobj!.data.length, + itemBuilder: (context, index) { + var requestedComData = requestedComobj!.data[index]; + return Padding( + padding: EdgeInsets.only(bottom: 25.h), + child: GestureDetector( + onTap: () {}, + child: commonGlassUI( + borderwidth: 0.9, + width: double.infinity, + height: 180.h, + borderRadius: BorderRadius.circular(10.r), + customWidget: Padding( + padding: EdgeInsets.symmetric( + horizontal: 16.w, vertical: 16.h), + child: Column( + children: [ + Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Container( + height: 65.h, + width: 65.h, + decoration: const BoxDecoration( + shape: BoxShape.circle, + // color: Colors.amber, + ), + child: + // Center( + // child: Image.asset(imagepath, fit: BoxFit.cover)), + requestedComData + .joinedAndRequestedCommunity != + null && + requestedComData + .joinedAndRequestedCommunity! + .communityProfilePhoto != + null && + requestedComData + .joinedAndRequestedCommunity! + .communityProfilePhoto! + .isNotEmpty + ? CircleAvatar( + backgroundImage: + NetworkImage( + requestedComData + .joinedAndRequestedCommunity! + .communityProfilePhoto!, + ), + ) + : const CircleAvatar( + backgroundImage: + AssetImage( + 'assets/images/png/img45.png', + ), + ), + ), + sizedBoxWidth(13.w), + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + // Container( + // // width: 250.w, + // // color: Colors.red, + // width: double.infinity, + // child: + + SizedBox( + width: 200.w, + child: text18w700_FCFCFC( + requestedComData + .joinedAndRequestedCommunity != + null && + requestedComData + .joinedAndRequestedCommunity! + .communityName != + null && + requestedComData + .joinedAndRequestedCommunity! + .communityName! + .isNotEmpty + ? requestedComData + .joinedAndRequestedCommunity! + .communityName! + : '', + ), + ), + + // ), + sizedBoxHeight(10.h), + requestedComData.totalCommunityMember == + null || + requestedComData + .totalCommunityMember! + .toString() + .isEmpty + ? const SizedBox() + : sizedBoxHeight(10.h), + Row( + children: [ + stackContainersGroups( + number: + " +${requestedComData.totalCommunityMember! - 3}", + containerImages: requestedComData + .fourMemberImages + ?.map((photo) => photo + .iamPrincipal + ?.profilePhoto) + .where((profilePhoto) => + profilePhoto != + null) + .map((profilePhoto) => + profilePhoto!) // Cast from String? to String + .toList() ?? + [], + ), + sizedBoxWidth(75.w), + requestedComData.totalCommunityMember == + null || + requestedComData + .totalCommunityMember! + .isBlank! + ? const SizedBox() + : text16w400_FCFCFC_blur( + '${requestedComData.totalCommunityMember} members', + ), + // Stack( + // clipBehavior: + // Clip.none, + // children: [ + // commonGlassUI( + // borderwidth: + // 0.9, + // width: 30.w, + // height: 30.h, + // borderRadius: + // BorderRadius + // .circular(100 + // .r), + // opacity1: 0.24, + // opacity2: 0.24, + // customWidget: + // Center( + // child: Image + // .asset( + // "assets/images/png/Black.png", + // height: + // 12.h, + // width: 16.w, + // ), + // )), + // // Positioned( + // // top: 0, + // // right: -4, + // // child: Container( + // // height: 12.h, + // // width: 12.w, + // // decoration: + // // const BoxDecoration( + // // shape: + // // BoxShape.circle, + // // color: Color( + // // 0xFFD90B2E), + // // ), + // // child: Center( + // // child: + // // text6400white( + // // "2") + + // // ),)) + // ]), + // sizedBoxWidth(15.w), + // text14w400_FCFCFCblur( + // "${requestedComData.joinedAndRequestedCommunity!.totalGroup ?? ''} groups"), + // sizedBoxWidth(50.w), + ], + ), + ], + ), + const Spacer(), + PopupMenuButton( + surfaceTintColor: + const Color(0xFF222935), + constraints: + BoxConstraints.tightFor( + width: 200.w), + offset: const Offset(0, 30), + color: + const Color(0xFF222935), + tooltip: "", + itemBuilder: (BuildContext + context) => + [ + PopupMenuItem( + onTap: () {}, + child: Padding( + padding: EdgeInsets + .symmetric( + horizontal: + 8.w), + child: Row( + children: [ + text14w400_FCFCFC( + "Mute group"), + const Spacer(), + Image.asset( + "assets/images/png/Black (1).png", + height: 18.h, + width: 18.w, + ) + ], + ), + ), + ), + const PopupMenuDivider(), + PopupMenuItem( + onTap: () {}, + child: Padding( + padding: EdgeInsets + .symmetric( + horizontal: + 8.w), + child: Row( + children: [ + text14w400_FCFCFC( + "Pin group"), + const Spacer(), + Image.asset( + "assets/images/png/f7_pin-fill (2).png", + height: 27.h, + width: 27.w, + ) + ], + ), + ), + ), + const PopupMenuDivider(), + PopupMenuItem( + onTap: () {}, + child: Padding( + padding: EdgeInsets + .symmetric( + horizontal: + 8.w), + child: Row( + children: [ + text14w400_FCFCFC( + "Make primary"), + const Spacer(), + Image.asset( + "assets/images/png/leave group.png", + height: 20.h, + width: 20.w, + ) + ], + ), + ), + ), + const PopupMenuDivider(), + PopupMenuItem( + onTap: () {}, + child: Padding( + padding: EdgeInsets + .symmetric( + horizontal: + 8.w), + child: Row( + children: [ + // text14w400_FCFCFC("Leave group"), + text14w400_D90B2E( + "Leave group"), + const Spacer(), + Image.asset( + "assets/images/png/LightGray22.png", + height: 18.h, + width: 18.w, + ) + ], + ), + ), + ), + ], + child: Image.asset( + "assets/images/png/Group 1000004071.png", + height: 18.h, + width: 20.w, + )), + ], + ), + sizedBoxHeight(16.h), + commonDivider(), + sizedBoxHeight(10.h), + Expanded( + child: Row( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + GestureDetector( + onTap: () async { + Map + updata = { + "manage_community_xid": + requestedComData + .manageCommunityXid + }; + final data = + await MyCommunityAPI() + .postcancelRequest( + updata); + if (data.status == + ResponseStatus + .SUCCESS) { + print("success"); + setState(() { + requestedComobj!.data + .removeAt(index); + }); + return utils.showToast( + data.message); + } else { + Get.back(); + print("Failed"); + return utils.showToast( + data.message); + } + }, + child: Container( + height: 30.h, + width: 180.w, + decoration: BoxDecoration( + borderRadius: + BorderRadius + .circular(30.r), + color: + Color(0xFFD90B2E)), + child: Center( + child: text12w400_FCFCFC( + "Cancel request")), + ), + ), + ], + ), + ) + ], + ), + )), + ), + ); + }, + ), + ), + ], + ), + ); + }); + } +} + +Widget _buildNoDataBody(context) { + return Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + "No Data Found", + style: TextStyle( + color: Colors.white, + fontSize: 16.sp, + fontWeight: FontWeight.w600), + ) + ], + ), + ); +} + +class InvitedTab extends StatefulWidget { + const InvitedTab({super.key}); + + @override + State createState() => _InvitedTabState(); +} + +class _InvitedTabState extends State { + late Future myfuture; + + @override + void initState() { + // TODO: implement initState + myfuture = MyCommunityAPI().getInviteCommunity(); + super.initState(); + } + + @override + Widget build(BuildContext context) { + return FutureBuilder( + future: myfuture, + builder: (ctx, snapshot) { + if (snapshot.data == null) { + return const Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Center( + child: CircularProgressIndicator( + color: Color(0xFFC18948), + ), + ) + ], + ); + } + if (snapshot.connectionState == ConnectionState.done) { + if (snapshot.hasError) { + return Center( + child: Text( + '${snapshot.error} occured', + style: TextStyle(fontSize: 18.spMin), + ), + ); + } + } + return inviteComobj!.data.isEmpty + ? _buildNoDataBody(context) + : Padding( + padding: EdgeInsets.symmetric(horizontal: 16.w), + child: Column( + children: [ + sizedBoxHeight(20.h), + Expanded( + child: ListView.builder( + shrinkWrap: true, + physics: const ScrollPhysics(), + itemCount: inviteComobj!.data.length, + itemBuilder: (context, index) { + var invitedComData = inviteComobj!.data[index]; + return Padding( + padding: EdgeInsets.only(bottom: 25.h), + child: GestureDetector( + onTap: () {}, + child: commonGlassUI( + borderwidth: 0.9, + width: double.infinity, + height: 180.h, + borderRadius: BorderRadius.circular(10.r), + customWidget: Padding( + padding: EdgeInsets.symmetric( + horizontal: 16.w, vertical: 16.h), + child: Column( + children: [ + Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Container( + height: 65.h, + width: 65.h, + decoration: const BoxDecoration( + shape: BoxShape.circle, + // color: Colors.amber, + ), + child: + // Center( + // child: Image.asset(imagepath, fit: BoxFit.cover)), + invitedComData + .senderDetail != + null && + invitedComData + .senderDetail! + .profilePhoto != + null && + invitedComData + .senderDetail! + .profilePhoto! + .isNotEmpty + ? CircleAvatar( + backgroundImage: + NetworkImage( + invitedComData + .senderDetail! + .profilePhoto!, + ), + ) + : const CircleAvatar( + backgroundImage: + AssetImage( + 'assets/images/png/img45.png', + ), + ), + ), + sizedBoxWidth(13.w), + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Container( + // width: 250.w, + // color: Colors.red, + // width: double.infinity, + child: SizedBox( + width: 200.w, + child: text18w700_FCFCFC( + invitedComData + .community != + null && + invitedComData + .community! + .communityName != + null && + invitedComData + .community! + .communityName! + .isNotEmpty + ? invitedComData + .community! + .communityName! + : '', + ), + )), + sizedBoxHeight(10.h), + // invitedComData.totalCommunityMember == + // null || + // joinnedComData + // .totalCommunityMember! + // .toString() + // .isEmpty + // ? const SizedBox() + // : sizedBoxHeight(10.h), + Row( + children: [ + stackContainersGroups( + number: invitedComData + .community != + null + ? " +${invitedComData.community!.totalCommunityMember! - 3}" + : "", + containerImages: invitedComData + .community + ?.fourMemberImages + .map((photo) => photo + .iamPrincipal + ?.profilePhoto) + .where((profilePhoto) => + profilePhoto != + null) + .map((profilePhoto) => + profilePhoto!) // Cast from String? to String + .toList() ?? + [], + ), + sizedBoxWidth(75.w), + if (invitedComData + .community != + null) + text16w400_FCFCFC_blur( + '${invitedComData.community!.totalCommunityMember} members', + ), + ], + ), + ], + ), + const Spacer(), + PopupMenuButton( + surfaceTintColor: + const Color(0xFF222935), + constraints: + BoxConstraints.tightFor( + width: 200.w), + offset: const Offset(0, 30), + color: + const Color(0xFF222935), + tooltip: "", + itemBuilder: (BuildContext + context) => + [ + PopupMenuItem( + onTap: () {}, + child: Padding( + padding: EdgeInsets + .symmetric( + horizontal: + 8.w), + child: Row( + children: [ + text14w400_FCFCFC( + "Mute group"), + const Spacer(), + Image.asset( + "assets/images/png/Black (1).png", + height: 18.h, + width: 18.w, + ) + ], + ), + ), + ), + const PopupMenuDivider(), + PopupMenuItem( + onTap: () {}, + child: Padding( + padding: EdgeInsets + .symmetric( + horizontal: + 8.w), + child: Row( + children: [ + text14w400_FCFCFC( + "Pin group"), + const Spacer(), + Image.asset( + "assets/images/png/f7_pin-fill (2).png", + height: 27.h, + width: 27.w, + ) + ], + ), + ), + ), + const PopupMenuDivider(), + PopupMenuItem( + onTap: () {}, + child: Padding( + padding: EdgeInsets + .symmetric( + horizontal: + 8.w), + child: Row( + children: [ + text14w400_FCFCFC( + "Make primary"), + const Spacer(), + Image.asset( + "assets/images/png/leave group.png", + height: 20.h, + width: 20.w, + ) + ], + ), + ), + ), + const PopupMenuDivider(), + PopupMenuItem( + onTap: () {}, + child: Padding( + padding: EdgeInsets + .symmetric( + horizontal: + 8.w), + child: Row( + children: [ + // text14w400_FCFCFC("Leave group"), + text14w400_D90B2E( + "Leave group"), + const Spacer(), + Image.asset( + "assets/images/png/LightGray22.png", + height: 18.h, + width: 18.w, + ) + ], + ), + ), + ), + ], + child: Image.asset( + "assets/images/png/Group 1000004071.png", + height: 18.h, + width: 20.w, + )), + ], + ), + sizedBoxHeight(16.h), + commonDivider(), + sizedBoxHeight(10.h), + Expanded( + child: Row( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.spaceAround, + children: [ + // stackContainersGroups( + // number: + // " +${invitedComData.totalCommunityMember! - 3}", + // containerImages: joinnedComData + // .fourMemberImages! + // .map((photo) => photo + // .iamPrincipal!.profilePhoto!) + // .toList(), + // ), + // sizedBoxWidth(75.w), + // joinnedComData.totalCommunityMember == + // null || + // joinnedComData! + // .totalCommunityMember! + // .isBlank! + // ? const SizedBox() + // : text16w400_FCFCFC_blur( + // '${joinnedComData.totalCommunityMember} members', + // ), + + GestureDetector( + onTap: () async { + Map + updata = { + "community_xid": + invitedComData + .communityXid + }; + final data = + await MyCommunityAPI() + .postRejectInvite( + updata); + if (data.status == + ResponseStatus + .SUCCESS) { + print("success"); + setState(() { + inviteComobj!.data + .removeAt(index); + }); + return utils.showToast( + data.message); + } else { + Get.back(); + print("Failed"); + return utils.showToast( + data.message); + } + }, + child: Container( + height: 30.h, + width: 160.w, + decoration: BoxDecoration( + borderRadius: + BorderRadius.circular( + 50.r), + gradient: + const LinearGradient( + begin: Alignment + .centerLeft, + end: Alignment + .centerRight, + colors: [ + Color.fromRGBO(255, + 255, 255, 0.06), + Color.fromRGBO(255, + 255, 255, 0.08), + ], + stops: [ + -0.0497, + 1.0238 + ], + // converting degrees to radians + ), + border: Border.all( + color: const Color( + 0xFF434A53), + width: 1.0, + ), + ), + child: Center( + child: text10400white( + "Reject")), + ), + ), + sizedBoxWidth(6.w), + GestureDetector( + onTap: () async { + Map + updata = { + "community_xid": + invitedComData + .communityXid + }; + final data = + await MyCommunityAPI() + .postAcceptInvite( + updata); + if (data.status == + ResponseStatus + .SUCCESS) { + print("success"); + setState(() { + inviteComobj!.data + .removeAt(index); + }); + return utils.showToast( + data.message); + } else { + Get.back(); + print("Failed"); + return utils.showToast( + data.message); + } + }, + child: Container( + height: 30.h, + width: 160.w, + decoration: BoxDecoration( + borderRadius: + BorderRadius + .circular(30.r), + color: + Color(0xFFD90B2E)), + child: Center( + child: + text12w400_FCFCFC( + "Accept")), + ), + ) + ], + ), + ) + ], + ), + )), + ), + ); + }, + ), + ), + ], + ), + ); + }); + } +} + +// Widget _buildNoDataBody(context) { +// return Center( +// child: Column( +// mainAxisAlignment: MainAxisAlignment.center, +// crossAxisAlignment: CrossAxisAlignment.center, +// children: [ +// Text( +// "No Data Found", +// style: TextStyle( +// color: Colors.white, +// fontSize: 16.sp, +// fontWeight: FontWeight.w600), +// ) +// ], +// ), +// ); +// } + + diff --git a/lib/sidemenu/Community/MyCommunity/view_model/ComDetails.dart b/lib/sidemenu/Community/MyCommunity/view_model/ComDetails.dart new file mode 100644 index 0000000..c024154 --- /dev/null +++ b/lib/sidemenu/Community/MyCommunity/view_model/ComDetails.dart @@ -0,0 +1,66 @@ +import 'package:regroup/Common/api_urls.dart'; +import 'package:regroup/Common/base_manager.dart'; +import 'package:regroup/Common/controller/data/network/network_api.dart'; +import 'package:regroup/sidemenu/Community/MyCommunity/Model/ComDetailModel.dart'; +import 'package:regroup/sidemenu/Community/MyCommunity/Model/ComPostModel.dart'; + +ComDetailModel? comdetailobj; +ComPostModel? compostobj; + +class CommunityDetail { + + Future> getCommunityDetail(updata) async { + final response = + await NetworkApiServices().getApi( + "${ApiUrls.getcommunitydetail}?id=$updata", + + ); + + if (response.status == ResponseStatus.SUCCESS) { + comdetailobj = ComDetailModel.fromJson(response.data); + + } + return response; + } + + Future> getComPostApi(updata) async { + final response = await NetworkApiServices().getApi( + + "${ApiUrls.getComPostdetail}?manage_community_xid=$updata" + ); + + if (response.status == ResponseStatus.SUCCESS) { + if (response.data["status"] == "success") { + compostobj = ComPostModel.fromJson(response.data); + } + return ResponseData( + response.data['message'], ResponseStatus.SUCCESS, + data: response.data); + } else { + return ResponseData( + response.data['message'], ResponseStatus.FAILED); + } + } + + Future> postLeaveCommunity(updata, comId) async { + final response = await NetworkApiServices().postApi( + updata, + "${ApiUrls.postleavecommunity}?manage_community_xid=$comId", + ); + if (response.status == ResponseStatus.SUCCESS) { + + } + return response; + } + + Future> postMuteNotification(updata) async { + final response = await NetworkApiServices().postApi( + updata, + ApiUrls.postmutenotification, + ); + if (response.status == ResponseStatus.SUCCESS) { + + } + return response; + } +} \ No newline at end of file diff --git a/lib/sidemenu/Community/MyCommunity/view_model/getmethod.dart b/lib/sidemenu/Community/MyCommunity/view_model/getmethod.dart new file mode 100644 index 0000000..bf24383 --- /dev/null +++ b/lib/sidemenu/Community/MyCommunity/view_model/getmethod.dart @@ -0,0 +1,93 @@ +import 'dart:async'; +import 'dart:developer'; + +import 'package:regroup/Common/api_urls.dart'; +import 'package:regroup/Common/base_manager.dart'; +import 'package:regroup/Common/controller/data/network/network_api.dart'; +import 'package:regroup/sidemenu/Community/MyCommunity/Model/communityMebersModel.dart'; +import 'package:regroup/sidemenu/Community/MyCommunity/Model/communityaddgroupsModel.dart'; +import 'package:regroup/sidemenu/Community/MyCommunity/Model/communityeditpageModel.dart'; +import 'package:regroup/sidemenu/Community/MyCommunity/Model/communitygroupsModel.dart'; +import 'package:regroup/sidemenu/Community/MyCommunity/Model/communitymanageGroupsModel.dart'; + +CommunityAddgroupsModel? communityaddgroupobj; +CommunitygroupsModel? communitygroupspobj; +CommunityMembersModel? communitymembersobj; +CommunityinfopageEditModel? communityeditobj; +CommunityManageGroupsModel? communitymanagegroupsobj; + + + + +class Getcommunity { + + Future> getCommunityAddGroupsearch(updata,community, + {required StreamController streamController}) async { + final response = + await NetworkApiServices().getApi( + "${ApiUrls.getcommunityaddgroups}?manage_community_xid=$community&search=$updata", + + ); + + if (response.status == ResponseStatus.SUCCESS) { + communityaddgroupobj = CommunityAddgroupsModel.fromJson(response.data); + if (!streamController.isClosed) streamController.sink.add(communityaddgroupobj!); + } + return response; + } + + Future> getCommunitygroups(updata) async { + final response = await NetworkApiServices().getApi( + "${ApiUrls.getcommunitygroups}?manage_community_xid=$updata", + // optionalpar: false + ); + if (response.status == ResponseStatus.SUCCESS) { + communitygroupspobj = CommunitygroupsModel.fromJson(response.data); + log(communitygroupspobj!.data.toString()); + } + return response; + } + + Future> getCommunityMemberssearch(updata,updata2, + {required StreamController streamController}) async { + final response = + await NetworkApiServices().getApi( + "${ApiUrls.getcommunitymembers}?manage_community_xid=$updata&search=$updata2", + + ); + + if (response.status == ResponseStatus.SUCCESS) { + communitymembersobj = CommunityMembersModel.fromJson(response.data); + if (!streamController.isClosed) streamController.sink.add(communitymembersobj!); + } + return response; + } + + Future> getCommunityeditpage(updata) async { + final response = await NetworkApiServices().getApi( + "${ApiUrls.geteditcommunity}?community_id=$updata", + // optionalpar: false + ); + if (response.status == ResponseStatus.SUCCESS) { + communityeditobj = CommunityinfopageEditModel.fromJson(response.data); + log(communityeditobj!.data.toString()); + } + return response; + } + + Future> getCommunityManageGroupssearch(updata,updata2, + {required StreamController streamController}) async { + final response = + await NetworkApiServices().getApi( + "${ApiUrls.getcommunitymanagegroups}?manage_community_xid=$updata&search=$updata2", + + ); + + if (response.status == ResponseStatus.SUCCESS) { + communitymanagegroupsobj = CommunityManageGroupsModel.fromJson(response.data); + if (!streamController.isClosed) streamController.sink.add(communitymanagegroupsobj!); + } + return response; + } + +} \ No newline at end of file diff --git a/lib/sidemenu/Community/MyCommunity/view_model/postmethod.dart b/lib/sidemenu/Community/MyCommunity/view_model/postmethod.dart new file mode 100644 index 0000000..ba90f84 --- /dev/null +++ b/lib/sidemenu/Community/MyCommunity/view_model/postmethod.dart @@ -0,0 +1,48 @@ +import 'package:regroup/Common/api_urls.dart'; +import 'package:regroup/Common/base_manager.dart'; +import 'package:regroup/Common/controller/data/network/network_api.dart'; + +class PostMethodCommunity { + PostMethodCommunity(); + + Future> postCreatecommunity(updata) async { + print("updata is $updata"); + final response = await NetworkApiServices().postApi( + updata, + ApiUrls.postcreatecommunity, + ); + print("response is ${response.data}"); + print("response message is ${response.message}"); + return response; + } + + Future> postEditcommunity(updata) async { + print("updata is $updata"); + final response = await NetworkApiServices().postApi( + updata, + ApiUrls.posteditcommunity, + ); + print("response is ${response.data}"); + print("response message is ${response.message}"); + return response; + } + + Future> postGroupsRemove(updata) async { + final response = await NetworkApiServices().postApi( + updata, + ApiUrls.postremovegroupscommunity, + ); + return response; + } + + Future> postmanageaddgroupscommunity(updata) async { + print("updata is $updata"); + final response = await NetworkApiServices().postApi( + updata, + ApiUrls.postmanageaddgroupscommunity, + ); + print("response is ${response.data}"); + print("response message is ${response.message}"); + return response; + } +} \ No newline at end of file diff --git a/lib/sidemenu/Community/MyCommunity/view_model/primaryactivity.dart b/lib/sidemenu/Community/MyCommunity/view_model/primaryactivity.dart new file mode 100644 index 0000000..045a1b3 --- /dev/null +++ b/lib/sidemenu/Community/MyCommunity/view_model/primaryactivity.dart @@ -0,0 +1,32 @@ +import 'package:regroup/Common/api_urls.dart'; +import 'package:regroup/Common/base_manager.dart'; +import 'package:regroup/Common/controller/data/network/network_api.dart'; +import 'package:regroup/sidemenu/Community/MyCommunity/Model/activitiesListModel.dart'; + +ActivitiesListsModel? interestlistobj; + + +class PrimaryActivityListApi { + PrimaryActivityListApi(); + var data = ""; + Future> getActivitylistApi() async { + final response = await NetworkApiServices().getApi( + ApiUrls.getactivitieslist, + + ); + + if (response.status == ResponseStatus.SUCCESS) { + Map responseData = + Map.from(response.data); + if (responseData['status'] == "success") { + print("success"); + ActivitiesListsModel interestlistobj = + ActivitiesListsModel.fromJson(responseData); + } else { + // return ResponseData( + // responseData['message'], ResponseStatus.FAILED); + } + } + return response; + } +} diff --git a/lib/Feed Module/sidemenu/Community/Watchlist.dart b/lib/sidemenu/Community/Watchlist.dart similarity index 99% rename from lib/Feed Module/sidemenu/Community/Watchlist.dart rename to lib/sidemenu/Community/Watchlist.dart index 5063a82..348f972 100644 --- a/lib/Feed Module/sidemenu/Community/Watchlist.dart +++ b/lib/sidemenu/Community/Watchlist.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:regroup/Utils/Common/CommonAppbar.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; + import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/texts.dart'; diff --git a/lib/sidemenu/Model/InviteComModel.dart b/lib/sidemenu/Model/InviteComModel.dart new file mode 100644 index 0000000..ef012a1 --- /dev/null +++ b/lib/sidemenu/Model/InviteComModel.dart @@ -0,0 +1,152 @@ +class InviteComModel { + InviteComModel({ + required this.status, + required this.statusCode, + required this.message, + required this.data, + }); + + final String? status; + final int? statusCode; + final String? message; + final List data; + + factory InviteComModel.fromJson(Map json) { + return InviteComModel( + status: json["status"], + statusCode: json["status_code"], + message: json["message"], + data: json["data"] == null + ? [] + : List.from(json["data"]!.map((x) => Datum.fromJson(x))), + ); + } +} + +class Datum { + Datum({ + required this.id, + required this.senderIamXid, + required this.communityXid, + required this.isAccepted, + required this.community, + required this.senderDetail, + }); + + final int? id; + final int? senderIamXid; + final int? communityXid; + final int? isAccepted; + final Community? community; + final SenderDetail? senderDetail; + + factory Datum.fromJson(Map json) { + return Datum( + id: json["id"], + senderIamXid: json["sender_iam_xid"], + communityXid: json["community_xid"], + isAccepted: json["is_accepted"], + community: json["community"] == null + ? null + : Community.fromJson(json["community"]), + senderDetail: json["sender_detail"] == null + ? null + : SenderDetail.fromJson(json["sender_detail"]), + ); + } +} + +class Community { + Community({ + required this.id, + required this.fourMemberImages, + required this.totalGroup, + required this.totalCommunityMember, + required this.communityProfilePhoto, + required this.communityBannerImage, + required this.communityName, + required this.totalAnnouncements, + required this.isCommunityPinned, + }); + + final int? id; + final List fourMemberImages; + final int? totalGroup; + final int? totalCommunityMember; + final String? communityProfilePhoto; + final String? communityBannerImage; + final String? communityName; + final int? totalAnnouncements; + final bool? isCommunityPinned; + + factory Community.fromJson(Map json) { + return Community( + id: json["id"], + fourMemberImages: json["four_member_images"] == null + ? [] + : List.from(json["four_member_images"]! + .map((x) => FourMemberImage.fromJson(x))), + totalGroup: json["total_group"], + totalCommunityMember: json["total_community_member"], + communityProfilePhoto: json["community_profile_photo"], + communityBannerImage: json["community_banner_image"], + communityName: json["community_name"], + totalAnnouncements: json["total_announcements"], + isCommunityPinned: json["is_community_pinned"], + ); + } +} + +class FourMemberImage { + FourMemberImage({ + required this.id, + required this.iamPrincipalXid, + required this.manageCommunityXid, + required this.iamPrincipal, + }); + + final int? id; + final int? iamPrincipalXid; + final int? manageCommunityXid; + final SenderDetail? iamPrincipal; + + factory FourMemberImage.fromJson(Map json) { + return FourMemberImage( + id: json["id"], + iamPrincipalXid: json["iam_principal_xid"], + manageCommunityXid: json["manage_community_xid"], + iamPrincipal: json["iam_principal"] == null + ? null + : SenderDetail.fromJson(json["iam_principal"]), + ); + } +} + +class SenderDetail { + SenderDetail({ + required this.id, + required this.principalTypeXid, + required this.userName, + required this.fullName, + required this.profilePhoto, + required this.isUserPinned, + }); + + final int? id; + final int? principalTypeXid; + final String? userName; + final String? fullName; + final String? profilePhoto; + final bool? isUserPinned; + + factory SenderDetail.fromJson(Map json) { + return SenderDetail( + id: json["id"], + principalTypeXid: json["principal_type_xid"], + userName: json["user_name"], + fullName: json["full_name"], + profilePhoto: json["profile_photo"], + isUserPinned: json["is_user_pinned"], + ); + } +} diff --git a/lib/sidemenu/Model/MyCommunityModel.dart b/lib/sidemenu/Model/MyCommunityModel.dart new file mode 100644 index 0000000..a24279c --- /dev/null +++ b/lib/sidemenu/Model/MyCommunityModel.dart @@ -0,0 +1,168 @@ +class MyCommunityModel { + MyCommunityModel({ + required this.status, + required this.statusCode, + required this.message, + required this.data, + }); + + final String? status; + final int? statusCode; + final String? message; + final List data; + + factory MyCommunityModel.fromJson(Map json) { + return MyCommunityModel( + status: json["status"], + statusCode: json["status_code"], + message: json["message"], + data: json["data"] == null + ? [] + : List.from(json["data"]!.map((x) => Datum.fromJson(x))), + ); + } +} + +class Datum { + Datum({ + required this.totalCommunityMember, + required this.fourMemberImages, + required this.iamPrincipalXid, + required this.manageCommunityXid, + required this.joinedAt, + required this.userTypeXid, + required this.isMute, + required this.joinedAndRequestedCommunity, + }); + + final int? totalCommunityMember; + final List fourMemberImages; + final int? iamPrincipalXid; + final int? manageCommunityXid; + final DateTime? joinedAt; + final UserTypeXid? userTypeXid; + final int? isMute; + final JoinedAndRequestedCommunity? joinedAndRequestedCommunity; + + factory Datum.fromJson(Map json) { + return Datum( + totalCommunityMember: json["total_community_member"], + fourMemberImages: json["four_member_images"] == null + ? [] + : List.from(json["four_member_images"]! + .map((x) => FourMemberImage.fromJson(x))), + iamPrincipalXid: json["iam_principal_xid"], + manageCommunityXid: json["manage_community_xid"], + joinedAt: DateTime.tryParse(json["joined_at"] ?? ""), + userTypeXid: json["user_type_xid"] == null + ? null + : UserTypeXid.fromJson(json["user_type_xid"]), + isMute: json["is_mute"], + joinedAndRequestedCommunity: + json["joined_and_requested_community"] == null + ? null + : JoinedAndRequestedCommunity.fromJson( + json["joined_and_requested_community"]), + ); + } +} + +class FourMemberImage { + FourMemberImage({ + required this.iamPrincipalXid, + required this.manageCommunityXid, + required this.iamPrincipal, + }); + + final int? iamPrincipalXid; + final int? manageCommunityXid; + final IamPrincipal? iamPrincipal; + + factory FourMemberImage.fromJson(Map json) { + return FourMemberImage( + iamPrincipalXid: json["iam_principal_xid"], + manageCommunityXid: json["manage_community_xid"], + iamPrincipal: json["iam_principal"] == null + ? null + : IamPrincipal.fromJson(json["iam_principal"]), + ); + } +} + +class IamPrincipal { + IamPrincipal({ + required this.id, + required this.principalTypeXid, + required this.userName, + required this.fullName, + required this.profilePhoto, + required this.isUserPinned, + }); + + final int? id; + final int? principalTypeXid; + final String? userName; + final String? fullName; + final String? profilePhoto; + final bool? isUserPinned; + + factory IamPrincipal.fromJson(Map json) { + return IamPrincipal( + id: json["id"], + principalTypeXid: json["principal_type_xid"], + userName: json["user_name"], + fullName: json["full_name"], + profilePhoto: json["profile_photo"], + isUserPinned: json["is_user_pinned"], + ); + } +} + +class JoinedAndRequestedCommunity { + JoinedAndRequestedCommunity({ + required this.id, + required this.communityProfilePhoto, + required this.communityBannerImage, + required this.communityName, + required this.totalGroup, + required this.totalAnnouncements, + required this.isCommunityPinned, + }); + + final int? id; + final String? communityProfilePhoto; + final String? communityBannerImage; + final String? communityName; + final int? totalGroup; + final int? totalAnnouncements; + final bool? isCommunityPinned; + + factory JoinedAndRequestedCommunity.fromJson(Map json) { + return JoinedAndRequestedCommunity( + id: json["id"], + communityProfilePhoto: json["community_profile_photo"], + communityBannerImage: json["community_banner_image"], + communityName: json["community_name"], + totalGroup: json["total_group"], + totalAnnouncements: json["total_announcements"], + isCommunityPinned: json["is_community_pinned"], + ); + } +} + +class UserTypeXid { + UserTypeXid({ + required this.id, + required this.name, + }); + + final int? id; + final String? name; + + factory UserTypeXid.fromJson(Map json) { + return UserTypeXid( + id: json["id"], + name: json["name"], + ); + } +} diff --git a/lib/sidemenu/Model/RequestedComModel.dart b/lib/sidemenu/Model/RequestedComModel.dart new file mode 100644 index 0000000..0d7abf2 --- /dev/null +++ b/lib/sidemenu/Model/RequestedComModel.dart @@ -0,0 +1,137 @@ +class RequestedComModel { + RequestedComModel({ + required this.status, + required this.statusCode, + required this.message, + required this.data, + }); + + final String? status; + final int? statusCode; + final String? message; + final List data; + + factory RequestedComModel.fromJson(Map json){ + return RequestedComModel( + status: json["status"], + statusCode: json["status_code"], + message: json["message"], + data: json["data"] == null ? [] : List.from(json["data"]!.map((x) => Datum.fromJson(x))), + ); + } + +} + +class Datum { + Datum({ + required this.id, + required this.iamPrincipalXid, + required this.fourMemberImages, + required this.totalCommunityMember, + required this.manageCommunityXid, + required this.joinedAt, + required this.isRequested, + required this.joinedAndRequestedCommunity, + }); + + final int? id; + final int? iamPrincipalXid; + final List fourMemberImages; + final int? totalCommunityMember; + final int? manageCommunityXid; + final DateTime? joinedAt; + final int? isRequested; + final JoinedAndRequestedCommunity? joinedAndRequestedCommunity; + + factory Datum.fromJson(Map json){ + return Datum( + id: json["id"], + iamPrincipalXid: json["iam_principal_xid"], + fourMemberImages: json["four_member_images"] == null ? [] : List.from(json["four_member_images"]!.map((x) => FourMemberImage.fromJson(x))), + totalCommunityMember: json["total_community_member"], + manageCommunityXid: json["manage_community_xid"], + joinedAt: DateTime.tryParse(json["joined_at"] ?? ""), + isRequested: json["is_requested"], + joinedAndRequestedCommunity: json["joined_and_requested_community"] == null ? null : JoinedAndRequestedCommunity.fromJson(json["joined_and_requested_community"]), + ); + } + +} + +class FourMemberImage { + FourMemberImage({ + required this.iamPrincipalXid, + required this.manageCommunityXid, + required this.iamPrincipal, + }); + + final int? iamPrincipalXid; + final int? manageCommunityXid; + final IamPrincipal? iamPrincipal; + + factory FourMemberImage.fromJson(Map json){ + return FourMemberImage( + iamPrincipalXid: json["iam_principal_xid"], + manageCommunityXid: json["manage_community_xid"], + iamPrincipal: json["iam_principal"] == null ? null : IamPrincipal.fromJson(json["iam_principal"]), + ); + } + +} + +class IamPrincipal { + IamPrincipal({ + required this.id, + required this.principalTypeXid, + required this.userName, + required this.profilePhoto, + required this.isUserPinned, + }); + + final int? id; + final int? principalTypeXid; + final String? userName; + final String? profilePhoto; + final bool? isUserPinned; + + factory IamPrincipal.fromJson(Map json){ + return IamPrincipal( + id: json["id"], + principalTypeXid: json["principal_type_xid"], + userName: json["user_name"], + profilePhoto: json["profile_photo"], + isUserPinned: json["is_user_pinned"], + ); + } + +} + +class JoinedAndRequestedCommunity { + JoinedAndRequestedCommunity({ + required this.id, + required this.communityProfilePhoto, + required this.communityBannerImage, + required this.communityName, + required this.totalGroup, + required this.totalAnnouncements, + }); + + final int? id; + final String? communityProfilePhoto; + final String? communityBannerImage; + final String? communityName; + final int? totalGroup; + final int? totalAnnouncements; + + factory JoinedAndRequestedCommunity.fromJson(Map json){ + return JoinedAndRequestedCommunity( + id: json["id"], + communityProfilePhoto: json["community_profile_photo"], + communityBannerImage: json["community_banner_image"], + communityName: json["community_name"], + totalGroup: json["total_group"], + totalAnnouncements: json["total_announcements"], + ); + } + +} diff --git a/lib/sidemenu/Model/TagCommunityUserModel.dart b/lib/sidemenu/Model/TagCommunityUserModel.dart new file mode 100644 index 0000000..84cb06f --- /dev/null +++ b/lib/sidemenu/Model/TagCommunityUserModel.dart @@ -0,0 +1,98 @@ +class TagCommunityUserModel { + String? status; + int? statusCode; + String? message; + Data? data; + + TagCommunityUserModel( + {this.status, this.statusCode, this.message, this.data}); + + TagCommunityUserModel.fromJson(Map json) { + status = json['status']; + statusCode = json['status_code']; + message = json['message']; + data = json['data'] != null ? Data.fromJson(json['data']) : null; + } + + Map toJson() { + final Map data = {}; + data['status'] = status; + data['status_code'] = statusCode; + data['message'] = message; + if (this.data != null) { + data['data'] = this.data!.toJson(); + } + return data; + } +} + +class Data { + List? community; + List? tags; + + Data({this.community, this.tags}); + + Data.fromJson(Map json) { + if (json['community'] != null) { + community = []; + json['community'].forEach((v) { + community!.add(Community.fromJson(v)); + }); + } + if (json['tags'] != null) { + tags = []; + json['tags'].forEach((v) { + tags!.add(Tags.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = {}; + if (community != null) { + data['community'] = community!.map((v) => v.toJson()).toList(); + } + if (tags != null) { + data['tags'] = tags!.map((v) => v.toJson()).toList(); + } + return data; + } +} + +class Community { + int? id; + String? communityName; + + Community({this.id, this.communityName}); + + Community.fromJson(Map json) { + id = json['id']; + communityName = json['community_name']; + } + + Map toJson() { + final Map data = {}; + data['id'] = id; + data['community_name'] = communityName; + return data; + } +} + +class Tags { + int? id; + String? name; + + Tags({this.id, this.name}); + + Tags.fromJson(Map json) { + id = json['id']; + name = json['name']; + } + + Map toJson() { + final Map data = {}; + data['id'] = id; + data['name'] = name; + return data; + } +} diff --git a/lib/Feed Module/sidemenu/Model/joineGroupsModel.dart b/lib/sidemenu/Model/joineGroupsModel.dart similarity index 100% rename from lib/Feed Module/sidemenu/Model/joineGroupsModel.dart rename to lib/sidemenu/Model/joineGroupsModel.dart diff --git a/lib/sidemenu/Model/userpinnedlist.dart b/lib/sidemenu/Model/userpinnedlist.dart new file mode 100644 index 0000000..6d726a3 --- /dev/null +++ b/lib/sidemenu/Model/userpinnedlist.dart @@ -0,0 +1,219 @@ +class UserpinnedModelList { + String? status; + int? statusCode; + String? message; + Data? data; + + UserpinnedModelList({this.status, this.statusCode, this.message, this.data}); + + UserpinnedModelList.fromJson(Map json) { + status = json['status']; + statusCode = json['status_code']; + message = json['message']; + data = json['data'] != null ? new Data.fromJson(json['data']) : null; + } + + Map toJson() { + final Map data = new Map(); + data['status'] = this.status; + data['status_code'] = this.statusCode; + data['message'] = this.message; + if (this.data != null) { + data['data'] = this.data!.toJson(); + } + return data; + } +} + +class Data { + List? pinnedTag; + List? pinnedCommunity; + List? pinnedUser; + + Data({this.pinnedTag, this.pinnedCommunity, this.pinnedUser}); + + Data.fromJson(Map json) { + if (json['pinned_tag'] != null) { + pinnedTag = []; + json['pinned_tag'].forEach((v) { + pinnedTag!.add(new PinnedTag.fromJson(v)); + }); + } + if (json['pinned_community'] != null) { + pinnedCommunity = []; + json['pinned_community'].forEach((v) { + pinnedCommunity!.add(new PinnedCommunity.fromJson(v)); + }); + } + if (json['pinned_user'] != null) { + pinnedUser = []; + json['pinned_user'].forEach((v) { + pinnedUser!.add(new PinnedUser.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = new Map(); + if (this.pinnedTag != null) { + data['pinned_tag'] = this.pinnedTag!.map((v) => v.toJson()).toList(); + } + if (this.pinnedCommunity != null) { + data['pinned_community'] = + this.pinnedCommunity!.map((v) => v.toJson()).toList(); + } + if (this.pinnedUser != null) { + data['pinned_user'] = this.pinnedUser!.map((v) => v.toJson()).toList(); + } + return data; + } +} + +class PinnedTag { + int? id; + int? manageTagsXid; + Tag? tag; + + PinnedTag({this.id, this.manageTagsXid, this.tag}); + + PinnedTag.fromJson(Map json) { + id = json['id']; + manageTagsXid = json['manage_tags_xid']; + tag = json['tag'] != null ? new Tag.fromJson(json['tag']) : null; + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['manage_tags_xid'] = this.manageTagsXid; + if (this.tag != null) { + data['tag'] = this.tag!.toJson(); + } + return data; + } +} + +class Tag { + int? id; + String? name; + + Tag({this.id, this.name}); + + Tag.fromJson(Map json) { + id = json['id']; + name = json['name']; + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['name'] = this.name; + return data; + } +} + +class PinnedCommunity { + int? id; + int? manageCommunitiesXid; + Community? community; + + PinnedCommunity({this.id, this.manageCommunitiesXid, this.community}); + + PinnedCommunity.fromJson(Map json) { + id = json['id']; + manageCommunitiesXid = json['manage_communities_xid']; + community = json['community'] != null + ? new Community.fromJson(json['community']) + : null; + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['manage_communities_xid'] = this.manageCommunitiesXid; + if (this.community != null) { + data['community'] = this.community!.toJson(); + } + return data; + } +} + +class Community { + int? id; + String? communityProfilePhoto; + String? communityBannerImage; + String? communityName; + + Community( + {this.id, + this.communityProfilePhoto, + this.communityBannerImage, + this.communityName}); + + Community.fromJson(Map json) { + id = json['id']; + communityProfilePhoto = json['community_profile_photo']; + communityBannerImage = json['community_banner_image']; + communityName = json['community_name']; + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['community_profile_photo'] = this.communityProfilePhoto; + data['community_banner_image'] = this.communityBannerImage; + data['community_name'] = this.communityName; + return data; + } +} + +class PinnedUser { + int? id; + int? pinIamPrincipalXid; + PinUser? pinUser; + + PinnedUser({this.id, this.pinIamPrincipalXid, this.pinUser}); + + PinnedUser.fromJson(Map json) { + id = json['id']; + pinIamPrincipalXid = json['pin_iam_principal_xid']; + pinUser = json['pin_user'] != null + ? new PinUser.fromJson(json['pin_user']) + : null; + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['pin_iam_principal_xid'] = this.pinIamPrincipalXid; + if (this.pinUser != null) { + data['pin_user'] = this.pinUser!.toJson(); + } + return data; + } +} + +class PinUser { + int? id; + String? userName; + String? fullName; + String? profilePhoto; + + PinUser({this.id, this.userName, this.fullName, this.profilePhoto}); + + PinUser.fromJson(Map json) { + id = json['id']; + userName = json['user_name']; + fullName = json['full_name']; + profilePhoto = json['profile_photo']; + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['user_name'] = this.userName; + data['full_name'] = this.fullName; + data['profile_photo'] = this.profilePhoto; + return data; + } +} diff --git a/lib/Feed Module/sidemenu/SavedPosts/SavedPosts.dart b/lib/sidemenu/SavedPosts/SavedPosts.dart similarity index 97% rename from lib/Feed Module/sidemenu/SavedPosts/SavedPosts.dart rename to lib/sidemenu/SavedPosts/SavedPosts.dart index 8a31586..ef27041 100644 --- a/lib/Feed Module/sidemenu/SavedPosts/SavedPosts.dart +++ b/lib/sidemenu/SavedPosts/SavedPosts.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:regroup/Utils/Common/CommonAppbar.dart'; -import 'package:regroup/Utils/Common/blureffect.dart'; + import 'package:regroup/Utils/Common/sized_box.dart'; class SavedPosts extends StatefulWidget { diff --git a/lib/sidemenu/communities.dart b/lib/sidemenu/communities.dart new file mode 100644 index 0000000..e85e1b7 --- /dev/null +++ b/lib/sidemenu/communities.dart @@ -0,0 +1,233 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:regroup/Common/CommonGlassmorphism.dart'; +import 'package:regroup/Common/base_manager.dart'; +import 'package:regroup/Utils/Common/CommonAppbar.dart'; +import 'package:regroup/Utils/Common/sized_box.dart'; +import 'package:regroup/Utils/dialogs.dart'; +import 'package:regroup/Utils/texts.dart'; +import 'package:regroup/sidemenu/view_model/getmethod.dart'; +import 'package:regroup/sidemenu/view_model/postmethod.dart'; + +class Communitiespinned extends StatefulWidget { + const Communitiespinned({super.key}); + + @override + State createState() => _Communitiespinned(); +} + +class _Communitiespinned extends State { + late Future myfuture; + + @override + void initState() { + // TODO: implement initState + myfuture = Sidegetmethod().getUserpinnedList(); + + super.initState(); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: const Color(0xFF222935), + appBar: const CommonAppbar( + titleTxt: "Pinned Communities", + ), + body: FutureBuilder( + future: myfuture, + builder: (ctx, snapshot) { + if (snapshot.data == null) { + return const Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Center( + child: CircularProgressIndicator( + color: Color(0xFFC18948), + ), + ) + ], + ); + } + if (snapshot.connectionState == ConnectionState.done) { + if (snapshot.hasError) { + return Center( + child: Text( + '${snapshot.error} occured', + style: TextStyle(fontSize: 18.spMin), + ), + ); + } + } + return userpinnedobj!.data!.pinnedCommunity!.isEmpty + ? _buildNoDataBody(context) + : _buildBody(context); + }, + ), + ); + } + + Widget _buildNoDataBody(context) { + return Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + "No Data Found", + style: TextStyle( + color: Colors.white, + fontSize: 16.sp, + fontWeight: FontWeight.w600), + ) + ], + ), + ); + } + + pinunpinCommunities(int communityid) async { + utils.loader(); + Map updata = { + "manage_communities_xid": communityid, + }; + final data = await SidebarTags().postUserpin(updata); + if (data.status == ResponseStatus.SUCCESS) { + Get.back(); + return utils.showToast(data.message); + } else { + Get.back(); + return utils.showToast(data.message); + } + } + + Widget _buildBody(context) { + return Stack( + children: [ + Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage("assets/images/png/Ellipse 1496.png"), + fit: BoxFit.fill)), + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + userpinnedobj!.data!.pinnedCommunity!.isEmpty + ? Center(child: text16400white("Pinned Communities")) + : ListView.builder( + shrinkWrap: true, + physics: const ScrollPhysics(), + itemCount: userpinnedobj!.data!.pinnedCommunity!.length, + itemBuilder: (context, index) { + final commnityid = userpinnedobj! + .data!.pinnedCommunity![index].manageCommunitiesXid!; + + return Padding( + padding: EdgeInsets.symmetric(horizontal: 16.w), + child: commonGlassUI( + borderwidth: 0.9, + width: double.infinity, + height: 101.h, + borderRadius: BorderRadius.circular(10.r), + customWidget: Padding( + padding: EdgeInsets.symmetric( + horizontal: 16.w, vertical: 16.h), + child: Row( + // crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + height: 65.h, + width: 65.h, + decoration: BoxDecoration( + shape: BoxShape.circle, + // color: Colors.amber, + ), + child: + // Center( + // child: Image.asset(imagepath, fit: BoxFit.cover)), + userpinnedobj! + .data! + .pinnedCommunity![ + index] + .community! + .communityProfilePhoto == + null || + userpinnedobj! + .data! + .pinnedCommunity![index] + .community! + .communityProfilePhoto! + .isEmpty + ? CircleAvatar( + backgroundImage: AssetImage( + 'assets/images/png/sidemenu/rowing 1 (traced).png', + ), + ) + : CircleAvatar( + backgroundImage: NetworkImage( + userpinnedobj! + .data! + .pinnedCommunity![ + index] + .community! + .communityProfilePhoto!), + )), + sizedBoxWidth(13.w), + userpinnedobj!.data!.pinnedCommunity![index] + .community == + null || + userpinnedobj! + .data! + .pinnedCommunity![index] + .community! + .communityName == + null || + userpinnedobj! + .data! + .pinnedCommunity![index] + .community! + .communityName! + .isEmpty + ? text18w700_FCFCFC('Regroup') + : SizedBox( + width: 200.w, + child: text18w700_FCFCFC( + userpinnedobj! + .data! + .pinnedCommunity![index] + .community! + .communityName!), + ), + // ), + Spacer(), + InkWell( + onTap: () async { + setState(() { + pinunpinCommunities(commnityid); + userpinnedobj!.data!.pinnedCommunity! + .removeWhere((item) => + item.manageCommunitiesXid == + commnityid); + }); + }, + child: Image.asset( + "assets/images/png/sidemenu/f7_pin-fill.png", + width: 19, + height: 19, + ), + ), + ], + ), + )), + ); + }, + ), + ], + ) + ], + ); + } +} diff --git a/lib/sidemenu/sidemenu.dart b/lib/sidemenu/sidemenu.dart new file mode 100644 index 0000000..209e7c5 --- /dev/null +++ b/lib/sidemenu/sidemenu.dart @@ -0,0 +1,675 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/widgets.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:regroup/Common/CommonGlassmorphism.dart'; +import 'package:regroup/Common/base_manager.dart'; +import 'package:regroup/Utils/Common/sized_box.dart'; +import 'package:regroup/Utils/dialogs.dart'; +import 'package:regroup/Utils/texts.dart'; +import 'package:regroup/resources/routes/route_name.dart'; +import 'package:regroup/sidemenu/view_model/getmethod.dart'; +import 'package:regroup/sidemenu/view_model/postmethod.dart'; + +class SideMenu extends StatefulWidget { + const SideMenu({super.key}); + + @override + State createState() => _SideMenuState(); +} + +class _SideMenuState extends State { + late Future myfuture; + + @override + void initState() { + // TODO: implement initState + myfuture = Sidegetmethod().getUserpinnedList(); + + super.initState(); + } + + final RxBool isPinned = false.obs; + + List sideBarData = [ + { + "imagePath": "assets/images/svg/sidemenu/Faq.svg", + "text": "FAQ’s", + }, + { + "imagePath": "assets/images/svg/sidemenu/contact.svg", + "text": "Contact Us" + }, + { + "imagePath": "assets/images/svg/sidemenu/rate.svg", + "text": "Rate this app" + }, + { + "imagePath": "assets/images/svg/sidemenu/terms.svg", + "text": "Terms & Conditions" + }, + { + "imagePath": "assets/images/svg/sidemenu/privacy.svg", + "text": "Privacy Policy" + }, + {"imagePath": "assets/images/svg/sidemenu/about.svg", "text": "About Us"}, + { + "imagePath": "assets/images/svg/sidemenu/settingmenu.svg", + "text": "Settings" + }, + {"imagePath": "assets/images/svg/sidemenu/logout.svg", "text": "Logout"}, + ]; + + Color sideBarBackgroundColor = const Color(0xFF222935); + Color whitecolor = Colors.white; + + // var selectedIndices = {}.obs; + + // void toggleSelectedIndex(int index) { + // if (selectedIndices.contains(index)) { + // selectedIndices.remove(index); + // } else { + // selectedIndices.add(index); + // } + // } + + final RxSet selectedIndices = {}.obs; + + void toggleSelectedIndex(int index) { + if (selectedIndices.contains(index)) { + selectedIndices.remove(index); + } else { + selectedIndices.add(index); + } + } + + final RxSet selectedIndicescommunity = {}.obs; + + void toggleSelectedIndexComunity(int index) { + if (selectedIndicescommunity.contains(index)) { + selectedIndicescommunity.remove(index); + } else { + selectedIndicescommunity.add(index); + } + } + + final RxSet selectedIndicesuser = {}.obs; + + void toggleSelectedIndexUser(int index) { + if (selectedIndicesuser.contains(index)) { + selectedIndicesuser.remove(index); + } else { + selectedIndicesuser.add(index); + } + } + + pinunpinTag(int tagid) async { + utils.loader(); + Map updata = { + "manage_tags_xid": tagid, + }; + final data = await SidebarTags().postUserpin(updata); + if (data.status == ResponseStatus.SUCCESS) { + Get.back(); + toggleSelectedIndex(tagid); + return utils.showToast(data.message); + } else { + Get.back(); + return utils.showToast(data.message); + } + } + + pinunpinCommunities(int communityid) async { + utils.loader(); + Map updata = { + "manage_communities_xid": communityid, + }; + final data = await SidebarTags().postUserpin(updata); + if (data.status == ResponseStatus.SUCCESS) { + Get.back(); + toggleSelectedIndexComunity(communityid); + return utils.showToast(data.message); + } else { + Get.back(); + return utils.showToast(data.message); + } + } + + pinunpinUser(int userid) async { + utils.loader(); + Map updata = { + "pin_iam_principal_xid": userid, + }; + final data = await SidebarTags().postUserpin(updata); + if (data.status == ResponseStatus.SUCCESS) { + Get.back(); + toggleSelectedIndexUser(userid); + return utils.showToast(data.message); + } else { + Get.back(); + return utils.showToast(data.message); + } + } + + void refreshData() { + setState(() { + myfuture = Sidegetmethod().getUserpinnedList(); + }); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: const Color(0xFF222935), + body: FutureBuilder( + future: myfuture, + builder: (ctx, snapshot) { + if (snapshot.data == null) { + return const Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Center( + child: CircularProgressIndicator( + color: Color(0xFFC18948), + ), + ) + ], + ); + } + if (snapshot.connectionState == ConnectionState.done) { + if (snapshot.hasError) { + return Center( + child: Text( + '${snapshot.error} occured', + style: TextStyle(fontSize: 18.spMin), + ), + ); + } + } + return userpinnedobj!.data!.isBlank! + ? _buildNoDataBody(context) + : _buildBody(context); + }, + ), + ); + } + + Widget _buildNoDataBody(context) { + return Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + "No Data Found", + style: TextStyle( + color: Colors.white, + fontSize: 16.sp, + fontWeight: FontWeight.w600), + ) + ], + ), + ); + } + + Widget _buildBody(context) { + return ListView( + padding: EdgeInsets.zero, + children: [ + sizedBoxHeight(50.h), + GestureDetector( + onTap: () async { + var result = await Get.toNamed(RouteName.mycommunity); + if (result != null && result) { + refreshData(); + print("Updating community details..."); + } + }, + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 16.w), + child: Row( + children: [ + text16w400_FCFCFC("My communities"), + sizedBoxWidth(4.w), + Image.asset('assets/images/png/sidemenu/rightarrow.png') + ], + ), + ), + ), + sizedBoxHeight(18.h), + Padding( + padding: EdgeInsets.symmetric(horizontal: 16.w), + child: Container( + height: 1, + margin: EdgeInsets.symmetric(vertical: 10.h), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: const Color.fromRGBO(255, 255, 255, 0.3), + width: 1.w, + ), + ), + ), + ), + ), + sizedBoxHeight(18.h), + Padding( + padding: EdgeInsets.symmetric(horizontal: 16.w), + child: text16w400_FCFCFC("My pinned content"), + ), + sizedBoxHeight(18.h), + Padding( + padding: EdgeInsets.symmetric(horizontal: 16.w), + child: Container( + height: 1, + margin: EdgeInsets.symmetric(vertical: 10.h), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: const Color.fromRGBO(255, 255, 255, 0.3), + width: 1.w, + ), + ), + ), + ), + ), + sizedBoxHeight(18.h), + Padding( + padding: EdgeInsets.symmetric(horizontal: 16.w), + child: Row( + children: [ + text16w400_FCFCFC("interest"), + const Spacer(), + GestureDetector( + onTap: () { + Get.toNamed(RouteName.viewalltags); + }, + child: text14w400_FCFCFC("View all")), + ], + ), + ), + sizedBoxHeight(0.h), + userpinnedobj!.data!.pinnedTag!.isEmpty + ? Center(child: text16400white("Pin tags")) + : SizedBox( + height: 200.h, + child: ListView.builder( + physics: NeverScrollableScrollPhysics(), + shrinkWrap: true, + itemCount: userpinnedobj!.data!.pinnedTag!.take(5).length, + itemBuilder: (context, index) { + final tagid = + userpinnedobj!.data!.pinnedTag![index].manageTagsXid!; + + return ListTile( + leading: commonContainer( + width: 29.w, + height: 29.h, + borderwidth: 0.9, + boxShape: BoxShape.circle, + customWidget: Center( + child: Image.asset( + 'assets/images/png/sidemenu/rowing 1 (traced).png', + width: 13.w, + height: 13.h, + ), + )), + title: + userpinnedobj!.data!.pinnedTag![index].tag == null || + userpinnedobj!.data!.pinnedTag![index].tag! + .name!.isEmpty + ? text14w400_FCFCFC('Regroup') + : text14w400_FCFCFC(userpinnedobj! + .data!.pinnedTag![index].tag!.name!), + trailing: InkWell( + onTap: () async { + setState(() { + pinunpinTag(tagid); + userpinnedobj!.data!.pinnedTag!.removeWhere( + (item) => item.manageTagsXid == tagid); + }); + }, + child: Image.asset( + "assets/images/png/sidemenu/f7_pin-fill.png", + width: 19, + height: 19, + ), + ), + ); + }, + ), + ), + sizedBoxHeight(18.h), + Padding( + padding: EdgeInsets.symmetric(horizontal: 16.w), + child: Container( + height: 1, + margin: EdgeInsets.symmetric(vertical: 10.h), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: const Color.fromRGBO(255, 255, 255, 0.3), + width: 1.w, + ), + ), + ), + ), + ), + sizedBoxHeight(18.h), + Padding( + padding: EdgeInsets.symmetric(horizontal: 16.w), + child: Row( + children: [ + text16w400_FCFCFC("Communities"), + const Spacer(), + GestureDetector( + onTap: () { + Get.toNamed(RouteName.viewallcommunitiespinned); + }, + child: text14w400_FCFCFC("View all")), + ], + ), + ), + sizedBoxHeight(0.h), + userpinnedobj!.data!.pinnedCommunity!.isEmpty + ? Center(child: text16400white("Pin communities")) + : SizedBox( + height: 200.h, + child: ListView.builder( + physics: NeverScrollableScrollPhysics(), + shrinkWrap: true, + itemCount: + userpinnedobj!.data!.pinnedCommunity!.take(5).length, + itemBuilder: (context, index) { + final commnityid = userpinnedobj! + .data!.pinnedCommunity![index].manageCommunitiesXid!; + + return ListTile( + leading: Container( + width: 29.w, + height: 29.h, + decoration: BoxDecoration( + shape: BoxShape.circle, + ), + child: userpinnedobj!.data!.pinnedCommunity![index] + .community!.communityProfilePhoto == + null || + userpinnedobj!.data!.pinnedCommunity![index] + .community!.communityProfilePhoto!.isEmpty + ? CircleAvatar( + backgroundImage: AssetImage( + 'assets/images/png/sidemenu/rowing 1 (traced).png', + ), + ) + : CircleAvatar( + backgroundImage: NetworkImage(userpinnedobj! + .data! + .pinnedCommunity![index] + .community! + .communityProfilePhoto!), + )), + title: userpinnedobj!.data!.pinnedCommunity![index] + .community == + null || + userpinnedobj!.data!.pinnedCommunity![index] + .community!.communityName!.isEmpty + ? text14w400_FCFCFC('Regroup') + : text14w400_FCFCFC(userpinnedobj! + .data! + .pinnedCommunity![index] + .community! + .communityName!), + trailing: InkWell( + onTap: () async { + setState(() { + pinunpinCommunities(commnityid); + userpinnedobj!.data!.pinnedCommunity!.removeWhere( + (item) => + item.manageCommunitiesXid == commnityid); + }); + }, + child: Image.asset( + "assets/images/png/sidemenu/f7_pin-fill.png", + width: 19, + height: 19, + ), + ), + ); + }, + ), + ), + sizedBoxHeight(18.h), + Padding( + padding: EdgeInsets.symmetric(horizontal: 16.w), + child: Container( + height: 1, + margin: EdgeInsets.symmetric(vertical: 10.h), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: const Color.fromRGBO(255, 255, 255, 0.3), + width: 1.w, + ), + ), + ), + ), + ), + sizedBoxHeight(18.h), + Padding( + padding: EdgeInsets.symmetric(horizontal: 16.w), + child: Row( + children: [ + text16w400_FCFCFC("Users"), + const Spacer(), + GestureDetector( + onTap: () { + Get.toNamed(RouteName.viewalluserspinned); + }, + child: text14w400_FCFCFC("View all")), + ], + ), + ), + sizedBoxHeight(0.h), + userpinnedobj!.data!.pinnedUser!.isEmpty + ? Center(child: text16400white("Pin users")) + : SizedBox( + height: 200.h, + child: ListView.builder( + physics: NeverScrollableScrollPhysics(), + shrinkWrap: true, + itemCount: userpinnedobj!.data!.pinnedUser!.take(5).length, + itemBuilder: (context, index) { + final userid = userpinnedobj! + .data!.pinnedUser![index].pinIamPrincipalXid!; + + return ListTile( + leading: commonContainer( + width: 29.w, + height: 29.h, + borderwidth: 0.9, + boxShape: BoxShape.circle, + customWidget: Center( + child: userpinnedobj!.data!.pinnedUser![index] + .pinUser!.profilePhoto == + null || + userpinnedobj!.data!.pinnedUser![index] + .pinUser!.profilePhoto!.isEmpty + ? Image.asset( + 'assets/images/png/sidemenu/rowing 1 (traced).png', + width: 13.w, + height: 13.h, + ) + : Image.network( + userpinnedobj!.data!.pinnedUser![index] + .pinUser!.profilePhoto!, + width: 13.w, + height: 13.h, + errorBuilder: + (context, error, stackTrace) { + return Image.asset( + 'assets/images/png/sidemenu/rowing 1 (traced).png', + width: 13.w, + height: 13.h, + ); + }, + ))), + title: userpinnedobj!.data!.pinnedUser![index].pinUser! + .fullName == + null || + userpinnedobj!.data!.pinnedUser![index].pinUser! + .fullName!.isEmpty + ? text14w400_FCFCFC('Regroup') + : text14w400_FCFCFC(userpinnedobj! + .data!.pinnedUser![index].pinUser!.fullName!), + trailing: InkWell( + onTap: () async { + setState(() { + pinunpinUser(userid); + userpinnedobj!.data!.pinnedUser!.removeWhere( + (item) => item.pinIamPrincipalXid == userid); + }); + }, + child: Image.asset( + "assets/images/png/sidemenu/f7_pin-fill.png", + width: 19, + height: 19, + ), + ), + ); + }, + ), + ), + sizedBoxHeight(18.h), + sizedBoxHeight(80.h), + ], + ); + } + + Widget firstRowTile({ + required String text, + required String leadingimage, + required int index, + }) { + return ListTile( + leading: commonContainer( + width: 29.w, + height: 29.h, + borderwidth: 0.9, + boxShape: BoxShape.circle, + customWidget: Center( + child: Image.asset( + leadingimage, + width: 13.w, + height: 13.h, + ), + )), + title: text14w400_FCFCFC(text), + trailing: InkWell( + onTap: () { + toggleSelectedIndex(index); + }, + child: Obx( + () { + return selectedIndices.contains(index) + ? Image.asset( + "assets/images/png/sidemenu/f7_pin-fill.png", + width: 19, + height: 19, + ) + : Image.asset( + "assets/images/png/sidemenu/f7_pin-fill (1).png", + width: 19, + height: 19, + ); + }, + ), + ), + onTap: () {}, + ); + } + +// LogOutdialog(context) { +// return showDialog( +// // barrierDismissible: false, +// context: context, +// builder: (context) => Column( +// mainAxisAlignment: MainAxisAlignment.center, +// children: [ +// AlertDialog( +// insetPadding: EdgeInsets.symmetric(horizontal: 16.w), +// backgroundColor: +// Get.isDarkMode ? Colors.black : const Color(0XFF1B243D), +// contentPadding: EdgeInsets.fromLTRB(29.w, 44.h, 29.w, 35.h), +// shape: RoundedRectangleBorder( +// borderRadius: BorderRadius.all(Radius.circular(5.r)), +// ), +// content: Column( +// mainAxisAlignment: MainAxisAlignment.center, +// crossAxisAlignment: CrossAxisAlignment.center, +// children: [ +// Container( +// height: 87.h, +// width: 80.w, +// decoration: const BoxDecoration( +// shape: BoxShape.circle, color: Color(0xFFC18948)), +// child: Align( +// alignment: Alignment.topLeft, +// child: Container( +// height: 79.h, +// width: 73.w, +// decoration: BoxDecoration( +// shape: BoxShape.circle, +// color: const Color(0xFFE8C69F).withOpacity(0.5), +// ), +// child: Center( +// child: SvgPicture.asset( +// 'assets/images/svg/apps 1.svg', +// // fit: BoxFit.fill, +// ), +// ), +// ), +// ), +// ), +// sizedBoxHeight(30.h), +// Text( +// "Are you sure you want to logout ?", +// textAlign: TextAlign.center, +// style: TextStyle( +// fontFamily: "hiragino", +// fontWeight: FontWeight.w400, +// fontSize: 20.sp, +// color: const Color(0xFFFFFFFF)), +// ), +// sizedBoxHeight(40.h), +// Row( +// mainAxisAlignment: MainAxisAlignment.spaceBetween, +// children: [ +// SizedBox( +// width: 140.w, +// child: CommonYesNoBtn( +// yesonTap: () async { +// SharedPreferences prefs = +// await SharedPreferences.getInstance(); +// await prefs.clear(); +// Get.offNamed(RouteName.loginscreen); +// }, +// )), +// SizedBox( +// width: 140.w, +// child: CommonYesNoBtn( +// noonTap: () { +// Get.back(); +// }, +// ), +// ), +// ], +// ) +// ], +// ), +// ), +// ], +// ), +// ); +// } +} diff --git a/lib/sidemenu/tags.dart b/lib/sidemenu/tags.dart new file mode 100644 index 0000000..a6a11fa --- /dev/null +++ b/lib/sidemenu/tags.dart @@ -0,0 +1,178 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:regroup/Common/CommonGlassmorphism.dart'; +import 'package:regroup/Common/base_manager.dart'; +import 'package:regroup/Utils/Common/CommonAppbar.dart'; +import 'package:regroup/Utils/Common/sized_box.dart'; +import 'package:regroup/Utils/dialogs.dart'; +import 'package:regroup/Utils/texts.dart'; +import 'package:regroup/sidemenu/view_model/getmethod.dart'; +import 'package:regroup/sidemenu/view_model/postmethod.dart'; + +class Viewtags extends StatefulWidget { + const Viewtags({super.key}); + + @override + State createState() => _ViewtagsState(); +} + +class _ViewtagsState extends State { + late Future myfuture; + + @override + void initState() { + // TODO: implement initState + myfuture = Sidegetmethod().getUserpinnedList(); + + super.initState(); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: const Color(0xFF222935), + appBar: const CommonAppbar( + titleTxt: "Pinned interest", + ), + body: FutureBuilder( + future: myfuture, + builder: (ctx, snapshot) { + if (snapshot.data == null) { + return const Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Center( + child: CircularProgressIndicator( + color: Color(0xFFC18948), + ), + ) + ], + ); + } + if (snapshot.connectionState == ConnectionState.done) { + if (snapshot.hasError) { + return Center( + child: Text( + '${snapshot.error} occured', + style: TextStyle(fontSize: 18.spMin), + ), + ); + } + } + return userpinnedobj!.data!.pinnedTag!.isEmpty + ? _buildNoDataBody(context) + : _buildBody(context); + }, + ), + ); + } + + Widget _buildNoDataBody(context) { + return Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + "No Data Found", + style: TextStyle( + color: Colors.white, + fontSize: 16.sp, + fontWeight: FontWeight.w600), + ) + ], + ), + ); + } + + pinunpinTag(int tagid) async { + utils.loader(); + Map updata = { + "manage_tags_xid": tagid, + }; + final data = await SidebarTags().postUserpin(updata); + if (data.status == ResponseStatus.SUCCESS) { + Get.back(); + return utils.showToast(data.message); + } else { + Get.back(); + return utils.showToast(data.message); + } + } + + Widget _buildBody(context) { + return Stack( + children: [ + Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage("assets/images/png/Ellipse 1496.png"), + fit: BoxFit.fill)), + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + userpinnedobj!.data!.pinnedTag!.isEmpty + ? Center(child: text16400white("Pin tags")) + : ListView.separated( + separatorBuilder: (context, index) { + return Divider( + thickness: 1, + color: const Color.fromRGBO(255, 255, 255, 0.3), + ); + }, + shrinkWrap: true, + physics: const ScrollPhysics(), + itemCount: userpinnedobj!.data!.pinnedTag!.length, + itemBuilder: (context, index) { + final tagid = + userpinnedobj!.data!.pinnedTag![index].manageTagsXid!; + return ListTile( + leading: commonContainer( + width: 29.w, + height: 29.h, + borderwidth: 0.9, + boxShape: BoxShape.circle, + customWidget: Center( + child: Image.asset( + 'assets/images/png/sidemenu/price-tag 1.png', + width: 13.w, + height: 13.h, + ), + )), + title: userpinnedobj!.data!.pinnedTag![index].tag == + null || + userpinnedobj! + .data!.pinnedTag![index].tag!.name!.isEmpty + ? text14w400_FCFCFC('') + : text14w400_FCFCFC(userpinnedobj! + .data!.pinnedTag![index].tag!.name!), + trailing: InkWell( + onTap: () async { + setState(() { + pinunpinTag(tagid); + userpinnedobj!.data!.pinnedTag!.removeWhere( + (item) => item.manageTagsXid == tagid); + }); + }, + child: Image.asset( + "assets/images/png/sidemenu/f7_pin-fill.png", + width: 19, + height: 19, + ), + ), + ); + }, + ), + Divider( + thickness: 1, + color: const Color.fromRGBO(255, 255, 255, 0.3), + ), + ], + ) + ], + ); + } +} diff --git a/lib/sidemenu/users.dart b/lib/sidemenu/users.dart new file mode 100644 index 0000000..23f3d6b --- /dev/null +++ b/lib/sidemenu/users.dart @@ -0,0 +1,197 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:regroup/Common/CommonGlassmorphism.dart'; +import 'package:regroup/Common/base_manager.dart'; +import 'package:regroup/Utils/Common/CommonAppbar.dart'; +import 'package:regroup/Utils/dialogs.dart'; +import 'package:regroup/Utils/texts.dart'; +import 'package:regroup/sidemenu/view_model/getmethod.dart'; +import 'package:regroup/sidemenu/view_model/postmethod.dart'; + +class Viewtusertags extends StatefulWidget { + const Viewtusertags({super.key}); + + @override + State createState() => _ViewtusertagsState(); +} + +class _ViewtusertagsState extends State { + late Future myfuture; + + @override + void initState() { + // TODO: implement initState + myfuture = Sidegetmethod().getUserpinnedList(); + + super.initState(); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: const Color(0xFF222935), + appBar: const CommonAppbar( + titleTxt: "Pinned users", + ), + body: FutureBuilder( + future: myfuture, + builder: (ctx, snapshot) { + if (snapshot.data == null) { + return const Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Center( + child: CircularProgressIndicator( + color: Color(0xFFC18948), + ), + ) + ], + ); + } + if (snapshot.connectionState == ConnectionState.done) { + if (snapshot.hasError) { + return Center( + child: Text( + '${snapshot.error} occured', + style: TextStyle(fontSize: 18.spMin), + ), + ); + } + } + return userpinnedobj!.data!.pinnedUser!.isEmpty + ? _buildNoDataBody(context) + : _buildBody(context); + }, + ), + ); + } + + Widget _buildNoDataBody(context) { + return Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + "No Data Found", + style: TextStyle( + color: Colors.white, + fontSize: 16.sp, + fontWeight: FontWeight.w600), + ) + ], + ), + ); + } + + pinunpinUser(int userid) async { + utils.loader(); + Map updata = { + "pin_iam_principal_xid": userid, + }; + final data = await SidebarTags().postUserpin(updata); + if (data.status == ResponseStatus.SUCCESS) { + Get.back(); + return utils.showToast(data.message); + } else { + Get.back(); + return utils.showToast(data.message); + } + } + + Widget _buildBody(context) { + return Stack( + children: [ + Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage("assets/images/png/Ellipse 1496.png"), + fit: BoxFit.fill)), + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + userpinnedobj!.data!.pinnedUser!.isEmpty + ? Center(child: text16400white("Pin tags")) + : ListView.separated( + separatorBuilder: (context, index) { + return Divider( + thickness: 1, + color: const Color.fromRGBO(255, 255, 255, 0.3), + ); + }, + shrinkWrap: true, + physics: const ScrollPhysics(), + itemCount: userpinnedobj!.data!.pinnedUser!.length, + itemBuilder: (context, index) { + final tagid = userpinnedobj! + .data!.pinnedUser![index].pinIamPrincipalXid!; + return ListTile( + leading: Container( + height: 65.h, + width: 65.h, + decoration: BoxDecoration( + shape: BoxShape.circle, + // color: Colors.amber, + ), + child: + // Center( + // child: Image.asset(imagepath, fit: BoxFit.cover)), + userpinnedobj!.data!.pinnedUser![index].pinUser! + .profilePhoto == + null || + userpinnedobj!.data!.pinnedUser![index] + .pinUser!.profilePhoto!.isEmpty + ? CircleAvatar( + backgroundImage: AssetImage( + 'assets/images/png/sidemenu/rowing 1 (traced).png', + ), + ) + : CircleAvatar( + backgroundImage: NetworkImage( + userpinnedobj! + .data! + .pinnedUser![index] + .pinUser! + .profilePhoto!), + )), + title: + userpinnedobj!.data!.pinnedUser![index].pinUser == + null || + userpinnedobj!.data!.pinnedUser![index] + .pinUser!.fullName == + null || + userpinnedobj!.data!.pinnedUser![index] + .pinUser!.fullName!.isEmpty + ? text14w400_FCFCFC('') + : text14w400_FCFCFC(userpinnedobj!.data! + .pinnedUser![index].pinUser!.fullName!), + trailing: InkWell( + onTap: () async { + setState(() { + pinunpinUser(tagid); + userpinnedobj!.data!.pinnedUser!.removeWhere( + (item) => item.pinIamPrincipalXid == tagid); + }); + }, + child: Image.asset( + "assets/images/png/sidemenu/f7_pin-fill.png", + width: 19, + height: 19, + ), + ), + ); + }, + ), + Divider( + thickness: 1, + color: const Color.fromRGBO(255, 255, 255, 0.3), + ), + ], + ) + ], + ); + } +} diff --git a/lib/sidemenu/view_model/getMyCommunity.dart b/lib/sidemenu/view_model/getMyCommunity.dart new file mode 100644 index 0000000..8cabd79 --- /dev/null +++ b/lib/sidemenu/view_model/getMyCommunity.dart @@ -0,0 +1,108 @@ +import 'dart:developer'; + +import 'package:regroup/Common/api_urls.dart'; +import 'package:regroup/Common/base_manager.dart'; +import 'package:regroup/Common/controller/data/network/network_api.dart'; +import 'package:regroup/sidemenu/Model/InviteComModel.dart'; +import 'package:regroup/sidemenu/Model/MyCommunityModel.dart'; +import 'package:regroup/sidemenu/Model/RequestedComModel.dart'; + +MyCommunityModel? myCommunityobj; +RequestedComModel ? requestedComobj; +InviteComModel ? inviteComobj; + + +class MyCommunityAPI { + + Future> getMyCommunity() async { + final response = await NetworkApiServices().getApi( + ApiUrls.getmycommunity, + ); + if (response.status == ResponseStatus.SUCCESS) { + myCommunityobj = MyCommunityModel.fromJson(response.data); + log(myCommunityobj!.data.toString()); + } + return response; + } + + Future> getRequestedCommunity() async { + final response = await NetworkApiServices().getApi( + ApiUrls.getrequestedcommunity, + ); + if (response.status == ResponseStatus.SUCCESS) { + requestedComobj = RequestedComModel.fromJson(response.data); + log(requestedComobj!.data.toString()); + } + return response; + } + + Future> getInviteCommunity() async { + final response = await NetworkApiServices().getApi( + ApiUrls.getInvitecommunity, + ); + if (response.status == ResponseStatus.SUCCESS) { + inviteComobj = InviteComModel.fromJson(response.data); + log(inviteComobj!.data.toString()); + } + return response; + } + + + Future> postcancelRequest(updata) async { + print("updata is $updata"); + final response = await NetworkApiServices().postApi( + updata, + ApiUrls.postcancelrequest, + ); + if (response.status == ResponseStatus.SUCCESS) { + if (response.data["status"] == "success") { + // likepostobj = LikepostModel.fromJson(response.data); + } + return ResponseData( + response.data['message'], ResponseStatus.SUCCESS, + data: response.data); + } else { + return ResponseData( + response.data['message'], ResponseStatus.FAILED); + } + } + + Future> postAcceptInvite(updata) async { + print("updata is $updata"); + final response = await NetworkApiServices().postApi( + updata, + ApiUrls.postacceptinvite, + ); + if (response.status == ResponseStatus.SUCCESS) { + if (response.data["status"] == "success") { + // likepostobj = LikepostModel.fromJson(response.data); + } + return ResponseData( + response.data['message'], ResponseStatus.SUCCESS, + data: response.data); + } else { + return ResponseData( + response.data['message'], ResponseStatus.FAILED); + } + } + + Future> postRejectInvite(updata) async { + print("updata is $updata"); + final response = await NetworkApiServices().postApi( + updata, + ApiUrls.postrejectinvite, + ); + if (response.status == ResponseStatus.SUCCESS) { + if (response.data["status"] == "success") { + // likepostobj = LikepostModel.fromJson(response.data); + } + return ResponseData( + response.data['message'], ResponseStatus.SUCCESS, + data: response.data); + } else { + return ResponseData( + response.data['message'], ResponseStatus.FAILED); + } + } + +} \ No newline at end of file diff --git a/lib/Feed Module/sidemenu/view_model/getmethod.dart b/lib/sidemenu/view_model/getmethod.dart similarity index 56% rename from lib/Feed Module/sidemenu/view_model/getmethod.dart rename to lib/sidemenu/view_model/getmethod.dart index 9b839b8..ae5dbfd 100644 --- a/lib/Feed Module/sidemenu/view_model/getmethod.dart +++ b/lib/sidemenu/view_model/getmethod.dart @@ -3,10 +3,11 @@ import 'dart:developer'; import 'package:regroup/Common/api_urls.dart'; import 'package:regroup/Common/base_manager.dart'; import 'package:regroup/Common/controller/data/network/network_api.dart'; -import 'package:regroup/Feed%20Module/sidemenu/Model/joineGroupsModel.dart'; +import 'package:regroup/sidemenu/Model/joineGroupsModel.dart'; +import 'package:regroup/sidemenu/Model/userpinnedlist.dart'; GetmyJoinedGroupsModel? joinedgroupsobj; - +UserpinnedModelList? userpinnedobj; class Sidegetmethod { @@ -22,5 +23,17 @@ class Sidegetmethod { return response; } + Future> getUserpinnedList() async { + final response = await NetworkApiServices().getApi( + ApiUrls.getuserpinlist, + // optionalpar: false + ); + if (response.status == ResponseStatus.SUCCESS) { + userpinnedobj = UserpinnedModelList.fromJson(response.data); + log(userpinnedobj!.data.toString()); + } + return response; + } + } \ No newline at end of file diff --git a/lib/sidemenu/view_model/postmethod.dart b/lib/sidemenu/view_model/postmethod.dart new file mode 100644 index 0000000..7de1519 --- /dev/null +++ b/lib/sidemenu/view_model/postmethod.dart @@ -0,0 +1,18 @@ +import 'package:regroup/Common/api_urls.dart'; +import 'package:regroup/Common/base_manager.dart'; +import 'package:regroup/Common/controller/data/network/network_api.dart'; + +class SidebarTags { + SidebarTags(); + + + Future> postUserpin(updata) async { + final response = await NetworkApiServices().postApi( + updata, + ApiUrls.postusertag, + ); + return response; + } + + +} \ No newline at end of file diff --git a/lib/sidemenu/view_model/tagcommunityuser.dart b/lib/sidemenu/view_model/tagcommunityuser.dart new file mode 100644 index 0000000..09ba926 --- /dev/null +++ b/lib/sidemenu/view_model/tagcommunityuser.dart @@ -0,0 +1,23 @@ +import 'dart:developer'; + +import 'package:regroup/Common/api_urls.dart'; +import 'package:regroup/Common/base_manager.dart'; +import 'package:regroup/Common/controller/data/network/network_api.dart'; +import 'package:regroup/sidemenu/Model/TagCommunityUserModel.dart'; +// import 'package:regroup/Feed%20Module/sidemenu/Model/TagCommunityUserModel.dart'; + +TagCommunityUserModel? tagcommunityuserobj; + +class Sidegetmethod { + Future> getJoinedusergroups(updata) async { + final response = await NetworkApiServices().getApi( + "${ApiUrls.tagcommunityuser}?=$updata", + // optionalpar: false + ); + if (response.status == ResponseStatus.SUCCESS) { + tagcommunityuserobj = TagCommunityUserModel.fromJson(response.data); + log(tagcommunityuserobj!.data.toString()); + } + return response; + } +} diff --git a/pubspec.lock b/pubspec.lock index 0919602..a10304a 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -49,6 +49,30 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.1" + cached_network_image: + dependency: "direct main" + description: + name: cached_network_image + sha256: "4a5d8d2c728b0f3d0245f69f921d7be90cae4c2fd5288f773088672c0893f819" + url: "https://pub.dev" + source: hosted + version: "3.4.0" + cached_network_image_platform_interface: + dependency: transitive + description: + name: cached_network_image_platform_interface + sha256: ff0c949e323d2a1b52be73acce5b4a7b04063e61414c8ca542dbba47281630a7 + url: "https://pub.dev" + source: hosted + version: "4.1.0" + cached_network_image_web: + dependency: transitive + description: + name: cached_network_image_web + sha256: "6322dde7a5ad92202e64df659241104a43db20ed594c41ca18de1014598d7996" + url: "https://pub.dev" + source: hosted + version: "1.3.0" characters: dependency: transitive description: @@ -89,6 +113,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.18.0" + comment_tree: + dependency: "direct main" + description: + name: comment_tree + sha256: f99978c6f4a47f9aec284753cc10442e509851d7d86192b963db70e6873f2ddb + url: "https://pub.dev" + source: hosted + version: "0.3.0" connectivity_plus: dependency: "direct main" description: @@ -310,6 +342,14 @@ packages: description: flutter source: sdk version: "0.0.0" + flutter_cache_manager: + dependency: transitive + description: + name: flutter_cache_manager + sha256: a77f77806a790eb9ba0118a5a3a936e81c4fea2b61533033b2b0c3d50bbde5ea + url: "https://pub.dev" + source: hosted + version: "3.4.0" flutter_facebook_auth: dependency: "direct main" description: @@ -342,6 +382,54 @@ packages: url: "https://pub.dev" source: hosted version: "3.0.0-beta.2" + flutter_keyboard_visibility: + dependency: "direct main" + description: + name: flutter_keyboard_visibility + sha256: "98664be7be0e3ffca00de50f7f6a287ab62c763fc8c762e0a21584584a3ff4f8" + url: "https://pub.dev" + source: hosted + version: "6.0.0" + flutter_keyboard_visibility_linux: + dependency: transitive + description: + name: flutter_keyboard_visibility_linux + sha256: "6fba7cd9bb033b6ddd8c2beb4c99ad02d728f1e6e6d9b9446667398b2ac39f08" + url: "https://pub.dev" + source: hosted + version: "1.0.0" + flutter_keyboard_visibility_macos: + dependency: transitive + description: + name: flutter_keyboard_visibility_macos + sha256: c5c49b16fff453dfdafdc16f26bdd8fb8d55812a1d50b0ce25fc8d9f2e53d086 + url: "https://pub.dev" + source: hosted + version: "1.0.0" + flutter_keyboard_visibility_platform_interface: + dependency: transitive + description: + name: flutter_keyboard_visibility_platform_interface + sha256: e43a89845873f7be10cb3884345ceb9aebf00a659f479d1c8f4293fcb37022a4 + url: "https://pub.dev" + source: hosted + version: "2.0.0" + flutter_keyboard_visibility_web: + dependency: transitive + description: + name: flutter_keyboard_visibility_web + sha256: d3771a2e752880c79203f8d80658401d0c998e4183edca05a149f5098ce6e3d1 + url: "https://pub.dev" + source: hosted + version: "2.0.0" + flutter_keyboard_visibility_windows: + dependency: transitive + description: + name: flutter_keyboard_visibility_windows + sha256: fc4b0f0b6be9b93ae527f3d527fb56ee2d918cd88bbca438c478af7bcfd0ef73 + url: "https://pub.dev" + source: hosted + version: "1.0.0" flutter_launcher_icons: dependency: "direct dev" description: @@ -808,6 +896,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.5" + nested: + dependency: transitive + description: + name: nested + sha256: "03bac4c528c64c95c722ec99280375a6f2fc708eec17c7b3f07253b626cd2a20" + url: "https://pub.dev" + source: hosted + version: "1.0.0" nm: dependency: transitive description: @@ -816,6 +912,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.5.0" + octo_image: + dependency: transitive + description: + name: octo_image + sha256: "34faa6639a78c7e3cbe79be6f9f96535867e879748ade7d17c9b1ae7536293bd" + url: "https://pub.dev" + source: hosted + version: "2.1.0" path: dependency: transitive description: @@ -968,6 +1072,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.8" + provider: + dependency: transitive + description: + name: provider + sha256: c8a055ee5ce3fd98d6fc872478b03823ffdb448699c6ebdbbc71d59b596fd48c + url: "https://pub.dev" + source: hosted + version: "6.1.2" remove_emoji_input_formatter: dependency: "direct main" description: @@ -976,6 +1088,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.0.1+1" + rxdart: + dependency: transitive + description: + name: rxdart + sha256: "5c3004a4a8dbb94bd4bf5412a4def4acdaa12e12f269737a5751369e12d1a962" + url: "https://pub.dev" + source: hosted + version: "0.28.0" shared_preferences: dependency: "direct main" description: @@ -1093,6 +1213,22 @@ packages: url: "https://pub.dev" source: hosted version: "7.0.0" + sqflite: + dependency: "direct main" + description: + name: sqflite + sha256: a43e5a27235518c03ca238e7b4732cf35eabe863a369ceba6cbefa537a66f16d + url: "https://pub.dev" + source: hosted + version: "2.3.3+1" + sqflite_common: + dependency: transitive + description: + name: sqflite_common + sha256: "3da423ce7baf868be70e2c0976c28a1bb2f73644268b7ffa7d2e08eab71f16a4" + url: "https://pub.dev" + source: hosted + version: "2.5.4" stack_trace: dependency: transitive description: @@ -1157,6 +1293,14 @@ packages: url: "https://pub.dev" source: hosted version: "21.2.10" + synchronized: + dependency: transitive + description: + name: synchronized + sha256: "539ef412b170d65ecdafd780f924e5be3f60032a1128df156adad6c5b373d558" + url: "https://pub.dev" + source: hosted + version: "3.1.0+1" term_glyph: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 0772b32..ea22e00 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,7 +2,7 @@ name: regroup description: A new Flutter project. # The following line prevents the package from being accidentally published to # pub.dev using `flutter pub publish`. This is preferred for private packages. -publish_to: 'none' # Remove this line if you wish to publish to pub.dev +publish_to: "none" # Remove this line if you wish to publish to pub.dev # The following defines the version and build number for your application. # A version number is three numbers separated by dots, like 1.2.43 @@ -19,7 +19,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev version: 1.0.0+1 environment: - sdk: '>=2.19.6 <3.0.0' + sdk: ">=2.19.6 <3.0.0" # Dependencies specify other packages that your package needs in order to work. # To automatically upgrade your package dependencies to the latest versions @@ -31,7 +31,6 @@ dependencies: flutter: sdk: flutter - # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.2 @@ -48,7 +47,7 @@ dependencies: image_cropper: ^6.0.0 image_picker: ^1.0.8 lottie: ^3.1.2 - connectivity_plus: + connectivity_plus: animations: ^2.0.11 shimmer: ^3.0.0 device_info_plus: ^9.1.2 @@ -76,7 +75,12 @@ dependencies: sign_in_with_apple: any timer_button: ^2.1.1 flutter_html: ^3.0.0-beta.2 + comment_tree: ^0.3.0 + flutter_keyboard_visibility: ^6.0.0 + sqflite: ^2.3.3+1 + + cached_network_image: any dev_dependencies: @@ -85,7 +89,6 @@ dev_dependencies: flutter_lints: ^2.0.0 - flutter_launcher_icons: ^0.13.1 flutter_launcher_icons: @@ -100,7 +103,6 @@ flutter_launcher_icons: # The following section is specific to Flutter packages. flutter: - # The following line ensures that the Material Icons font is # included with your application, so that you can use the icons in # the material Icons class.