9 Commits

107 changed files with 5634 additions and 15306 deletions

4
.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,4 @@
{
"CodeGPT.apiKey": "CodeGPT Plus Beta",
"dart.flutterSdkPath": "D:\\pooja\\fluttersdk\\flutter_3.16.9\\flutter"
}

View File

@@ -22,9 +22,6 @@ if (flutterVersionName == null) {
}
apply plugin: 'com.android.application'
// START: FlutterFire Configuration
apply plugin: 'com.google.gms.google-services'
// END: FlutterFire Configuration
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

View File

@@ -1,29 +0,0 @@
{
"project_info": {
"project_number": "563133114654",
"project_id": "regroup-9aed2",
"storage_bucket": "regroup-9aed2.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:563133114654:android:9032ddcb6dc5add26c010f",
"android_client_info": {
"package_name": "com.example.regroup"
}
},
"oauth_client": [],
"api_key": [
{
"current_key": "AIzaSyA7z_Q3xN1IHZFzhfOtkXTyryGEJMOZrPY"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": []
}
}
}
],
"configuration_version": "1"
}

View File

@@ -16,7 +16,7 @@
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
<application
android:label="ReGroup"
android:label="regroup"
android:requestLegacyExternalStorage="true"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Regroup</string>
<string name="facebook_app_id">803386025107790</string>
<string name="fb_login_protocol_scheme">fb803386025107790</string>
<string name="facebook_client_token">fa69ee794ff94e50c7ddbfac1e035cb9</string>
<string name="app_name">ReGroup123</string>
<string name="facebook_app_id">8076081959097016</string>
<string name="fb_login_protocol_scheme">fb8076081959097016</string>
<string name="facebook_client_token">ca5a1805872edbec0d3a0a0b02229ba5</string>
</resources>

View File

@@ -6,9 +6,6 @@ buildscript {
}
dependencies {
// START: FlutterFire Configuration
classpath 'com.google.gms:google-services:4.3.15'
// END: FlutterFire Configuration
classpath 'com.android.tools.build:gradle:7.2.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 256 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -1 +0,0 @@
{"flutter":{"platforms":{"android":{"default":{"projectId":"regroup-9aed2","appId":"1:563133114654:android:9032ddcb6dc5add26c010f","fileOutput":"android/app/google-services.json"}},"ios":{"default":{"projectId":"regroup-9aed2","appId":"1:563133114654:ios:d5ce57e5b214757e6c010f","uploadDebugSymbols":false,"fileOutput":"ios/Runner/GoogleService-Info.plist"}},"dart":{"lib/firebase_options.dart":{"projectId":"regroup-9aed2","configurations":{"android":"1:563133114654:android:9032ddcb6dc5add26c010f","ios":"1:563133114654:ios:d5ce57e5b214757e6c010f"}}}}}}

View File

@@ -1,10 +1,4 @@
PODS:
- AppAuth (1.7.5):
- AppAuth/Core (= 1.7.5)
- AppAuth/ExternalUserAgent (= 1.7.5)
- AppAuth/Core (1.7.5)
- AppAuth/ExternalUserAgent (1.7.5):
- AppAuth/Core
- connectivity_plus (0.0.1):
- Flutter
- FlutterMacOS
@@ -52,32 +46,6 @@ PODS:
- file_picker (0.0.1):
- DKImagePickerController/PhotoGallery
- Flutter
- Firebase/Auth (10.25.0):
- Firebase/CoreOnly
- FirebaseAuth (~> 10.25.0)
- Firebase/CoreOnly (10.25.0):
- FirebaseCore (= 10.25.0)
- firebase_auth (4.20.0):
- Firebase/Auth (= 10.25.0)
- firebase_core
- Flutter
- firebase_core (2.32.0):
- Firebase/CoreOnly (= 10.25.0)
- Flutter
- FirebaseAppCheckInterop (10.28.0)
- FirebaseAuth (10.25.0):
- FirebaseAppCheckInterop (~> 10.17)
- FirebaseCore (~> 10.0)
- GoogleUtilities/AppDelegateSwizzler (~> 7.8)
- GoogleUtilities/Environment (~> 7.8)
- GTMSessionFetcher/Core (< 4.0, >= 2.1)
- RecaptchaInterop (~> 100.0)
- FirebaseCore (10.25.0):
- FirebaseCoreInternal (~> 10.0)
- GoogleUtilities/Environment (~> 7.12)
- GoogleUtilities/Logger (~> 7.12)
- FirebaseCoreInternal (10.28.0):
- "GoogleUtilities/NSData+zlib (~> 7.8)"
- Flutter (1.0.0)
- flutter_facebook_auth (6.0.4):
- FBSDKLoginKit (~> 16.3.1)
@@ -90,51 +58,11 @@ PODS:
- google_maps_flutter_ios (0.0.1):
- Flutter
- GoogleMaps (< 9.0)
- google_sign_in_ios (0.0.1):
- AppAuth (>= 1.7.4)
- Flutter
- FlutterMacOS
- GoogleSignIn (~> 7.1)
- GTMSessionFetcher (>= 3.4.0)
- GoogleMaps (6.2.1):
- GoogleMaps/Maps (= 6.2.1)
- GoogleMaps/Base (6.2.1)
- GoogleMaps/Maps (6.2.1):
- GoogleMaps/Base
- GoogleSignIn (7.1.0):
- AppAuth (< 2.0, >= 1.7.3)
- GTMAppAuth (< 5.0, >= 4.1.1)
- GTMSessionFetcher/Core (~> 3.3)
- GoogleUtilities/AppDelegateSwizzler (7.13.3):
- GoogleUtilities/Environment
- GoogleUtilities/Logger
- GoogleUtilities/Network
- GoogleUtilities/Privacy
- GoogleUtilities/Environment (7.13.3):
- GoogleUtilities/Privacy
- PromisesObjC (< 3.0, >= 1.2)
- GoogleUtilities/Logger (7.13.3):
- GoogleUtilities/Environment
- GoogleUtilities/Privacy
- GoogleUtilities/Network (7.13.3):
- GoogleUtilities/Logger
- "GoogleUtilities/NSData+zlib"
- GoogleUtilities/Privacy
- GoogleUtilities/Reachability
- "GoogleUtilities/NSData+zlib (7.13.3)":
- GoogleUtilities/Privacy
- GoogleUtilities/Privacy (7.13.3)
- GoogleUtilities/Reachability (7.13.3):
- GoogleUtilities/Logger
- GoogleUtilities/Privacy
- 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/Core
- image_cropper (0.0.4):
- Flutter
- TOCropViewController (~> 2.7.3)
@@ -147,16 +75,12 @@ PODS:
- FlutterMacOS
- permission_handler_apple (9.3.0):
- Flutter
- PromisesObjC (2.4.0)
- RecaptchaInterop (100.0.0)
- SDWebImage (5.19.2):
- SDWebImage/Core (= 5.19.2)
- SDWebImage/Core (5.19.2)
- shared_preferences_foundation (0.0.1):
- Flutter
- FlutterMacOS
- sign_in_with_apple (0.0.1):
- Flutter
- SwiftyGif (5.4.5)
- Toast (4.1.1)
- TOCropViewController (2.7.4)
@@ -165,43 +89,27 @@ DEPENDENCIES:
- connectivity_plus (from `.symlinks/plugins/connectivity_plus/darwin`)
- device_info_plus (from `.symlinks/plugins/device_info_plus/ios`)
- file_picker (from `.symlinks/plugins/file_picker/ios`)
- firebase_auth (from `.symlinks/plugins/firebase_auth/ios`)
- firebase_core (from `.symlinks/plugins/firebase_core/ios`)
- Flutter (from `Flutter`)
- flutter_facebook_auth (from `.symlinks/plugins/flutter_facebook_auth/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`)
- google_sign_in_ios (from `.symlinks/plugins/google_sign_in_ios/darwin`)
- image_cropper (from `.symlinks/plugins/image_cropper/ios`)
- image_gallery_saver (from `.symlinks/plugins/image_gallery_saver/ios`)
- image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
- permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
- sign_in_with_apple (from `.symlinks/plugins/sign_in_with_apple/ios`)
SPEC REPOS:
trunk:
- AppAuth
- DKImagePickerController
- DKPhotoGallery
- FBAEMKit
- FBSDKCoreKit
- FBSDKCoreKit_Basics
- FBSDKLoginKit
- Firebase
- FirebaseAppCheckInterop
- FirebaseAuth
- FirebaseCore
- FirebaseCoreInternal
- GoogleMaps
- GoogleSignIn
- GoogleUtilities
- GTMAppAuth
- GTMSessionFetcher
- PromisesObjC
- RecaptchaInterop
- SDWebImage
- SwiftyGif
- Toast
@@ -214,10 +122,6 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/device_info_plus/ios"
file_picker:
:path: ".symlinks/plugins/file_picker/ios"
firebase_auth:
:path: ".symlinks/plugins/firebase_auth/ios"
firebase_core:
:path: ".symlinks/plugins/firebase_core/ios"
Flutter:
:path: Flutter
flutter_facebook_auth:
@@ -228,8 +132,6 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/geolocator_apple/ios"
google_maps_flutter_ios:
:path: ".symlinks/plugins/google_maps_flutter_ios/ios"
google_sign_in_ios:
:path: ".symlinks/plugins/google_sign_in_ios/darwin"
image_cropper:
:path: ".symlinks/plugins/image_cropper/ios"
image_gallery_saver:
@@ -242,11 +144,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/permission_handler_apple/ios"
shared_preferences_foundation:
:path: ".symlinks/plugins/shared_preferences_foundation/darwin"
sign_in_with_apple:
:path: ".symlinks/plugins/sign_in_with_apple/ios"
SPEC CHECKSUMS:
AppAuth: 501c04eda8a8d11f179dbe8637b7a91bb7e5d2fa
connectivity_plus: ddd7f30999e1faaef5967c23d5b6d503d10434db
device_info_plus: c6fb39579d0f423935b0c9ce7ee2f44b71b9fce6
DKImagePickerController: 946cec48c7873164274ecc4624d19e3da4c1ef3c
@@ -256,34 +155,19 @@ SPEC CHECKSUMS:
FBSDKCoreKit_Basics: cd7b5f5d1e8868c26706917919d058999ca672c3
FBSDKLoginKit: 572cca0bc6c90067ef197187697cb3b584310c52
file_picker: 09aa5ec1ab24135ccd7a1621c46c84134bfd6655
Firebase: 0312a2352584f782ea56f66d91606891d4607f06
firebase_auth: 5719ddc9f654b813405899480e84971bd8e61235
firebase_core: a626d00494efa398e7c54f25f1454a64c8abf197
FirebaseAppCheckInterop: 5315f40293191bfec04b2cfab0215760e441540a
FirebaseAuth: c0f93dcc570c9da2bffb576969d793e95c344fbb
FirebaseCore: 7ec4d0484817f12c3373955bc87762d96842d483
FirebaseCoreInternal: 58d07f1362fddeb0feb6a857d1d1d1c5e558e698
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
flutter_facebook_auth: c8700ab1770f3d8e5e7456220e4f3bbcdb831454
fluttertoast: 9f2f8e81bb5ce18facb9748d7855bf5a756fe3db
geolocator_apple: 6cbaf322953988e009e5ecb481f07efece75c450
google_maps_flutter_ios: d1318b4ff711612cab16862d7a87e31a7403d458
google_sign_in_ios: 07375bfbf2620bc93a602c0e27160d6afc6ead38
GoogleMaps: 20d7b12be49a14287f797e88e0e31bc4156aaeb4
GoogleSignIn: d4281ab6cf21542b1cfaff85c191f230b399d2db
GoogleUtilities: ea963c370a38a8069cc5f7ba4ca849a60b6d7d15
GTMAppAuth: f69bd07d68cd3b766125f7e072c45d7340dea0de
GTMSessionFetcher: 8000756fc1c19d2e5697b90311f7832d2e33f6cd
image_cropper: 2c150b3d63f4feaad31054d20381ddac0a460e63
image_gallery_saver: cb43cc43141711190510e92c460eb1655cd343cb
image_picker_ios: 99dfe1854b4fa34d0364e74a78448a0151025425
path_provider_foundation: 3784922295ac71e43754bd15e0653ccfd36a147c
permission_handler_apple: 9878588469a2b0d0fc1e048d9f43605f92e6cec2
PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47
RecaptchaInterop: 7d1a4a01a6b2cb1610a47ef3f85f0c411434cb21
SDWebImage: dfe95b2466a9823cf9f0c6d01217c06550d7b29a
shared_preferences_foundation: b4c3b4cddf1c21f02770737f147a3f5da9d39695
sign_in_with_apple: f3bf75217ea4c2c8b91823f225d70230119b8440
SwiftyGif: 706c60cf65fa2bc5ee0313beece843c8eb8194d4
Toast: 1f5ea13423a1e6674c4abdac5be53587ae481c4e
TOCropViewController: 80b8985ad794298fb69d3341de183f33d1853654

View File

@@ -14,7 +14,6 @@
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 */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
@@ -36,7 +35,6 @@
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
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 = "<group>"; };
5210D9302C4006FC0040021E /* Runner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Runner.entitlements; sourceTree = "<group>"; };
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
@@ -48,7 +46,6 @@
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
D4274500C33C54346ECA2D49 /* GoogleService-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; name = "GoogleService-Info.plist"; path = "Runner/GoogleService-Info.plist"; sourceTree = "<group>"; };
DC7FC30109CCD5376F6BFA0F /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
@@ -93,7 +90,6 @@
97C146EF1CF9000F007C117D /* Products */,
01448FBCAC46C16EC8BC1181 /* Pods */,
DE8E73CF7AB07643531FB23E /* Frameworks */,
D4274500C33C54346ECA2D49 /* GoogleService-Info.plist */,
);
sourceTree = "<group>";
};
@@ -108,7 +104,6 @@
97C146F01CF9000F007C117D /* Runner */ = {
isa = PBXGroup;
children = (
5210D9302C4006FC0040021E /* Runner.entitlements */,
97C146FA1CF9000F007C117D /* Main.storyboard */,
97C146FD1CF9000F007C117D /* Assets.xcassets */,
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
@@ -151,8 +146,6 @@
dependencies = (
);
name = Runner;
packageProductDependencies = (
);
productName = Runner;
productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
productType = "com.apple.product-type.application";
@@ -181,8 +174,6 @@
Base,
);
mainGroup = 97C146E51CF9000F007C117D;
packageReferences = (
);
productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
projectDirPath = "";
projectRoot = "";
@@ -201,7 +192,6 @@
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
9FD3FE5A0194B5B2D8202DCF /* GoogleService-Info.plist in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -385,7 +375,6 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 8;
DEVELOPMENT_TEAM = A89AY6VY4F;
ENABLE_BITCODE = NO;
@@ -519,7 +508,6 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 8;
DEVELOPMENT_TEAM = A89AY6VY4F;
ENABLE_BITCODE = NO;
@@ -547,7 +535,6 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 8;
DEVELOPMENT_TEAM = A89AY6VY4F;
ENABLE_BITCODE = NO;

View File

@@ -1,15 +0,0 @@
{
"originHash" : "ca3cf5f8f83d297b47d2cb0edff3e06f294951e2e06fa55cfc82831103499b2a",
"pins" : [
{
"identity" : "facebook-ios-sdk",
"kind" : "remoteSourceControl",
"location" : "https://github.com/facebook/facebook-ios-sdk",
"state" : {
"revision" : "c19607d535864533523d1f437c84035e5fb101cf",
"version" : "14.1.0"
}
}
],
"version" : 3
}

View File

@@ -1,30 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>API_KEY</key>
<string>AIzaSyCvettUZf1thSh9xO5-SxR_IYx-tCmVnc0</string>
<key>GCM_SENDER_ID</key>
<string>563133114654</string>
<key>PLIST_VERSION</key>
<string>1</string>
<key>BUNDLE_ID</key>
<string>com.regroup.wdi</string>
<key>PROJECT_ID</key>
<string>regroup-9aed2</string>
<key>STORAGE_BUCKET</key>
<string>regroup-9aed2.appspot.com</string>
<key>IS_ADS_ENABLED</key>
<false></false>
<key>IS_ANALYTICS_ENABLED</key>
<false></false>
<key>IS_APPINVITE_ENABLED</key>
<true></true>
<key>IS_GCM_ENABLED</key>
<true></true>
<key>IS_SIGNIN_ENABLED</key>
<true></true>
<key>GOOGLE_APP_ID</key>
<string>1:563133114654:ios:d5ce57e5b214757e6c010f</string>
</dict>
</plist>

View File

@@ -51,29 +51,5 @@
<string>Regroup get write-only access to the user photo library</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Allow access to photo library</string>
<key>NSCameraUsageDescription</key>
<string>To capture profile photo please grant camera access</string>
<!-- facebook start -->
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>fb803386025107790</string>
</array>
</dict>
</array>
<key>FacebookAppID</key>
<string>803386025107790</string>
<key>FacebookClientToken</key>
<string>fa69ee794ff94e50c7ddbfac1e035cb9</string>
<key>FacebookDisplayName</key>
<string>Regroup</string>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>fbapi</string>
<string>fb-messenger-share-api</string>
</array>
<!-- facebook end -->
</dict>
</plist>

View File

@@ -4,9 +4,5 @@
<dict>
<key>aps-environment</key>
<string>development</string>
<key>com.apple.developer.applesignin</key>
<array>
<string>Default</string>
</array>
</dict>
</plist>

View File

@@ -1,81 +1,11 @@
class ApiUrls {
static const baseUrl = "https://regroup.betadelivery.com/api/v1/";
static const getlogin = "${baseUrl}login";
static const forgotpassword = "${baseUrl}forgot-password";
static const verifyotp = "${baseUrl}forgot-password/verify-otp";
static const tellUsBusinessApi = "${baseUrl}tell-us-about-your-business";
static const letUsUnderstandApi = "${baseUrl}update-business-profile-step-1";
static const resetpassword = "${baseUrl}reset-password";
static const registeration = "${baseUrl}send_otp";
static const verifyregisteration = "${baseUrl}verify_otp";
static const tellusIndividual = "${baseUrl}add_profile";
static const getIndividualactivity = "${baseUrl}fetch-interests";
static const postindividualactivity = "${baseUrl}select-interests";
static const getgroups = "${baseUrl}fetch-groups";
static const postgroups = "${baseUrl}select-groups";
static const getcommunities = "${baseUrl}fetch-communities";
static const postcommunities = "${baseUrl}select-communities";
static const googlelogin = "${baseUrl}sign-in-with-google-login";
static const applelogin = "${baseUrl}apple-login-or-registration";
static const facebooklogin = "${baseUrl}facebook-login";
static const storeDetailsOfOAuth = "${baseUrl}update-user-account-type";
static const getuserdetails = "${baseUrl}get-auth-user-data";
static const getfaqs = "${baseUrl}fetch-faqs";
static const getprivacypolicy = "${baseUrl}fetch-privacy-policy";
static const gettermsconditios = "${baseUrl}fetch-terms-and-condition";
static const postcontactus = "${baseUrl}contact-us";
static const postreportbug = "${baseUrl}bug-report";
static const getfollowers = "${baseUrl}fetch-followers";
static const getfollowing = "${baseUrl}fetch-following";
static const postblock = "${baseUrl}block-profile";
static const postunfollow = "${baseUrl}follow-user";
static const postremoveuser = "${baseUrl}remove-follower";
static const postchangepassword = "${baseUrl}update-password-send-otp";
static const postchangepassverify = "${baseUrl}verify-update-password-otp";
static const postnotification = "${baseUrl}update-notification-settings";
static const getnotification = "${baseUrl}fetch-notification-settings";
static const getblockuser = "${baseUrl}fetch-blocked-profile";
static const postblockuser = "${baseUrl}block-profile";
// Individual
static const posteditprofile = "${baseUrl}update-profile";
static const geteditprofile = "${baseUrl}fetch-profile";
// Business
static const posteditprofilebusiness = "${baseUrl}update-business-profile";
static const geteditprofilebusiness = "${baseUrl}fetch-business-profile";
}

View File

@@ -6,7 +6,7 @@ import 'package:regroup/Feed%20Module/Main_Screens/Chats/View/chatsmainscreen.da
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';
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/ProfileTab.dart';
class MainController extends GetxController {
var selectedIndex = 0.obs;

View File

@@ -1,5 +1,4 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:get/get.dart';
import 'package:regroup/Common/controller/MainController.dart';
@@ -10,56 +9,11 @@ class MainScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Obx(() {
return WillPopScope(
onWillPop: () async {
_onBackButtonPressed(context);
return true; // Return true to allow the pop action
},
child: Scaffold(
resizeToAvoidBottomInset: false,
body: mainController.currentTab[mainController.selectedIndex.value],
),
return Scaffold(
resizeToAvoidBottomInset: false,
body: mainController.currentTab[mainController.selectedIndex.value],
);
});
}
Future<bool> _onBackButtonPressed(BuildContext context) async {
bool? exitApp = await showDialog(
context: context,
builder: (context) {
return AlertDialog(
backgroundColor: Color(0xFF222935),
title: const Text('Exit App', style: TextStyle(color: Colors.white)),
content: const Text('Do you really want to close the app?',
style: TextStyle(color: Colors.white)),
actions: [
TextButton(
onPressed: () {
Navigator.of(context).pop(false);
},
child: const Text(
'No',
style: TextStyle(
color: Color(0xFFD90B2E),
),
),
),
TextButton(
onPressed: () {
SystemNavigator.pop();
Navigator.pop(context);
},
child: const Text(
'Yes',
style: TextStyle(
color: Color(0xFFD90B2E),
),
),
)
],
);
},
);
return exitApp ?? false;
}
}

View File

@@ -13,6 +13,10 @@ import 'package:http/http.dart' as http;
import '../../entry_point_controller.dart';
class NetworkApiServices {
// String basicAuth = 'Basic ' +
// base64.encode(
// utf8.encode('RegroupUserName:71%@L%es^bUX94`J9XT*@bh,._WWM{\$%^^&&'));
Dio dio = Dio();
final controllerEntryPoint = Get.put(EntryPointController());
@@ -20,61 +24,27 @@ class NetworkApiServices {
base64.encode(
utf8.encode('RegroupUserName:71%@L%es^bUX94`J9XT*@bh,._WWM{\$%^^&&'));
Future<ResponseData> getApi(String url, {bool optionalpar = false}) async {
Future<ResponseData> getApi(String url) async {
if (kDebugMode) {
print("api url is >>> $url");
}
Response response;
SharedPreferences prefs = await SharedPreferences.getInstance();
token = prefs.getString('access-token');
print("url is $url");
log(token.toString());
token = prefs.getString('token');
try {
response = await dio.get(
url,
options:
// Options(headers: {
// "authorization": "Bearer $token",
// 'content-Type': 'application/json',
// })
optionalpar
? Options(
headers: {
"authorization": basicAuth,
},
)
: Options(
headers: {
'authorization': basicAuth,
'access-token': token
},
),
);
} on Exception catch (e) {
log(e.toString());
response = await dio.get(url,
options: Options(headers: {
"authorization": "Bearer $token",
'content-Type': 'application/json',
}));
} on Exception catch (_) {
return ResponseData<dynamic>(
'Oops something Went Wrong', ResponseStatus.FAILED);
}
// on Exception catch (e) {
// if (e is DioException) {
// if (e.response!.statusCode == 403) {
// return ResponseData<dynamic>(
// e.response!.data['message'][0]!, ResponseStatus.FAILED,
// data: e.response!.data);
// }
// }
// return ResponseData<dynamic>(
// 'Oops something Went Wrong',
// ResponseStatus.FAILED,
// );
// }
if (response.statusCode == 200) {
return ResponseData<dynamic>("success", ResponseStatus.SUCCESS,
data: response.data);
} else if (response.statusCode == 201) {
return ResponseData<dynamic>("success", ResponseStatus.SUCCESS,
data: response.data);
} else if (response.statusCode == 404) {
return ResponseData<dynamic>("error", ResponseStatus.ERROR,
data: response.data);
@@ -152,7 +122,6 @@ class NetworkApiServices {
//New post api
@override
Future<ResponseData> postApi(data, String url,
{bool optionalpar = false}) async {
if (kDebugMode) {
@@ -163,20 +132,23 @@ class NetworkApiServices {
SharedPreferences prefs = await SharedPreferences.getInstance();
String? token = prefs.getString('access-token');
log(token.toString());
log(basicAuth);
try {
response = await dio.post(
url,
data: data,
options: optionalpar
// (token != null)
? Options(
headers: {
"authorization": basicAuth,
},
)
: Options(
headers: {'authorization': basicAuth, 'access-token': token},
headers: {
'authorization': basicAuth,
// 'access-token': token
},
),
);
log(response.toString());
@@ -199,15 +171,9 @@ class NetworkApiServices {
);
}
if (e.response!.statusCode == 403) {
if (e.response!.data['message'] is List) {
return ResponseData<dynamic>(
e.response!.data['message'][0]!, ResponseStatus.FAILED,
data: e.response!.data);
} else {
return ResponseData<dynamic>(
e.response!.data['message'], ResponseStatus.FAILED,
data: e.response!.data);
}
return ResponseData<dynamic>(
e.response!.statusMessage!, ResponseStatus.PRIVATE,
data: e.response!.data);
}
}
return ResponseData<dynamic>(
@@ -242,7 +208,7 @@ class NetworkApiServices {
Response response;
SharedPreferences prefs = await SharedPreferences.getInstance();
// ignore: unused_local_variable
String? token = prefs.getString('access-token').toString();
String? token = prefs.getString('token').toString();
try {
response = await dio.post(url,
data: data,
@@ -364,7 +330,7 @@ class NetworkApiServices {
Response response;
SharedPreferences prefs = await SharedPreferences.getInstance();
// String? token = prefs.getString('token');
String? token = prefs.getString('access-token').toString();
String? token = prefs.getString('token').toString();
print("token is $token");
try {
response = await dio.post(url,

View File

@@ -224,13 +224,11 @@ class _NewPostState extends State<NewPost> {
CustomDropDownCheckBox(
header: "",
title: "",
listData: [
'Active alliance network',
'Fitfam federation',
'The athletic town',
'Football fever'
],
onItemSelected: (p0) {},
images: [

View File

@@ -0,0 +1,276 @@
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:regroup/Common/CommonButton.dart';
import 'package:regroup/Common/CommonDropDown.dart';
import 'package:regroup/Common/CommonWidget.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/blureffect.dart';
import 'package:regroup/Utils/Common/sized_box.dart';
import 'package:regroup/Utils/texts.dart';
import 'package:intl/intl.dart';
class EditProfile extends StatefulWidget {
const EditProfile({super.key});
@override
State<EditProfile> createState() => _EditProfileState();
}
class _EditProfileState extends State<EditProfile> {
TextEditingController dateController = TextEditingController();
List<File?> filePath = [];
bool? isImageAdded = false;
@override
Widget build(BuildContext context) {
return Scaffold(
// key: _scaffoldKey1,
backgroundColor: Color(0xFF222935),
extendBody: true,
appBar: CommonAppbar(
titleTxt: "",
),
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(children: [
sizedBoxHeight(25.h),
Stack(
children: [
filePath.isNotEmpty
? ClipOval(
child: SizedBox.fromSize(
size: Size.fromRadius(50.r),
child: Image.file(
filePath[0]!,
fit: BoxFit.cover,
width: double.infinity,
),
),
)
: CircleAvatar(
backgroundImage: AssetImage(
"assets/images/png/cimg3.png",
),
radius: 50.r,
),
Positioned(
bottom: 0,
right: 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(
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(
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(
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(
header: "Male",
title: "",
showOtherOption: true,
listData: ["Male", "Female", "Prefer not to say"],
onItemSelected: (p0) {},
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(
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("Primary sport"),
sizedBoxWidth(6.w),
Image.asset(
"assets/images/png/octicon_question-24.png",
height: 16.h,
width: 16.w,
)
],
),
sizedBoxHeight(16.h),
CustomDropDownRadio(
showOtherOption: true,
header: "Rowing, Rugby, Swimming",
title: "",
listData: [
"Rowing",
"Cycling",
"Running",
"Swimming",
"Triathlon",
"Hiking",
"Football",
"Rugby"
],
onItemSelected: (p0) {},
leadingImage: Image.asset(
"assets/images/png/Vector (4).png",
width: 18.w,
height: 17.h,
),
),
// CommonDropdownradioBtn(
// hint: "Rowing, Rugby, Swimming",
// items: [
// "Rowing",
// "Cycling",
// "Running",
// "Swimming",
// "Triathlon",
// "Hiking",
// "Football",
// "Rugby"
// ],
// leadingIcon: Image.asset(
// "assets/images/png/Vector (4).png",
// width: 18.w,
// height: 17.h,
// ),
// showOtherOption: true,
// ),
sizedBoxHeight(20.h),
text16400white("Bio"),
sizedBoxHeight(16.h),
CustomTextFormField2(
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(60.h),
CommonBtn(text: "Save"),
sizedBoxHeight(60.h),
],
)
])))
]));
}
}

View File

@@ -1,178 +0,0 @@
class GetEditProfileBus {
String? status;
int? statusCode;
String? message;
Data? data;
GetEditProfileBus({this.status, this.statusCode, this.message, this.data});
GetEditProfileBus.fromJson(Map<String, dynamic> json) {
status = json['status'];
statusCode = json['status_code'];
message = json['message'];
data = json['data'] != null ? new Data.fromJson(json['data']) : null;
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
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 {
int? id;
int? businessTypeXid;
String? businessOwnerName;
String? businessName;
String? businessLocation;
String? businessContactNumber;
String? businessEmail;
String? businessHandle;
String? websiteLink;
String? googleReviewLink;
String? businessLogo;
String? tags;
String? bannerImage;
Follows? follows;
BusinessType? businessType;
Data(
{this.id,
this.businessTypeXid,
this.businessOwnerName,
this.businessName,
this.businessLocation,
this.businessContactNumber,
this.businessEmail,
this.businessHandle,
this.websiteLink,
this.googleReviewLink,
this.businessLogo,
this.tags,
this.bannerImage,
this.follows,
this.businessType});
Data.fromJson(Map<String, dynamic> json) {
id = json['id'];
businessTypeXid = json['business_type_xid'];
businessOwnerName = json['business_owner_name'];
businessName = json['business_name'];
businessLocation = json['business_location'];
businessContactNumber = json['business_contact_number'];
businessEmail = json['business_email'];
businessHandle = json['business_handle'];
websiteLink = json['website_link'];
googleReviewLink = json['google_review_link'];
businessLogo = json['business_logo'];
tags = json['tags'];
bannerImage = json['banner_image'];
follows =
json['follows'] != null ? new Follows.fromJson(json['follows']) : null;
businessType = json['business_type'] != null
? new BusinessType.fromJson(json['business_type'])
: null;
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['business_type_xid'] = this.businessTypeXid;
data['business_owner_name'] = this.businessOwnerName;
data['business_name'] = this.businessName;
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;
if (this.follows != null) {
data['follows'] = this.follows!.toJson();
}
if (this.businessType != null) {
data['business_type'] = this.businessType!.toJson();
}
return data;
}
}
class Follows {
int? following;
int? followers;
Follows({this.following, this.followers});
Follows.fromJson(Map<String, dynamic> json) {
following = json['following'];
followers = json['followers'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['following'] = this.following;
data['followers'] = this.followers;
return data;
}
}
class BusinessType {
int? id;
String? name;
String? image;
String? description;
int? isActive;
String? createdBy;
String? modifiedBy;
String? deletedAt;
String? createdAt;
String? updatedAt;
BusinessType(
{this.id,
this.name,
this.image,
this.description,
this.isActive,
this.createdBy,
this.modifiedBy,
this.deletedAt,
this.createdAt,
this.updatedAt});
BusinessType.fromJson(Map<String, dynamic> json) {
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'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
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;
return data;
}
}

View File

@@ -1,139 +0,0 @@
class GetEditProfileIndi {
String? status;
int? statusCode;
String? message;
Data? data;
GetEditProfileIndi({this.status, this.statusCode, this.message, this.data});
GetEditProfileIndi.fromJson(Map<String, dynamic> json) {
status = json['status'];
statusCode = json['status_code'];
message = json['message'];
data = json['data'] != null ? new Data.fromJson(json['data']) : null;
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
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 {
int? id;
String? userName;
String? fullName;
String? gender;
String? dateOfBirth;
List<Interest>? interest;
String? about;
String? position;
String? trainingScores;
String? height;
String? weight;
String? battingAverage;
Follows? follows;
Data(
{this.id,
this.userName,
this.fullName,
this.gender,
this.dateOfBirth,
this.interest,
this.about,
this.position,
this.trainingScores,
this.height,
this.weight,
this.battingAverage,
this.follows});
Data.fromJson(Map<String, dynamic> json) {
id = json['id'];
userName = json['user_name'];
fullName = json['full_name'];
gender = json['gender'];
dateOfBirth = json['date_of_birth'];
if (json['interest'] != null) {
interest = <Interest>[];
json['interest'].forEach((v) {
interest!.add(new Interest.fromJson(v));
});
}
about = json['about'];
position = json['position'];
trainingScores = json['training_scores'];
height = json['height'];
weight = json['weight'];
battingAverage = json['batting_average'];
follows =
json['follows'] != null ? new Follows.fromJson(json['follows']) : null;
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['user_name'] = this.userName;
data['full_name'] = this.fullName;
data['gender'] = this.gender;
data['date_of_birth'] = this.dateOfBirth;
if (this.interest != null) {
data['interest'] = this.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();
}
return data;
}
}
class Interest {
int? id;
String? name;
Interest({this.id, this.name});
Interest.fromJson(Map<String, dynamic> json) {
id = json['id'];
name = json['name'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['name'] = this.name;
return data;
}
}
class Follows {
int? following;
int? followers;
Follows({this.following, this.followers});
Follows.fromJson(Map<String, dynamic> json) {
following = json['following'];
followers = json['followers'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['following'] = this.following;
data['followers'] = this.followers;
return data;
}
}

View File

@@ -1,423 +0,0 @@
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/ProfileTab.dart';
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/EditProfile/ViewModel/EditProfileApi.dart';
import 'package:regroup/Utils/Common/CommonAppbar.dart';
import 'package:regroup/Utils/Common/CommonDropdown.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';
import '../../../../../Utils/Common/CustomTextformfield.dart';
class BusEditProfile extends StatefulWidget {
const BusEditProfile({super.key});
@override
State<BusEditProfile> createState() => _BusEditProfileState();
}
class _BusEditProfileState extends State<BusEditProfile> {
TextEditingController busNameController = TextEditingController();
TextEditingController busUserNameController = TextEditingController();
TextEditingController ownerNameController = TextEditingController();
TextEditingController foundedonController = TextEditingController();
TextEditingController websiteLinkController = TextEditingController();
TextEditingController locationController = TextEditingController();
TextEditingController bioController = TextEditingController();
String profilePicture = "";
bool isImageAdded = false;
bool isOnce = true;
late Future myfuture;
convertFileToMultiPart(String? file) async {
return await MultipartFile.fromFile(
file!,
filename: path.basename(file),
);
}
@override
void initState() {
// TODO: implement initState
myfuture = EditProfileApi()
.getEditProfileBusiness()
.then((value) => {setValues()});
super.initState();
}
//Founded on & bio data not there
setValues() {
if (isOnce) {
busNameController.text = getEditProfileBus!.data!.businessName ?? '';
busUserNameController.text = getEditProfileBus!.data!.businessName ?? '';
ownerNameController.text =
getEditProfileBus!.data!.businessOwnerName ?? '';
foundedonController.text =
getEditProfileBus!.data!.businessOwnerName ?? '';
websiteLinkController.text = getEditProfileBus!.data!.websiteLink ?? '';
locationController.text = getEditProfileBus!.data!.businessLocation ?? '';
bioController.text = getEditProfileBus!.data!.businessOwnerName ?? '';
// _selectedgenderType = getEditProfileIndi!.data!.gender ?? '';
// _selectedsportType = getEditProfileIndi!.data!.interest!.join(', ') ?? '';
isOnce = false;
setState(() {});
}
}
void saveEditProfileBus() async {
FormData? updata;
if (busNameController.text.isBlank! ||
busUserNameController.text.isBlank! ||
ownerNameController.text.isBlank! ||
foundedonController.text.isBlank! ||
websiteLinkController.text.isBlank! ||
locationController.text.isBlank! ||
bioController.text.isBlank!) {
Get.snackbar(
'Error',
'Enter your credentials',
snackPosition: SnackPosition.BOTTOM,
backgroundColor: Colors.red,
colorText: Colors.white,
);
} else if (profilePicture == "") {
utils.showToast('Upload edit profile picture!');
} else {
updata = FormData.fromMap({
"business_name": busNameController.text,
"business_username": busUserNameController.text,
"business_owner_name": ownerNameController.text,
"founded_on": foundedonController.text,
"website_link": websiteLinkController.text,
"business_location": locationController.text,
"bio": bioController.text,
"business_profile": await convertFileToMultiPart(profilePicture),
});
final data = await EditProfileApi().postEditProfileBusiness(updata);
if (data.status == ResponseStatus.SUCCESS) {
// await global.setname();
// Get.snackbar(
// "Success!",
// 'success!',
// duration: Duration(seconds: 2),
// colorText: Colors.white,
// backgroundColor: Colors.green,
// margin: EdgeInsets.all(8),
// snackStyle: SnackStyle.FLOATING,
// snackPosition: SnackPosition.BOTTOM,
// );
utils.showToast("Data Saved Successfully");
// Get.back();
Get.toNamed(RouteName.profiletab);
// Get.back(result: true);
} else {
// btnController.reset();
Get.snackbar(
"Error!",
data.data['message'],
duration: Duration(seconds: 2),
colorText: Colors.white,
backgroundColor: Colors.red,
margin: EdgeInsets.all(8),
snackStyle: SnackStyle.FLOATING,
snackPosition: SnackPosition.BOTTOM,
);
// _controller.isTextFieldEnabled.value = true;
}
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
// key: _scaffoldKey1,
backgroundColor: Color(0xFF222935),
extendBody: true,
appBar: CommonAppbar(
titleTxt: "",
),
body: FutureBuilder(
future: myfuture,
builder: (ctx, snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) {
return 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),
// filePath[0]!,
fit: BoxFit.cover,
width: double.infinity,
),
),
)
: getEditProfileBus!.data!.businessLogo !=
null
? Container(
width: 100.w,
height: 100.h,
decoration: ShapeDecoration(
image: DecorationImage(
image: Image(
image: NetworkImage(
getEditProfileBus!.data!
.businessLogo ??
''),
).image,
fit: BoxFit.cover,
),
shape: OvalBorder(),
),
)
: CircleAvatar(
backgroundImage: AssetImage(
"assets/images/png/Ellipse 37 (1).png",
),
radius: 50.r,
),
Positioned(
bottom: 0,
right: 0,
child: InkWell(
onTap: () {
ImageUploadBottomSheet().showModal(
context,
true,
(result) {
var filenameresult =
extractFileName(result);
profilePicture = result;
isImageAdded = true;
setState(() {});
},
);
},
child: Container(
height: 35.h,
width: 35.w,
decoration: 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(30.h),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
text16400white("Business name"),
sizedBoxHeight(16.h),
CustomTextFormField(
textEditingController: busNameController,
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: "Victory gear sports emporium",
),
sizedBoxHeight(20.h),
text16400white("Business username"),
sizedBoxHeight(16.h),
CustomTextFormField(
textEditingController: busUserNameController,
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: "victorygames _10",
),
sizedBoxHeight(20.h),
text16400white("Owner name"),
sizedBoxHeight(16.h),
CustomTextFormField(
textEditingController: ownerNameController,
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: "James Bothman",
),
sizedBoxHeight(20.h),
text16400white("Founded on"),
sizedBoxHeight(16.h),
GestureDetector(
onTap: () =>
datePicker(context, foundedonController),
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:
foundedonController,
),
),
),
sizedBoxHeight(20.h),
text16400white("Website link"),
sizedBoxHeight(16.h),
CustomTextFormField(
textEditingController: websiteLinkController,
leadingIcon: Container(
width: 18.w,
height: 17.h,
child: Center(
child: Image.asset(
"assets/images/png/Vector2a.png",
width: 18.w,
height: 17.h,
),
),
),
hintText: "victorygames _10",
),
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),
text16400white("Bio"),
sizedBoxHeight(16.h),
CustomTextFormField2(
textEditingController: bioController,
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(60.h),
CommonBtn(
text: "Save",
onTap: () {
saveEditProfileBus();
},
),
sizedBoxHeight(60.h),
],
)
])))
]);
}
return Container();
}));
}
}

View File

@@ -1,525 +0,0 @@
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/ViewModel/EditProfileApi.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;
class EditProfile extends StatefulWidget {
const EditProfile({super.key});
@override
State<EditProfile> createState() => _EditProfileState();
}
class _EditProfileState extends State<EditProfile> {
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;
});
}
String _selectedsportType = '';
List<String> _selectedSports = [];
void _onSportSelected(List<String> selectedValues) {
setState(() {
_selectedSports = selectedValues;
_selectedsportType = _selectedSports.join(', ');
});
}
List<int> getSelectedSportsIds() {
if (getEditProfileIndi == null ||
getEditProfileIndi!.data!.interest == null) {
return [];
}
return _selectedSports
.map((sportName) => getEditProfileIndi!.data!.interest!
.firstWhere((interest) => interest.name == sportName)
.id!)
.toList();
}
@override
void initState() {
// TODO: implement initState
myfuture = EditProfileApi()
.getEditProfileIndividual()
.then((value) => {setValues()});
super.initState();
}
setValues() {
if (isOnce) {
fullNameController.text = getEditProfileIndi!.data!.fullName ?? '';
userNameController.text = getEditProfileIndi!.data!.userName ?? '';
dateController.text = getEditProfileIndi!.data!.dateOfBirth ?? '';
_selectedgenderType = getEditProfileIndi!.data!.gender ?? '';
_selectedSports =
getEditProfileIndi!.data!.interest!.map((e) => e.name!).toList();
_selectedsportType = _selectedSports.join(', ');
isOnce = false;
setState(() {});
}
}
void saveEditProfileInd() async {
List<int> selectedSportsIds = getSelectedSportsIds();
FormData? updata;
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',
'Enter your credentials',
snackPosition: SnackPosition.BOTTOM,
backgroundColor: Colors.red,
colorText: Colors.white,
);
} else if (profilePicture == "") {
utils.showToast('Upload edit profile picture!');
} else {
updata = FormData.fromMap({
"email_address": "priyanka12@yopmail.com",
"full_name": fullNameController.text,
"profile_image": await convertFileToMultiPart1(profilePicture),
// "profile_image": "ghjkk.png",
"user_name": userNameController.text,
"date_of_birth": dateController.text,
"gender": _selectedgenderType,
// "interest": "selectedSportsIds",
"interest": ["1", "2", "3"].toList(),
"about": aboutController.text,
"position": positionController.text,
"training_scores": trainingScoresController.text,
"height": heightController.text,
"weight": weightController.text,
"batting_average": battingAvgController.text,
"address_line1": battingAvgController.text,
});
final data = await EditProfileApi().postEditProfileIndividual(updata);
if (data.status == ResponseStatus.SUCCESS) {
// await global.setname();
Get.snackbar(
"Success!",
'success!',
duration: Duration(seconds: 2),
colorText: Colors.white,
backgroundColor: Colors.green,
margin: EdgeInsets.all(8),
snackStyle: SnackStyle.FLOATING,
snackPosition: SnackPosition.BOTTOM,
);
Get.back();
// Get.toNamed(RouteName.individualgroupstep3);
Get.back();
} else {
// btnController.reset();
Get.snackbar(
"Error!",
data.data['message'],
duration: Duration(seconds: 2),
colorText: Colors.white,
backgroundColor: Colors.red,
margin: EdgeInsets.all(8),
snackStyle: SnackStyle.FLOATING,
snackPosition: SnackPosition.BOTTOM,
);
// _controller.isTextFieldEnabled.value = true;
}
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
// key: _scaffoldKey1,
backgroundColor: Color(0xFF222935),
extendBody: true,
appBar: CommonAppbar(
titleTxt: "",
),
body: FutureBuilder(
future: myfuture,
builder: (ctx, snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) {
return 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),
// filePath[0]!,
fit: BoxFit.cover,
width: double.infinity,
),
),
)
: CircleAvatar(
backgroundImage: 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: 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(
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();
}));
}
}

View File

@@ -1,83 +0,0 @@
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:shared_preferences/shared_preferences.dart';
GetEditProfileIndi? getEditProfileIndi;
GetEditProfileBus? getEditProfileBus;
class EditProfileApi {
EditProfileApi();
Future<ResponseData<dynamic>> postEditProfileIndividual(var data) async {
SharedPreferences prefs = await SharedPreferences.getInstance();
final response =
await NetworkApiServices().postApi(data, ApiUrls.posteditprofile);
if (response.status == ResponseStatus.SUCCESS) {
if (response.data['status'] == 'success') {
} else {
return ResponseData<dynamic>(
response.data['message'], ResponseStatus.FAILED);
}
}
return response;
}
Future<ResponseData<dynamic>> getEditProfileIndividual() async {
final response = await NetworkApiServices().getApi(
ApiUrls.geteditprofile,
);
getEditProfileIndi = GetEditProfileIndi.fromJson(response.data);
if (response.status == ResponseStatus.SUCCESS) {
if (response.data["status"] == "success") {
print("Success---->");
return ResponseData<dynamic>(
response.data['message'], ResponseStatus.SUCCESS,
data: response.data);
} else {
return ResponseData<dynamic>(
response.data['message'], ResponseStatus.FAILED);
}
}
return response;
}
Future<ResponseData<dynamic>> postEditProfileBusiness(var data) async {
SharedPreferences prefs = await SharedPreferences.getInstance();
final response = await NetworkApiServices()
.postApi(data, ApiUrls.posteditprofilebusiness);
if (response.status == ResponseStatus.SUCCESS) {
if (response.data['status'] == 'success') {
} else {
return ResponseData<dynamic>(
response.data['message'], ResponseStatus.FAILED);
}
}
return response;
}
Future<ResponseData<dynamic>> getEditProfileBusiness() async {
final response = await NetworkApiServices().getApi(
ApiUrls.geteditprofilebusiness,
);
getEditProfileBus = GetEditProfileBus.fromJson(response.data);
if (response.status == ResponseStatus.SUCCESS) {
if (response.data["status"] == "success") {
print("Success---->");
return ResponseData<dynamic>(
response.data['message'], ResponseStatus.SUCCESS,
data: response.data);
} else {
return ResponseData<dynamic>(
response.data['message'], ResponseStatus.FAILED);
}
}
return response;
}
}

View File

@@ -1,19 +1,11 @@
import 'dart:async';
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/Common/base_manager.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/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';
import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart';
class Followers extends StatefulWidget {
const Followers({super.key});
@@ -23,59 +15,43 @@ class Followers extends StatefulWidget {
}
class _FollowersState extends State<Followers> {
StreamController<FollowersModel> searchcontroller = StreamController();
@override
void initState() {
// TODO: implement initState
var updata = "";
Profilegetmethod().getFollowers(updata, streamController: searchcontroller);
super.initState();
}
@override
void dispose() {
searchcontroller.close();
super.dispose();
}
int? blockid;
int? removeid;
RemoveUploadata() async {
utils.loader();
Map<String, dynamic> updata = {
"iam_principal_xid": removeid,
};
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);
}
}
BlockUploadata() async {
utils.loader();
Map<String, dynamic> updata = {
"blocked_iam_principal_xid": blockid,
};
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);
}
}
List followersData = [
{
"imagePath": "assets/images/png/Ellipse 52.png",
"title": "Ryan Dorwart",
"subtitle": "Lorem ipsum dummy text",
},
{
"imagePath": "assets/images/png/Ellipse 48.png",
"title": "Ahmad Rhiel Madsen",
"subtitle": "Lorem ipsum dummy text",
},
{
"imagePath": "assets/images/png/Ellipse 43.png",
"title": "Kaylynn Vaccaro",
"subtitle": "Lorem ipsum dummy text",
},
{
"imagePath": "assets/images/png/img2.png",
"title": "Kianna Donin",
"subtitle": "Lorem ipsum dummy text",
},
{
"imagePath": "assets/images/png/img2.png",
"title": "Maria Herwitz",
"subtitle": "Lorem ipsum dummy text",
},
{
"imagePath": "assets/images/png/Ellipse 43.png",
"title": "Ahmad Rhiel Madsen",
"subtitle": "Lorem ipsum dummy text",
},
{
"imagePath": "assets/images/png/Ellipse 48.png",
"title": "Kaylynn Vaccaro",
"subtitle": "Lorem ipsum dummy text",
},
];
@override
Widget build(BuildContext context) {
@@ -88,14 +64,13 @@ class _FollowersState extends State<Followers> {
),
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: [
Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
Padding(
padding: EdgeInsets.symmetric(horizontal: 16.w),
@@ -111,283 +86,125 @@ class _FollowersState extends State<Followers> {
),
),
),
texttype: TextInputType.text,
inputFormatters: [
RemoveEmojiInputFormatter(),
],
onInput: (value) {
Profilegetmethod().getFollowers(value,
streamController: searchcontroller);
},
hintText: "Search people",
),
),
sizedBoxHeight(25.h),
StreamBuilder<FollowersModel>(
stream: searchcontroller.stream,
builder: (ctx, snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) {
// Display shimmer effect while waiting for data
return Center(child: CircularProgressIndicator());
} else if (snapshot.hasError) {
// Handle error state
return Center(
child: Text(
'${snapshot.error} occurred',
style: TextStyle(fontSize: 18),
),
);
} else {
// Data has been loaded, show actual UI
return followersobj!.data!.isEmpty
? _buildNoDataBody(context)
:
// ListView.builder(
// shrinkWrap: true,
// itemCount: followersobj!.data!.length,
// itemBuilder: (context, index) {
// return Column(
// children: [
// followerWidget(
// imagePath: followersobj?.data?[index]
// .follower?.profilePhoto ??
// "",
// // followersData[index]["imagePath"],
// title: followersobj?.data?[index].follower
// ?.fullName ??
// "",
// // followersData[index]["title"],
// subtitle: followersobj?.data?[index]
// .follower?.userName ??
// "",
// blockonTap: () {
// BlockUploadata(followersobj!
// .data![index].follower!.id);
// }
// // followersData[index]["subtitle"]
// ),
// if (index != followersobj!.data!.length - 1)
// commonDivider(),
// ],
// );
// },
// );
ListView.separated(
physics: ScrollPhysics(),
shrinkWrap: true,
itemCount: followersobj!.data!.length,
separatorBuilder:
(BuildContext context, int index) {
return commonDivider();
},
itemBuilder: (context, index) {
return Column(
children: [
Padding(
padding: EdgeInsets.symmetric(
vertical: 16.h, horizontal: 16.w),
child: Row(
children: [
followersobj!.data![index].follower!
.profilePhoto ==
null ||
followersobj!
.data![index]
.follower!
.profilePhoto!
.isEmpty
? CircleAvatar(
backgroundImage: AssetImage(
'assets/images/png/Ellipse 43.png'),
radius: 25.r,
)
: CircleAvatar(
backgroundImage: NetworkImage(
followersobj!
.data![index]
.follower!
.profilePhoto!),
radius: 25.r,
),
sizedBoxWidth(10.w),
Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
followersobj!.data![index].follower!
.fullName ==
null ||
followersobj!
.data![index]
.follower!
.fullName!
.isEmpty ==
true
? text16w400_FCFCFC("Regroup")
: text16w400_FCFCFC(
followersobj!.data![index]
.follower!.fullName!),
sizedBoxHeight(4.h),
followersobj!.data![index].follower!
.userName ==
null ||
followersobj!
.data![index]
.follower!
.userName!
.isEmpty ==
true
? text12w400_FCFCFC_blur(
"regroup")
: text12w400_FCFCFC_blur(
followersobj!.data![index]
.follower!.userName!)
],
),
Spacer(),
PopupMenuButton(
surfaceTintColor: Color(0xFF222935),
constraints:
BoxConstraints.tightFor(
width: 176.w),
offset: Offset(0, 20),
color: Color(0xFF222935),
tooltip: "",
itemBuilder: (BuildContext
context) =>
<PopupMenuEntry>[
PopupMenuItem(
// onTap: () {},
onTap: () async {
setState(() {
removeid = followersobj!
.data![index]
.follower!
.id ??
0;
followersobj!.data!
.removeWhere((item) =>
item.follower!
.id ==
removeid);
RemoveUploadata();
});
},
child: Padding(
padding:
EdgeInsets.symmetric(
horizontal: 12.w),
child: Row(
children: [
text14400white(
"Remove user"),
Spacer(),
Image.asset(
"assets/images/png/fluent_delete-28-regular.png",
height: 15.h,
width: 15.w,
)
],
),
),
),
PopupMenuDivider(),
PopupMenuItem(
onTap: () {},
child: Padding(
padding:
EdgeInsets.symmetric(
horizontal: 12.w),
child: Row(
children: [
text14400white(
"Message user"),
Spacer(),
Image.asset(
"assets/images/png/fluent_chat-20-regular.png",
height: 20.h,
width: 20.w,
)
],
),
),
),
PopupMenuDivider(),
PopupMenuItem(
onTap: () async {
setState(() {
blockid = followersobj!
.data![index]
.follower!
.id ??
0;
followersobj!.data!
.removeWhere((item) =>
item.follower!
.id ==
blockid);
BlockUploadata();
});
},
child: Padding(
padding:
EdgeInsets.symmetric(
horizontal: 12.w),
child: Row(
children: [
text14400white(
"Block user"),
Spacer(),
Image.asset(
"assets/images/png/blockchat.png",
height: 25.h,
width: 25.w,
)
],
),
),
),
],
child: Container(
height: 20,
width: 20,
child: Center(
child: Image.asset(
"assets/images/png/Group 1000004071.png",
height: 22.h,
width: 4.w,
),
),
)),
],
),
)
],
);
},
);
}
ListView.builder(
shrinkWrap: true,
itemCount: followersData.length,
itemBuilder: (context, index) {
return Column(
children: [
followerWidget(
imagePath: followersData[index]["imagePath"],
title: followersData[index]["title"],
subtitle: followersData[index]["subtitle"]),
if (index != followersData.length - 1) commonDivider(),
],
);
},
),
)
])
]))
]));
}
Widget _buildNoDataBody(context) {
return Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
Widget followerWidget({
required String imagePath,
required String title,
required String subtitle,
}) {
return Padding(
padding: EdgeInsets.symmetric(vertical: 16.h, horizontal: 16.w),
child: Row(
children: [
Text(
"No Data Found",
style: TextStyle(
color: Colors.white,
fontSize: 16.sp,
fontWeight: FontWeight.w600),
)
CircleAvatar(
backgroundImage: AssetImage(imagePath),
radius: 25.r,
),
sizedBoxWidth(10.w),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
text16w400_FCFCFC(title),
sizedBoxHeight(4.h),
text12w400_FCFCFC_blur(subtitle)
],
),
Spacer(),
PopupMenuButton(
surfaceTintColor: Color(0xFF222935),
constraints: BoxConstraints.tightFor(width: 176.w),
offset: Offset(0, 20),
color: Color(0xFF222935),
tooltip: "",
itemBuilder: (BuildContext context) => <PopupMenuEntry>[
PopupMenuItem(
onTap: () {},
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 12.w),
child: Row(
children: [
text14400white("Remove user"),
Spacer(),
Image.asset(
"assets/images/png/fluent_delete-28-regular.png",
height: 15.h,
width: 15.w,
)
],
),
),
),
PopupMenuDivider(),
PopupMenuItem(
onTap: () {},
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 12.w),
child: Row(
children: [
text14400white("Message user"),
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: [
text14400white("Block user"),
Spacer(),
Image.asset(
"assets/images/png/f7_pin-fill (2).png",
height: 25.h,
width: 25.w,
)
],
),
),
),
],
child: Container(
height: 20,
width: 20,
child: Center(
child: Image.asset(
"assets/images/png/Group 1000004071.png",
height: 22.h,
width: 4.w,
),
),
)),
],
),
);

View File

@@ -1,19 +1,11 @@
import 'dart:async';
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/Common/base_manager.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/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';
import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart';
class Following extends StatefulWidget {
const Following({super.key});
@@ -23,45 +15,43 @@ class Following extends StatefulWidget {
}
class _FollowingState extends State<Following> {
StreamController<FollowingModel> searchcontroller = StreamController();
@override
void initState() {
// TODO: implement initState
var updata = "";
Profilegetmethod().getFollowing(updata, streamController: searchcontroller);
super.initState();
}
@override
void dispose() {
searchcontroller.close();
super.dispose();
}
Uploadata() async {
utils.loader();
Map<String, dynamic> updata = {
"following_iam_principal_xid": unfollowid,
};
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);
// });
return utils.showToast(data.message);
} else {
Get.back();
print("unfollow not done");
return utils.showToast(data.message);
}
}
int? unfollowid;
List followingData = [
{
"imagePath": "assets/images/png/Ellipse 52.png",
"title": "Ryan Dorwart",
"subtitle": "Lorem ipsum dummy text",
},
{
"imagePath": "assets/images/png/Ellipse 48.png",
"title": "Ahmad Rhiel Madsen",
"subtitle": "Lorem ipsum dummy text",
},
{
"imagePath": "assets/images/png/Ellipse 43.png",
"title": "Kaylynn Vaccaro",
"subtitle": "Lorem ipsum dummy text",
},
{
"imagePath": "assets/images/png/img2.png",
"title": "Kianna Donin",
"subtitle": "Lorem ipsum dummy text",
},
{
"imagePath": "assets/images/png/img2.png",
"title": "Maria Herwitz",
"subtitle": "Lorem ipsum dummy text",
},
{
"imagePath": "assets/images/png/Ellipse 43.png",
"title": "Ahmad Rhiel Madsen",
"subtitle": "Lorem ipsum dummy text",
},
{
"imagePath": "assets/images/png/Ellipse 48.png",
"title": "Kaylynn Vaccaro",
"subtitle": "Lorem ipsum dummy text",
},
];
@override
Widget build(BuildContext context) {
@@ -74,14 +64,13 @@ class _FollowingState extends State<Following> {
titleTxt: "Following",
),
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: [
Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
Padding(
padding: EdgeInsets.symmetric(horizontal: 16.w),
@@ -98,244 +87,106 @@ class _FollowingState extends State<Following> {
),
),
hintText: "Search people",
texttype: TextInputType.text,
inputFormatters: [
// LengthLimitingTextInputFormatter(20),
RemoveEmojiInputFormatter(),
],
onInput: (value) {
// Onboard().postGroupsearch({"search": value},
// streamController: searchcontroller);
// searchGroups(value!);
Profilegetmethod().getFollowing(value,
streamController: searchcontroller);
},
),
),
sizedBoxHeight(25.h),
StreamBuilder<FollowingModel>(
stream: searchcontroller.stream,
builder: (ctx, snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) {
// Display shimmer effect while waiting for data
return Center(child: CircularProgressIndicator());
} else if (snapshot.hasError) {
// Handle error state
return Center(
child: Text(
'${snapshot.error} occurred',
style: TextStyle(fontSize: 18),
),
);
} else {
// Data has been loaded, show actual UI
return followingobj!.data!.isEmpty
? _buildNoDataBody(context)
: ListView.separated(
physics: ScrollPhysics(),
shrinkWrap: true,
itemCount: followingobj!.data!.length,
separatorBuilder:
(BuildContext context, int index) {
return commonDivider();
},
itemBuilder: (context, index) {
return
// Column(
// children: [
// Followinglist(
// imagePath: followingobj?.data?[index]
// .following?.profilePhoto ??
// '',
// title: followingobj!
// .data?[index].following?.fullName ??
// '',
// subtitle: followingobj!
// .data?[index].following?.userName ??
// '',
// unfollowontap: (id) => Uploadata(id),
// unfollowindex: followingobj!
// .data![index].following!.id!,
// ),
// if (index != followingobj!.data!.length - 1)
// commonDivider(),
// ],
// );
Column(
children: [
Padding(
padding: EdgeInsets.symmetric(
vertical: 16.h, horizontal: 16.w),
child: Row(
children: [
followingobj!.data![index].following!
.profilePhoto ==
null ||
followingobj!
.data![index]
.following!
.profilePhoto!
.isEmpty
? CircleAvatar(
backgroundImage: AssetImage(
'assets/images/png/Ellipse 43.png'),
radius: 25.r,
)
: CircleAvatar(
backgroundImage: NetworkImage(
followingobj!
.data![index]
.following!
.profilePhoto!),
radius: 25.r,
),
sizedBoxWidth(10.w),
Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
followingobj!
.data![index]
.following!
.fullName ==
null ||
followingobj!
.data![index]
.following!
.fullName!
.isEmpty
? text16w400_FCFCFC("Regroup")
: text16w400_FCFCFC(
followingobj!.data![index]
.following!.fullName!),
sizedBoxHeight(4.h),
followingobj!
.data![index]
.following!
.userName ==
null ||
followingobj!
.data![index]
.following!
.userName!
.isEmpty
? text12w400_FCFCFC_blur(
"regroup")
: text12w400_FCFCFC_blur(
followingobj!.data![index]
.following!.userName!)
],
),
Spacer(),
PopupMenuButton(
surfaceTintColor: Color(0xFF222935),
constraints:
BoxConstraints.tightFor(
width: 176.w),
offset: Offset(0, 20),
color: Color(0xFF222935),
tooltip: "",
itemBuilder: (BuildContext
context) =>
<PopupMenuEntry>[
PopupMenuItem(
onTap: () async {
setState(() {
unfollowid =
followingobj!
.data![
index]
.following!
.id ??
0;
// followingobj!.data!.removeAt(index);
followingobj!.data!
.removeWhere((item) =>
item.following!
.id ==
unfollowid);
Uploadata();
});
},
child: Padding(
padding:
EdgeInsets.symmetric(
horizontal: 12.w),
child: Row(
children: [
text14400white(
"Unfollow user"),
Spacer(),
Image.asset(
"assets/images/png/Black1323e.png",
height: 20.h,
width: 20.w,
)
],
),
),
),
PopupMenuDivider(),
PopupMenuItem(
onTap: () {},
child: Padding(
padding:
EdgeInsets.symmetric(
horizontal: 12.w),
child: Row(
children: [
text14400white(
"Message user"),
Spacer(),
Image.asset(
"assets/images/png/fluent_chat-20-22.png",
height: 20.h,
width: 20.w,
)
],
),
),
),
],
child: Container(
height: 20,
width: 20,
child: Center(
child: Image.asset(
"assets/images/png/Group 1000004071.png",
height: 22.h,
width: 4.w,
),
),
)),
],
),
),
],
);
},
);
}
ListView.builder(
shrinkWrap: true,
itemCount: followingData.length,
itemBuilder: (context, index) {
return Column(
children: [
followingWidget(
imagePath: followingData[index]["imagePath"],
title: followingData[index]["title"],
subtitle: followingData[index]["subtitle"]),
if (index != followingData.length - 1) commonDivider(),
],
);
},
),
)
])
]))
]));
}
Widget _buildNoDataBody(context) {
return Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
Widget followingWidget({
required String imagePath,
required String title,
required String subtitle,
}) {
return Padding(
padding: EdgeInsets.symmetric(vertical: 16.h, horizontal: 16.w),
child: Row(
children: [
Text(
"No Data Found",
style: TextStyle(
color: Colors.white,
fontSize: 16.sp,
fontWeight: FontWeight.w600),
)
CircleAvatar(
backgroundImage: AssetImage(imagePath),
radius: 25.r,
),
sizedBoxWidth(10.w),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
text16w400_FCFCFC(title),
sizedBoxHeight(4.h),
text12w400_FCFCFC_blur(subtitle)
],
),
Spacer(),
PopupMenuButton(
surfaceTintColor: Color(0xFF222935),
constraints: BoxConstraints.tightFor(width: 176.w),
offset: Offset(0, 20),
color: Color(0xFF222935),
tooltip: "",
itemBuilder: (BuildContext context) => <PopupMenuEntry>[
PopupMenuItem(
onTap: () {},
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 12.w),
child: Row(
children: [
text14400white("Unfollow user"),
Spacer(),
Image.asset(
"assets/images/png/Black1323e.png",
height: 20.h,
width: 20.w,
)
],
),
),
),
PopupMenuDivider(),
PopupMenuItem(
onTap: () {},
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 12.w),
child: Row(
children: [
text14400white("Message user"),
Spacer(),
Image.asset(
"assets/images/png/fluent_chat-20-22.png",
height: 20.h,
width: 20.w,
)
],
),
),
),
],
child: Container(
height: 20,
width: 20,
child: Center(
child: Image.asset(
"assets/images/png/Group 1000004071.png",
height: 22.h,
width: 4.w,
),
),
)),
],
),
);

View File

@@ -1,813 +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/Feed%20Module/Main_Screens/ProfileTab/EditProfile/ViewModel/EditProfileApi.dart';
import 'package:regroup/Utils/Common/sized_box.dart';
import 'package:regroup/Utils/texts.dart';
import 'package:regroup/resources/routes/route_name.dart';
class profiletabBusGest extends StatefulWidget {
const profiletabBusGest({super.key});
@override
State<profiletabBusGest> createState() => _profiletabBusGestState();
}
class _profiletabBusGestState extends State<profiletabBusGest> {
@override
Widget build(BuildContext context) {
return Scaffold(
// key: _scaffoldKey1,
backgroundColor: Color(0xFF222935),
extendBody: true,
// accountTypeValue == '1' ||
body:
// FutureBuilder(
// future: businessfuture,
// builder: (ctx, snapshot) {
// if (snapshot.connectionState == ConnectionState.waiting) {
// return 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(clipBehavior: Clip.none, children: [
Container(
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/images/png/Ellipse 1496.png"),
fit: BoxFit.fill)),
),
SafeArea(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Stack(
children: [
Container(
height: 484.h,
width: double.infinity,
child: Image.asset(
"assets/images/png/Rectangle 49 (1).png",
fit: BoxFit.cover,
),
),
Positioned.fill(
child: Container(
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [
Color.fromRGBO(34, 41, 53, 0.1),
Color.fromRGBO(34, 41, 53, 0.79),
],
stops: [
0.5788,
0.8,
],
),
),
),
),
Positioned(
bottom: 0,
right: 0,
left: 0,
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 16.w),
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Column(
children: [
text20700white(
"Victory gear sports emporium"),
sizedBoxHeight(5.h),
text18w400white("@Victorygames_10"),
sizedBoxHeight(15.h),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
GestureDetector(
onTap: () {
Get.toNamed(RouteName.followers);
},
child: Column(
children: [
text16400white("254"),
sizedBoxHeight(6.h),
text12400whiteblur("Followers")
],
),
),
sizedBoxWidth(20.w),
Container(
height: 58.h,
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(
color: Colors.white,
width: 1.0,
),
boxShadow: [
BoxShadow(
color: Color(0x66000000),
offset: Offset(0, 4),
blurRadius: 4.0,
),
],
),
),
sizedBoxWidth(20.w),
GestureDetector(
onTap: () {
Get.toNamed(RouteName.following);
},
child: Column(
children: [
text16400white("344"),
sizedBoxHeight(6.h),
text12400whiteblur("Following")
],
),
),
],
),
sizedBoxHeight(20.h),
],
),
],
),
),
),
],
),
Padding(
padding: EdgeInsets.symmetric(horizontal: 16.w),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
sizedBoxHeight(30.h),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
GestureDetector(
onTap: () {
Get.toNamed(RouteName.buseditprofile);
},
child: Container(
height: 40.h,
width: 170.w,
decoration: BoxDecoration(
color: Color(0xFFD90B2E),
borderRadius: BorderRadius.circular(30.r),
),
child:
Center(child: text16w400_FCFCFC("Follow")),
),
),
GestureDetector(
onTap: () {
Get.toNamed(RouteName.shareProfile);
},
child: commonGlassUI(
width: 170.w,
height: 40.h,
opacity1: 0.05,
opacity2: 0.07,
borderRadius: BorderRadius.circular(30.r),
mainOpacity: 1,
customWidget: Center(
child: text16w400_FCFCFC("Message"),
),
// border: 1,
),
)
],
),
sizedBoxHeight(30.h),
text18w700white("About"),
sizedBoxHeight(10.h),
text14400white(
"Lorem Ipsum has been the industry's standard dummy text ever since the 1500s."),
sizedBoxHeight(25.h),
Row(
children: [
commonContainer(
width: 25.w,
height: 25.h,
opacity1: 0.26,
opacity2: 0.26,
borderwidth: 0.5,
boxShape: BoxShape.circle,
customWidget: Center(
child: Image.asset(
"assets/images/png/Frame 24.png",
height: 12.h,
width: 12.w,
)),
),
sizedBoxWidth(12.w),
text14400whiteblur("James Bothman"),
],
),
sizedBoxHeight(20.h),
Row(
children: [
commonContainer(
width: 25.w,
height: 25.h,
opacity1: 0.26,
opacity2: 0.26,
borderwidth: 0.5,
boxShape: BoxShape.circle,
customWidget: Center(
child: Image.asset(
"assets/images/png/Vector2a.png",
height: 12.h,
width: 12.w,
)),
),
sizedBoxWidth(12.w),
text14400whiteblur("www.exampledummywebsite.com"),
],
),
sizedBoxHeight(20.h),
Row(
children: [
commonContainer(
width: 25.w,
height: 25.h,
opacity1: 0.26,
opacity2: 0.26,
borderwidth: 0.5,
boxShape: BoxShape.circle,
customWidget: Center(
child: Image.asset(
"assets/images/png/Group 58645.png",
height: 12.h,
width: 12.w,
)),
),
sizedBoxWidth(12.w),
text14400whiteblur(
"Elm street london, United Kingdom"),
],
),
sizedBoxHeight(20.h),
Row(
children: [
commonContainer(
width: 25.w,
height: 25.h,
opacity1: 0.26,
opacity2: 0.26,
borderwidth: 0.5,
boxShape: BoxShape.circle,
customWidget: Center(
child: Image.asset(
"assets/images/png/calender.png",
height: 12.h,
width: 12.w,
)),
),
sizedBoxWidth(12.w),
// text14400whiteblur(getEditProfileIndi!
// .data!.interest!
// .join(', ')),
text14400whiteblur("Founded at : 2010"),
],
),
sizedBoxHeight(30.h),
],
),
),
sizedBoxHeight(30.h),
Padding(
padding: EdgeInsets.only(left: 16.w),
child: text18w700white("Posts"),
),
normalcardtile(
profileImg: 'assets/images/png/Ellipse 48.png',
title: 'Jocelyn Dokidis',
mainImg: 'assets/images/png/Rectangle 46.png',
containerTitle: [
'Race',
'Swimming',
'Events',
'Marathon',
'Events'
]),
sizedBoxHeight(120.h),
],
),
),
),
Positioned.fill(
top: 40.h,
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 16.w),
child: Column(
children: [
sizedBoxHeight(20.h),
Row(
children: [
Spacer(),
commonContainer(
width: 40.w,
height: 40.h,
borderwidth: 0.5,
boxShape: BoxShape.circle,
opacity1: 0.5,
opacity2: 0.6,
customWidget: PopupMenuButton(
surfaceTintColor: const Color(0xFF222935),
constraints: BoxConstraints.tightFor(width: 200.w),
offset: const Offset(0, 50),
color: const Color(0xFF222935),
tooltip: "",
itemBuilder: (BuildContext context) =>
<PopupMenuEntry>[
PopupMenuItem(
onTap: () {
Get.toNamed(RouteName.shareProfile);
},
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 12.w),
child: Row(
children: [
Text(
'Share profile',
style: TextStyle(
fontSize: 16.sp,
color: Colors.white,
fontWeight: FontWeight.w800,
fontFamily: "Nunito Sans",
),
),
const Spacer(),
Image.asset(
"assets/images/png/share.png",
height: 17.h,
width: 17.w,
)
],
),
),
),
const PopupMenuDivider(),
PopupMenuItem(
onTap: () {},
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 12.w),
child: Row(
children: [
Text(
'Report user',
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: 20.h,
width: 20.w,
)
],
),
),
),
const PopupMenuDivider(),
PopupMenuItem(
onTap: () {},
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 12.w),
child: Row(
children: [
Text(
'Block user',
style: TextStyle(
fontSize: 16.sp,
color: Colors.white,
fontWeight: FontWeight.w800,
fontFamily: "Nunito Sans",
),
),
const Spacer(),
Image.asset(
"assets/images/png/blocked.png",
height: 18.h,
width: 18.w,
)
],
),
),
),
],
child: Center(
child: Image.asset(
'assets/images/png/Group 1000004071.png',
height: 20.h,
width: 20.w,
)),
),
),
],
),
],
),
),
),
]));
}
}
Widget normalcardtile({
required String profileImg,
required String title,
required String mainImg,
required List<String> 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) => <PopupMenuEntry>[
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(),
commonContainer(
width: 30.w,
height: 30.h,
opacity1: 0.2,
opacity2: 0.2,
borderwidth: 0.43,
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,
opacity1: 0.2,
opacity2: 0.2,
borderwidth: 0.43,
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(30.h),
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Obx(() {
return ReactionButton<String>(
onReactionChanged: (reaction) {
updateImage(reaction?.value ?? 'like');
debugPrint('Selected value: ${reaction?.value}');
},
reactions: <Reaction<String>?>[
Reaction<String>(
value: 'like',
previewIcon: _buildReactionsPreviewIcon(
'assets/images/png/f7_hand-thumbsup.png'),
icon: _buildReactionsIcon(
'assets/images/png/f7_hand-thumbsup.png'),
),
Reaction<String>(
value: 'heart',
previewIcon: _buildReactionsPreviewIcon(
'assets/images/png/heart 2.png'),
icon: _buildReactionsIcon(
'assets/images/png/heart 2.png'),
),
Reaction<String>(
value: 'party',
previewIcon: _buildReactionsPreviewIcon(
'assets/images/png/party-popper 2.png'),
icon: _buildReactionsIcon(
'assets/images/png/party-popper 2.png'),
),
],
selectedReaction: Reaction<String>(
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 commonContainer(
width: 100.w,
height: 30.h,
borderRadius: BorderRadius.circular(30.r),
borderColor: Color(0xFFD90B2E),
borderwidth: 0.9,
customWidget: Padding(
padding: EdgeInsets.symmetric(horizontal: 10.w),
child: Center(child: text14w400_FCFCFC(text)),
));
}

View File

@@ -1,53 +0,0 @@
class FaqModel {
String? status;
int? statusCode;
String? message;
List<Data>? data;
FaqModel({this.status, this.statusCode, this.message, this.data});
FaqModel.fromJson(Map<String, dynamic> json) {
status = json['status'];
statusCode = json['status_code'];
message = json['message'];
if (json['data'] != null) {
data = <Data>[];
json['data'].forEach((v) {
data!.add(new Data.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
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? question;
String? answer;
Data({this.id, this.question, this.answer});
Data.fromJson(Map<String, dynamic> json) {
id = json['id'];
question = json['question'];
answer = json['answer'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['question'] = this.question;
data['answer'] = this.answer;
return data;
}
}

View File

@@ -1,82 +0,0 @@
class FollowersModel {
String? status;
int? statusCode;
String? message;
List<Data>? data;
FollowersModel({this.status, this.statusCode, this.message, this.data});
FollowersModel.fromJson(Map<String, dynamic> json) {
status = json['status'];
statusCode = json['status_code'];
message = json['message'];
if (json['data'] != null) {
data = <Data>[];
json['data'].forEach((v) {
data!.add(new Data.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
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? followingIamPrincipalXid;
int? iamPrincipalXid;
Follower? follower;
Data({this.followingIamPrincipalXid, this.iamPrincipalXid, this.follower});
Data.fromJson(Map<String, dynamic> json) {
followingIamPrincipalXid = json['following_iam_principal_xid'];
iamPrincipalXid = json['iam_principal_xid'];
follower = json['follower'] != null
? new Follower.fromJson(json['follower'])
: null;
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['following_iam_principal_xid'] = this.followingIamPrincipalXid;
data['iam_principal_xid'] = this.iamPrincipalXid;
if (this.follower != null) {
data['follower'] = this.follower!.toJson();
}
return data;
}
}
class Follower {
int? id;
String? userName;
String? fullName;
String? profilePhoto;
Follower({this.id, this.userName, this.fullName, this.profilePhoto});
Follower.fromJson(Map<String, dynamic> json) {
id = json['id'];
userName = json['user_name'];
fullName = json['full_name'];
profilePhoto = json['profile_photo'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['user_name'] = this.userName;
data['full_name'] = this.fullName;
data['profile_photo'] = this.profilePhoto;
return data;
}
}

View File

@@ -1,82 +0,0 @@
class FollowingModel {
String? status;
int? statusCode;
String? message;
List<Data>? data;
FollowingModel({this.status, this.statusCode, this.message, this.data});
FollowingModel.fromJson(Map<String, dynamic> json) {
status = json['status'];
statusCode = json['status_code'];
message = json['message'];
if (json['data'] != null) {
data = <Data>[];
json['data'].forEach((v) {
data!.add(new Data.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
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? followingIamPrincipalXid;
int? iamPrincipalXid;
Following? following;
Data({this.followingIamPrincipalXid, this.iamPrincipalXid, this.following});
Data.fromJson(Map<String, dynamic> json) {
followingIamPrincipalXid = json['following_iam_principal_xid'];
iamPrincipalXid = json['iam_principal_xid'];
following = json['following'] != null
? new Following.fromJson(json['following'])
: null;
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['following_iam_principal_xid'] = this.followingIamPrincipalXid;
data['iam_principal_xid'] = this.iamPrincipalXid;
if (this.following != null) {
data['following'] = this.following!.toJson();
}
return data;
}
}
class Following {
int? id;
String? userName;
String? fullName;
String? profilePhoto;
Following({this.id, this.userName, this.fullName, this.profilePhoto});
Following.fromJson(Map<String, dynamic> json) {
id = json['id'];
userName = json['user_name'];
fullName = json['full_name'];
profilePhoto = json['profile_photo'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['user_name'] = this.userName;
data['full_name'] = this.fullName;
data['profile_photo'] = this.profilePhoto;
return data;
}
}

View File

@@ -1,45 +0,0 @@
class PrivacypolicyModel {
String? status;
int? statusCode;
String? message;
Data? data;
PrivacypolicyModel({this.status, this.statusCode, this.message, this.data});
PrivacypolicyModel.fromJson(Map<String, dynamic> json) {
status = json['status'];
statusCode = json['status_code'];
message = json['message'];
data = json['data'] != null ? new Data.fromJson(json['data']) : null;
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
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 {
int? id;
String? content;
Data({this.id, this.content});
Data.fromJson(Map<String, dynamic> json) {
id = json['id'];
content = json['content'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['content'] = this.content;
return data;
}
}

View File

@@ -1,45 +0,0 @@
class TermsConditionsModel {
String? status;
int? statusCode;
String? message;
Data? data;
TermsConditionsModel({this.status, this.statusCode, this.message, this.data});
TermsConditionsModel.fromJson(Map<String, dynamic> json) {
status = json['status'];
statusCode = json['status_code'];
message = json['message'];
data = json['data'] != null ? new Data.fromJson(json['data']) : null;
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
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 {
int? id;
String? content;
Data({this.id, this.content});
Data.fromJson(Map<String, dynamic> json) {
id = json['id'];
content = json['content'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['content'] = this.content;
return data;
}
}

View File

@@ -1,410 +0,0 @@
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_screenutil/flutter_screenutil.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/CustomTextformfield.dart';
import 'package:regroup/Utils/Common/sized_box.dart';
import 'package:regroup/Utils/texts.dart';
class MyNetwork extends StatefulWidget {
const MyNetwork({super.key});
@override
State<MyNetwork> createState() => _MyNetworkState();
}
class _MyNetworkState extends State<MyNetwork> {
@override
Widget build(BuildContext context) {
return Scaffold(
// key: _scaffoldKey1,
resizeToAvoidBottomInset: false,
backgroundColor: Color(0xFF222935),
extendBody: true,
appBar: CommonAppbar(
titleTxt: "My networks",
),
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(16.h),
Expanded(
child: DefaultTabController(
length: 2,
// initialIndex: selectedIndex.value,
child: Column(children: [
CommonTabBar(tabs: const [
Tab(
text: 'Followers',
),
Tab(
text: 'Following',
),
]),
Expanded(
child: TabBarView(
children: [
followersTab(),
followingTab(),
],
),
),
])),
)
])
]));
}
Widget followersTab() {
List followersData = [
{
"imagePath": "assets/images/png/Ellipse 52.png",
"title": "Iron titans fitness crew",
"subtitle": "Lorem ipsum dummy text",
},
{
"imagePath": "assets/images/png/Ellipse 48.png",
"title": "Body blitz brigade",
"subtitle": "Lorem ipsum dummy text",
},
{
"imagePath": "assets/images/png/Ellipse 43.png",
"title": "Fit fusion squad",
"subtitle": "Lorem ipsum dummy text",
},
{
"imagePath": "assets/images/png/Ellipse 37.png",
"title": "Power pulse posse",
"subtitle": "Lorem ipsum dummy text",
},
{
"imagePath": "assets/images/png/Ellipse 52.png",
"title": "Iron titans fitness crew",
"subtitle": "Lorem ipsum dummy text",
},
{
"imagePath": "assets/images/png/Ellipse 48.png",
"title": "Body blitz brigade",
"subtitle": "Lorem ipsum dummy text",
},
];
return Column(
children: [
sizedBoxHeight(25.h),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: 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 people",
),
),
ListView.separated(
physics: ScrollPhysics(),
shrinkWrap: true,
itemCount: followersData.length,
separatorBuilder: (BuildContext context, int index) {
return commonDivider();
},
itemBuilder: (context, index) {
return Column(
children: [
Padding(
padding:
EdgeInsets.symmetric(vertical: 16.h, horizontal: 16.w),
child: Row(
children: [
CircleAvatar(
backgroundImage:
AssetImage(followersData[index]["imagePath"]),
radius: 25.r,
),
sizedBoxWidth(10.w),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
text16w400_FCFCFC(followersData[index]["title"]),
sizedBoxHeight(4.h),
text12w400_FCFCFC_blur(
followersData[index]["subtitle"])
],
),
Spacer(),
PopupMenuButton(
surfaceTintColor: Color(0xFF222935),
constraints: BoxConstraints.tightFor(width: 176.w),
offset: Offset(0, 20),
color: Color(0xFF222935),
tooltip: "",
itemBuilder: (BuildContext context) =>
<PopupMenuEntry>[
PopupMenuItem(
// onTap: () {},
onTap: () async {},
child: Padding(
padding:
EdgeInsets.symmetric(horizontal: 12.w),
child: Row(
children: [
text14400white("Remove user"),
Spacer(),
Image.asset(
"assets/images/png/fluent_delete-28-regular.png",
height: 15.h,
width: 15.w,
)
],
),
),
),
PopupMenuDivider(),
PopupMenuItem(
onTap: () {},
child: Padding(
padding:
EdgeInsets.symmetric(horizontal: 12.w),
child: Row(
children: [
text14400white("Message user"),
Spacer(),
Image.asset(
"assets/images/png/fluent_chat-20-regular.png",
height: 20.h,
width: 20.w,
)
],
),
),
),
PopupMenuDivider(),
PopupMenuItem(
onTap: () async {},
child: Padding(
padding:
EdgeInsets.symmetric(horizontal: 12.w),
child: Row(
children: [
text14400white("Block user"),
Spacer(),
Image.asset(
"assets/images/png/blockchat.png",
height: 25.h,
width: 25.w,
)
],
),
),
),
],
child: Container(
height: 20,
width: 20,
child: Center(
child: Image.asset(
"assets/images/png/Group 1000004071.png",
height: 22.h,
width: 4.w,
),
),
)),
],
),
)
],
);
},
),
],
);
}
Widget followingTab() {
List followingData = [
{
"imagePath": "assets/images/png/Ellipse 52.png",
"title": "Iron titans fitness crew",
"subtitle": "Lorem ipsum dummy text",
},
{
"imagePath": "assets/images/png/Ellipse 48.png",
"title": "Body blitz brigade",
"subtitle": "Lorem ipsum dummy text",
},
{
"imagePath": "assets/images/png/Ellipse 43.png",
"title": "Fit fusion squad",
"subtitle": "Lorem ipsum dummy text",
},
{
"imagePath": "assets/images/png/Ellipse 37.png",
"title": "Power pulse posse",
"subtitle": "Lorem ipsum dummy text",
},
{
"imagePath": "assets/images/png/Ellipse 52.png",
"title": "Iron titans fitness crew",
"subtitle": "Lorem ipsum dummy text",
},
{
"imagePath": "assets/images/png/Ellipse 48.png",
"title": "Body blitz brigade",
"subtitle": "Lorem ipsum dummy text",
},
];
return Column(
children: [
sizedBoxHeight(25.h),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: 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 people",
),
),
ListView.separated(
physics: ScrollPhysics(),
shrinkWrap: true,
itemCount: followingData.length,
separatorBuilder: (BuildContext context, int index) {
return commonDivider();
},
itemBuilder: (context, index) {
return Column(
children: [
Padding(
padding:
EdgeInsets.symmetric(vertical: 16.h, horizontal: 16.w),
child: Row(
children: [
CircleAvatar(
backgroundImage:
AssetImage(followingData[index]["imagePath"]),
radius: 25.r,
),
sizedBoxWidth(10.w),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
text16w400_FCFCFC(followingData[index]["title"]),
sizedBoxHeight(4.h),
text12w400_FCFCFC_blur(
followingData[index]["subtitle"])
],
),
Spacer(),
PopupMenuButton(
surfaceTintColor: Color(0xFF222935),
constraints: BoxConstraints.tightFor(width: 176.w),
offset: Offset(0, 20),
color: Color(0xFF222935),
tooltip: "",
itemBuilder: (BuildContext context) =>
<PopupMenuEntry>[
PopupMenuItem(
// onTap: () {},
onTap: () async {},
child: Padding(
padding:
EdgeInsets.symmetric(horizontal: 12.w),
child: Row(
children: [
text14400white("Remove user"),
Spacer(),
Image.asset(
"assets/images/png/fluent_delete-28-regular.png",
height: 15.h,
width: 15.w,
)
],
),
),
),
PopupMenuDivider(),
PopupMenuItem(
onTap: () {},
child: Padding(
padding:
EdgeInsets.symmetric(horizontal: 12.w),
child: Row(
children: [
text14400white("Message user"),
Spacer(),
Image.asset(
"assets/images/png/fluent_chat-20-regular.png",
height: 20.h,
width: 20.w,
)
],
),
),
),
PopupMenuDivider(),
PopupMenuItem(
onTap: () async {},
child: Padding(
padding:
EdgeInsets.symmetric(horizontal: 12.w),
child: Row(
children: [
text14400white("Block user"),
Spacer(),
Image.asset(
"assets/images/png/blockchat.png",
height: 25.h,
width: 25.w,
)
],
),
),
),
],
child: Container(
height: 20,
width: 20,
child: Center(
child: Image.asset(
"assets/images/png/Group 1000004071.png",
height: 22.h,
width: 4.w,
),
),
)),
],
),
)
],
);
},
),
],
);
}
}

View File

@@ -0,0 +1,919 @@
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/CommonBottomNavigationBar.dart';
import 'package:regroup/Common/CommonGlassmorphism.dart';
import 'package:regroup/Common/CommonWidget.dart';
import 'package:regroup/Common/controller/MainScreen.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 ProfileTab extends StatefulWidget {
const ProfileTab({super.key});
@override
State<ProfileTab> createState() => _ProfileTabState();
}
class _ProfileTabState extends State<ProfileTab> {
List cardtile = [
{
"imagePath": "assets/images/png/Rectangle 29ss.png",
"title": "Cardio crusaders circle"
},
{
"imagePath": "assets/images/png/Rectangle 31ee.png",
"title": "Strength squad syndicate"
},
{
"imagePath": "assets/images/png/Rectangle 30aa.png",
"title": "Flexibility faction force"
},
{
"imagePath": "assets/images/png/Rectangle 29ss.png",
"title": "Cardio crusaders circle"
},
];
List timeline = [
{
"imagePath": "assets/images/png/cimg1.png",
"title": "Cardio crusaders circle"
},
{
"imagePath": "assets/images/png/cimg1.png",
"title": "Cardio crusaders circle"
},
{
"imagePath": "assets/images/png/cimg1.png",
"title": "Cardio crusaders circle"
},
{
"imagePath": "assets/images/png/cimg1.png",
"title": "Cardio crusaders circle"
},
];
@override
Widget build(BuildContext context) {
return Scaffold(
// key: _scaffoldKey1,
backgroundColor: Color(0xFF222935),
extendBody: true,
body: Stack(clipBehavior: Clip.none, children: [
Container(
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/images/png/Ellipse 1496.png"),
fit: BoxFit.fill)),
),
SafeArea(
child: SingleChildScrollView(
child: Column(
children: [
Stack(
children: [
Container(
height: 484.h,
width: double.infinity,
child: Image.asset(
"assets/images/png/profileimg.png",
fit: BoxFit.cover,
),
),
Positioned.fill(
child: Container(
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [
Color.fromRGBO(34, 41, 53, 0.1),
Color.fromRGBO(34, 41, 53, 0.79),
],
stops: [
0.5788,
0.8,
],
),
),
),
),
Positioned(
bottom: 0,
right: 0,
left: 0,
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 16.w),
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Column(
children: [
text20700white("Edward Hackett"),
sizedBoxHeight(5.h),
text18w400white("@edward_01"),
sizedBoxHeight(15.h),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
GestureDetector(
onTap: () {
Get.toNamed(RouteName.followers);
},
child: Column(
children: [
text16400white("254"),
sizedBoxHeight(6.h),
text12400whiteblur("Followers")
],
),
),
sizedBoxWidth(20.w),
Container(
height: 58.h,
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(
color: Colors.white,
width: 1.0,
),
boxShadow: [
BoxShadow(
color: Color(0x66000000),
offset: Offset(0, 4),
blurRadius: 4.0,
),
],
),
),
sizedBoxWidth(20.w),
GestureDetector(
onTap: () {
Get.toNamed(RouteName.following);
},
child: Column(
children: [
text16400white("254"),
sizedBoxHeight(6.h),
text12400whiteblur("Following")
],
),
),
sizedBoxWidth(20.w),
Container(
height: 58.h,
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(
color: Colors.white,
width: 1.0,
),
boxShadow: [
BoxShadow(
color: Color(0x66000000),
offset: Offset(0, 4),
blurRadius: 4.0,
),
],
),
),
sizedBoxWidth(20.w),
GestureDetector(
onTap: () {
Get.toNamed(RouteName.clubs);
},
child: Column(
children: [
text16400white("10"),
sizedBoxHeight(6.h),
text12400whiteblur("Clubs")
],
),
),
],
),
sizedBoxHeight(20.h),
],
),
],
),
),
),
],
),
Padding(
padding: EdgeInsets.symmetric(horizontal: 16.w),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
sizedBoxHeight(30.h),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
GestureDetector(
onTap: () {
Get.toNamed(RouteName.editProfile);
},
child: Container(
height: 40.h,
width: 170.w,
decoration: BoxDecoration(
color: Color(0xFFD90B2E),
borderRadius: BorderRadius.circular(30.r),
),
child: Center(
child: text16w400_FCFCFC("Edit profile")),
),
),
GestureDetector(
onTap: () {
Get.toNamed(RouteName.shareProfile);
},
child: commonGlassUI(
width: 170.w,
height: 40.h,
opacity1: 0.05,
opacity2: 0.07,
borderRadius: BorderRadius.circular(30.r),
mainOpacity: 1,
customWidget: Center(
child: text16w400_FCFCFC("Share profile"),
),
// border: 1,
),
)
],
),
sizedBoxHeight(30.h),
text18w700white("Bio"),
sizedBoxHeight(10.h),
text14400white(
"Lorem Ipsum has been the industry's standard dummy text ever since the 1500s."),
sizedBoxHeight(25.h),
Row(
children: [
commonContainer(
width: 25.w,
height: 25.h,
opacity1: 0.26,
opacity2: 0.26,
borderwidth: 0.5,
boxShape: BoxShape.circle,
customWidget: Center(
child: Image.asset(
"assets/images/png/Group 58645.png",
height: 12.h,
width: 12.w,
)),
),
sizedBoxWidth(12.w),
text14400whiteblur(
"Elm street london, United Kingdom"),
],
),
sizedBoxHeight(20.h),
Row(
children: [
commonContainer(
width: 25.w,
height: 25.h,
opacity1: 0.26,
opacity2: 0.26,
borderwidth: 0.5,
boxShape: BoxShape.circle,
customWidget: Center(
child: Image.asset(
"assets/images/png/Vector (4).png",
height: 12.h,
width: 12.w,
)),
),
sizedBoxWidth(12.w),
text14400whiteblur("Rowing, Football, Swimming"),
],
),
sizedBoxHeight(30.h),
commonGlassUI(
width: double.infinity,
height: 135.h,
borderRadius: BorderRadius.circular(10),
customWidget: Padding(
padding: EdgeInsets.symmetric(
vertical: 12.h, horizontal: 16.w),
child: Column(
children: [
Row(
children: [
text16w700white("Badges"),
Spacer(),
GestureDetector(
onTap: () {
Get.toNamed(RouteName.badges);
},
child: text12400white("View more"))
],
),
sizedBoxHeight(8.h),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Image.asset(
"assets/images/png/Frame 1000004056.png",
height: 70.h,
width: 74.w,
),
Image.asset(
"assets/images/png/Frame 1000004056.png",
height: 70.h,
width: 74.w,
),
Image.asset(
"assets/images/png/Frame 1000004056.png",
height: 70.h,
width: 74.w,
),
Image.asset(
"assets/images/png/Frame 1000004056.png",
height: 70.h,
width: 74.w,
),
],
),
],
),
),
// border: 1
),
sizedBoxHeight(40.h),
],
),
),
SizedBox(
height: 190.h,
child: ListView.builder(
shrinkWrap: true,
scrollDirection: Axis.horizontal,
padding: EdgeInsets.only(left: 16.w),
itemCount: cardtile.length,
itemBuilder: (context, index) {
return Padding(
padding: EdgeInsets.only(right: 20.w),
child: profilecardtile(
imagePath: cardtile[index]["imagePath"],
title: cardtile[index]["title"]),
);
},
),
),
sizedBoxHeight(20.h),
Padding(
padding: EdgeInsets.symmetric(horizontal: 16.w),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
text18w700white("Timeline"),
Spacer(),
InkWell(
onTap: () {
Get.toNamed(RouteName.addtimeline);
},
child: Image.asset(
"assets/images/png/iconamoon_edit-thin.png",
height: 20.h,
width: 20.w,
),
)
],
),
sizedBoxHeight(20.h),
SizedBox(
height: 300.h,
child: ListView.builder(
shrinkWrap: true,
itemCount: timeline.length,
itemBuilder: (context, index) {
return commonTimelineCard(
imagePath: timeline[index]["imagePath"],
title: timeline[index]["title"]);
},
)),
sizedBoxHeight(30.h),
text18w700white("Posts"),
]),
),
normalcardtile(
profileImg: 'assets/images/png/Ellipse 48.png',
title: 'Jocelyn Dokidis',
mainImg: 'assets/images/png/Rectangle 46.png',
containerTitle: [
'Race',
'Swimming',
'Events',
'Marathon',
'Events'
]),
sizedBoxHeight(120.h),
],
),
),
),
Positioned.fill(
top: 40.h,
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 16.w),
child: Column(
children: [
sizedBoxHeight(20.h),
Row(
children: [
Spacer(),
InkWell(
onTap: () {
Get.toNamed(RouteName.settings);
},
child: commonContainer(
width: 40.w,
height: 40.h,
borderwidth: 0.5,
boxShape: BoxShape.circle,
opacity1: 0.5,
opacity2: 0.6,
customWidget: Center(
child: Image.asset(
'assets/images/png/setting2.png',
height: 20.h,
width: 20.w,
)),
),
),
],
),
],
),
),
),
]),
bottomNavigationBar: bottomnavigationbar(mainController),
);
}
Widget commonTimelineCard(
{required String imagePath, required String title}) {
return Row(
children: [
Container(
width: 10,
height: 170.h,
child: Stack(
clipBehavior: Clip.none,
children: [
Positioned(
top: 50.h,
child: Container(
height: 11.h,
width: 11.w,
decoration: BoxDecoration(
color: Colors.white, shape: BoxShape.circle)),
),
Positioned(
right: 3.w,
child: Container(
width: 1.w,
height: 170.h,
decoration: BoxDecoration(color: Colors.white),
),
),
],
),
),
sizedBoxWidth(20.w),
Expanded(
child: Column(
children: [
commonGlassUI(
width: double.infinity,
height: 145.h,
borderRadius: BorderRadius.circular(10.r),
customWidget: Padding(
padding: EdgeInsets.symmetric(horizontal: 16.w),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
CircleAvatar(
radius: 10.r,
backgroundImage: AssetImage(imagePath),
),
sizedBoxWidth(8.w),
text14700white(title)
],
),
sizedBoxHeight(10.h),
text12700white("Team captain"),
sizedBoxHeight(8.h),
text12400white("April 2023 - May 2024"),
sizedBoxHeight(10.h),
text10400whiteblur(
"Lorem Ipsum is simply dummy text of the printing and typesetting industry.")
],
),
),
// border: 1
),
],
),
),
],
);
}
Widget normalcardtile({
required String profileImg,
required String title,
required String mainImg,
required List<String> 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) => <PopupMenuEntry>[
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(),
commonContainer(
width: 30.w,
height: 30.h,
opacity1: 0.2,
opacity2: 0.2,
borderwidth: 0.43,
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,
opacity1: 0.2,
opacity2: 0.2,
borderwidth: 0.43,
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(30.h),
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Obx(() {
return ReactionButton<String>(
onReactionChanged: (reaction) {
updateImage(reaction?.value ?? 'like');
debugPrint('Selected value: ${reaction?.value}');
},
reactions: <Reaction<String>?>[
Reaction<String>(
value: 'like',
previewIcon: _buildReactionsPreviewIcon(
'assets/images/png/f7_hand-thumbsup.png'),
icon: _buildReactionsIcon(
'assets/images/png/f7_hand-thumbsup.png'),
),
Reaction<String>(
value: 'heart',
previewIcon: _buildReactionsPreviewIcon(
'assets/images/png/heart 2.png'),
icon: _buildReactionsIcon(
'assets/images/png/heart 2.png'),
),
Reaction<String>(
value: 'party',
previewIcon: _buildReactionsPreviewIcon(
'assets/images/png/party-popper 2.png'),
icon: _buildReactionsIcon(
'assets/images/png/party-popper 2.png'),
),
],
selectedReaction: Reaction<String>(
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 commonContainer(
width: 100.w,
height: 30.h,
borderRadius: BorderRadius.circular(30.r),
borderColor: Color(0xFFD90B2E),
borderwidth: 0.9,
customWidget: Padding(
padding: EdgeInsets.symmetric(horizontal: 10.w),
child: Center(child: text14w400_FCFCFC(text)),
));
}
Widget profilecardtile({required String imagePath, required String title}) {
return Column(
children: [
Container(
height: 109.h,
width: 100.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10.r),
),
child: Image.asset(imagePath),
),
sizedBoxHeight(10.h),
SizedBox(width: 100.w, child: text12w700_FCFCFC(title)),
],
);
}
}

View File

@@ -0,0 +1,208 @@
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/CustomTextformfield.dart';
import 'package:regroup/Utils/Common/blureffect.dart';
import 'package:regroup/Utils/Common/sized_box.dart';
import 'package:regroup/Utils/texts.dart';
class BlockedUsers extends StatefulWidget {
const BlockedUsers({super.key});
@override
State<BlockedUsers> createState() => _BlockedUsersState();
}
class _BlockedUsersState extends State<BlockedUsers> {
List blockedUserData = [
{
"imagePath": "assets/images/png/cimg1.png",
"title": "Ryan Dorwart",
"subtitle": "Lorem ipsum dummy text",
},
{
"imagePath": "assets/images/png/cimg2.png",
"title": "Ahmad Rhiel Madsen",
"subtitle": "Lorem ipsum dummy text",
},
{
"imagePath": "assets/images/png/cimg3.png",
"title": "Kaylynn Vaccaro",
"subtitle": "Lorem ipsum dummy text",
},
{
"imagePath": "assets/images/png/cimg4.png",
"title": "Kianna Donin",
"subtitle": "Lorem ipsum dummy text",
},
{
"imagePath": "assets/images/png/Ellipse 43.png",
"title": "Maria Herwitz",
"subtitle": "Lorem ipsum dummy text",
},
{
"imagePath": "assets/images/png/Ellipse 52.png",
"title": "Ahmad Rhiel Madsen",
"subtitle": "Lorem ipsum dummy text",
},
{
"imagePath": "assets/images/png/img2.png",
"title": "Kaylynn Vaccaro",
"subtitle": "Lorem ipsum dummy text",
},
];
@override
Widget build(BuildContext context) {
return Scaffold(
// key: _scaffoldKey1,
resizeToAvoidBottomInset: false,
backgroundColor: Color(0xFF222935),
extendBody: true,
appBar: CommonAppbar(
titleTxt: "Blocked users",
),
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(25.h),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: 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 people",
),
),
sizedBoxHeight(25.h),
Expanded(
child: ListView.builder(
shrinkWrap: true,
itemCount: blockedUserData.length,
itemBuilder: (context, index) {
return Column(
children: [
blockedUser(
imagePath: blockedUserData[index]["imagePath"],
title: blockedUserData[index]["title"],
subtitle: blockedUserData[index]["subtitle"]),
if (index != blockedUserData.length - 1) commonDivider(),
],
);
},
),
),
sizedBoxHeight(20.h)
])
]));
}
dialogwidget() {
Get.dialog(Dialog(
backgroundColor: Colors.transparent,
surfaceTintColor: Colors.transparent,
child: commonGlassContainer(
width: double.infinity,
height: 200.h,
borderradius: 14,
opacity1: 0.09,
opacity2: 0.13,
customWidget: Padding(
padding: EdgeInsets.symmetric(horizontal: 30.w, vertical: 30.h),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
text18w400_FCFCFC(
"Are you sure you want to unblock the user?",
textAlign: TextAlign.center),
sizedBoxHeight(30.h),
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
commonGlassContainer(
width: 110.w,
height: 40.h,
borderradius: 30.r,
opacity1: 0.05,
opacity2: 0.07,
customWidget: Center(child: text14400white("No")),
border: 1),
InkWell(
onTap: () {
Get.back();
},
child: Container(
height: 40.h,
width: 110.w,
decoration: BoxDecoration(
color: Color(0xFFD90B2E),
borderRadius: BorderRadius.circular(30.r),
),
child: Center(child: text14400white("Yes")),
),
)
],
),
],
),
),
border: 0.8)));
}
Widget blockedUser({
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: 25.r,
),
sizedBoxWidth(10.w),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
text16w400_FCFCFC(title),
sizedBoxHeight(4.h),
text12w400_FCFCFC_blur(subtitle),
],
),
Spacer(),
GestureDetector(
onTap: () {
dialogwidget();
},
child: Container(
height: 30.h,
width: 105.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(30.r),
color: Color(0xFFD90B2E)),
child: Center(child: text14w400_FCFCFC("Unblock")),
),
)
],
),
);
}
}

View File

@@ -3,13 +3,10 @@ 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/base_manager.dart';
import 'package:regroup/Feed%20Module/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';
import 'package:regroup/resources/routes/route_name.dart';
import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart';
@@ -22,164 +19,116 @@ class ChangePassword extends StatefulWidget {
}
class _ChangePasswordState extends State<ChangePassword> {
TextEditingController currentpasscontroller = TextEditingController();
TextEditingController newpasscontroller = TextEditingController();
TextEditingController repeatpasscontroller = TextEditingController();
Uploadata() async {
utils.loader();
Map<String, dynamic> updata = {
"current_password": currentpasscontroller.text,
"new_password": newpasscontroller.text,
"confirm_password": repeatpasscontroller.text,
};
final data = await Profilepostmethod().postChangepassword(updata);
if (data.status == ResponseStatus.SUCCESS) {
Get.back();
print("Change pass up done");
Get.toNamed(RouteName.verifycode,
arguments: {
"currentpass" : currentpasscontroller.text,
"newpass" : newpasscontroller.text,
"confirmpass" : repeatpasscontroller.text
}
);
return utils.showToast(data.message);
} else {
Get.back();
print("change pass not done");
return utils.showToast(data.message);
}
}
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
child: Scaffold(
resizeToAvoidBottomInset: false,
// key: _scaffoldKey1,
backgroundColor: Color(0xFF222935),
extendBody: true,
appBar: CommonAppbar(
titleTxt: "Change password",
return Scaffold(
resizeToAvoidBottomInset: false,
// key: _scaffoldKey1,
backgroundColor: Color(0xFF222935),
extendBody: true,
appBar: CommonAppbar(
titleTxt: "Change password",
),
body: Stack(children: [
Container(
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/images/png/Ellipse 1496.png"), fit: BoxFit.fill)),
),
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(25.h),
text16w400_FCFCFC("Current password"),
sizedBoxHeight(16.w),
CustomTextFormField(
isInputPassword: true,
// textEditingController: _password,
hintText: '',
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(20),
RemoveEmojiInputFormatter()
],
),
sizedBoxHeight(25.h),
text16w400_FCFCFC("New password"),
sizedBoxHeight(16.w),
CustomTextFormField(
isInputPassword: true,
// textEditingController: _password,
hintText: '',
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(20),
RemoveEmojiInputFormatter()
],
),
sizedBoxHeight(25.h),
text16w400_FCFCFC("Repeat password"),
sizedBoxHeight(16.w),
CustomTextFormField(
isInputPassword: true,
// textEditingController: _password,
hintText: '',
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(20),
RemoveEmojiInputFormatter()
],
),
sizedBoxHeight(50.h),
CommonBtn(
text: "Verify",
onTap: () {
Get.toNamed(RouteName.verifycode);
},
)
]),
),
Padding(
padding: EdgeInsets.symmetric(horizontal: 16.w),
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
sizedBoxHeight(25.h),
text16w400_FCFCFC("Current password"),
sizedBoxHeight(16.w),
CustomTextFormField(
textEditingController: currentpasscontroller,
isInputPassword: true,
// textEditingController: _password,
hintText: '',
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(25.h),
text16w400_FCFCFC("New password"),
sizedBoxHeight(16.w),
CustomTextFormField(
textEditingController: newpasscontroller,
isInputPassword: true,
// textEditingController: _password,
hintText: '',
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(25.h),
text16w400_FCFCFC("Repeat password"),
sizedBoxHeight(16.w),
CustomTextFormField(
isInputPassword: true,
textEditingController: repeatpasscontroller,
hintText: '',
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';
}
if (val != newpasscontroller.text) {
return 'Password does not match';
}
return null;
},
inputFormatters: [
LengthLimitingTextInputFormatter(50),
RemoveEmojiInputFormatter()
],
),
sizedBoxHeight(50.h),
CommonBtn(
text: "Verify",
onTap: () {
// Get.toNamed(RouteName.verifycode);
if (currentpasscontroller.text.isBlank! &&
newpasscontroller.text.isBlank! &&
repeatpasscontroller.text.isBlank!) {
utils.showToast('Please fill all fields');
} else {
Uploadata();
}
},
)
]),
),
)
])),
);
)
]));
}
}

View File

@@ -1,16 +1,12 @@
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/base_manager.dart';
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profilePostmethod.dart';
import 'package:regroup/Common/CommonButton.dart';
import 'package:regroup/Common/CommonDropDown.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';
import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart';
import '../../../../Utils/Common/CustomTextformfield.dart';
@@ -22,188 +18,91 @@ class ContactUs extends StatefulWidget {
}
class _ContactUsState extends State<ContactUs> {
final GlobalKey<FormState> _formkey = GlobalKey<FormState>();
TextEditingController fullname = TextEditingController();
TextEditingController email = TextEditingController();
TextEditingController querycontroller = TextEditingController();
String _selectedreasontocontact = '';
void _onItemSelected(String value) {
setState(() {
_selectedreasontocontact = value;
});
}
Uploadata() async {
utils.loader();
Map<String, dynamic> updata = {
"full_name": fullname.text,
"email": email.text,
"reason_to_contact": _selectedreasontocontact,
"query": querycontroller.text
};
final data = await Profilepostmethod().postContactus(updata);
if (data.status == ResponseStatus.SUCCESS) {
Get.back();
Get.back();
print("contact us done");
return utils.showToast(data.message);
} else {
Get.back();
print("contact us 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,
appBar: CommonAppbar(
titleTxt: "Contact us",
return Scaffold(
// key: _scaffoldKey1,
backgroundColor: Color(0xFF222935),
extendBody: true,
appBar: CommonAppbar(
titleTxt: "Contact us",
),
body: Stack(children: [
Container(
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/images/png/Ellipse 1496.png"), fit: BoxFit.fill)),
),
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(horizontal: 16),
child: SingleChildScrollView(
child: Form(
key: _formkey,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
sizedBoxHeight(20.h),
text16400white("Full name"),
sizedBoxHeight(16.h),
CustomTextFormField(
leadingIcon: Container(
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
sizedBoxHeight(20.h),
text16400white("Full name"),
sizedBoxHeight(16.h),
CustomTextFormField(
leadingIcon: Container(
height: 17.h,
width: 18.w,
child: Center(
child: Image.asset(
"assets/images/png/Frame 24.png",
height: 17.h,
width: 18.w,
child: Center(
child: Image.asset(
"assets/images/png/Frame 24.png",
height: 17.h,
width: 18.w,
fit: BoxFit.cover,
),
),
fit: BoxFit.cover,
),
validator: (value) {
if (value!.isEmpty) {
return 'Enter your full name ';
}
return null;
},
inputFormatters: [
// LengthLimitingTextInputFormatter(20),
RemoveEmojiInputFormatter(),
FilteringTextInputFormatter.allow(
RegExp('[a-zA-Z ]'))
],
hintText: "Enter full name",
textEditingController: fullname,
),
sizedBoxHeight(10.h),
text16400white("Email address"),
sizedBoxHeight(16.h),
CustomTextFormField(
leadingIcon: Container(
height: 17.h,
width: 18.w,
child: Center(
child: Image.asset(
"assets/images/png/Frame 12.png",
height: 17.h,
width: 18.w,
fit: BoxFit.cover,
),
),
),
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()
],
textEditingController: email,
hintText: "Enter email address",
),
sizedBoxHeight(10.h),
text16400white("Reason to contact"),
sizedBoxHeight(16.h),
CustomDropDownRadio(
header: "",
title: "",
listData: [
"Feature suggestion",
"Issues with app",
"Scoreboard",
"Feedback"
],
onItemSelected: _onItemSelected,
leadingImage: Image.asset(
"assets/images/png/fluent_person-support-20-regular.png",
),
hintText: "Edward Hackett",
),
text16400white("Email address"),
sizedBoxHeight(16.h),
CustomTextFormField(
leadingIcon: Container(
height: 17.h,
width: 18.w,
child: Center(
child: Image.asset(
"assets/images/png/Frame 12.png",
height: 17.h,
width: 18.w,
fit: BoxFit.cover,
),
),
sizedBoxHeight(25.h),
text16400white("Query"),
sizedBoxHeight(16.h),
CustomTextFormField2(
maxlines: 3,
hintText: "Enter query",
validator: (value) {
if (value!.isEmpty) {
return 'Enter your full name ';
}
return null;
},
inputFormatters: [
// LengthLimitingTextInputFormatter(20),
RemoveEmojiInputFormatter(),
FilteringTextInputFormatter.allow(
RegExp('[a-zA-Z ]'))
],
textEditingController: querycontroller,
),
CustomButton(
onPressed: () {
// final isValid =
// _formkey.currentState?.validate();
if (fullname.text.isBlank! &&
email.text.isBlank! &&
querycontroller.text.isBlank! &&
_selectedreasontocontact.isEmpty) {
utils.showToast("Please fill all fields");
} else {
Uploadata();
}
},
text: "Send")
]),
),
))
])),
);
),
hintText: "loremipsum@gmail.com",
),
text16400white("Reason to contact"),
sizedBoxHeight(16.h),
CustomDropDownRadio(
header: "",
title: "",
listData: [
"Feature suggestion",
"Issues with app",
"Scoreboard",
"Feedback"
],
onItemSelected: (p0) {},
leadingImage: Image.asset(
"assets/images/png/fluent_person-support-20-regular.png",
height: 17.h,
width: 18.w,
),
),
sizedBoxHeight(25.h),
text16400white("Query"),
sizedBoxHeight(16.h),
CustomTextFormField2(
maxlines: 3,
hintText:
"Lorem Ipsum has been the industry's standard dummy text ever since the 1500s. Lorem Ipsum has been the industry's standard",
),
CommonBtn(text: "Send")
]),
))
]));
}
}

View File

@@ -2,7 +2,6 @@ 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/Utils/Common/CommonAppbar.dart';
import 'package:regroup/Utils/Common/blureffect.dart';
import 'package:regroup/Utils/Common/sized_box.dart';
@@ -21,10 +20,7 @@ class _FaqScreenState extends State<FaqScreen> {
@override
void initState() {
// myfuture = Profilegetmethod().getfaqs().then((value) {
// isExpandedList =
// RxList.generate(faqobj!.data!.length, (index) => index == 0);
// });
isExpandedList = RxList.generate(faqcard.length, (index) => index == 0);
super.initState();
}
@@ -63,99 +59,44 @@ class _FaqScreenState extends State<FaqScreen> {
@override
Widget build(BuildContext context) {
return Scaffold(
// key: _scaffoldKey1,
backgroundColor: Color(0xFF222935),
resizeToAvoidBottomInset: false,
extendBody: true,
appBar: CommonAppbar(
titleTxt: "FAQs",
),
body: FutureBuilder(
future: Profilegetmethod().getFaqs(),
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),
),
);
}
}
isExpandedList =
RxList.generate(faqobj!.data!.length, (index) => index == 0);
return faqobj!.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 Stack(children: [
Container(
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/images/png/Ellipse 1496.png"),
fit: BoxFit.fill)),
),
Positioned.fill(
child: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: Column(children: [
sizedBoxHeight(25.h),
ListView.builder(
controller: ScrollController(),
shrinkWrap: true,
itemCount: faqobj!.data!.length,
itemBuilder: (BuildContext context, int index) {
return Obx(
() {
return customExpandableItem(
isExpanded: isExpandedList[index],
title: faqobj!.data![index].question ?? '',
content: faqobj!.data![index].answer ?? '',
toggleExpansion: () => toggleExpansion(index),
// key: _scaffoldKey1,
backgroundColor: Color(0xFF222935),
resizeToAvoidBottomInset: false,
extendBody: true,
appBar: CommonAppbar(
titleTxt: "FAQs",
),
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: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: Column(children: [
sizedBoxHeight(25.h),
ListView.builder(
controller: ScrollController(),
shrinkWrap: true,
itemCount: faqcard.length,
itemBuilder: (BuildContext context, int index) {
return Obx(
() {
return customExpandableItem(
isExpanded: isExpandedList[index],
title: faqcard[index]['title'] ?? '',
content: faqcard[index]['content'] ?? '',
toggleExpansion: () =>
toggleExpansion(index),
);
},
);
},
);
})
]))))
]);
})
]))))
]));
}
Widget customExpandableItem({

View File

@@ -1,83 +0,0 @@
class FetchBlockedUser {
String? status;
int? statusCode;
String? message;
List<Data>? data;
FetchBlockedUser({this.status, this.statusCode, this.message, this.data});
FetchBlockedUser.fromJson(Map<String, dynamic> json) {
status = json['status'];
statusCode = json['status_code'];
message = json['message'];
if (json['data'] != null) {
data = <Data>[];
json['data'].forEach((v) {
data!.add(new Data.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
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? blockedIamPrincipalXid;
int? iamPrincipalXid;
BlockedProfile? blockedProfile;
Data(
{this.blockedIamPrincipalXid, this.iamPrincipalXid, this.blockedProfile});
Data.fromJson(Map<String, dynamic> json) {
blockedIamPrincipalXid = json['blocked_iam_principal_xid'];
iamPrincipalXid = json['iam_principal_xid'];
blockedProfile = json['blocked_profile'] != null
? new BlockedProfile.fromJson(json['blocked_profile'])
: null;
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['blocked_iam_principal_xid'] = this.blockedIamPrincipalXid;
data['iam_principal_xid'] = this.iamPrincipalXid;
if (this.blockedProfile != null) {
data['blocked_profile'] = this.blockedProfile!.toJson();
}
return data;
}
}
class BlockedProfile {
int? id;
String? userName;
String? fullName;
String? profilePhoto;
BlockedProfile({this.id, this.userName, this.fullName, this.profilePhoto});
BlockedProfile.fromJson(Map<String, dynamic> json) {
id = json['id'];
userName = json['user_name'];
fullName = json['full_name'];
profilePhoto = json['profile_photo'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['user_name'] = this.userName;
data['full_name'] = this.fullName;
data['profile_photo'] = this.profilePhoto;
return data;
}
}

View File

@@ -1,59 +0,0 @@
class FetchNotification {
String? status;
int? statusCode;
String? message;
Data? data;
FetchNotification({this.status, this.statusCode, this.message, this.data});
FetchNotification.fromJson(Map<String, dynamic> json) {
status = json['status'];
statusCode = json['status_code'];
message = json['message'];
data = json['data'] != null ? new Data.fromJson(json['data']) : null;
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
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 {
int? groupNotification;
int? communityNotification;
int? followerNotification;
int? newFollowerNotification;
int? directMessageNotification;
Data(
{this.groupNotification,
this.communityNotification,
this.followerNotification,
this.newFollowerNotification,
this.directMessageNotification});
Data.fromJson(Map<String, dynamic> json) {
groupNotification = json['group_notification'];
communityNotification = json['community_notification'];
followerNotification = json['follower_notification'];
newFollowerNotification = json['new_follower_notification'];
directMessageNotification = json['direct_message_notification'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
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;
return data;
}
}

View File

@@ -0,0 +1,76 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.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 NotificationScreen extends StatefulWidget {
const NotificationScreen({super.key});
@override
State<NotificationScreen> createState() => _NotificationScreenState();
}
class _NotificationScreenState extends State<NotificationScreen> {
List<bool> switchValues = List.generate(5, (index) => false);
bool swichvalue = false;
@override
Widget build(BuildContext context) {
return Scaffold(
resizeToAvoidBottomInset: false,
// key: _scaffoldKey1,
backgroundColor: Color(0xFF222935),
extendBody: true,
appBar: CommonAppbar(
titleTxt: "Notifications",
),
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),
rowTile(text: "Group notification", index: 0),
commonDivider(),
rowTile(text: "Community notification", index: 1),
commonDivider(),
rowTile(text: "Follower notification", index: 2),
commonDivider(),
rowTile(text: "New follower notification", index: 3),
commonDivider(),
rowTile(text: "Direct message notification", index: 4),
]))
]));
}
Widget rowTile({required String text, required int index}) {
return Padding(
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 20.h),
child: Row(
children: [
text16w400_FCFCFC(text),
Spacer(),
Transform.scale(
scaleY: 1,
child: CupertinoSwitch(
value: switchValues[index],
trackColor: Colors.white.withOpacity(0.4),
activeColor: Color(0xFF34C759),
onChanged: (bool? value) {
setState(() {
switchValues[index] = value ?? false;
});
},
),
),
],
),
);
}
}

View File

@@ -1,8 +1,5 @@
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/Utils/Common/CommonAppbar.dart';
import 'package:regroup/Utils/Common/blureffect.dart';
import 'package:regroup/Utils/Common/sized_box.dart';
@@ -19,109 +16,35 @@ class _PrivacyPolicyState extends State<PrivacyPolicy> {
@override
Widget build(BuildContext context) {
return Scaffold(
// key: _scaffoldKey1,
backgroundColor: Color(0xFF222935),
extendBody: true,
resizeToAvoidBottomInset: false,
appBar: CommonAppbar(
titleTxt: "Privacy policy",
),
body: FutureBuilder(
future: Profilegetmethod().getPrivacypolicy(),
builder: (ctx, snapshot) {
if (snapshot.data == null) {
return Center(child: CircularProgressIndicator());
}
if (snapshot.connectionState == ConnectionState.done) {
if (snapshot.hasError) {
return Center(
child: Text(
'${snapshot.error} occured',
style: TextStyle(fontSize: 18.spMin),
),
);
}
}
return privacyobj!.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 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(children: [
sizedBoxHeight(20.h),
Html(
data: privacyobj!.data!.content,
// style: {
// "html": Style(
// color: Colors.white,
// fontFamily: "Poppins",
// fontSize: FontSize(18.sp),
// fontWeight: FontWeight.w700,
// ),
// },
style: {
"html": Style(
color: Colors.white, // Text color
fontFamily: "Poppins", // Font family
fontSize: FontSize(18), // Font size
fontWeight: FontWeight.w700, // Font weight
),
"p": Style(
color: Colors.white,
fontSize: FontSize(18.sp),
fontWeight: FontWeight.w500),
"a": Style(
color: Colors.white,
fontSize: FontSize(18.sp),
fontWeight: FontWeight.w500
// Link color
),
},
)
// text18w700white(
// "Regroup is a community where everyone can belong"),
// sizedBoxHeight(20.h),
// text16400whiteblur(
// "Lorem Ipsum is simply dummy text of the printing and typesetting industry. 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. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."),
// sizedBoxHeight(20.h),
// text16400whiteblur(
// "Lorem Ipsum is simply dummy text of the printing and typesetting industry. 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. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.")
]),
// key: _scaffoldKey1,
backgroundColor: Color(0xFF222935),
extendBody: true,
resizeToAvoidBottomInset: false,
appBar: CommonAppbar(
titleTxt: "Privacy policy",
),
)
]);
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(children: [
sizedBoxHeight(20.h),
text18w700white(
"Regroup is a community where everyone can belong"),
sizedBoxHeight(20.h),
text16400whiteblur(
"Lorem Ipsum is simply dummy text of the printing and typesetting industry. 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. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."),
sizedBoxHeight(20.h),
text16400whiteblur(
"Lorem Ipsum is simply dummy text of the printing and typesetting industry. 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. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.")
]),
),
)
]));
}
}

View File

@@ -1,22 +1,13 @@
import 'package:flutter/cupertino.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';
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/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';
import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart';
class ReportABug extends StatefulWidget {
const ReportABug({super.key});
@@ -26,243 +17,131 @@ class ReportABug extends StatefulWidget {
}
class _ReportABugState extends State<ReportABug> {
final GlobalKey<FormState> _formkey = GlobalKey<FormState>();
TextEditingController deviceoscontroller = TextEditingController();
TextEditingController versionoscontroller = TextEditingController();
TextEditingController emailcontroller = TextEditingController();
TextEditingController querycontroller = TextEditingController();
String _selectedreasontocontact = '';
void _onItemSelected(String value) {
setState(() {
_selectedreasontocontact = value;
});
}
Uploadata() async {
utils.loader();
Map<String, dynamic> updata = {
"device": deviceoscontroller.text,
"version": versionoscontroller.text,
"email": emailcontroller.text,
"reason_to_contact": _selectedreasontocontact,
"query": querycontroller.text,
};
final data = await Profilepostmethod().postReportandbug(updata);
if (data.status == ResponseStatus.SUCCESS) {
Get.back();
Get.back();
print("report done");
return utils.showToast(data.message);
} else {
Get.back();
print("report not done");
return utils.showToast(data.message);
}
}
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
child: Scaffold(
// key: _scaffoldKey1,
resizeToAvoidBottomInset: false,
backgroundColor: Color(0xFF222935),
extendBody: true,
appBar: CommonAppbar(
titleTxt: "Report a bug",
return Scaffold(
// key: _scaffoldKey1,
resizeToAvoidBottomInset: false,
backgroundColor: Color(0xFF222935),
extendBody: true,
appBar: CommonAppbar(
titleTxt: "Report a bug",
),
body: Stack(children: [
Container(
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/images/png/Ellipse 1496.png"), fit: BoxFit.fill)),
),
body: Stack(children: [
Container(
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/images/png/Ellipse 1496.png"),
fit: BoxFit.fill)),
),
SingleChildScrollView(
physics: ScrollPhysics(),
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 16.w),
child: Form(
key: _formkey,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
sizedBoxHeight(20.h),
Row(
children: [
text16400white("Device OS"),
sizedBoxWidth(8.w),
Image.asset(
"assets/images/png/octicon_question-24.png",
height: 16.h,
width: 16.w,
)
],
Padding(
padding: EdgeInsets.symmetric(horizontal: 16.w),
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
sizedBoxHeight(20.h),
Row(
children: [
text16400white("Device OS"),
sizedBoxWidth(8.w),
Image.asset(
"assets/images/png/octicon_question-24.png",
height: 16.h,
width: 16.w,
)
],
),
sizedBoxHeight(15.h),
CustomTextFormField(
leadingIcon: Container(
height: 25.h,
width: 15.w,
child: Center(
child: Image.asset(
"assets/images/png/VectorDevice.png",
height: 25.h,
width: 15.w,
fit: BoxFit.cover,
),
sizedBoxHeight(15.h),
CustomTextFormField(
leadingIcon: Container(
height: 25.h,
width: 15.w,
child: Center(
child: Image.asset(
"assets/images/png/VectorDevice.png",
height: 25.h,
width: 15.w,
fit: BoxFit.cover,
),
),
),
validator: (value) {
if (value!.isEmpty) {
return 'Enter your decice os';
}
return null;
},
inputFormatters: [
// LengthLimitingTextInputFormatter(20),
RemoveEmojiInputFormatter(),
FilteringTextInputFormatter.allow(
RegExp('[a-zA-Z ]'))
],
hintText: "Enter decice os",
textEditingController: deviceoscontroller,
),
),
hintText: "Apple iphone",
),
Row(
children: [
text16400white("OS version"),
sizedBoxWidth(8.w),
Image.asset(
"assets/images/png/octicon_question-24.png",
height: 16.h,
width: 16.w,
)
],
),
sizedBoxHeight(15.h),
CustomTextFormField(
leadingIcon: Container(
height: 23.h,
width: 23.w,
child: Center(
child: Image.asset(
"assets/images/png/setting2.png",
height: 23.h,
width: 23.w,
fit: BoxFit.cover,
),
sizedBoxHeight(10.h),
Row(
children: [
text16400white("OS version"),
sizedBoxWidth(8.w),
Image.asset(
"assets/images/png/octicon_question-24.png",
height: 16.h,
width: 16.w,
)
],
),
),
hintText: "Version 16",
),
text16400white("Email address"),
sizedBoxHeight(15.h),
CustomTextFormField(
leadingIcon: Container(
height: 17.h,
width: 22.w,
child: Center(
child: Image.asset(
"assets/images/png/Frame 12 (1).png",
height: 17.h,
width: 22.w,
fit: BoxFit.cover,
),
sizedBoxHeight(15.h),
CustomTextFormField(
leadingIcon: Container(
height: 23.h,
width: 23.w,
child: Center(
child: Image.asset(
"assets/images/png/setting2.png",
height: 23.h,
width: 23.w,
fit: BoxFit.cover,
),
),
),
validator: (value) {
if (value!.isEmpty) {
return 'Enter your os version';
}
return null;
},
inputFormatters: [
// LengthLimitingTextInputFormatter(20),
RemoveEmojiInputFormatter(),
],
hintText: "Enter os verison",
textEditingController: versionoscontroller,
),
sizedBoxHeight(10.h),
text16400white("Email address"),
sizedBoxHeight(15.h),
CustomTextFormField(
leadingIcon: Container(
height: 17.h,
width: 24.w,
child: Center(
child: Image.asset(
"assets/images/png/Frame 12.png",
height: 17.h,
width: 22.w,
fit: BoxFit.cover,
),
),
),
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()
],
textEditingController: emailcontroller,
hintText: "Enter email address",
),
sizedBoxHeight(10.h),
text16400white("Reason to contact"),
sizedBoxHeight(15.h),
CustomDropDownRadio(
header: "",
title: "",
listData: [
"Messaging",
"Crashes",
"Constant logout",
"Unable to view post"
],
onItemSelected: _onItemSelected,
leadingImage: Image.asset(
"assets/images/png/codicon_bug.png",
height: 23.h,
width: 23.w,
),
showOtherOption: true,
),
sizedBoxHeight(20.h),
text16400white("Query"),
sizedBoxHeight(15.h),
CustomTextFormField2(
maxlines: 3,
hintText: "Enter query",
validator: (value) {
if (value!.isEmpty) {
return 'Enter your full name ';
}
return null;
},
inputFormatters: [
// LengthLimitingTextInputFormatter(20),
RemoveEmojiInputFormatter(),
FilteringTextInputFormatter.allow(
RegExp('[a-zA-Z ]'))
],
textEditingController: querycontroller,
),
sizedBoxHeight(20.h),
CustomButton(
onPressed: () {
if (deviceoscontroller.text.isBlank! &&
versionoscontroller.text.isBlank! &&
querycontroller.text.isBlank! &&
emailcontroller.text.isBlank! &&
_selectedreasontocontact.isEmpty) {
utils.showToast("Please fill all fields");
} else {
Uploadata();
}
},
text: "Send")
]),
),
),
)
])),
);
),
),
hintText: "loremipsum@gmail.com",
),
text16400white("Reason to contact"),
sizedBoxHeight(15.h),
CustomDropDownRadio(
header: "",
title: "",
listData: [
"Messaging",
"Crashes",
"Constant logout",
"Unable to view post"
],
onItemSelected: (p0) {},
leadingImage: Image.asset(
"assets/images/png/codicon_bug.png",
height: 23.h,
width: 23.w,
),
showOtherOption: true,
),
sizedBoxHeight(20.h),
text16400white("Query"),
sizedBoxHeight(15.h),
CustomTextFormField2(
maxlines: 3,
hintText:
"Lorem Ipsum has been the industry's standard dummy text ever since the 1500s. Lorem Ipsum has been the industry's standard",
),
sizedBoxHeight(20.h),
CommonBtn(text: "Send")
])),
)
]));
}
}

View File

@@ -1,5 +1,4 @@
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';
@@ -10,7 +9,6 @@ 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:shared_preferences/shared_preferences.dart';
class Settings extends StatefulWidget {
const Settings({super.key});
@@ -58,16 +56,6 @@ class _SettingsState extends State<Settings> {
),
),
commonDivider(),
GestureDetector(
onTap: () {
Get.toNamed(RouteName.editProfile);
},
child: rowTile(
imagePath: "assets/images/png/edit 1.png",
text: "Edit profile",
),
),
commonDivider(),
GestureDetector(
onTap: () {
Get.toNamed(RouteName.helpandsupport);
@@ -158,26 +146,18 @@ class _SettingsState extends State<Settings> {
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
GestureDetector(
onTap: () async {
SharedPreferences prefs =
await SharedPreferences.getInstance();
await prefs.clear();
Get.offAllNamed(RouteName.loginScreen);
},
child: commonGlassContainer(
width: 130.w,
height: 40.h,
borderradius: 30.r,
opacity1: 0.05,
opacity2: 0.07,
customWidget:
Center(child: text14400white("Yes, I want to")),
border: 1),
),
commonGlassContainer(
width: 140.w,
height: 40.h,
borderradius: 30.r,
opacity1: 0.05,
opacity2: 0.07,
customWidget:
Center(child: text14400white("Yes, I want to")),
border: 1),
Container(
height: 40.h,
width: 130.w,
width: 140.w,
decoration: BoxDecoration(
color: Color(0xFFD90B2E),
borderRadius: BorderRadius.circular(30.r),

View File

@@ -1,10 +1,9 @@
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/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 TermsCondition extends StatefulWidget {
const TermsCondition({super.key});
@@ -17,92 +16,35 @@ class _TermsConditionState extends State<TermsCondition> {
@override
Widget build(BuildContext context) {
return Scaffold(
// key: _scaffoldKey1,
backgroundColor: Color(0xFF222935),
extendBody: true,
resizeToAvoidBottomInset: false,
appBar: CommonAppbar(
titleTxt: "Terms & Condition",
),
body: FutureBuilder(
future: Profilegetmethod().getTermsConditions(),
builder: (ctx, snapshot) {
if (snapshot.data == null) {
return Center(child: CircularProgressIndicator());
}
if (snapshot.connectionState == ConnectionState.done) {
if (snapshot.hasError) {
return Center(
child: Text(
'${snapshot.error} occured',
style: TextStyle(fontSize: 18.spMin),
),
);
}
}
return termsobj!.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 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(children: [
sizedBoxHeight(20.h),
Html(
data: termsobj!.data!.content,
style: {
"html": Style(
color: Colors.white, // Text color
fontFamily: "Poppins", // Font family
fontSize: FontSize(18), // Font size
fontWeight: FontWeight.w700, // Font weight
),
"p": Style(
color: Colors.white,
fontSize: FontSize(18.sp),
fontWeight: FontWeight.w500),
"a": Style(
color: Colors.white,
fontSize: FontSize(18.sp),
fontWeight: FontWeight.w500
// Link color
),
},
)
]),
// key: _scaffoldKey1,
backgroundColor: Color(0xFF222935),
extendBody: true,
resizeToAvoidBottomInset: false,
appBar: CommonAppbar(
titleTxt: "Terms & Condition",
),
)
]);
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(children: [
sizedBoxHeight(20.h),
text18w700white(
"Regroup is a community where everyone can belong"),
sizedBoxHeight(20.h),
text16400whiteblur(
"Lorem Ipsum is simply dummy text of the printing and typesetting industry. 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. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."),
sizedBoxHeight(20.h),
text16400whiteblur(
"Lorem Ipsum is simply dummy text of the printing and typesetting industry. 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. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.")
]),
),
)
]));
}
}

View File

@@ -1,20 +1,13 @@
import 'package:flutter/material.dart';
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/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';
import 'package:timer_button/timer_button.dart';
class VerifyCode extends StatefulWidget {
const VerifyCode({super.key});
@@ -24,59 +17,8 @@ class VerifyCode extends StatefulWidget {
}
class _VerifyCodeState extends State<VerifyCode> {
TextEditingController pincodeController = TextEditingController();
// final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
String currentpassword = Get.arguments['currentpass'];
String newpassword = Get.arguments['newpass'];
String confirmpassword = Get.arguments['confirmpass'];
Uploadata() async {
utils.loader();
Map<String, dynamic> updata = {
"otp": pincodeController.text,
"new_password": newpassword,
};
// final data = res
final res = await Profilepostmethod().postChangepassverifyotp(updata);
if (res.status == ResponseStatus.SUCCESS) {
Get.back();
print("verification done");
Get.back();
Get.back();
return utils.showToast(res.message);
} else {
Get.back();
print("change pass not done");
return utils.showToast(res.message);
}
}
Uploadataresendotp() async {
utils.loader();
Map<String, dynamic> updata = {
"current_password": currentpassword,
"new_password": newpassword,
"confirm_password": confirmpassword,
};
final data = await Profilepostmethod().postChangepassword(updata);
if (data.status == ResponseStatus.SUCCESS) {
Get.back();
print("otp done");
setState(() {
pincodeController.clear();
// turnValidation = false;
});
return utils.showToast(data.message);
} else {
Get.back();
print("otp not done");
return utils.showToast(data.message);
}
}
final TextEditingController pincodeController = TextEditingController();
final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
@override
Widget build(BuildContext context) {
@@ -102,97 +44,34 @@ class _VerifyCodeState extends State<VerifyCode> {
text20700white("Check your email"),
sizedBoxHeight(10.h),
text14400whiteblur(
"Enter the verification code that we sent to $emailid"),
"Enter the verification code that we sent to loremipsum@gmail.com"),
sizedBoxHeight(30.h),
text16400white("Enter code"),
sizedBoxHeight(20.h),
PinCodeTextField(
validator: (value) {
if (value != null && value.isEmpty) {
return "Please Enter verification code";
} else if (value != null && value.length < 4) {
return "OTP length should be at least 4";
}
return null;
},
keyboardType: TextInputType.number,
inputFormatters: [
FilteringTextInputFormatter.allow(RegExp('[0-9]')),
],
mainAxisAlignment: MainAxisAlignment.spaceBetween,
length: 4,
obscureText: false,
animationType: AnimationType.fade,
pinTheme: PinTheme(
selectedFillColor: Color(0xFF434A53),
inactiveFillColor: Color(0xFF434A53),
inactiveColor: Color(0xFF434A53),
activeColor: Color(0xFF434A53),
selectedColor: Color(0xFF434A53),
shape: PinCodeFieldShape.underline,
borderRadius: BorderRadius.circular(5),
fieldHeight: 70,
fieldWidth: 70,
activeFillColor:
// Colors.white
Color(0xFF303030).withOpacity(0.4),
// textStyle: TextStyle(color: Colors.white, fontSize: 20), // Change text color and font size
),
animationDuration: Duration(milliseconds: 300),
enableActiveFill: true,
autovalidateMode: AutovalidateMode.onUserInteraction,
controller: pincodeController,
onCompleted: (v) {
print("Completed");
},
onChanged: (value) {
print(value);
setState(() {
// currentText = value;
});
},
cursorColor: Colors.white,
textStyle: TextStyle(
color: Colors.white,
fontSize: 20.sp,
fontFamily: 'Helvetica',
),
beforeTextPaste: (text) {
print("Allowing to paste $text");
return true;
},
appContext: context,
),
sizedBoxHeight(10.h),
Center(
child: TimerButton(
disabledTextStyle: TextStyle(color: Colors.red),
activeTextStyle: TextStyle(color: Colors.white),
disabledColor: Color(0XFF222935).withOpacity(0.10),
buttonType: ButtonType.textButton,
label: "Resend OTP",
timeOutInSeconds: 6,
//mobile.text.isEmpty ? 1 : 60,
onPressed: () {
setState(() {
Uploadataresendotp();
});
commonGlassContainer(
width: double.infinity,
height: 50.h,
borderradius: 30.r,
border: 1,
customWidget: CustomPinCodeField(
controller: pincodeController,
onChanged: (value) {
print(value);
},
onCompleted: (value) {
print("Completed");
pincodeController.text = value;
},
// disabledColor: Colors.white,
color: Color(0XFF222935).withOpacity(0.10),
),
),
// ),
sizedBoxHeight(70.h),
CustomButton(
text: 'Continue',
onPressed: () {
if (pincodeController.text.isEmpty) {
utils.showToast("Pin field is empty");
} else if (pincodeController.text.length < 4) {
utils.showToast("OTP length should be 4 digits");
} else {
Uploadata();
return;
}
},
),
@@ -206,176 +85,122 @@ class _VerifyCodeState extends State<VerifyCode> {
}
}
// class CustomPinCodeField extends StatefulWidget {
// final TextEditingController controller;
// final ValueChanged<String> onChanged;
// final ValueChanged<String> onCompleted;
class CustomPinCodeField extends StatefulWidget {
final TextEditingController controller;
final ValueChanged<String> onChanged;
final ValueChanged<String> onCompleted;
// CustomPinCodeField({
// required this.controller,
// required this.onChanged,
// required this.onCompleted,
// });
CustomPinCodeField({
required this.controller,
required this.onChanged,
required this.onCompleted,
});
// @override
// _CustomPinCodeFieldState createState() => _CustomPinCodeFieldState();
// }
@override
_CustomPinCodeFieldState createState() => _CustomPinCodeFieldState();
}
// class _CustomPinCodeFieldState extends State<CustomPinCodeField> {
// final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
// late List<TextEditingController> _controllers;
// late List<FocusNode> _focusNodes;
// String _currentText = "";
class _CustomPinCodeFieldState extends State<CustomPinCodeField> {
final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
late List<TextEditingController> _controllers;
late List<FocusNode> _focusNodes;
String _currentText = "";
// @override
// void initState() {
// super.initState();
// _controllers = List.generate(4, (_) => TextEditingController());
// _focusNodes = List.generate(4, (_) => FocusNode());
// }
@override
void initState() {
super.initState();
_controllers = List.generate(4, (_) => TextEditingController());
_focusNodes = List.generate(4, (_) => FocusNode());
}
// @override
// void dispose() {
// _controllers.forEach((controller) => controller.dispose());
// _focusNodes.forEach((focusNode) => focusNode.dispose());
// super.dispose();
// }
@override
void dispose() {
_controllers.forEach((controller) => controller.dispose());
_focusNodes.forEach((focusNode) => focusNode.dispose());
super.dispose();
}
// String? _validate(int index) {
// if (_controllers[index].text.isEmpty) {
// return "Please enter verification code";
// } else if (_controllers[index].text.length > 1) {
// return "Please enter only one digit";
// }
// return null;
// }
String? _validate(int index) {
// _currentText = _controllers.map((controller) => controller.text).join();
if (_currentText[index].isEmpty) {
return "Please Enter verification code";
} else if (_currentText.length < 4) {
return "OTP length should be at least 4";
}
return null;
}
// void _onChanged(String value, int index) {
// setState(() {
// _currentText = _controllers.map((controller) => controller.text).join();
// });
void _onChanged(String value, int index) {
setState(() {
_currentText = _controllers.map((controller) => controller.text).join();
});
if (value.length == 1 && index != 3) {
FocusScope.of(context).nextFocus();
} else if (value.isEmpty && index != 0) {
FocusScope.of(context).previousFocus();
}
widget.onChanged(_currentText);
// if (value.isNotEmpty) {
// if (index < _controllers.length - 1) {
// FocusScope.of(context).nextFocus();
// } else {
// // Last field, trigger onCompleted directly
// if (_currentText.length == _controllers.length) {
// widget.onCompleted(_currentText);
// }
// }
// } else {
// // Empty value, focus to previous field if not the first field
// if (index > 0) {
// FocusScope.of(context).previousFocus();
// }
// }
// widget.onChanged(_currentText);
// }
if (_currentText.length == 4) {
widget.onCompleted(_currentText);
}
}
// @override
// Widget build(BuildContext context) {
// return Form(
// key: _formKey,
// child: Column(
// children: [
// commonGlassContainer(
// width: double.infinity,
// height: 50.h,
// borderradius: 30.r,
// border: 1,
// customWidget: Row(
// mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.center,
// children: List.generate(4, (index) {
// return Row(
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// Center(
// child: Container(
// width: 30,
// height: 40,
// child: Center(
// child: TextFormField(
// controller: _controllers[index],
// focusNode: _focusNodes[index],
// keyboardType: TextInputType.number,
// inputFormatters: [
// FilteringTextInputFormatter.allow(
// RegExp('[0-9]')),
// LengthLimitingTextInputFormatter(1),
// ],
// textAlign: TextAlign.center,
// style: TextStyle(
// color: Colors.white,
// fontSize: 20,
// fontFamily: 'Helvetica',
// ),
// decoration: InputDecoration(
// border: InputBorder.none,
// errorStyle: TextStyle(height: 0),
// ),
// onChanged: (value) => _onChanged(value, index),
// validator: (value) => _validate(index),
// ),
// ),
// ),
// ),
// if (index != 3)
// Container(
// width: 12,
// height: 2,
// color: Colors.white,
// margin: EdgeInsets.symmetric(horizontal: 10),
// ),
// ],
// );
// }),
// ),
// ),
// sizedBoxHeight(10.h),
// Text(
// _validateErrors(),
// style: TextStyle(color: Colors.red),
// ),
// ],
// ),
// );
// }
// String _validateErrors() {
// for (int i = 0; i < _controllers.length; i++) {
// String? error = _validate(i);
// if (error != null) {
// return error;
// }
// }
// // Check if OTP length is less than 4
// if (_currentText.length < 4) {
// return "OTP length should be 4 digits";
// }
// return "";
// }
// // String _validateErrors() {
// // List<String> errors = [];
// // // Validate each TextFormField
// // for (int i = 0; i < _controllers.length; i++) {
// // String? error = _validate(i);
// // if (error != null && !errors.contains(error)) {
// // errors.add(error);
// // }
// // }
// // // Check OTP length only if there are no other errors
// // if (errors.isEmpty && _currentText.length < 4) {
// // errors.add("OTP length should be 4 digits");
// // }
// // // Return concatenated error messages
// // return errors.isNotEmpty ? errors.join("\n") : "";
// // }
// }
@override
Widget build(BuildContext context) {
return Form(
key: _formKey,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: List.generate(4, (index) {
return Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Center(
child: Container(
width: 30,
height: 40,
// color: Colors.amber,
child: Center(
child: TextFormField(
controller: _controllers[index],
focusNode: _focusNodes[index],
keyboardType: TextInputType.number,
inputFormatters: [
FilteringTextInputFormatter.allow(RegExp('[0-9]')),
LengthLimitingTextInputFormatter(1),
],
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
fontSize: 20.sp,
fontFamily: 'Helvetica',
),
decoration: InputDecoration(
border: InputBorder.none,
errorStyle: TextStyle(height: 0),
),
onChanged: (value) => _onChanged(value, index),
validator: (value) {
if (index == 3) return _validate(index);
return null;
},
),
),
),
),
if (index != 3)
Container(
width: 12,
height: 2,
color: Colors.white,
margin: EdgeInsets.symmetric(horizontal: 10),
),
],
);
}),
),
);
}
}

View File

@@ -1,318 +0,0 @@
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/Feed%20Module/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';
import 'package:regroup/Utils/texts.dart';
import 'package:shared_preferences/shared_preferences.dart';
class BlockedUsers extends StatefulWidget {
const BlockedUsers({super.key});
@override
State<BlockedUsers> createState() => _BlockedUsersState();
}
class _BlockedUsersState extends State<BlockedUsers> {
List blockedUserData = [
{
"imagePath": "assets/images/png/cimg1.png",
"title": "Ryan Dorwart",
"subtitle": "Lorem ipsum dummy text",
},
{
"imagePath": "assets/images/png/cimg2.png",
"title": "Ahmad Rhiel Madsen",
"subtitle": "Lorem ipsum dummy text",
},
{
"imagePath": "assets/images/png/cimg3.png",
"title": "Kaylynn Vaccaro",
"subtitle": "Lorem ipsum dummy text",
},
{
"imagePath": "assets/images/png/cimg4.png",
"title": "Kianna Donin",
"subtitle": "Lorem ipsum dummy text",
},
{
"imagePath": "assets/images/png/Ellipse 43.png",
"title": "Maria Herwitz",
"subtitle": "Lorem ipsum dummy text",
},
{
"imagePath": "assets/images/png/Ellipse 52.png",
"title": "Ahmad Rhiel Madsen",
"subtitle": "Lorem ipsum dummy text",
},
{
"imagePath": "assets/images/png/img2.png",
"title": "Kaylynn Vaccaro",
"subtitle": "Lorem ipsum dummy text",
},
];
late Future myfuture;
double? blockedXid;
unblockDone(int index) async {
SharedPreferences prefs = await SharedPreferences.getInstance();
await prefs.setInt('blockedprincipalxid',
fetchblockuser!.data![index].blockedIamPrincipalXid!);
blockedXid = prefs.getInt('blockedprincipalxid')!.toDouble();
Map<String, String> updata = {
"blocked_iam_principal_xid": blockedXid.toString(),
};
final resp = await BlockUserAPI().postBlockApi(updata);
if (resp.status == ResponseStatus.SUCCESS) {
Get.snackbar(
"Success!",
'Unblock user successfully',
duration: Duration(seconds: 2),
colorText: Colors.white,
backgroundColor: Colors.green,
margin: EdgeInsets.all(8),
snackStyle: SnackStyle.FLOATING,
snackPosition: SnackPosition.BOTTOM,
);
// utils.showToast('Unblock user successfully');
setState(() {
fetchblockuser!.data!.removeAt(index);
});
print('success');
} else {
// btnController.error();
// btnController.reset();
Get.snackbar(
"Error!",
resp.data['message'],
duration: Duration(seconds: 2),
colorText: Colors.white,
backgroundColor: Colors.red,
margin: EdgeInsets.all(8),
snackStyle: SnackStyle.FLOATING,
snackPosition: SnackPosition.BOTTOM,
);
}
}
@override
void initState() {
myfuture = BlockUserAPI().fetchBlockUser();
// TODO: implement initState
super.initState();
}
@override
Widget build(BuildContext context) {
return Scaffold(
// key: _scaffoldKey1,
resizeToAvoidBottomInset: false,
backgroundColor: Color(0xFF222935),
extendBody: true,
appBar: CommonAppbar(
titleTxt: "Blocked users",
),
body: FutureBuilder(
future: myfuture,
builder: (ctx, snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) {
return 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)),
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
sizedBoxHeight(25.h),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: 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 people",
),
),
sizedBoxHeight(25.h),
Expanded(
child: ListView.builder(
shrinkWrap: true,
itemCount: fetchblockuser!.data!.length,
itemBuilder: (context, index) {
return Column(
children: [
blockedUser(
imagePath: fetchblockuser!.data![index]
.blockedProfile!.profilePhoto ??
'',
title: fetchblockuser!.data![index]
.blockedProfile!.fullName ??
'',
subtitle: fetchblockuser!.data![index]
.blockedProfile!.userName ??
'',
index: index),
// blockedUser(
// imagePath: blockedUserData[index]
// ["imagePath"],
// title: blockedUserData[index]["title"],
// subtitle: blockedUserData[index]
// ["subtitle"]),
if (index != fetchblockuser!.data!.length - 1)
commonDivider(),
],
);
},
),
),
sizedBoxHeight(20.h)
])
]);
}
return Container();
}));
}
dialogwidget({required int index}) {
Get.dialog(Dialog(
backgroundColor: Colors.transparent,
surfaceTintColor: Colors.transparent,
child: commonGlassContainer(
width: double.infinity,
height: 200.h,
borderradius: 14,
opacity1: 0.09,
opacity2: 0.13,
customWidget: Padding(
padding: EdgeInsets.symmetric(horizontal: 30.w, vertical: 30.h),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
text18w400_FCFCFC(
"Are you sure you want to unblock the user?",
textAlign: TextAlign.center),
sizedBoxHeight(30.h),
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
GestureDetector(
onTap: () {
Get.back();
},
child: commonGlassContainer(
width: 110.w,
height: 40.h,
borderradius: 30.r,
opacity1: 0.05,
opacity2: 0.07,
customWidget: Center(child: text14400white("No")),
border: 1),
),
InkWell(
onTap: () {
// Get.back();
unblockDone(index);
// await BlockUserAPI().fetchBlockUser();
Get.back();
// setState(() {});
},
child: Container(
height: 40.h,
width: 110.w,
decoration: BoxDecoration(
color: Color(0xFFD90B2E),
borderRadius: BorderRadius.circular(30.r),
),
child: Center(child: text14400white("Yes")),
),
)
],
),
],
),
),
border: 0.8)));
}
Widget blockedUser({
required String imagePath,
required String title,
required String subtitle,
required int index,
}) {
return Padding(
padding: EdgeInsets.symmetric(vertical: 16.h, horizontal: 16.w),
child: Row(
children: [
CircleAvatar(
backgroundImage: NetworkImage(imagePath),
// AssetImage(imagePath),
radius: 25.r,
),
sizedBoxWidth(10.w),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
text16w400_FCFCFC(title),
sizedBoxHeight(4.h),
text12w400_FCFCFC_blur(subtitle),
],
),
Spacer(),
GestureDetector(
onTap: () {
dialogwidget(index: index);
},
child: Container(
height: 30.h,
width: 105.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(30.r),
color: Color(0xFFD90B2E)),
child: Center(child: text14w400_FCFCFC("Unblock")),
),
)
],
),
);
}
}

View File

@@ -1,172 +0,0 @@
import 'package:flutter/cupertino.dart';
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/Common/base_manager.dart';
import 'package:regroup/Feed%20Module/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';
class NotificationScreen extends StatefulWidget {
const NotificationScreen({super.key});
@override
State<NotificationScreen> createState() => _NotificationScreenState();
}
class _NotificationScreenState extends State<NotificationScreen> {
var switchValues = List<bool>.generate(5, (index) => false).obs;
void toggleSwitch(int index, bool value) {
switchValues[index] = value;
}
String switchValueFinal(int index) {
return switchValues[index] ? '1' : '0';
}
void switchValueBool() {
final notifications = [
fetchNoti!.data!.groupNotification,
fetchNoti!.data!.communityNotification,
fetchNoti!.data!.followerNotification,
fetchNoti!.data!.newFollowerNotification,
fetchNoti!.data!.directMessageNotification,
];
for (int i = 0; i < notifications.length; i++) {
toggleSwitch(i, notifications[i] == 1);
}
}
Future<void> updateNotification() async {
Map<String, String> updata = {
"group_notification": switchValueFinal(0),
"community_notification": switchValueFinal(1),
"follower_notification": switchValueFinal(2),
"new_follower_notification": switchValueFinal(3),
"direct_message_notification": switchValueFinal(4),
};
final data = await NotificationAPI().notificationPostApi(updata);
if (data.status == ResponseStatus.SUCCESS) {
utils.showToast('Notification updated');
} else {
Get.snackbar(
"Error!",
data.data['message'],
duration: Duration(seconds: 2),
colorText: Colors.white,
backgroundColor: Colors.red,
margin: EdgeInsets.all(8),
snackStyle: SnackStyle.FLOATING,
snackPosition: SnackPosition.BOTTOM,
);
}
}
late Future myfuture;
@override
void initState() {
myfuture = NotificationAPI().getNotification();
super.initState();
}
@override
Widget build(BuildContext context) {
return Scaffold(
resizeToAvoidBottomInset: false,
backgroundColor: Color(0xFF222935),
extendBody: true,
appBar: CommonAppbar(
titleTxt: "Notifications",
),
body: FutureBuilder(
future: myfuture,
builder: (ctx, snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) {
return 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) {
switchValueBool();
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(20.h),
rowTile(text: "Group notification", index: 0),
commonDivider(),
rowTile(text: "Community notification", index: 1),
commonDivider(),
rowTile(text: "Follower notification", index: 2),
commonDivider(),
rowTile(text: "New follower notification", index: 3),
commonDivider(),
rowTile(text: "Direct message notification", index: 4),
],
),
),
],
);
}
return Container();
},
),
);
}
Widget rowTile({required String text, required int index}) {
return Padding(
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 20.h),
child: Row(
children: [
text16w400_FCFCFC(text),
Spacer(),
Obx(
() => Transform.scale(
scaleY: 1,
child: CupertinoSwitch(
value: switchValues[index],
trackColor: Colors.white.withOpacity(0.4),
activeColor: Color(0xFF34C759),
onChanged: (bool? value) {
toggleSwitch(index, value ?? false);
updateNotification();
},
),
),
),
],
),
);
}
}

View File

@@ -1,53 +0,0 @@
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';
FetchBlockedUser? fetchblockuser;
class BlockUserAPI {
BlockUserAPI();
Future<ResponseData<dynamic>> fetchBlockUser() async {
final response = await NetworkApiServices().getApi(
ApiUrls.getblockuser,
);
fetchblockuser = FetchBlockedUser.fromJson(response.data);
if (response.status == ResponseStatus.SUCCESS) {
if (response.data["status"] == "success") {
print("Success---->");
return ResponseData<dynamic>(
response.data['message'], ResponseStatus.SUCCESS,
data: response.data);
} else {
return ResponseData<dynamic>(
response.data['message'], ResponseStatus.FAILED);
}
}
return response;
}
Future<ResponseData<dynamic>> postBlockApi(var data) async {
final response = await NetworkApiServices().postApi(
data,
ApiUrls.postblockuser,
);
if (response.status == ResponseStatus.SUCCESS) {
//Map<String, dynamic> responseData = jsonDecode(response.data);
if (response.data['status'] == "success") {
return ResponseData<dynamic>(
response.data['message'], ResponseStatus.SUCCESS,
// data: response.data
);
} else {
return ResponseData<dynamic>(
response.data['message'], ResponseStatus.FAILED);
}
}
return response;
}
}

View File

@@ -1,54 +0,0 @@
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';
FetchNotification? fetchNoti;
class NotificationAPI {
NotificationAPI();
// class otpAPI {
// otpAPI(this.data);
// var data;
Future<ResponseData<dynamic>> notificationPostApi(var data) async {
final response = await NetworkApiServices().postApi(
data,
ApiUrls.postnotification,
// "https://regroup.betadelivery.com/api/v1/forgot-password",
);
if (response.status == ResponseStatus.SUCCESS) {
//Map<String, dynamic> responseData = jsonDecode(response.data);
if (response.data['status'] == "success") {
return ResponseData<dynamic>(
response.data['message'], ResponseStatus.SUCCESS,
// data: response.data
);
} else {
return ResponseData<dynamic>(
response.data['message'], ResponseStatus.FAILED);
}
}
return response;
}
Future<ResponseData<dynamic>> getNotification() async {
final response = await NetworkApiServices().getApi(
ApiUrls.getnotification,
);
fetchNoti = FetchNotification.fromJson(response.data);
if (response.status == ResponseStatus.SUCCESS) {
if (response.data["status"] == "success") {
return ResponseData<dynamic>(
response.data['message'], ResponseStatus.SUCCESS,
data: response.data);
} else {
return ResponseData<dynamic>(
response.data['message'], ResponseStatus.FAILED);
}
}
return response;
}
}

View File

@@ -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/CommonDropdown.dart';
import 'package:regroup/Utils/Common/CustomTextformfield.dart';
import 'package:regroup/Utils/Common/blureffect.dart';
import 'package:regroup/Utils/Common/sized_box.dart';
@@ -23,19 +22,6 @@ class _AddTimelineState extends State<AddTimeline> {
TextEditingController dateController = TextEditingController();
TextEditingController dateController2 = TextEditingController();
final List<String> _dropdownProductItems = [
'Individual',
'Business',
];
String _selectedAccountType = '';
void _onItemSelected(String value) {
setState(() {
_selectedAccountType = value;
});
}
RxBool isChecked = false.obs;
@override
Widget build(BuildContext context) {
@@ -164,18 +150,6 @@ class _AddTimelineState extends State<AddTimeline> {
)
],
),
text16400white("Ability"),
sizedBoxHeight(15.h),
CustomDropDownWidgetSignup(
header: 'Select ability',
title: '',
listData: _dropdownProductItems,
onItemSelected: _onItemSelected,
// leadingImage:
// Image.asset(
// 'assets/images/png/user.png',
// ),
),
sizedBoxHeight(80.h),
Padding(
padding: EdgeInsets.symmetric(horizontal: 20.w),

View File

@@ -1,81 +0,0 @@
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/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';
FaqModel? faqobj;
PrivacypolicyModel? privacyobj;
TermsConditionsModel? termsobj;
FollowersModel? followersobj;
FollowingModel? followingobj;
class Profilegetmethod {
Future<ResponseData<dynamic>> getFaqs() async {
final response = await NetworkApiServices().getApi(
ApiUrls.getfaqs,
// optionalpar: false
);
if (response.status == ResponseStatus.SUCCESS) {
faqobj = FaqModel.fromJson(response.data);
log(faqobj!.data.toString());
}
return response;
}
Future<ResponseData<dynamic>> getPrivacypolicy() async {
final response = await NetworkApiServices().getApi(
ApiUrls.getprivacypolicy,
// optionalpar: false
);
if (response.status == ResponseStatus.SUCCESS) {
privacyobj = PrivacypolicyModel.fromJson(response.data);
log(privacyobj!.data.toString());
}
return response;
}
Future<ResponseData<dynamic>> getTermsConditions() async {
final response = await NetworkApiServices().getApi(
ApiUrls.gettermsconditios,
// optionalpar: false
);
if (response.status == ResponseStatus.SUCCESS) {
termsobj = TermsConditionsModel.fromJson(response.data);
log(termsobj!.data.toString());
}
return response;
}
Future<ResponseData<dynamic>> getFollowers(updata,
{required StreamController<FollowersModel> streamController}) async {
final response = await NetworkApiServices().getApi(
"${ApiUrls.getfollowers}?search=$updata",
);
if (response.status == ResponseStatus.SUCCESS) {
followersobj = FollowersModel.fromJson(response.data);
if (!streamController.isClosed) streamController.sink.add(followersobj!);
}
return response;
}
Future<ResponseData<dynamic>> getFollowing(updata,
{required StreamController<FollowingModel> streamController}) async {
final response = await NetworkApiServices().getApi(
"${ApiUrls.getfollowing}?search=$updata",
);
if (response.status == ResponseStatus.SUCCESS) {
followingobj = FollowingModel.fromJson(response.data);
if (!streamController.isClosed) streamController.sink.add(followingobj!);
}
return response;
}
}

View File

@@ -1,84 +0,0 @@
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 Profilepostmethod {
Profilepostmethod();
Future<ResponseData<dynamic>> 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<ResponseData<dynamic>> 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<ResponseData<dynamic>> 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<ResponseData<dynamic>> 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<ResponseData<dynamic>> 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<ResponseData<dynamic>> 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<ResponseData<dynamic>> 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;
}
}

View File

@@ -50,48 +50,46 @@ class _AnnouncementsState extends State<Announcements> {
titleTxt: "Announcements",
),
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(25.h),
Row(
children: [
Spacer(),
InkWell(
onTap: () {
Get.toNamed(RouteName.announcementrequest);
},
child: text16w700_FCFCFCUnderline(
"View announcement requests"),
),
],
),
sizedBoxHeight(30.h),
Column(
children: List.generate(announcement.length, (index) {
return Column(
children: [
announcementWidget(
imagepath: announcement[index]["imagepath"],
title: announcement[index]["title"],
date: announcement[index]["date"],
subtitle: announcement[index]["subtitle"]),
sizedBoxHeight(16.h)
],
);
}),
)
])),
),
const CommonBlurLeftRed(),
const CommonBlurRightRed(),
const CommonBlurLeft(),
const CommonBlurRight(),
Positioned.fill(
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 16.w),
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
sizedBoxHeight(25.h),
Row(
children: [
Spacer(),
InkWell(
onTap: () {
Get.toNamed(RouteName.announcementrequest);
},
child: text16w700_FCFCFCUnderline(
"View announcement requests"),
),
],
),
sizedBoxHeight(30.h),
Column(
children: List.generate(announcement.length, (index) {
return Column(
children: [
announcementWidget(
imagepath: announcement[index]["imagepath"],
title: announcement[index]["title"],
date: announcement[index]["date"],
subtitle: announcement[index]["subtitle"]),
sizedBoxHeight(16.h)
],
);
}),
)
]))))
]),
floatingActionButton: Container(
height: 55.h,

View File

@@ -3,10 +3,7 @@ import 'dart:async';
import 'package:get/get.dart';
String? myusername;
String? fullname;
String? token;
String? emailid;
int? isprofileupdated;
String? phonenumber;
bool pindialog = false;
bool storagedialog = false;

View File

@@ -27,212 +27,19 @@ class LoginModel {
class Data {
String? accessToken;
UserData? userData;
int? id;
Data({this.accessToken, this.userData});
Data({this.accessToken, this.id});
Data.fromJson(Map<String, dynamic> json) {
accessToken = json['access-token'];
userData = json['user_data'] != null
? new UserData.fromJson(json['user_data'])
: null;
id = json['id'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['access-token'] = this.accessToken;
if (this.userData != null) {
data['user_data'] = this.userData!.toJson();
}
return data;
}
}
class UserData {
int? id;
int? principalTypeXid;
int? principalSourceXid;
String? oneSignalPlayerId;
String? googleId;
String? appleId;
String? facebookId;
String? microsoftId;
String? userName;
String? pin;
String? fullName;
String? gender;
String? dateOfBirth;
String? phoneNumber;
String? otherPhoneNumber;
String? emailAddress;
String? addressLine1;
String? addressLine2;
String? cityXid;
String? stateXid;
String? countryXid;
String? postCode;
String? lastLoginDatetime;
String? profilePhoto;
String? referralCode;
String? description;
String? about;
String? position;
String? trainingScores;
String? height;
String? weight;
String? battingAverage;
int? isProfileUpdated;
String? isActive;
int? groupNotification;
int? communityNotification;
int? followerNotification;
int? newFollowerNotification;
int? directMessageNotification;
String? createdBy;
String? modifiedBy;
String? deletedAt;
String? createdAt;
String? updatedAt;
UserData(
{this.id,
this.principalTypeXid,
this.principalSourceXid,
this.oneSignalPlayerId,
this.googleId,
this.appleId,
this.facebookId,
this.microsoftId,
this.userName,
this.pin,
this.fullName,
this.gender,
this.dateOfBirth,
this.phoneNumber,
this.otherPhoneNumber,
this.emailAddress,
this.addressLine1,
this.addressLine2,
this.cityXid,
this.stateXid,
this.countryXid,
this.postCode,
this.lastLoginDatetime,
this.profilePhoto,
this.referralCode,
this.description,
this.about,
this.position,
this.trainingScores,
this.height,
this.weight,
this.battingAverage,
this.isProfileUpdated,
this.isActive,
this.groupNotification,
this.communityNotification,
this.followerNotification,
this.newFollowerNotification,
this.directMessageNotification,
this.createdBy,
this.modifiedBy,
this.deletedAt,
this.createdAt,
this.updatedAt});
UserData.fromJson(Map<String, dynamic> json) {
id = json['id'];
principalTypeXid = json['principal_type_xid'];
principalSourceXid = json['principal_source_xid'];
oneSignalPlayerId = json['one_signal_player_id'];
googleId = json['google_id'];
appleId = json['apple_id'];
facebookId = json['facebook_id'];
microsoftId = json['microsoft_id'];
userName = json['user_name'];
pin = json['pin'];
fullName = json['full_name'];
gender = json['gender'];
dateOfBirth = json['date_of_birth'];
phoneNumber = json['phone_number'];
otherPhoneNumber = json['other_phone_number'];
emailAddress = json['email_address'];
addressLine1 = json['address_line1'];
addressLine2 = json['address_line2'];
cityXid = json['city_xid'];
stateXid = json['state_xid'];
countryXid = json['country_xid'];
postCode = json['post_code'];
lastLoginDatetime = json['last_login_datetime'];
profilePhoto = json['profile_photo'];
referralCode = json['referral_code'];
description = json['description'];
about = json['about'];
position = json['position'];
trainingScores = json['training_scores'];
height = json['height'];
weight = json['weight'];
battingAverage = json['batting_average'];
isProfileUpdated = json['is_profile_updated'];
isActive = json['is_active'];
groupNotification = json['group_notification'];
communityNotification = json['community_notification'];
followerNotification = json['follower_notification'];
newFollowerNotification = json['new_follower_notification'];
directMessageNotification = json['direct_message_notification'];
createdBy = json['created_by'];
modifiedBy = json['modified_by'];
deletedAt = json['deleted_at'];
createdAt = json['created_at'];
updatedAt = json['updated_at'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
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;
return data;
}
}
}

View File

@@ -1,21 +1,14 @@
import 'dart:io';
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:logger/web.dart';
import 'package:regroup/Common/base_manager.dart';
import 'package:regroup/Login/ViewModel/LoginApi.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';
import 'package:regroup/Utils/dialogs.dart';
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';
@@ -30,75 +23,44 @@ class LoginScreen extends StatefulWidget {
}
class _LoginScreenState extends State<LoginScreen> {
Map<String, dynamic>? _userData;
AccessToken? _accessToken;
bool _checking = true;
final TextEditingController _emailController = TextEditingController();
RxBool isObscured = true.obs;
final TextEditingController _passwordController = TextEditingController();
GoogleAuthService googleSigninController = Get.put(GoogleAuthService());
// final GlobalKey<FormState> _form = GlobalKey<FormState>();
// RxString errormsg = ''.obs;
// RxString errormsgpass = ''.obs;
@override
void initState() {
// TODO: implement initState
super.initState();
}
_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],
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();
//user token
final accessToken = await FacebookAuth.instance.accessToken;
setState(() {
_checking = false;
});
if (accessToken != null) {
print("/////////////////////////////////////////xcheck");
print("/////////////////////////////////////////check");
print("worked");
print(accessToken.toJson());
final userData = await FacebookAuth.instance.getUserData();
logger.i(accessToken.token);
logger.i(userData.toString());
_accessToken = accessToken;
setState(() {
_userData = userData;
});
} else {
print("/////////////////////////////////////////check");
print("not worked");
_login();
}
}
@@ -110,21 +72,20 @@ class _LoginScreenState extends State<LoginScreen> {
_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']);
_userData = userData;
} else {
print(result.status);
print(result.message);
}
setState(() {
_checking = false;
});
}
_logout() async {
await FacebookAuth.instance.logOut();
_accessToken = null;
_userData = null;
setState(() {});
}
@@ -156,25 +117,26 @@ class _LoginScreenState extends State<LoginScreen> {
final data = await LoginAPI().loginApi(updata);
if (data.status == ResponseStatus.SUCCESS) {
// await global.setname();
// 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,
// );
return utils.showToast(data.message);
Get.snackbar(
"Success!",
'Login successful!',
duration: Duration(seconds: 2),
colorText: Colors.white,
backgroundColor: Colors.green,
margin: EdgeInsets.all(8),
snackStyle: SnackStyle.FLOATING,
snackPosition: SnackPosition.BOTTOM,
);
Get.toNamed(RouteName.mainscreen);
} else if (data.status == ResponseStatus.FAILED) {
Get.snackbar(
"Error!",
data.message,
duration: const Duration(seconds: 2),
duration: Duration(seconds: 2),
colorText: Colors.white,
backgroundColor: Colors.red,
margin: const EdgeInsets.all(8),
margin: EdgeInsets.all(8),
snackStyle: SnackStyle.FLOATING,
snackPosition: SnackPosition.BOTTOM,
);
@@ -184,10 +146,10 @@ class _LoginScreenState extends State<LoginScreen> {
Get.snackbar(
"Error!",
data.data['message'],
duration: const Duration(seconds: 2),
duration: Duration(seconds: 2),
colorText: Colors.white,
backgroundColor: Colors.red,
margin: const EdgeInsets.all(8),
margin: EdgeInsets.all(8),
snackStyle: SnackStyle.FLOATING,
snackPosition: SnackPosition.BOTTOM,
);
@@ -198,310 +160,305 @@ class _LoginScreenState extends State<LoginScreen> {
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
child: Scaffold(
resizeToAvoidBottomInset:
false, // Prevent resizing when the keyboard opens
backgroundColor: const Color.fromARGB(255, 18, 32, 47),
body: Stack(
clipBehavior: Clip.none,
children: [
Container(
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/images/png/Choice screen.png"),
fit: BoxFit.cover)),
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 150.h,
),
Padding(
padding: EdgeInsets.symmetric(horizontal: 16.w),
child: Align(
alignment: Alignment.center,
child: Container(
width: 107.w,
height: 70.h,
child: SvgPicture.asset(
"assets/images/svg/onboarding2.svg",
fit: BoxFit.cover,
),
return Scaffold(
resizeToAvoidBottomInset:
false, // Prevent resizing when the keyboard opens
backgroundColor: const Color.fromARGB(255, 18, 32, 47),
body: Stack(
clipBehavior: Clip.none,
children: [
Container(
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/images/png/Choice screen.png"),
fit: BoxFit.cover)),
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 150.h,
),
Padding(
padding: EdgeInsets.symmetric(horizontal: 16.w),
child: Align(
alignment: Alignment.center,
child: Container(
width: 107.w,
height: 70.h,
child: SvgPicture.asset(
"assets/images/svg/onboarding2.svg",
fit: BoxFit.cover,
),
),
),
sizedBoxHeight(20.h),
Align(
alignment: Alignment.center,
child: text22400FCFCFC("Find your community")),
sizedBoxHeight(40.h),
Expanded(
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 16.w),
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
text16400white('Email address'),
sizedBoxHeight(10.h),
CustomTextFormField(
textEditingController: _emailController,
hintText: "Enter your email address",
leadingIcon:
// const Icon(Icons.mail_outline),
SizedBox(
),
sizedBoxHeight(20.h),
Align(
alignment: Alignment.center,
child: text22400FCFCFC("Find your community")),
sizedBoxHeight(40.h),
Expanded(
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 16.w),
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
text16400white('Email address'),
sizedBoxHeight(10.h),
CustomTextFormField(
textEditingController: _emailController,
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,
child: Image.asset(
'assets/images/png/mail.png',
width: 22.w,
height: 17.h,
),
),
// validationMessage: errormsg.value,
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;
},
// 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),
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,
),
// validationMessage: errormsgpass.value,
validator: (value) {
if (value!.isEmpty) {
return 'Please enter your password';
}
if (!RegExp(
r'^(?=.*?[A-Z])(?=.*?[0-9])(?=.*?[!@#\$&*~]).{8,}$')
.hasMatch(value)) {
return 'Enter a valid password';
}
return null;
},
// onInput: (p0) {
// if (p0 == null || p0.isEmpty) {
// errormsgpass.value =
// 'Please enter your password';
// }
// return null;
// },
inputFormatters: [
LengthLimitingTextInputFormatter(20),
RemoveEmojiInputFormatter()
],
),
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 ?')),
)),
sizedBoxHeight(40.h),
CustomButton(
text: "Login",
onPressed: () {
_logincheck();
}),
sizedBoxHeight(20.h),
GestureDetector(
onTap: () {
Get.toNamed(RouteName.signupscreen);
},
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
text14400white('Dont have account ? '),
sizedBoxWidth(5.w),
text14700white('Sign up')
],
),
),
sizedBoxHeight(30.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),
),
),
),
),
// validationMessage: errormsg.value,
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;
},
// 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),
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,
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),
),
),
),
),
// validationMessage: errormsgpass.value,
validator: (value) {
if (value!.isEmpty) {
return 'Please enter your password';
}
if (!RegExp(
r'^(?=.*?[A-Z])(?=.*?[0-9])(?=.*?[!@#\$&*~]).{8,}$')
.hasMatch(value)) {
return 'Enter a valid password';
}
return null;
},
// onInput: (p0) {
// if (p0 == null || p0.isEmpty) {
// errormsgpass.value =
// 'Please enter your password';
// }
// return null;
// },
inputFormatters: [
LengthLimitingTextInputFormatter(20),
RemoveEmojiInputFormatter()
],
),
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 ?')),
)),
sizedBoxHeight(40.h),
CustomButton(
text: "Login",
onPressed: () {
_logincheck();
}),
sizedBoxHeight(20.h),
GestureDetector(
onTap: () {
Get.toNamed(RouteName.signupscreen);
},
],
),
sizedBoxHeight(20.h),
Center(
child: SizedBox(
width: 220.w,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
text14400white('Dont have account ? '),
sizedBoxWidth(5.w),
text14700white('Sign up')
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'))),
),
const Spacer(),
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'))),
),
const Spacer(),
GestureDetector(
onTap: () async {
_checkIfisLoggedIn();
/* FacebookAuth.instance.login(
permissions: ['public_profile', 'email'],
).then((value) {
FacebookAuth.instance.getUserData().then((userData) {
setState(() {
/* _isLoggedIn = true;
_userObj = userData; */
});
});
}); */
},
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(30.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'))),
),
),
// const Spacer(),
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'))),
),
),
// const Spacer(),
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(100)
],
),
),
sizedBoxHeight(100)
],
),
),
),
],
),
],
),
),
],
),
],
),
);
}

View File

@@ -1,229 +0,0 @@
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:regroup/Common/base_manager.dart';
import 'package:regroup/Common/controller/CommonTextFormField.dart';
import 'package:regroup/Global.dart';
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';
import 'package:regroup/resources/routes/route_name.dart';
import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart';
class Verifygoogleandapple extends StatefulWidget {
Verifygoogleandapple({
super.key,
});
@override
State<Verifygoogleandapple> createState() => _VerifygoogleandappleState();
}
class _VerifygoogleandappleState extends State<Verifygoogleandapple> {
TextEditingController emailidcontroller = TextEditingController();
String _selectedAccountType = '';
@override
void initState() {
emailidcontroller.text = Get.arguments['email'];
super.initState();
}
void _onItemSelected(String value) {
setState(() {
_selectedAccountType = value;
});
}
getIdFromAccountType() {
if (_selectedAccountType == 'Individual') {
return 1;
} else {
return 2;
}
}
_createAccountWithOAuth() async {
var updata = {
"principal_type_xid": getIdFromAccountType(),
"email_address": emailidcontroller.text,
};
final resp = await LoginAPI()
.storeUserDetailsWhenComingFromGoogleAppleSignin(updata);
if (resp.status == ResponseStatus.SUCCESS) {
if (_selectedAccountType == 'Individual') {
Get.toNamed(RouteName.tellusindividualscreen);
} else {
Get.toNamed(RouteName.tellusbusinessscreen);
}
} else {
Get.snackbar(
'Error',
'Google Sign-In canceled',
snackPosition: SnackPosition.BOTTOM,
backgroundColor: Colors.red,
colorText: Colors.white,
);
}
}
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
child: Scaffold(
appBar: const CommonAppbar(
titleTxt: '',
),
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),
// 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(
padding: EdgeInsets.symmetric(horizontal: 16.w),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
sizedBoxHeight(20.h),
text22400white('One more step to verify'),
sizedBoxHeight(10.h),
Container(
width: 154,
decoration: const ShapeDecoration(
shape: RoundedRectangleBorder(
side: BorderSide(
width: 1,
strokeAlign: BorderSide.strokeAlignCenter,
color: Color(0xFF858585),
),
),
)),
sizedBoxHeight(20.h),
text14400white(
'Lorem Ipsum is simply dummy text of the printing and typesetting industry.'),
sizedBoxHeight(30.h),
text16400white('Full name'),
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),
Row(
children: [
text16400white('Account type'),
sizedBoxWidth(5.w),
Image.asset('assets/images/png/informationicon.png')
],
),
sizedBoxHeight(10.h),
CustomDropDownRadio(
header: '',
title: '',
listData: const [
'Individual',
'Business',
],
onItemSelected: _onItemSelected,
leadingImage: Image.asset(
'assets/images/png/user.png',
),
),
const Spacer(
flex: 3,
),
CustomButton(
text: "Continue",
onPressed: () {
if (emailidcontroller.text.isEmpty &&
_selectedAccountType.isEmpty) {
utils.showToast('Please fill all fields');
} else {
_createAccountWithOAuth();
}
}),
const Spacer()
],
),
),
)
],
),
),
);
}
}

View File

@@ -1,66 +1,27 @@
import 'package:get/get.dart';
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/Global.dart';
import 'package:regroup/Login/Model/LoginModel.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';
class LoginAPI {
LoginAPI();
Future<ResponseData> loginApi(var data) async {
SharedPreferences prefs = await SharedPreferences.getInstance();
final response = await NetworkApiServices()
.postApi(data, ApiUrls.getlogin, optionalpar: true);
final response = await NetworkApiServices().postApi(
data, 'https://regroup.betadelivery.com/api/v1/login',
optionalpar: true
// "auth/login/",
);
if (response.status == ResponseStatus.SUCCESS) {
String? accountype;
//Map<String, dynamic> responseData = jsonDecode(response.data);
if (response.data['status'] == 'success') {
LoginModel loginObj = LoginModel.fromJson(response.data);
await prefs.setString('access-token', loginObj.data!.accessToken!);
await prefs.setString(
'fullname', loginObj.data?.userData?.fullName ?? "");
await prefs.setString(
'username', loginObj.data?.userData?.userName ?? "");
await prefs.setString(
'email', loginObj.data?.userData?.emailAddress ?? "");
await prefs.setString(
'phone', loginObj.data?.userData?.phoneNumber ?? "");
token = loginObj.data!.accessToken;
emailid = loginObj.data?.userData?.emailAddress;
myusername = loginObj.data?.userData?.userName;
fullname = loginObj.data?.userData?.fullName;
phonenumber = loginObj.data?.userData?.phoneNumber;
await prefs.setString('accountTypefromLogin',
loginObj.data?.userData?.principalTypeXid.toString() ?? "");
// await prefs.setString('refreshToken', loginObj.data!.refresh!);
print("token is ${loginObj.data!.accessToken!}");
if (loginObj.data?.userData?.isProfileUpdated == 0) {
accountype = loginObj.data?.userData?.principalTypeXid.toString();
if (accountype == "1") {
print('tell us individyal');
Get.toNamed(
RouteName.tellusindividualscreen,
// arguments: {
// 'pageroute' : "mainscreen"
// }
);
} else if (accountype == "2") {
print('tell us business');
Get.toNamed(
RouteName.tellusbusinessscreen,
// arguments: {
// 'pageroute' : "mainscreen"
// }
);
}
} else {
Get.toNamed(RouteName.mainscreen);
}
// print("refresh-token is ${loginObj.data!.refresh!}");
} else {
return ResponseData<dynamic>(
response.data['message'], ResponseStatus.FAILED);
@@ -69,76 +30,4 @@ class LoginAPI {
return response;
}
Future<ResponseData> storeGoogleSignin(var data) async {
SharedPreferences prefs = await SharedPreferences.getInstance();
final response = await NetworkApiServices()
.postApi(data, ApiUrls.googlelogin, optionalpar: true);
if (response.status == ResponseStatus.SUCCESS) {
await prefs.setString('access-token', response.data['data']['token']);
if (response.data['data']['is_account_type_updated'] == 3) {
return ResponseData<dynamic>(
"go-to-signin-via-oauth", ResponseStatus.SUCCESS,
data: response.data['data']['email']);
} else {
return ResponseData<dynamic>("go-to-login", ResponseStatus.SUCCESS);
}
}
return response;
}
Future<ResponseData> storeAppleSignin(var data,
{String? emailReceived}) async {
SharedPreferences prefs = await SharedPreferences.getInstance();
final response = await NetworkApiServices()
.postApi(data, ApiUrls.applelogin, optionalpar: true);
if (response.status == ResponseStatus.SUCCESS) {
await prefs.setString('access-token', response.data['data']['token']);
if (response.data['data']['is_account_type_updated'] == 3) {
Get.toNamed(RouteName.verifygoogleapplepage,
arguments: {"email": emailReceived});
return ResponseData<dynamic>(
"go-to-signin-via-oauth", ResponseStatus.SUCCESS);
} else {
Get.toNamed(RouteName.mainscreen);
return ResponseData<dynamic>("go-to-login", ResponseStatus.SUCCESS);
}
}
return response;
}
Future<ResponseData> storeFacebookSignin(var data,
{String? emailReceived}) async {
SharedPreferences prefs = await SharedPreferences.getInstance();
final response = await NetworkApiServices()
.postApi(data, ApiUrls.facebooklogin, optionalpar: true);
if (response.status == ResponseStatus.SUCCESS) {
await prefs.setString('access-token', response.data['data']['token']);
if (response.data['data']['is_account_type_updated'] == 3) {
Get.toNamed(RouteName.verifygoogleapplepage,
arguments: {"email": emailReceived});
return ResponseData<dynamic>(
"go-to-signin-via-oauth", ResponseStatus.SUCCESS);
} else {
Get.toNamed(RouteName.mainscreen);
return ResponseData<dynamic>("go-to-login", ResponseStatus.SUCCESS);
}
}
return response;
}
Future<ResponseData> storeUserDetailsWhenComingFromGoogleAppleSignin(
var data) async {
final response = await NetworkApiServices()
.postApi(data, ApiUrls.storeDetailsOfOAuth, optionalpar: false);
if (response.status == ResponseStatus.SUCCESS) {
return ResponseData<dynamic>(
response.data['message'], ResponseStatus.SUCCESS);
}
return response;
}
}

View File

@@ -1,25 +0,0 @@
import 'package:get/get.dart';
import 'package:regroup/Login/ViewModel/LoginApi.dart';
import 'package:regroup/Utils/Common/googleOAuthService.dart';
import 'package:sign_in_with_apple/sign_in_with_apple.dart';
class AppleOAuthService {
void logIn() async {
try {
final credential = await SignInWithApple.getAppleIDCredential(
scopes: [
AppleIDAuthorizationScopes.email,
AppleIDAuthorizationScopes.fullName,
],
);
logger.d("email is ${credential.email}");
logger.d("fullname is ${credential.givenName}");
logger.d("token is ${credential.userIdentifier}");
await LoginAPI()
.storeAppleSignin({"apple_auth_token": credential.userIdentifier}, emailReceived:credential.email );
} catch (e) {
print("Error occured");
}
}
}

View File

@@ -1,5 +1,4 @@
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/Utils/Common/CustomTextformfield.dart';
@@ -13,7 +12,7 @@ class CustomDropDownWidgetSignup extends StatefulWidget {
required this.title,
required this.listData,
required this.onItemSelected,
this.leadingImage,
required this.leadingImage,
}) : super(key: key);
final String header;
@@ -49,7 +48,7 @@ class _CustomDropDownWidgetSignupState
padding: EdgeInsets.only(
top: 14.0, bottom: 14.0, right: 22.w, left: 12.w),
decoration: BoxDecoration(
color: const Color(0xFFFFFFFF).withOpacity(0.10),
color: Color(0xFFFFFFFF).withOpacity(0.10),
borderRadius: onDropTap.value
? BorderRadius.vertical(
top: Radius.circular(30.r),
@@ -74,13 +73,7 @@ class _CustomDropDownWidgetSignupState
// 'assets/images/png/user.png',
// ),
widget.leadingImage == null
?
SizedBox()
:
widget.leadingImage!
,
widget.leadingImage!,
SizedBox(width: 16.w),
Text(
selectedValue.value.isEmpty
@@ -105,7 +98,7 @@ class _CustomDropDownWidgetSignupState
Container(
width: double.infinity,
decoration: BoxDecoration(
color: const Color(0xFFFFFFFF).withOpacity(0.10),
color: Color(0xFFFFFFFF).withOpacity(0.10),
borderRadius: BorderRadius.vertical(
bottom: Radius.circular(30.r),
),
@@ -146,7 +139,7 @@ class _CustomDropDownWidgetSignupState
),
// sizedBoxHeight(5.h),
if (index != widget.listData.length - 1)
const Divider(thickness: 1, color: Color(0xFF434A53)),
Divider(thickness: 1, color: const Color(0xFF434A53)),
],
),
);
@@ -223,7 +216,7 @@ class _CustomDropDownTag1State extends State<CustomDropDownTag1> {
left: 12.w,
),
decoration: BoxDecoration(
color: const Color(0xFFFFFFFF).withOpacity(0.10),
color: Color(0xFFFFFFFF).withOpacity(0.10),
gradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
@@ -285,7 +278,7 @@ class _CustomDropDownTag1State extends State<CustomDropDownTag1> {
Container(
width: double.infinity,
decoration: BoxDecoration(
color: const Color(0xFFFFFFFF).withOpacity(0.10),
color: Color(0xFFFFFFFF).withOpacity(0.10),
borderRadius: BorderRadius.vertical(
bottom: Radius.circular(30.r),
),
@@ -327,14 +320,14 @@ class _CustomDropDownTag1State extends State<CustomDropDownTag1> {
fontWeight: FontWeight.w400,
fontFamily: 'Helvetica'),
),
const Spacer(),
Spacer(),
text14400whiteblur(widget.rowData[widget.listData
.indexOf(filteredListData[index])]),
],
),
),
if (index != filteredListData.length - 1)
const Divider(thickness: 1, color: Color(0xFF434A53)),
Divider(thickness: 1, color: const Color(0xFF434A53)),
],
),
);
@@ -390,7 +383,7 @@ class _CustomDropDownTagState extends State<CustomDropDownTag> {
padding: EdgeInsets.only(
top: 14.0, bottom: 14.0, right: 22.w, left: 12.w),
decoration: BoxDecoration(
color: const Color(0xFFFFFFFF).withOpacity(0.10),
color: Color(0xFFFFFFFF).withOpacity(0.10),
borderRadius: onDropTap.value
? BorderRadius.vertical(
top: Radius.circular(30.r),
@@ -440,7 +433,7 @@ class _CustomDropDownTagState extends State<CustomDropDownTag> {
Container(
width: double.infinity,
decoration: BoxDecoration(
color: const Color(0xFFFFFFFF).withOpacity(0.10),
color: Color(0xFFFFFFFF).withOpacity(0.10),
borderRadius: BorderRadius.vertical(
bottom: Radius.circular(30.r),
),
@@ -480,14 +473,14 @@ class _CustomDropDownTagState extends State<CustomDropDownTag> {
fontWeight: FontWeight.w400,
fontFamily: 'Helvetica'),
),
const Spacer(),
Spacer(),
text14400whiteblur(widget.rowData[index]),
],
),
),
// sizedBoxHeight(5.h),
if (index != widget.listData.length - 1)
const Divider(thickness: 1, color: Color(0xFF434A53)),
Divider(thickness: 1, color: const Color(0xFF434A53)),
],
),
);
@@ -500,7 +493,6 @@ class _CustomDropDownTagState extends State<CustomDropDownTag> {
}
}
///
class CustomDropDownRadio extends StatefulWidget {
const CustomDropDownRadio({
Key? key,
@@ -541,7 +533,6 @@ class _CustomDropDownRadioState extends State<CustomDropDownRadio> {
selectedValue.value = item;
_textController.clear();
widget.onItemSelected(item);
onDropTap.value = !onDropTap.value;
},
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
@@ -560,10 +551,10 @@ class _CustomDropDownRadioState extends State<CustomDropDownRadio> {
},
);
}),
const SizedBox(width: 8),
SizedBox(width: 8),
Text(
item,
style: const TextStyle(
style: TextStyle(
color: Colors.white,
fontSize: 16,
fontFamily: 'Helvetica',
@@ -575,7 +566,7 @@ class _CustomDropDownRadioState extends State<CustomDropDownRadio> {
),
// SizedBox(height: 5.h),
if (index != widget.listData.length - 1)
const Divider(thickness: 1, color: Color(0xFF434A53)),
Divider(thickness: 1, color: const Color(0xFF434A53)),
],
),
),
@@ -588,7 +579,7 @@ class _CustomDropDownRadioState extends State<CustomDropDownRadio> {
value: _textController.text,
child: Column(
children: [
const Divider(thickness: 1, color: Color(0xFF434A53)),
Divider(thickness: 1, color: const Color(0xFF434A53)),
Row(
children: [
Obx(() {
@@ -603,8 +594,8 @@ class _CustomDropDownRadioState extends State<CustomDropDownRadio> {
},
);
}),
const SizedBox(width: 8),
const Text(
SizedBox(width: 8),
Text(
"Other: ",
style: TextStyle(
color: Colors.white,
@@ -617,13 +608,13 @@ class _CustomDropDownRadioState extends State<CustomDropDownRadio> {
Expanded(
child: TextField(
controller: _textController,
style: const TextStyle(
style: TextStyle(
color: Colors.white,
fontSize: 16,
fontFamily: 'Helvetica',
fontWeight: FontWeight.w500,
),
decoration: const InputDecoration(
decoration: InputDecoration(
hintText: '',
hintStyle: TextStyle(color: Colors.white70),
border: UnderlineInputBorder(),
@@ -637,7 +628,7 @@ class _CustomDropDownRadioState extends State<CustomDropDownRadio> {
widget.onItemSelected(_textController.text);
}
},
child: const Text(
child: Text(
'OK',
style: TextStyle(
color: Colors.white,
@@ -671,13 +662,11 @@ class _CustomDropDownRadioState extends State<CustomDropDownRadio> {
},
child: Container(
width: double.infinity,
height: 52.h,
height: 50.h,
padding: EdgeInsets.only(
right: 22.w,
left: 12.w,
),
top: 14.0, bottom: 14.0, right: 22.w, left: 12.w),
decoration: BoxDecoration(
color: const Color(0xFFFFFFFF).withOpacity(0.10),
color: Color(0xFFFFFFFF).withOpacity(0.10),
borderRadius: onDropTap.value
? BorderRadius.vertical(
top: Radius.circular(30.r),
@@ -693,29 +682,29 @@ class _CustomDropDownRadioState extends State<CustomDropDownRadio> {
),
border: Border.all(color: const Color(0xFF434A53)),
),
child: Center(
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
widget.leadingImage!,
SizedBox(width: 12.w),
Text(
selectedValue.value.isEmpty
? widget.header
: selectedValue.value,
style: TextStyle(
color: Colors.white,
fontSize: 16.sp,
fontFamily: 'Helvetica',
fontWeight: FontWeight.w400),
),
Spacer(),
onDropTap.value
? Image.asset('assets/images/png/arrowup.png')
: Image.asset('assets/images/png/arrowdown.png'),
],
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
widget.leadingImage!,
SizedBox(width: 16.w),
Text(
selectedValue.value.isEmpty
? widget.header
: selectedValue.value,
style: TextStyle(
color: Colors.white,
fontSize: 16.sp,
fontFamily: 'Helvetica',
fontWeight: FontWeight.w400),
),
],
),
onDropTap.value
? Image.asset('assets/images/png/arrowup.png')
: Image.asset('assets/images/png/arrowdown.png'),
],
),
),
),
@@ -726,7 +715,7 @@ class _CustomDropDownRadioState extends State<CustomDropDownRadio> {
width: double.infinity,
//height: widget.listData.length > 4 ? 250.h : null,
decoration: BoxDecoration(
color: const Color(0xFFFFFFFF).withOpacity(0.10),
color: Color(0xFFFFFFFF).withOpacity(0.10),
borderRadius: BorderRadius.vertical(
bottom: Radius.circular(30.r),
),
@@ -753,270 +742,6 @@ class _CustomDropDownRadioState extends State<CustomDropDownRadio> {
}
}
class CustomDropDownChexkBox extends StatefulWidget {
const CustomDropDownChexkBox({
Key? key,
required this.header,
required this.title,
required this.listData,
required this.onItemSelected,
required this.leadingImage,
this.showOtherOption = false,
required this.initiallySelected, // Added this line
}) : super(key: key);
final String header;
final String title;
final List<String> listData;
final Function(List<String>) onItemSelected;
final Widget? leadingImage;
final bool showOtherOption;
final List<String> initiallySelected; // Added this line
@override
State<CustomDropDownChexkBox> createState() => _CustomDropDownChexkBoxState();
}
class _CustomDropDownChexkBoxState extends State<CustomDropDownChexkBox> {
RxBool onDropTap = false.obs;
RxList<String> selectedValues = <String>[].obs;
final TextEditingController _textController = TextEditingController();
@override
void initState() {
super.initState();
selectedValues.addAll(widget.initiallySelected); // Added this line
}
List<DropdownMenuItem<String>> _buildDropdownMenuItems() {
List<DropdownMenuItem<String>> items =
widget.listData.asMap().entries.map((entry) {
int index = entry.key;
String item = entry.value;
return DropdownMenuItem<String>(
value: item,
child: InkWell(
onTap: () {
if (selectedValues.contains(item)) {
selectedValues.remove(item);
} else {
selectedValues.add(item);
}
_textController.clear();
widget.onItemSelected(selectedValues);
},
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) {
if (value == true) {
selectedValues.add(item);
} else {
selectedValues.remove(item);
}
_textController.clear();
widget.onItemSelected(selectedValues);
},
);
}),
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<String>(
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) {
if (value == true &&
_textController.text.trim().isNotEmpty) {
selectedValues.add(_textController.text);
} else {
selectedValues.remove(_textController.text);
}
widget.onItemSelected(selectedValues);
},
);
}),
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: () {
if (_textController.text.trim().isNotEmpty) {
selectedValues.add(_textController.text);
widget.onItemSelected(selectedValues);
}
},
child: const Text(
'OK',
style: TextStyle(
color: Colors.white,
fontSize: 16,
fontFamily: 'Helvetica',
fontWeight: FontWeight.w500,
),
),
),
],
),
SizedBox(height: 10),
],
),
),
);
}
return items;
}
@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:
EdgeInsets.only(right: 22, left: 12, top: 14, bottom: 14),
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: [
if (widget.leadingImage != null) widget.leadingImage!,
const SizedBox(width: 12),
Expanded(
child: Text(
selectedValues.isEmpty
? widget.header
: selectedValues.join(', '),
style: TextStyle(
color: Colors.white,
fontSize: 16,
fontFamily: 'Helvetica',
fontWeight: FontWeight.w400),
),
),
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(),
),
),
),
],
),
);
}
}
class CustomDropDownCheckBox extends StatefulWidget {
const CustomDropDownCheckBox({
Key? key,
@@ -1059,7 +784,7 @@ class _CustomDropDownCheckBoxState extends State<CustomDropDownCheckBox> {
padding: EdgeInsets.only(
top: 14.0, bottom: 14.0, right: 22.w, left: 12.w),
decoration: BoxDecoration(
color: const Color(0xFFFFFFFF).withOpacity(0.10),
color: Color(0xFFFFFFFF).withOpacity(0.10),
borderRadius: onDropTap.value
? BorderRadius.vertical(top: Radius.circular(30.r))
: BorderRadius.circular(30.r),
@@ -1109,7 +834,7 @@ class _CustomDropDownCheckBoxState extends State<CustomDropDownCheckBox> {
Container(
width: double.infinity,
decoration: BoxDecoration(
color: const Color(0xFFFFFFFF).withOpacity(0.10),
color: Color(0xFFFFFFFF).withOpacity(0.10),
borderRadius:
BorderRadius.vertical(bottom: Radius.circular(30.r)),
border: Border.all(color: const Color(0xFF434A53)),
@@ -1170,10 +895,9 @@ class _CustomDropDownCheckBoxState extends State<CustomDropDownCheckBox> {
),
),
Checkbox(
side:
const BorderSide(color: Color(0xFF434A53)),
side: BorderSide(color: Color(0xFF434A53)),
value: selectedValues.contains(item),
activeColor: const Color(0xFF434A53),
activeColor: Color(0xFF434A53),
checkColor: Colors.white,
onChanged: (bool? value) {
if (value == true) {
@@ -1189,7 +913,7 @@ class _CustomDropDownCheckBoxState extends State<CustomDropDownCheckBox> {
),
),
if (index != widget.listData.length - 1)
const Divider(thickness: 1, color: Color(0xFF434A53)),
Divider(thickness: 1, color: const Color(0xFF434A53)),
],
),
);

View File

@@ -113,7 +113,7 @@ class _CustomTextFormFieldState extends State<CustomTextFormField> {
readOnly: widget.readonly,
onTap: widget.onTap,
enabled: widget.enabled,
enableInteractiveSelection: true,
enableInteractiveSelection: false,
maxLines: widget.maxlines,
obscureText: obscureText,
controller: widget.textEditingController,
@@ -129,8 +129,7 @@ class _CustomTextFormFieldState extends State<CustomTextFormField> {
prefixIcon: widget.leadingIcon == null
? null
: Padding(
padding: EdgeInsets.symmetric(
horizontal: 10.w, vertical: 13.h),
padding: const EdgeInsets.symmetric(horizontal: 10),
child: widget.leadingIcon!,
),
suffixIcon: widget.isInputPassword
@@ -160,12 +159,13 @@ class _CustomTextFormFieldState extends State<CustomTextFormField> {
],
),
)
: widget.suffixIcon == null
? null
: widget.suffixIcon!,
border: InputBorder.none,
contentPadding:
EdgeInsets.symmetric(horizontal: 20.h, vertical: 13.w),
const EdgeInsets.symmetric(horizontal: 20, vertical: 10),
),
keyboardType: widget.texttype,
inputFormatters: widget.inputFormatters,
@@ -286,7 +286,7 @@ class _CustomTextFormField2State extends State<CustomTextFormField2> {
readOnly: widget.readonly,
onTap: widget.onTap,
enabled: widget.enabled,
enableInteractiveSelection: true,
enableInteractiveSelection: false,
maxLines: widget.maxlines,
autovalidateMode: AutovalidateMode.onUserInteraction,
obscureText: obscureText,
@@ -647,7 +647,7 @@ class _SearchTextFormFieldState extends State<SearchTextFormField> {
readOnly: widget.readonly,
onTap: widget.onTap,
enabled: widget.enabled,
enableInteractiveSelection: true,
enableInteractiveSelection: false,
maxLines: widget.maxlines,
obscureText: obscureText,
controller: widget.textEditingController,

View File

@@ -53,7 +53,7 @@ class ImageUploadBottomSheet {
.getImage(ImageSource.camera);
onImagePicked(result);
// Get.back();
Get.back();
},
child: Column(
children: [
@@ -116,7 +116,7 @@ class ImageUploadBottomSheet {
onTap: () async {
var result = await FilePickerMethod().pickFile();
onImagePicked(result?.path ?? "");
// Get.back();
Get.back();
},
child: Column(
children: [
@@ -155,7 +155,7 @@ class ImageUploadBottomSheet {
.getImage(ImageSource.camera);
onImagePicked(result);
// Get.back();
Get.back();
},
child: Column(
children: [
@@ -187,7 +187,7 @@ class ImageUploadBottomSheet {
var result = await ImagePickerMethod()
.getImage(ImageSource.gallery);
onImagePicked(result);
// Get.back();
Get.back();
},
child: Column(
children: [

View File

@@ -14,22 +14,19 @@ class NoInternet extends StatefulWidget {
}
class _NoInternetState extends State<NoInternet> {
Future<void> checkInternet() async {
final connectivityResult = await (Connectivity().checkConnectivity());
if (connectivityResult.contains(ConnectivityResult.wifi) ||
connectivityResult.contains(ConnectivityResult.mobile)) {
if (connectivityResult.contains(ConnectivityResult.wifi) ||
connectivityResult.contains(ConnectivityResult.mobile) ) {
setState(() {
// _connectionStatus = connectivityResult.toString();
Get.back(result: true);
});
} else {
setState(() {
Get.snackbar(
"Error",
"Your internet is still down!",
backgroundColor: Colors.white,
);
Get.snackbar("Error", "Your internet is still down!");
// _connectionStatus = connectivityResult.toString();
// print(_connectionStatus.toString());
// Get.toNamed(RouteName.nointernet);
@@ -61,19 +58,13 @@ class _NoInternetState extends State<NoInternet> {
sizedBoxHeight(40.h),
Text(
'No Internet !',
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 20,
color: Colors.white),
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20),
),
sizedBoxHeight(15.h),
Text(
'Please Check Your Internet\nConnection',
textAlign: TextAlign.center,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 20,
color: Colors.white),
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20),
),
sizedBoxHeight(20.h),
CustomButton(

View File

@@ -1,84 +0,0 @@
import 'package:get/get.dart';
import 'package:google_sign_in/google_sign_in.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:logger/logger.dart';
String? userName;
String? mobileNumber;
String? emailAddress;
String? firebaseidTokenGoogleSignin;
String? packageidTokenGoogleSignin;
var logger = Logger(
printer: PrettyPrinter(
// methodCount: 2, // Number of method calls to be displayed
// errorMethodCount: 8, // Number of method calls if stacktrace is provided
// lineLength: 120, // Width of the output
colors: true, // Colorful log messages
// printEmojis: true, // Print an emoji for each log message
// printTime: false // Should each log print contain a timestamp
),
);
class GoogleAuthService extends GetxController {
final GoogleSignIn _googleSignIn = GoogleSignIn(scopes: ['email']);
Rx<User?> user = Rx<User?>(FirebaseAuth.instance.currentUser);
@override
void onInit() {
super.onInit();
FirebaseAuth.instance.authStateChanges().listen((User? newUser) {
user.value = newUser;
});
}
Future<String?> handleGoogleSignIn() async {
try {
// Sign out the user if they are already signed in
await _googleSignIn.signOut();
// This will show the Google Sign-In popup and allow the user to select an account.
final GoogleSignInAccount? googleUser = await _googleSignIn.signIn();
if (googleUser == null) {
return 'Google Sign-In canceled';
}
// // If the user signed in successfully, we can get their user information.
final GoogleSignInAuthentication googleAuth =
await googleUser.authentication;
final String? accessToken = googleAuth.accessToken;
packageidTokenGoogleSignin = googleAuth.accessToken;
final String? idToken = googleAuth.idToken;
logger.d(packageidTokenGoogleSignin);
//new method
// Sign in with Google credentials using Firebase Authentication.
final AuthCredential credential = GoogleAuthProvider.credential(
accessToken: accessToken,
idToken: idToken,
);
// Use Firebase Authentication to sign in with the provided credential.
final UserCredential authResult =
await FirebaseAuth.instance.signInWithCredential(credential);
// Firebase user information is available in authResult.user.
final User? firebaseUser = authResult.user;
print("Firebase user ID: ${firebaseUser?.uid}");
print("Firebase user email: ${firebaseUser?.email}");
print("Firebase user display name: ${firebaseUser?.displayName}");
print("Firebase user metadata: ${firebaseUser?.metadata}");
print("Firebase user number: ${firebaseUser?.phoneNumber}");
userName = firebaseUser?.displayName;
mobileNumber = firebaseUser?.phoneNumber;
emailAddress = firebaseUser?.email;
firebaseidTokenGoogleSignin = firebaseUser?.uid;
return packageidTokenGoogleSignin;
} catch (error) {
// Handle any errors that occurred during the sign-in process.
print('Error during Google Sign-In: $error');
return null;
}
}
}

View File

@@ -15,13 +15,15 @@ class utils {
elevation: 0,
backgroundColor: Colors.transparent,
child: WillPopScope(
child: const Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
CircularProgressIndicator(
color: Color(0xffc18948),
),
],
child: Container(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
CircularProgressIndicator(
color: Color(0xffc18948),
),
],
),
),
onWillPop: () async => false),
),

View File

@@ -414,16 +414,6 @@ Widget text10400white(String text) {
fontWeight: FontWeight.w400),
);
}
Widget text9400white(String text) {
return Text(
text,
style: TextStyle(
fontSize: 9.sp,
color: Colors.white,
fontFamily: 'Helvetica',
fontWeight: FontWeight.w400),
);
}
Widget text6400white(String text) {
return Text(

View File

@@ -1,68 +0,0 @@
// File generated by FlutterFire CLI.
// ignore_for_file: type=lint
import 'package:firebase_core/firebase_core.dart' show FirebaseOptions;
import 'package:flutter/foundation.dart'
show defaultTargetPlatform, kIsWeb, TargetPlatform;
/// Default [FirebaseOptions] for use with your Firebase apps.
///
/// Example:
/// ```dart
/// import 'firebase_options.dart';
/// // ...
/// await Firebase.initializeApp(
/// options: DefaultFirebaseOptions.currentPlatform,
/// );
/// ```
class DefaultFirebaseOptions {
static FirebaseOptions get currentPlatform {
if (kIsWeb) {
throw UnsupportedError(
'DefaultFirebaseOptions have not been configured for web - '
'you can reconfigure this by running the FlutterFire CLI again.',
);
}
switch (defaultTargetPlatform) {
case TargetPlatform.android:
return android;
case TargetPlatform.iOS:
return ios;
case TargetPlatform.macOS:
throw UnsupportedError(
'DefaultFirebaseOptions have not been configured for macos - '
'you can reconfigure this by running the FlutterFire CLI again.',
);
case TargetPlatform.windows:
throw UnsupportedError(
'DefaultFirebaseOptions have not been configured for windows - '
'you can reconfigure this by running the FlutterFire CLI again.',
);
case TargetPlatform.linux:
throw UnsupportedError(
'DefaultFirebaseOptions have not been configured for linux - '
'you can reconfigure this by running the FlutterFire CLI again.',
);
default:
throw UnsupportedError(
'DefaultFirebaseOptions are not supported for this platform.',
);
}
}
static const FirebaseOptions android = FirebaseOptions(
apiKey: 'AIzaSyA7z_Q3xN1IHZFzhfOtkXTyryGEJMOZrPY',
appId: '1:563133114654:android:9032ddcb6dc5add26c010f',
messagingSenderId: '563133114654',
projectId: 'regroup-9aed2',
storageBucket: 'regroup-9aed2.appspot.com',
);
static const FirebaseOptions ios = FirebaseOptions(
apiKey: 'AIzaSyCvettUZf1thSh9xO5-SxR_IYx-tCmVnc0',
appId: '1:563133114654:ios:d5ce57e5b214757e6c010f',
messagingSenderId: '563133114654',
projectId: 'regroup-9aed2',
storageBucket: 'regroup-9aed2.appspot.com',
iosBundleId: 'com.regroup.wdi',
);
}

View File

@@ -1,22 +1,20 @@
import 'dart:async';
import 'dart:io';
import 'dart:developer';
import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:device_info_plus/device_info_plus.dart';
import 'package:firebase_core/firebase_core.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: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';
import 'package:statsfl/statsfl.dart';
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);
SystemChrome.setPreferredOrientations([
DeviceOrientation.portraitUp,
@@ -32,8 +30,6 @@ Future<void> main() async {
);
}
final streamController = StreamController.broadcast();
class MyApp extends StatefulWidget {
const MyApp({super.key});
@@ -41,137 +37,7 @@ class MyApp extends StatefulWidget {
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
// var _connectionStatus = ConnectivityResult.values.toString();
// final Connectivity _connectivity = Connectivity();
// late StreamSubscription<ConnectivityResult> _connectivitySubscription;
List<ConnectivityResult> _connectionStatus = [ConnectivityResult.none];
final Connectivity _connectivity = Connectivity();
late StreamSubscription<List<ConnectivityResult>> _connectivitySubscription;
// Future<void> checkInternet() async {
// final connectivityResult = await (Connectivity().checkConnectivity());
// if (connectivityResult == ConnectivityResult.wifi ||
// connectivityResult == ConnectivityResult.mobile) {
// setState(() {
// _connectionStatus = connectivityResult.toString();
// print("has internet");
// });
// } else {
// setState(() {
// _connectionStatus = connectivityResult.toString();
// print("no internet");
// });
// }
// }
Future<void> initConnectivity() async {
late List<ConnectivityResult> result;
// Platform messages may fail, so we use a try/catch PlatformException.
try {
result = await _connectivity.checkConnectivity();
print("initconnectivitity");
} on PlatformException catch (e) {
print("errrror");
print(e);
return;
}
if (!mounted) {
return Future.value(null);
}
return _updateConnectionStatus(result);
}
// Future<void> _updateConnectionStatus(List<ConnectivityResult> result) async {
// setState(() {
// _connectionStatus = result.toString();
// });
// // ignore: avoid_print
// print('Connectivity changed: $_connectionStatus');
// }
Future<void> _updateConnectionStatus(List<ConnectivityResult> result) async {
// setState(() {
// _connectionStatus = result;
// });
if (result.contains(ConnectivityResult.wifi) ||
result.contains(ConnectivityResult.mobile)) {
setState(() {
_connectionStatus = result;
Get.back(result: true);
});
} else {
setState(() {
_connectionStatus = result;
Get.toNamed(RouteName.nointernet);
});
// Get.toNamed(RouteName.nointernet);
}
// ignore: avoid_print
print('Connectivity changed: $_connectionStatus');
}
Future<void> _getStoragePermission() async {
DeviceInfoPlugin plugin = DeviceInfoPlugin();
AndroidDeviceInfo android = await plugin.androidInfo;
if (android.version.sdkInt < 33) {
if (await Permission.storage.request().isGranted) {
// setState(() {
// permissionGranted = true;
// });
} else if (await Permission.storage.request().isPermanentlyDenied) {
await openAppSettings();
await utils.showToast("Permission denied.");
}
// else if (await Permission.audio.request().isDenied) {
// // setState(() {
// // permissionGranted = false;
// // });
// }
} else {
if (await Permission.photos.request().isGranted) {
// await utils.showToast("Permission granted.");
// setState(() {
// permissionGranted = true;
// });
} else if (await Permission.photos.request().isPermanentlyDenied) {
await openAppSettings();
await utils.showToast("Permission denied.");
} else if (await Permission.photos.request().isDenied) {
await openAppSettings();
await utils.showToast("Permission denied.");
// setState(() {
// permissionGranted = false;
// });
}
}
}
@override
void initState() {
initConnectivity();
WidgetsBinding.instance.addObserver(this);
_connectivitySubscription =
_connectivity.onConnectivityChanged.listen(_updateConnectionStatus);
//do not remove this coomented code
if (Platform.isAndroid) {
_getStoragePermission();
}
super.initState();
}
@override
void dispose() {
_connectivitySubscription.cancel();
super.dispose();
}
class _MyAppState extends State<MyApp> {
@override
Widget build(BuildContext context) {
return ScreenUtilInit(
@@ -182,7 +48,7 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
fontFamily: 'Cambria',
),
debugShowCheckedModeBanner: false,
initialRoute: RouteName.profiletabbusguest,
initialRoute: RouteName.splashScreen,
getPages: AppRoutes.appRoutes(),
),
designSize: const Size(390, 844),

View File

@@ -1,16 +1,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:regroup/Common/CommonButton.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/texts.dart';
import 'package:regroup/onboarding/NewPass/ViewModel/NewPassAPI.dart';
import 'package:regroup/resources/routes/route_name.dart';
import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart';
class NewPassword extends StatefulWidget {
const NewPassword({super.key});
@@ -20,77 +14,6 @@ class NewPassword extends StatefulWidget {
}
class _NewPasswordState extends State<NewPassword> {
TextEditingController newPassController = TextEditingController();
TextEditingController confirmPassController = TextEditingController();
final emailAddress = Get.arguments;
_newpassDone() async {
print('EmailAddress --- $emailAddress');
if (newPassController.text.isBlank! ||
confirmPassController.text.isBlank!) {
Get.snackbar(
'Error',
'Enter your credentials',
snackPosition: SnackPosition.BOTTOM,
backgroundColor: Colors.red,
colorText: Colors.white,
);
} else if (!RegExp(r'^(?=.*?[A-Z])(?=.*?[0-9])(?=.*?[!@#\$&*~]).{8,}$')
.hasMatch(newPassController.text)) {
Get.snackbar(
'Error',
'Password must contain at least one special character, one capital letter, and one number',
snackPosition: SnackPosition.BOTTOM,
backgroundColor: Colors.red,
colorText: Colors.white,
);
} else if (confirmPassController.text != newPassController.text) {
Get.snackbar(
'Error',
'Password does not match',
snackPosition: SnackPosition.BOTTOM,
backgroundColor: Colors.red,
colorText: Colors.white,
);
} else {
Map<String, String> updata = {
"email_address": emailAddress,
"password": newPassController.text,
};
final data = await NewtpassAPI().newtpassApi(updata);
if (data.status == ResponseStatus.SUCCESS) {
// btnController.reset();
Get.snackbar(
"Success!",
'Password has been reset successfully!',
duration: Duration(seconds: 2),
colorText: Colors.white,
backgroundColor: Colors.green,
margin: EdgeInsets.all(8),
snackStyle: SnackStyle.FLOATING,
snackPosition: SnackPosition.BOTTOM,
);
Future.delayed(Duration(seconds: 1), () {
Get.toNamed(RouteName.loginScreen);
});
// print('success');
} else {
Get.snackbar(
"Error!",
data.message,
duration: Duration(seconds: 2),
colorText: Colors.white,
backgroundColor: Colors.red,
margin: EdgeInsets.all(8),
snackStyle: SnackStyle.FLOATING,
snackPosition: SnackPosition.BOTTOM,
);
}
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
@@ -125,51 +48,13 @@ class _NewPasswordState extends State<NewPassword> {
sizedBoxHeight(35.h),
text16w400_FCFCFC("Create new password"),
sizedBoxHeight(15.h),
CustomTextFormField(
textEditingController: newPassController,
validator: (val) {
if (val == null || val.isEmpty) {
return 'Please enter your password';
}
if (!RegExp(
r'^(?=.*?[A-Z])(?=.*?[0-9])(?=.*?[!@#\$&*~]).{8,}$')
.hasMatch(val)) {
return 'Enter a valid password';
}
return null;
},
inputFormatters: [
LengthLimitingTextInputFormatter(20),
RemoveEmojiInputFormatter()
],
),
CustomTextFormField(),
sizedBoxHeight(20.h),
text16w400_FCFCFC("Confirm password"),
sizedBoxHeight(15.h),
CustomTextFormField(
textEditingController: confirmPassController,
validator: (val) {
if (val == null || val.isEmpty) {
return 'Please enter your password';
}
if (val != newPassController.text) {
return 'Password does not match';
}
return null;
},
inputFormatters: [
LengthLimitingTextInputFormatter(20),
RemoveEmojiInputFormatter()
],
),
CustomTextFormField(),
sizedBoxHeight(90.h),
CommonBtn(
text: 'Continue',
onTap: () {
_newpassDone();
},
),
CommonBtn(text: 'Continue'),
])))
]));
}

View File

@@ -1,21 +0,0 @@
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 NewtpassAPI {
NewtpassAPI();
Future<ResponseData<dynamic>> newtpassApi(var data) async {
final response = await NetworkApiServices().postApi(
data,
ApiUrls.resetpassword,
// "https://regroup.betadelivery.com/api/v1/reset-password",
);
if (response.data['status'] == 'success') {
return ResponseData<dynamic>(
response.data['message'], ResponseStatus.SUCCESS);
} else {
return ResponseData<dynamic>(
response.data['message'], ResponseStatus.FAILED);
}
}
}

View File

@@ -1,332 +0,0 @@
class GetuserdetailsModel {
String? status;
int? statusCode;
String? message;
Data? data;
GetuserdetailsModel({this.status, this.statusCode, this.message, this.data});
GetuserdetailsModel.fromJson(Map<String, dynamic> json) {
status = json['status'];
statusCode = json['status_code'];
message = json['message'];
data = json['data'] != null ? new Data.fromJson(json['data']) : null;
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
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 {
UserData? userData;
List<UserCommunity>? userCommunity;
List<UserGroups>? userGroups;
Data({this.userData, this.userCommunity, this.userGroups});
Data.fromJson(Map<String, dynamic> json) {
userData = json['userData'] != null
? new UserData.fromJson(json['userData'])
: null;
if (json['userCommunity'] != null) {
userCommunity = <UserCommunity>[];
json['userCommunity'].forEach((v) {
userCommunity!.add(new UserCommunity.fromJson(v));
});
}
if (json['userGroups'] != null) {
userGroups = <UserGroups>[];
json['userGroups'].forEach((v) {
userGroups!.add(new UserGroups.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.userData != null) {
data['userData'] = this.userData!.toJson();
}
if (this.userCommunity != null) {
data['userCommunity'] =
this.userCommunity!.map((v) => v.toJson()).toList();
}
if (this.userGroups != null) {
data['userGroups'] = this.userGroups!.map((v) => v.toJson()).toList();
}
return data;
}
}
class UserData {
int? id;
int? principalTypeXid;
String? googleId;
String? appleId;
String? userName;
String? fullName;
String? gender;
String? dateOfBirth;
String? phoneNumber;
String? emailAddress;
String? addressLine1;
String? addressLine2;
String? postCode;
String? lastLoginDatetime;
String? profilePhoto;
int? isProfileUpdated;
String? isActive;
String? createdAt;
UserData(
{this.id,
this.principalTypeXid,
this.googleId,
this.appleId,
this.userName,
this.fullName,
this.gender,
this.dateOfBirth,
this.phoneNumber,
this.emailAddress,
this.addressLine1,
this.addressLine2,
this.postCode,
this.lastLoginDatetime,
this.profilePhoto,
this.isProfileUpdated,
this.isActive,
this.createdAt});
UserData.fromJson(Map<String, dynamic> json) {
id = json['id'];
principalTypeXid = json['principal_type_xid'];
googleId = json['google_id'];
appleId = json['apple_id'];
userName = json['user_name'];
fullName = json['full_name'];
gender = json['gender'];
dateOfBirth = json['date_of_birth'];
phoneNumber = json['phone_number'];
emailAddress = json['email_address'];
addressLine1 = json['address_line1'];
addressLine2 = json['address_line2'];
postCode = json['post_code'];
lastLoginDatetime = json['last_login_datetime'];
profilePhoto = json['profile_photo'];
isProfileUpdated = json['is_profile_updated'];
isActive = json['is_active'];
createdAt = json['created_at'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
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;
return data;
}
}
class UserCommunity {
int? id;
int? iamPrincipalXid;
int? manageCommunityXid;
String? joinedAt;
int? isActive;
CommunityData? communityData;
UserCommunity(
{this.id,
this.iamPrincipalXid,
this.manageCommunityXid,
this.joinedAt,
this.isActive,
this.communityData});
UserCommunity.fromJson(Map<String, dynamic> json) {
id = json['id'];
iamPrincipalXid = json['iam_principal_xid'];
manageCommunityXid = json['manage_community_xid'];
joinedAt = json['joined_at'];
isActive = json['is_active'];
communityData = json['community_data'] != null
? new CommunityData.fromJson(json['community_data'])
: null;
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
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();
}
return data;
}
}
class CommunityData {
int? id;
String? communityProfilePhoto;
String? communityBannerImage;
String? communityName;
String? communityLocation;
String? communityDescription;
int? communityTypeXid;
int? activityXid;
int? isActive;
String? createdAt;
CommunityData(
{this.id,
this.communityProfilePhoto,
this.communityBannerImage,
this.communityName,
this.communityLocation,
this.communityDescription,
this.communityTypeXid,
this.activityXid,
this.isActive,
this.createdAt});
CommunityData.fromJson(Map<String, dynamic> json) {
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'];
createdAt = json['created_at'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
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;
return data;
}
}
class UserGroups {
int? id;
int? iamPrincipalXid;
int? manageGroupXid;
String? createdAt;
GroupData? groupData;
UserGroups(
{this.id,
this.iamPrincipalXid,
this.manageGroupXid,
this.createdAt,
this.groupData});
UserGroups.fromJson(Map<String, dynamic> json) {
id = json['id'];
iamPrincipalXid = json['iam_principal_xid'];
manageGroupXid = json['manage_group_xid'];
createdAt = json['created_at'];
groupData = json['group_data'] != null
? new GroupData.fromJson(json['group_data'])
: null;
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
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();
}
return data;
}
}
class GroupData {
int? id;
int? manageGroupTypeXid;
String? title;
String? backgroundImage;
String? groupImage;
String? link;
String? description;
int? isActive;
String? createdAt;
GroupData(
{this.id,
this.manageGroupTypeXid,
this.title,
this.backgroundImage,
this.groupImage,
this.link,
this.description,
this.isActive,
this.createdAt});
GroupData.fromJson(Map<String, dynamic> json) {
id = json['id'];
manageGroupTypeXid = json['manage_group_type_xid'];
title = json['title'];
backgroundImage = json['background_image'];
groupImage = json['group_image'];
link = json['link'];
description = json['description'];
isActive = json['is_active'];
createdAt = json['created_at'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
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;
return data;
}
}

View File

@@ -1,76 +0,0 @@
class GetcommunitiesModel {
String? status;
int? statusCode;
String? message;
List<Data>? data;
GetcommunitiesModel({this.status, this.statusCode, this.message, this.data});
GetcommunitiesModel.fromJson(Map<String, dynamic> json) {
status = json['status'];
statusCode = json['status_code'];
message = json['message'];
if (json['data'] != null) {
data = <Data>[];
json['data'].forEach((v) {
data!.add(new Data.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
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? communityProfilePhoto;
String? communityBannerImage;
String? communityName;
String? communityLocation;
String? communityDescription;
int? communityTypeXid;
int? activityXid;
Data(
{this.id,
this.communityProfilePhoto,
this.communityBannerImage,
this.communityName,
this.communityLocation,
this.communityDescription,
this.communityTypeXid,
this.activityXid});
Data.fromJson(Map<String, dynamic> json) {
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'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
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;
return data;
}
}

View File

@@ -1,72 +0,0 @@
class GrouplistModel {
String? status;
int? statusCode;
String? message;
List<Data>? data;
GrouplistModel({this.status, this.statusCode, this.message, this.data});
GrouplistModel.fromJson(Map<String, dynamic> json) {
status = json['status'];
statusCode = json['status_code'];
message = json['message'];
if (json['data'] != null) {
data = <Data>[];
json['data'].forEach((v) {
data!.add(new Data.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
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? title;
String? backgroundImage;
String? groupImage;
String? location;
String? link;
String? description;
Data(
{this.id,
this.title,
this.backgroundImage,
this.groupImage,
this.location,
this.link,
this.description});
Data.fromJson(Map<String, dynamic> json) {
id = json['id'];
title = json['title'];
backgroundImage = json['background_image'];
groupImage = json['group_image'];
location = json['location'];
link = json['link'];
description = json['description'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['title'] = this.title;
data['background_image'] = this.backgroundImage;
data['group_image'] = this.groupImage;
data['location'] = this.location;
data['link'] = this.link;
data['description'] = this.description;
return data;
}
}

View File

@@ -1,235 +0,0 @@
class TellusIndividualModel {
String? status;
int? statusCode;
String? message;
Data? data;
TellusIndividualModel(
{this.status, this.statusCode, this.message, this.data});
TellusIndividualModel.fromJson(Map<String, dynamic> json) {
status = json['status'];
statusCode = json['status_code'];
message = json['message'];
data = json['data'] != null ? new Data.fromJson(json['data']) : null;
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
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 {
Profile? profile;
Data({this.profile});
Data.fromJson(Map<String, dynamic> json) {
profile =
json['profile'] != null ? new Profile.fromJson(json['profile']) : null;
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.profile != null) {
data['profile'] = this.profile!.toJson();
}
return data;
}
}
class Profile {
int? id;
int? principalTypeXid;
int? principalSourceXid;
String? oneSignalPlayerId;
String? googleId;
String? appleId;
String? facebookId;
String? microsoftId;
String? userName;
String? pin;
String? fullName;
String? gender;
String? dateOfBirth;
String? phoneNumber;
String? otherPhoneNumber;
String? emailAddress;
String? addressLine1;
String? addressLine2;
String? cityXid;
String? stateXid;
String? countryXid;
String? postCode;
String? lastLoginDatetime;
String? profilePhoto;
String? referralCode;
String? description;
String? about;
String? position;
String? trainingScores;
String? height;
String? weight;
String? battingAverage;
int? isProfileUpdated;
String? isActive;
int? groupNotification;
int? communityNotification;
int? followerNotification;
int? newFollowerNotification;
int? directMessageNotification;
String? createdBy;
String? modifiedBy;
String? deletedAt;
String? createdAt;
String? updatedAt;
Profile(
{this.id,
this.principalTypeXid,
this.principalSourceXid,
this.oneSignalPlayerId,
this.googleId,
this.appleId,
this.facebookId,
this.microsoftId,
this.userName,
this.pin,
this.fullName,
this.gender,
this.dateOfBirth,
this.phoneNumber,
this.otherPhoneNumber,
this.emailAddress,
this.addressLine1,
this.addressLine2,
this.cityXid,
this.stateXid,
this.countryXid,
this.postCode,
this.lastLoginDatetime,
this.profilePhoto,
this.referralCode,
this.description,
this.about,
this.position,
this.trainingScores,
this.height,
this.weight,
this.battingAverage,
this.isProfileUpdated,
this.isActive,
this.groupNotification,
this.communityNotification,
this.followerNotification,
this.newFollowerNotification,
this.directMessageNotification,
this.createdBy,
this.modifiedBy,
this.deletedAt,
this.createdAt,
this.updatedAt});
Profile.fromJson(Map<String, dynamic> json) {
id = json['id'];
principalTypeXid = json['principal_type_xid'];
principalSourceXid = json['principal_source_xid'];
oneSignalPlayerId = json['one_signal_player_id'];
googleId = json['google_id'];
appleId = json['apple_id'];
facebookId = json['facebook_id'];
microsoftId = json['microsoft_id'];
userName = json['user_name'];
pin = json['pin'];
fullName = json['full_name'];
gender = json['gender'];
dateOfBirth = json['date_of_birth'];
phoneNumber = json['phone_number'];
otherPhoneNumber = json['other_phone_number'];
emailAddress = json['email_address'];
addressLine1 = json['address_line1'];
addressLine2 = json['address_line2'];
cityXid = json['city_xid'];
stateXid = json['state_xid'];
countryXid = json['country_xid'];
postCode = json['post_code'];
lastLoginDatetime = json['last_login_datetime'];
profilePhoto = json['profile_photo'];
referralCode = json['referral_code'];
description = json['description'];
about = json['about'];
position = json['position'];
trainingScores = json['training_scores'];
height = json['height'];
weight = json['weight'];
battingAverage = json['batting_average'];
isProfileUpdated = json['is_profile_updated'];
isActive = json['is_active'];
groupNotification = json['group_notification'];
communityNotification = json['community_notification'];
followerNotification = json['follower_notification'];
newFollowerNotification = json['new_follower_notification'];
directMessageNotification = json['direct_message_notification'];
createdBy = json['created_by'];
modifiedBy = json['modified_by'];
deletedAt = json['deleted_at'];
createdAt = json['created_at'];
updatedAt = json['updated_at'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
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;
return data;
}
}

View File

@@ -1,54 +0,0 @@
class GetIndividualactivityModel {
String? status;
int? statusCode;
String? message;
List<Data>? data;
GetIndividualactivityModel(
{this.status, this.statusCode, this.message, this.data});
GetIndividualactivityModel.fromJson(Map<String, dynamic> json) {
status = json['status'];
statusCode = json['status_code'];
message = json['message'];
if (json['data'] != null) {
data = <Data>[];
json['data'].forEach((v) {
data!.add(new Data.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
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;
String? image;
Data({this.id, this.name, this.image});
Data.fromJson(Map<String, dynamic> json) {
id = json['id'];
name = json['name'];
image = json['image'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['name'] = this.name;
data['image'] = this.image;
return data;
}
}

View File

@@ -1,823 +0,0 @@
import 'dart:io';
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: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';
import 'package:regroup/onboarding/Signup/View/Business/ViewModel/TellUsBusinessApi.dart';
import 'package:regroup/resources/routes/route_name.dart';
import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart';
import 'package:dio/dio.dart';
import 'package:path/path.dart' as path;
import 'package:regroup/Utils/Common/CustomTextformfield.dart';
class LetusUnderstand extends StatefulWidget {
const LetusUnderstand({super.key});
@override
State<LetusUnderstand> createState() => _LetusUnderstandState();
}
class _LetusUnderstandState extends State<LetusUnderstand> {
TextEditingController busunesscontactcontroller = TextEditingController();
TextEditingController emailidcontroller = TextEditingController();
TextEditingController businesshandlecontroller = TextEditingController();
TextEditingController openinghourscontroller = TextEditingController();
TextEditingController websitelinkcontroller = TextEditingController();
TextEditingController googlereviewlinkcontroller = TextEditingController();
TextEditingController tagscontroller = TextEditingController();
bool isValidPhoneNumber(String phoneNumber) {
final RegExp phoneNumberExpression = RegExp(r"^0{10}$");
return !phoneNumberExpression.hasMatch(phoneNumber);
}
String logoFile = "";
String bannerFile = "";
bool isImageAdded = false;
bool isbannerAdded = false;
String extractFileName(String filePath) {
return path.basename(filePath);
}
convertFileToMultiPart(String? file) async {
return await MultipartFile.fromFile(
file!,
filename: path.basename(file),
);
}
void _letusUnderstandDone() async {
FormData? updata;
if (busunesscontactcontroller.text.isBlank! ||
emailidcontroller.text.isBlank! ||
businesshandlecontroller.text.isBlank! ||
openinghourscontroller.text.isBlank! ||
websitelinkcontroller.text.isBlank! ||
googlereviewlinkcontroller.text.isBlank! ||
tagscontroller.text.isBlank!) {
Get.snackbar(
'Error',
'Enter your credentials',
snackPosition: SnackPosition.BOTTOM,
backgroundColor: Colors.red,
colorText: Colors.white,
);
} else if (logoFile == "") {
utils.showToast('Upload business logo!');
} else if (bannerFile == "") {
utils.showToast('Upload banner image!');
} else {
updata = FormData.fromMap({
"business_contact_number": busunesscontactcontroller.text,
"business_email": emailidcontroller.text,
"business_handle": businesshandlecontroller.text,
"opening_hours": openinghourscontroller.text,
"website_link": websitelinkcontroller.text,
"google_review_link": googlereviewlinkcontroller.text,
"tags": tagscontroller.text,
"business_logo": await convertFileToMultiPart(logoFile),
"banner_image": await convertFileToMultiPart(bannerFile),
});
final data = await BusinessAPI().letUsUnderstandApi(updata);
if (data.status == ResponseStatus.SUCCESS) {
// await global.setname();
Get.snackbar(
"Success!",
'success!',
duration: Duration(seconds: 2),
colorText: Colors.white,
backgroundColor: Colors.green,
margin: EdgeInsets.all(8),
snackStyle: SnackStyle.FLOATING,
snackPosition: SnackPosition.BOTTOM,
);
Get.toNamed(RouteName.individualgroupstep3);
} else if (data.status == ResponseStatus.FAILED) {
Get.snackbar(
"Error!",
data.message,
duration: Duration(seconds: 2),
colorText: Colors.white,
backgroundColor: Colors.red,
margin: EdgeInsets.all(8),
snackStyle: SnackStyle.FLOATING,
snackPosition: SnackPosition.BOTTOM,
);
// _controller.isTextFieldEnabled.value = true;
} else {
// btnController.reset();
Get.snackbar(
"Error!",
data.data['message'],
duration: Duration(seconds: 2),
colorText: Colors.white,
backgroundColor: Colors.red,
margin: EdgeInsets.all(8),
snackStyle: SnackStyle.FLOATING,
snackPosition: SnackPosition.BOTTOM,
);
// _controller.isTextFieldEnabled.value = true;
}
}
}
Future<void> _selectDuration(BuildContext context) async {
final int? picked = await showDialog<int>(
context: context,
builder: (BuildContext context) {
return durationPickerDialog();
},
);
if (picked != null && picked >= 0) {
setState(() {
openinghourscontroller.text = '$picked';
});
}
}
Widget durationPickerDialog() {
int selectedHour = 1;
return AlertDialog(
title: Text('Select Duration'),
content: Container(
width: double.minPositive,
child: Container(
height: 200,
child: ListView.builder(
shrinkWrap: true,
itemCount: 20,
itemBuilder: (BuildContext context, int index) {
int hour = index + 1;
return ListTile(
title: Text('$hour hours'),
onTap: () {
setState(() {
selectedHour = hour;
});
Navigator.of(context).pop(selectedHour);
},
);
},
),
),
),
actions: <Widget>[
TextButton(
child: Text('Cancel'),
onPressed: () {
Navigator.of(context).pop();
},
),
],
);
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Color.fromARGB(255, 18, 32, 47),
body: Stack(
children: [
// Positioned(top: 70, left: -30, child: CommonBlurLeftSecond()),
// Positioned(top: 310, right: -30, child: CommonBlurRightSecond()),
// 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: [
// 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:
Container(
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/images/png/Ellipse 1496.png"),
fit: BoxFit.fill)),
),
ListView(children: [
Padding(
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 50.h),
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: 358.w,
height: 25.h,
decoration: ShapeDecoration(
shape: RoundedRectangleBorder(
side: 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: 15,
height: 15,
decoration: ShapeDecoration(
gradient: LinearGradient(
begin: Alignment(0.98, -0.21),
end: Alignment(-0.98, 0.21),
colors: [
Color(0xA5D90B2E),
Color(0x42D90B2E)
],
),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(30),
),
),
)
],
),
),
),
sizedBoxHeight(30.h),
Center(
child: text20400white('Let us understand you better')),
sizedBoxHeight(10.w),
Center(
child: Container(
width: 154.w,
decoration: ShapeDecoration(
shape: RoundedRectangleBorder(
side: BorderSide(
width: 1,
strokeAlign: BorderSide.strokeAlignCenter,
color: Color(0xFF858585),
),
),
),
),
),
sizedBoxHeight(30.h),
text16400white('Business contact number'),
sizedBoxHeight(10.h),
CustomTextFormField(
textEditingController: busunesscontactcontroller,
texttype: TextInputType.phone,
hintText: "Enter your business contact number",
leadingIcon:
// const Icon(Icons.mail_outline),
Image.asset(
width: 22.w,
height: 17.h,
'assets/images/png/phone.png',
),
// validatorText: "Enter your business owner name",
validator: (value) {
if (value.isEmpty) {
return 'Enter your phone number';
} else if (!RegExp(r'(^(?:[+0]9)?[0-9]{10}$)')
.hasMatch(value)) {
return 'Enter a valid phone number';
} else if (!isValidPhoneNumber(value)) {
return 'Phone number cannot contain 10 zeros';
}
return null;
},
inputFormatters: [
LengthLimitingTextInputFormatter(10),
RemoveEmojiInputFormatter(),
FilteringTextInputFormatter.allow(RegExp('[0-9]')),
],
),
sizedBoxHeight(15.h),
text16400white('Business 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(20),
RemoveEmojiInputFormatter()
],
),
// sizedBoxHeight(10.h),
sizedBoxHeight(15.h),
text16400white('Business handle'),
sizedBoxHeight(10.h),
CustomTextFormField(
textEditingController: businesshandlecontroller,
texttype: TextInputType.text,
hintText: "Enter your business handle",
leadingIcon:
// const Icon(Icons.mail_outline),
Image.asset(
width: 22.w,
height: 17.h,
'assets/images/png/user.png',
),
// validatorText: "Enter your business owner name",
validator: (value) {
if (value!.isEmpty) {
return 'Enter your business handle';
}
return null;
},
inputFormatters: [
// LengthLimitingTextInputFormatter(20),
RemoveEmojiInputFormatter(),
FilteringTextInputFormatter.allow(RegExp('[a-zA-Z ]'))
],
),
// sizedBoxHeight(10.h),
sizedBoxHeight(15.h),
text16400white('Opening hours'),
sizedBoxHeight(10.h),
GestureDetector(
onTap: () {
_selectDuration(context);
},
child: AbsorbPointer(
child: CustomTextFormField(
textEditingController: openinghourscontroller,
texttype: TextInputType.text,
hintText: "Enter your opening hours",
leadingIcon:
// const Icon(Icons.mail_outline),
Container(
width: 22.w,
height: 17.h,
child: Center(
child: Image.asset(
width: 22.w,
height: 17.h,
'assets/images/png/clock.png',
),
),
),
// validatorText: "Enter your business owner name",
validator: (value) {
if (value!.isEmpty) {
return 'Enter your opening hours';
}
return null;
},
inputFormatters: [
// LengthLimitingTextInputFormatter(20),
RemoveEmojiInputFormatter(),
FilteringTextInputFormatter.allow(
RegExp('[a-zA-ZS0-9 ]')),
],
),
),
),
// sizedBoxHeight(10.h),
sizedBoxHeight(15.h),
text16400white('Website link'),
sizedBoxHeight(10.h),
CustomTextFormField(
textEditingController: websitelinkcontroller,
texttype: TextInputType.text,
hintText: "Enter your website link",
leadingIcon:
// const Icon(Icons.mail_outline),
Image.asset(
width: 22.w,
height: 17.h,
'assets/images/png/globe.png',
),
// validatorText: "Enter your business owner name",
validator: (value) {
if (value!.isEmpty) {
return 'Enter your website link';
}
return null;
},
inputFormatters: [
// LengthLimitingTextInputFormatter(20),
RemoveEmojiInputFormatter(),
FilteringTextInputFormatter.allow(
RegExp('[a-zA-ZS0-9 ]')),
],
),
// sizedBoxHeight(10.h),
sizedBoxHeight(15.h),
text16400white('Google review link'),
sizedBoxHeight(10.h),
CustomTextFormField(
textEditingController: googlereviewlinkcontroller,
texttype: TextInputType.text,
hintText: "Enter your google review link",
leadingIcon:
// const Icon(Icons.mail_outline),
Image.asset(
width: 22.w,
height: 17.h,
'assets/images/png/globe.png',
),
// validatorText: "Enter your business owner name",
validator: (value) {
if (value!.isEmpty) {
return 'Enter your google review link';
}
return null;
},
inputFormatters: [
// LengthLimitingTextInputFormatter(20),
RemoveEmojiInputFormatter(),
FilteringTextInputFormatter.allow(
RegExp('[a-zA-ZS0-9 ]')),
],
),
// sizedBoxHeight(10.h),
sizedBoxHeight(15.h),
text16400white('Tags'),
sizedBoxHeight(10.h),
CustomTextFormField(
textEditingController: tagscontroller,
texttype: TextInputType.text,
hintText: "Enter your tags",
leadingIcon:
// const Icon(Icons.mail_outline),
Image.asset(
width: 22.w,
height: 17.h,
'assets/images/png/hashtag.png',
),
// validatorText: "Enter your business owner name",
validator: (value) {
if (value!.isEmpty) {
return 'Enter your tags';
}
return null;
},
inputFormatters: [
// LengthLimitingTextInputFormatter(20),
RemoveEmojiInputFormatter(),
// FilteringTextInputFormatter.allow(
// RegExp('[a-zA-ZS0-9 ]')),
],
),
// sizedBoxHeight(10.h),
sizedBoxHeight(15.h),
text16400white('Images upload'),
sizedBoxHeight(10.h),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
logoFile != "" && isImageAdded
? Container(
width: 169,
height: 115,
decoration: ShapeDecoration(
gradient: LinearGradient(
begin: Alignment(0.98, -0.21),
end: Alignment(-0.98, 0.21),
colors: [
Colors.white
.withOpacity(0.30000001192092896),
Colors.white
.withOpacity(0.2800000011920929)
],
),
shape: RoundedRectangleBorder(
side: BorderSide(
width: 0.50, color: Color(0xFF7E7E7E)),
borderRadius: BorderRadius.circular(10),
),
),
child: Stack(
children: [
Image.file(
File(logoFile),
fit: BoxFit.cover,
width: double.infinity,
),
Positioned(
// top: 0,
// left: 0,
right: 5,
bottom: 5,
child: GestureDetector(
onTap: () {
// Clear the list and show the upload button
logoFile = "";
isImageAdded = 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,
)
// SvgPicture.asset(
// "assets/images/SVG/trash-2.svg",
// width: 17.w,
// height: 17.h,
// ),
)),
),
],
),
)
: GestureDetector(
onTap: () {
ImageUploadBottomSheet().showModal(
context,
false,
(result) {
var filenameresult =
extractFileName(result);
logoFile = result;
isImageAdded = true;
setState(() {});
},
);
},
child: Container(
width: 169,
height: 115,
decoration: ShapeDecoration(
gradient: LinearGradient(
begin: Alignment(0.98, -0.21),
end: Alignment(-0.98, 0.21),
colors: [
Colors.white
.withOpacity(0.30000001192092896),
Colors.white
.withOpacity(0.2800000011920929)
],
),
shape: RoundedRectangleBorder(
side: BorderSide(
width: 0.50,
color: Color(0xFF7E7E7E)),
borderRadius: BorderRadius.circular(10),
),
),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(
'assets/images/png/onlycamera.png'),
sizedBoxHeight(5.h),
Text(
'Upload business \nlogo',
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
fontSize: 14.sp,
fontFamily: 'Poppins',
fontWeight: FontWeight.w400,
),
),
],
),
),
),
bannerFile != "" && isbannerAdded
? Container(
width: 169,
height: 115,
decoration: ShapeDecoration(
gradient: LinearGradient(
begin: Alignment(0.98, -0.21),
end: Alignment(-0.98, 0.21),
colors: [
Colors.white
.withOpacity(0.30000001192092896),
Colors.white
.withOpacity(0.2800000011920929)
],
),
shape: RoundedRectangleBorder(
side: BorderSide(
width: 0.50, color: Color(0xFF7E7E7E)),
borderRadius: BorderRadius.circular(10),
),
),
child: Stack(
children: [
Image.file(
File(bannerFile),
fit: BoxFit.cover,
width: double.infinity,
),
Positioned(
// top: 0,
// left: 0,
right: 5,
bottom: 5,
child: GestureDetector(
onTap: () {
// Clear the list and show the upload button
bannerFile = "";
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,
)
// SvgPicture.asset(
// "assets/images/SVG/trash-2.svg",
// width: 17.w,
// height: 17.h,
// ),
)),
),
],
),
)
: GestureDetector(
onTap: () {
ImageUploadBottomSheet().showModal(
context,
false,
(result) {
var filenameresult =
extractFileName(result);
bannerFile = result;
isbannerAdded = true;
setState(() {});
},
);
},
child: Container(
width: 169,
height: 115,
decoration: ShapeDecoration(
gradient: LinearGradient(
begin: Alignment(0.98, -0.21),
end: Alignment(-0.98, 0.21),
colors: [
Colors.white
.withOpacity(0.30000001192092896),
Colors.white
.withOpacity(0.2800000011920929)
],
),
shape: RoundedRectangleBorder(
side: BorderSide(
width: 0.50,
color: Color(0xFF7E7E7E)),
borderRadius: BorderRadius.circular(10),
),
),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(
'assets/images/png/onlycamera.png'),
sizedBoxHeight(5.h),
Text(
'Upload banner \nimage',
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
fontSize: 14.sp,
fontFamily: 'Poppins',
fontWeight: FontWeight.w400,
),
),
],
),
),
)
],
),
sizedBoxHeight(40.h),
CustomButton(
text: 'Continue',
onPressed: () {
// Get.toNamed(RouteName.businessSelectgroupstep2);
_letusUnderstandDone();
})
],
),
),
])
],
));
}
}

View File

@@ -1,259 +0,0 @@
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: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';
import 'package:regroup/onboarding/Signup/View/Business/ViewModel/TellUsBusinessApi.dart';
import 'package:regroup/resources/routes/route_name.dart';
import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart';
class TellusaboutBusiness extends StatefulWidget {
const TellusaboutBusiness({super.key});
@override
State<TellusaboutBusiness> createState() => _TellusaboutBusinessState();
}
class _TellusaboutBusinessState extends State<TellusaboutBusiness> {
TextEditingController businessownerController = TextEditingController();
TextEditingController businessNameController = TextEditingController();
TextEditingController businesslocationController = TextEditingController();
final List<String> _businesslist = [
'Retail',
'Hospitality',
'Event provider',
'Coaching services',
'Recruitment & Scouting',
'Healthcare & Wellbeing',
'Other',
];
String _selectedbusinesstype = '';
void _onItemSelected(String value) {
setState(() {
_selectedbusinesstype = value;
});
}
String getBusinessTypeId(String selectedBusinessType) {
if (selectedBusinessType.contains("Retail")) {
return '1';
} else if (selectedBusinessType.contains("Hospitality")) {
return '2';
} else if (selectedBusinessType.contains("Event provider")) {
return '3';
} else if (selectedBusinessType.contains("Coaching services")) {
return '4';
} else if (selectedBusinessType.contains("Recruitment & Scouting")) {
return '5';
} else if (selectedBusinessType.contains("Healthcare & Wellbeing")) {
return '6';
} else if (selectedBusinessType.contains("Other")) {
return '7';
} else {
return '0';
}
}
void _tellUsBusinessDone() async {
if (businessownerController.text.isBlank! ||
businessNameController.text.isBlank! ||
businesslocationController.text.isBlank!) {
Get.snackbar(
'Error',
'Enter your credentials',
snackPosition: SnackPosition.BOTTOM,
backgroundColor: Colors.red,
colorText: Colors.white,
);
} else if (_selectedbusinesstype.isEmpty) {
utils.showToast('Please select a business type');
} else {
String businessTypeId = getBusinessTypeId(_selectedbusinesstype);
Map<String, String> updata = {
"business_name": businessNameController.text,
"business_owner_name": businessownerController.text,
"business_location": businessownerController.text,
"business_type_xid": businessTypeId,
};
final data = await BusinessAPI().tellUsBusinessApi(updata);
if (data.status == ResponseStatus.SUCCESS) {
Get.snackbar(
"Success!",
'success!',
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.businessletusunderstandstep1);
} else if (data.status == ResponseStatus.FAILED) {
Get.snackbar(
"Error!",
data.message,
duration: const Duration(seconds: 2),
colorText: Colors.white,
backgroundColor: Colors.red,
margin: const EdgeInsets.all(8),
snackStyle: SnackStyle.FLOATING,
snackPosition: SnackPosition.BOTTOM,
);
} else {
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,
);
}
}
}
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
child: Scaffold(
backgroundColor: const Color.fromARGB(255, 18, 32, 47),
body: 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(60.h),
Center(
child: text20400white('Tell us about your business')),
sizedBoxHeight(10.w),
Center(
child: Container(
width: 154,
decoration: const ShapeDecoration(
shape: RoundedRectangleBorder(
side: BorderSide(
width: 1,
strokeAlign: BorderSide.strokeAlignCenter,
color: Color(0xFF858585),
),
),
)),
),
sizedBoxHeight(40.h),
text16400white('Business owner name'),
sizedBoxHeight(10.h),
CustomTextFormField(
textEditingController: businessownerController,
texttype: TextInputType.text,
hintText: "Enter your business owner name",
leadingIcon: Image.asset(
width: 22.w,
height: 17.h,
'assets/images/png/user.png',
),
validator: (value) {
if (value!.isEmpty) {
return 'Enter your business owner name';
}
return null;
},
inputFormatters: [
RemoveEmojiInputFormatter(),
FilteringTextInputFormatter.allow(RegExp('[a-zA-Z ]'))
],
),
sizedBoxHeight(10.h),
text16400white('Business name'),
sizedBoxHeight(10.h),
CustomTextFormField(
textEditingController: businessNameController,
texttype: TextInputType.text,
hintText: "Enter your business name",
leadingIcon: Image.asset(
width: 22.w,
height: 17.h,
'assets/images/png/briefcase.png',
),
validator: (value) {
if (value!.isEmpty) {
return 'Enter your business name ';
}
return null;
},
inputFormatters: [
RemoveEmojiInputFormatter(),
FilteringTextInputFormatter.allow(RegExp('[a-zA-Z ]'))
],
),
sizedBoxHeight(10.h),
text16400white('Business location'),
sizedBoxHeight(10.h),
CustomTextFormField(
textEditingController: businesslocationController,
texttype: TextInputType.text,
hintText: "Enter your business location",
leadingIcon: Image.asset(
width: 22.w,
height: 17.h,
'assets/images/png/location.png',
),
validator: (value) {
if (value!.isEmpty) {
return 'Enter your business location ';
}
return null;
},
inputFormatters: [
RemoveEmojiInputFormatter(),
FilteringTextInputFormatter.allow(RegExp('[a-zA-Z ]'))
],
),
sizedBoxHeight(10.h),
text16400white('Type of business'),
sizedBoxHeight(10.h),
CustomDropDownRadio(
header: 'Select type of business',
title: '',
listData: _businesslist,
onItemSelected: _onItemSelected,
leadingImage:
Image.asset('assets/images/png/briefcase.png'),
),
sizedBoxHeight(50.h),
CustomButton(
text: "Continue",
onPressed: () {
_tellUsBusinessDone();
}),
sizedBoxHeight(30.h),
],
),
),
])
])),
);
}
}

View File

@@ -1,42 +0,0 @@
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 BusinessAPI {
BusinessAPI();
Future<ResponseData<dynamic>> tellUsBusinessApi(var data) async {
SharedPreferences prefs = await SharedPreferences.getInstance();
final response =
await NetworkApiServices().postApi(data, ApiUrls.tellUsBusinessApi);
if (response.status == ResponseStatus.SUCCESS) {
if (response.data['status'] == 'success') {
} else {
return ResponseData<dynamic>(
response.data['message'], ResponseStatus.FAILED);
}
}
return response;
}
Future<ResponseData<dynamic>> letUsUnderstandApi(var data) async {
final response = await NetworkApiServices().postApi(
data,
ApiUrls.letUsUnderstandApi,
);
if (response.status == ResponseStatus.SUCCESS) {
if (response.data['status'] == "success") {
return ResponseData<dynamic>(
response.data['message'], ResponseStatus.SUCCESS);
} else {
return ResponseData<dynamic>(
response.data['message'], ResponseStatus.FAILED);
}
}
return response;
}
}

View File

@@ -0,0 +1,672 @@
import 'dart:io';
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:regroup/Common/controller/CommonTextFormField.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/resources/routes/route_name.dart';
import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart';
class LetusUnderstand extends StatefulWidget {
const LetusUnderstand({super.key});
@override
State<LetusUnderstand> createState() => _LetusUnderstandState();
}
class _LetusUnderstandState extends State<LetusUnderstand> {
TextEditingController busunesscontactcontroller = TextEditingController();
TextEditingController emailidcontroller = TextEditingController();
TextEditingController businesshandlecontroller = TextEditingController();
TextEditingController openinghourscontroller = TextEditingController();
TextEditingController websitelinkcontroller = TextEditingController();
TextEditingController googlereviewlinkcontroller = TextEditingController();
bool isValidPhoneNumber(String phoneNumber) {
final RegExp phoneNumberExpression = RegExp(r"^0{10}$");
return !phoneNumberExpression.hasMatch(phoneNumber);
}
List<File?> filePath = [];
List<File?> bannerPath = [];
bool isImageAdded = false;
bool isbannerAdded = false;
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Color.fromARGB(255, 18, 32, 47),
body: Stack(
children: [
Positioned(top: 70, left: -30, child: CommonBlurLeftSecond()),
Positioned(top: 310, right: -30, child: CommonBlurRightSecond()),
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: [
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: ListView(children: [
Padding(
padding:
EdgeInsets.symmetric(horizontal: 16.w, vertical: 50.h),
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: 358.w,
height: 25.h,
decoration: ShapeDecoration(
shape: RoundedRectangleBorder(
side: 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: 15,
height: 15,
decoration: ShapeDecoration(
gradient: LinearGradient(
begin: Alignment(0.98, -0.21),
end: Alignment(-0.98, 0.21),
colors: [
Color(0xA5D90B2E),
Color(0x42D90B2E)
],
),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(30),
),
),
)
],
),
),
),
sizedBoxHeight(30.h),
Center(
child:
text20400white('Let us understand you better')),
sizedBoxHeight(10.w),
Center(
child: Container(
width: 154.w,
decoration: ShapeDecoration(
shape: RoundedRectangleBorder(
side: BorderSide(
width: 1,
strokeAlign: BorderSide.strokeAlignCenter,
color: Color(0xFF858585),
),
),
),
),
),
sizedBoxHeight(30.h),
text16400white('Business contact number'),
sizedBoxHeight(10.h),
CustomTextFormField(
textEditingController: busunesscontactcontroller,
texttype: TextInputType.text,
hintText: "Enter your business contact number",
leadingIcon:
// const Icon(Icons.mail_outline),
Image.asset(
width: 22.w,
height: 17.h,
'assets/images/png/phone.png',
),
// validatorText: "Enter your business owner name",
validator: (value) {
if (value.isEmpty) {
return 'Enter your phone number';
} else if (!RegExp(r'(^(?:[+0]9)?[0-9]{10}$)')
.hasMatch(value)) {
return 'Enter a valid phone number';
} else if (!isValidPhoneNumber(value)) {
return 'Phone number cannot contain 10 zeros';
}
return null;
},
inputFormatters: [
// LengthLimitingTextInputFormatter(20),
RemoveEmojiInputFormatter(),
FilteringTextInputFormatter.allow(RegExp('[0-9]')),
],
),
sizedBoxHeight(15.h),
text16400white('Business 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(20),
RemoveEmojiInputFormatter()
],
),
// sizedBoxHeight(10.h),
sizedBoxHeight(15.h),
text16400white('Business handle'),
sizedBoxHeight(10.h),
CustomTextFormField(
textEditingController: businesshandlecontroller,
texttype: TextInputType.text,
hintText: "Enter your business handle",
leadingIcon:
// const Icon(Icons.mail_outline),
Image.asset(
width: 22.w,
height: 17.h,
'assets/images/png/user.png',
),
// validatorText: "Enter your business owner name",
validator: (value) {
if (value!.isEmpty) {
return 'Enter your business handle';
}
return null;
},
inputFormatters: [
// LengthLimitingTextInputFormatter(20),
RemoveEmojiInputFormatter(),
FilteringTextInputFormatter.allow(
RegExp('[a-zA-Z ]'))
],
),
// sizedBoxHeight(10.h),
sizedBoxHeight(15.h),
text16400white('Opening hours'),
sizedBoxHeight(10.h),
CustomTextFormField(
textEditingController: openinghourscontroller,
texttype: TextInputType.text,
hintText: "Enter your opening hours",
leadingIcon:
// const Icon(Icons.mail_outline),
Image.asset(
width: 22.w,
height: 17.h,
'assets/images/png/clock.png',
),
// validatorText: "Enter your business owner name",
validator: (value) {
if (value!.isEmpty) {
return 'Enter your opening hours';
}
return null;
},
inputFormatters: [
// LengthLimitingTextInputFormatter(20),
RemoveEmojiInputFormatter(),
FilteringTextInputFormatter.allow(
RegExp('[a-zA-ZS0-9 ]')),
],
),
// sizedBoxHeight(10.h),
sizedBoxHeight(15.h),
text16400white('Website link'),
sizedBoxHeight(10.h),
CustomTextFormField(
textEditingController: websitelinkcontroller,
texttype: TextInputType.text,
hintText: "Enter your website link",
leadingIcon:
// const Icon(Icons.mail_outline),
Image.asset(
width: 22.w,
height: 17.h,
'assets/images/png/globe.png',
),
// validatorText: "Enter your business owner name",
validator: (value) {
if (value!.isEmpty) {
return 'Enter your website link';
}
return null;
},
inputFormatters: [
// LengthLimitingTextInputFormatter(20),
RemoveEmojiInputFormatter(),
FilteringTextInputFormatter.allow(
RegExp('[a-zA-ZS0-9 ]')),
],
),
// sizedBoxHeight(10.h),
sizedBoxHeight(15.h),
text16400white('Google review link'),
sizedBoxHeight(10.h),
CustomTextFormField(
textEditingController: googlereviewlinkcontroller,
texttype: TextInputType.text,
hintText: "Enter your google review link",
leadingIcon:
// const Icon(Icons.mail_outline),
Image.asset(
width: 22.w,
height: 17.h,
'assets/images/png/globe.png',
),
// validatorText: "Enter your business owner name",
validator: (value) {
if (value!.isEmpty) {
return 'Enter your google review link';
}
return null;
},
inputFormatters: [
// LengthLimitingTextInputFormatter(20),
RemoveEmojiInputFormatter(),
FilteringTextInputFormatter.allow(
RegExp('[a-zA-ZS0-9 ]')),
],
),
// sizedBoxHeight(10.h),
sizedBoxHeight(15.h),
text16400white('Tags'),
sizedBoxHeight(10.h),
CustomTextFormField(
textEditingController: googlereviewlinkcontroller,
texttype: TextInputType.text,
hintText: "Enter your Tags",
leadingIcon:
// const Icon(Icons.mail_outline),
Image.asset(
width: 22.w,
height: 17.h,
'assets/images/png/hashtag.png',
),
// validatorText: "Enter your business owner name",
validator: (value) {
if (value!.isEmpty) {
return 'Enter your tags';
}
return null;
},
inputFormatters: [
// LengthLimitingTextInputFormatter(20),
RemoveEmojiInputFormatter(),
FilteringTextInputFormatter.allow(
RegExp('[a-zA-ZS0-9 ]')),
],
),
// sizedBoxHeight(10.h),
sizedBoxHeight(15.h),
text16400white('Images upload'),
sizedBoxHeight(10.h),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
filePath.isNotEmpty && isImageAdded
? Container(
width: 169,
height: 115,
decoration: ShapeDecoration(
gradient: LinearGradient(
begin: Alignment(0.98, -0.21),
end: Alignment(-0.98, 0.21),
colors: [
Colors.white
.withOpacity(0.30000001192092896),
Colors.white
.withOpacity(0.2800000011920929)
],
),
shape: RoundedRectangleBorder(
side: BorderSide(
width: 0.50,
color: Color(0xFF7E7E7E)),
borderRadius: BorderRadius.circular(10),
),
),
child: Stack(
children: [
Image.file(
filePath[0]!,
fit: BoxFit.cover,
width: double.infinity,
),
Positioned(
// top: 0,
// left: 0,
right: 5,
bottom: 5,
child: GestureDetector(
onTap: () {
// Clear the list and show the upload button
filePath.clear();
isImageAdded = 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,
)
// SvgPicture.asset(
// "assets/images/SVG/trash-2.svg",
// width: 17.w,
// height: 17.h,
// ),
)),
),
],
),
)
: GestureDetector(
onTap: () {
ImageUploadBottomSheet().showModal(
context,
false,
(result) {
var file = File(result);
// filePath[0] = file;
// filePath.clear();
filePath.add(file);
isImageAdded = true;
// isImageAdded = true;
setState(() {});
},
);
},
child: Container(
width: 169,
height: 115,
decoration: ShapeDecoration(
gradient: LinearGradient(
begin: Alignment(0.98, -0.21),
end: Alignment(-0.98, 0.21),
colors: [
Colors.white.withOpacity(
0.30000001192092896),
Colors.white
.withOpacity(0.2800000011920929)
],
),
shape: RoundedRectangleBorder(
side: BorderSide(
width: 0.50,
color: Color(0xFF7E7E7E)),
borderRadius:
BorderRadius.circular(10),
),
),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.center,
children: [
Image.asset(
'assets/images/png/onlycamera.png'),
sizedBoxHeight(5.h),
Text(
'Upload business \nlogo',
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
fontSize: 14.sp,
fontFamily: 'Poppins',
fontWeight: FontWeight.w400,
),
),
],
),
),
),
bannerPath.isNotEmpty && isbannerAdded
? Container(
width: 169,
height: 115,
decoration: ShapeDecoration(
gradient: LinearGradient(
begin: Alignment(0.98, -0.21),
end: Alignment(-0.98, 0.21),
colors: [
Colors.white
.withOpacity(0.30000001192092896),
Colors.white
.withOpacity(0.2800000011920929)
],
),
shape: RoundedRectangleBorder(
side: BorderSide(
width: 0.50,
color: Color(0xFF7E7E7E)),
borderRadius: BorderRadius.circular(10),
),
),
child: Stack(
children: [
Image.file(
bannerPath[0]!,
fit: BoxFit.cover,
width: double.infinity,
),
Positioned(
// top: 0,
// left: 0,
right: 5,
bottom: 5,
child: GestureDetector(
onTap: () {
// Clear the list and show the upload button
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,
)
// SvgPicture.asset(
// "assets/images/SVG/trash-2.svg",
// width: 17.w,
// height: 17.h,
// ),
)),
),
],
),
)
: GestureDetector(
onTap: () {
ImageUploadBottomSheet().showModal(
context,
false,
(result) {
var file = File(result);
// filePath[0] = file;
// filePath.clear();
bannerPath.add(file);
isbannerAdded = true;
// isImageAdded = true;
setState(() {});
},
);
},
child: Container(
width: 169,
height: 115,
decoration: ShapeDecoration(
gradient: LinearGradient(
begin: Alignment(0.98, -0.21),
end: Alignment(-0.98, 0.21),
colors: [
Colors.white.withOpacity(
0.30000001192092896),
Colors.white
.withOpacity(0.2800000011920929)
],
),
shape: RoundedRectangleBorder(
side: BorderSide(
width: 0.50,
color: Color(0xFF7E7E7E)),
borderRadius:
BorderRadius.circular(10),
),
),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.center,
children: [
Image.asset(
'assets/images/png/onlycamera.png'),
sizedBoxHeight(5.h),
Text(
'Upload banner \nimage',
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
fontSize: 14.sp,
fontFamily: 'Poppins',
fontWeight: FontWeight.w400,
),
),
],
),
),
)
],
),
sizedBoxHeight(40.h),
CustomButton(text: 'Continue', onPressed: () {
Get.toNamed(RouteName.businessSelectgroupstep2);
})
],
),
),
])),
],
));
}
}

View File

@@ -0,0 +1,235 @@
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: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';
import 'package:regroup/resources/routes/route_name.dart';
import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart';
class TellusaboutBusiness extends StatefulWidget {
const TellusaboutBusiness({super.key});
@override
State<TellusaboutBusiness> createState() => _TellusaboutBusinessState();
}
class _TellusaboutBusinessState extends State<TellusaboutBusiness> {
TextEditingController businessownerController = TextEditingController();
TextEditingController businessNameController = TextEditingController();
TextEditingController businesslocation = TextEditingController();
final List<String> _businesslist = [
'Retail',
'Hospitality',
'Event provider',
'Coaching services',
'Recruitment & Scouting',
'Healthcare & Wellbeing',
'Other',
];
String _selectedbusinesstype = '';
void _onItemSelected(String value) {
setState(() {
_selectedbusinesstype = value;
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Color.fromARGB(255, 18, 32, 47),
body: Stack(
children: [
Positioned(top: 90, left: -30, child: CommonBlurLeftSecond()),
Positioned(top: 300, right: -30, child: CommonBlurRightSecond()),
Positioned(top: 490, 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: ListView(physics: ScrollPhysics(), children: [
Padding(
padding: EdgeInsets.symmetric(horizontal: 16.w),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// const Spacer(flex: 1),
sizedBoxHeight(60.h),
Center(
child:
text20400white('Tell us about your business')),
sizedBoxHeight(10.w),
Center(
child: Container(
width: 154,
decoration: ShapeDecoration(
shape: RoundedRectangleBorder(
side: BorderSide(
width: 1,
strokeAlign: BorderSide.strokeAlignCenter,
color: Color(0xFF858585),
),
),
)),
),
sizedBoxHeight(40.h),
text16400white('Business owner name'),
sizedBoxHeight(10.h),
CustomTextFormField(
textEditingController: businessownerController,
texttype: TextInputType.text,
hintText: "Enter your business owner name",
leadingIcon:
// const Icon(Icons.mail_outline),
Image.asset(
width: 22.w,
height: 17.h,
'assets/images/png/user.png',
),
// validatorText: "Enter your business owner name",
validator: (value) {
if (value!.isEmpty) {
return 'Enter your business owner name';
}
return null;
},
inputFormatters: [
// LengthLimitingTextInputFormatter(20),
RemoveEmojiInputFormatter(),
FilteringTextInputFormatter.allow(
RegExp('[a-zA-Z ]'))
],
),
sizedBoxHeight(10.h),
text16400white('Business name'),
sizedBoxHeight(10.h),
CustomTextFormField(
textEditingController: businessNameController,
texttype: TextInputType.text,
hintText: "Enter your business name",
leadingIcon:
// const Icon(Icons.mail_outline),
Image.asset(
width: 22.w,
height: 17.h,
'assets/images/png/briefcase.png',
),
// validatorText: "Enter your business name",
validator: (value) {
if (value!.isEmpty) {
return 'Enter your business name ';
}
return null;
},
inputFormatters: [
// LengthLimitingTextInputFormatter(20),
RemoveEmojiInputFormatter(),
FilteringTextInputFormatter.allow(
RegExp('[a-zA-Z ]'))
],
),
sizedBoxHeight(10.h),
text16400white('Business location'),
sizedBoxHeight(10.h),
CustomTextFormField(
textEditingController: businessNameController,
texttype: TextInputType.text,
hintText: "Enter your business location",
leadingIcon:
// const Icon(Icons.mail_outline),
Image.asset(
width: 22.w,
height: 17.h,
'assets/images/png/location.png',
),
// validatorText: "Enter your business location",
validator: (value) {
if (value!.isEmpty) {
return 'Enter your business location ';
}
return null;
},
inputFormatters: [
// LengthLimitingTextInputFormatter(20),
RemoveEmojiInputFormatter(),
FilteringTextInputFormatter.allow(
RegExp('[a-zA-Z ]'))
],
),
sizedBoxHeight(10.h),
text16400white('Type of business'),
sizedBoxHeight(10.h),
CustomDropDownWidgetSignup(
header: 'Select type of business',
title: '',
listData: _businesslist,
onItemSelected: _onItemSelected,
leadingImage:
Image.asset('assets/images/png/briefcase.png'),
),
sizedBoxHeight(50.h),
CustomButton(
text: "Continue",
onPressed: () {
if (_selectedbusinesstype.isNotEmpty) {
Get.toNamed(RouteName.businessletusunderstandstep1);
// Get.to(() => BusinessPage());
} else {
// Handle case where no selection is made
utils.showToast('Please select an gender type');
}
}),
sizedBoxHeight(30.h),
// const Spacer(
// flex: 3,
// )
],
),
),
])),
],
));
}
}

View File

@@ -1,22 +1,15 @@
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/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';
import 'package:regroup/onboarding/Signup/view_model/getmethod.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';
class SelectIndividualActivity extends StatefulWidget {
const SelectIndividualActivity({super.key});
@@ -28,402 +21,351 @@ class SelectIndividualActivity extends StatefulWidget {
class _SelectIndividualActivityState extends State<SelectIndividualActivity> {
final List<int> _selectedIndices = [];
TextEditingController otheractivitycontroller = TextEditingController();
// to select only two containers
// void _onContainerTap(int index) {
// setState(() {
// if (_selectedIndices.contains(index)) {
// _selectedIndices.remove(index);
// } else {
// if (_selectedIndices.length < 2) {
// _selectedIndices.add(index);
// } else {
// _selectedIndices[1] = index;
// }
// }
// });
// }
void _onContainerTap(int id) {
void _onContainerTap(int index) {
setState(() {
if (_selectedIndices.contains(id)) {
_selectedIndices.remove(id);
if (_selectedIndices.contains(index)) {
_selectedIndices.remove(index);
} else {
_selectedIndices.add(id);
if (_selectedIndices.length < 2) {
_selectedIndices.add(index);
} else {
_selectedIndices[1] = index;
}
}
});
}
// to give two different colors for selectedd two containers
// Color _getGradientColor(int index) {
// if (_selectedIndices.isEmpty) {
// return Colors.transparent;
// } else if (_selectedIndices.length == 1 &&
// _selectedIndices.contains(index)) {
// return Color(0XFFD90B2E);
// } else if (_selectedIndices.length == 2) {
// if (_selectedIndices[0] == index) {
// return Color(0XFFD90B2E);
// } else if (_selectedIndices[1] == index) {
// return Color(0xFF009DAB);
// }
// }
// return Colors.transparent;
// }
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');
Map<String, dynamic> 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();
print("Activities selected");
Get.toNamed(RouteName.individualgroupstep3);
return utils.showToast(data.message);
} else {
Get.back();
print("Not done");
return utils.showToast(data.message);
Color _getGradientColor(int index) {
if (_selectedIndices.isEmpty) {
return Colors.transparent;
} else if (_selectedIndices.length == 1 &&
_selectedIndices.contains(index)) {
return Color(0XFFD90B2E);
} else if (_selectedIndices.length == 2) {
if (_selectedIndices[0] == index) {
return Color(0XFFD90B2E);
} else if (_selectedIndices[1] == index) {
return Color(0xFF009DAB);
}
}
return Colors.transparent;
}
@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),
),
);
}
}
return Scaffold(
backgroundColor: Color.fromARGB(255, 18, 32, 47),
body: Stack(
children: [
Positioned(top: 220, left: -30, child: CommonBlurLeftSecond()),
Positioned(top: 450, right: -30, child: CommonBlurRightSecond()),
Positioned(top: 530, left: -30, child: CommonBlurLeftBlue()),
GlassmorphicContainer(
width: MediaQuery.of(context).size.width,
height: 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),
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),
),
// 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(
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 50.h),
child: Expanded(
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 2 of 4')),
sizedBoxHeight(20.h),
Container(
width: double.infinity,
height: 25.h,
decoration: ShapeDecoration(
shape: RoundedRectangleBorder(
side: 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),
),
),
)
),
child: Padding(
padding: EdgeInsets.symmetric(
horizontal: 8.w, vertical: 2.h),
child: Row(
children: [
Container(
width: 120.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)
],
))
],
),
),
),
sizedBoxHeight(40.h),
indiactivityobj!.data == null ||
indiactivityobj!.data!.isEmpty
? _buildNoDataBody(context)
: Column(
crossAxisAlignment: CrossAxisAlignment.start,
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(
shape: RoundedRectangleBorder(
side: BorderSide(
width: 1,
strokeAlign:
BorderSide.strokeAlignCenter,
color: Color(0xFF858585),
),
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),
),
),
),
),
),
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),
],
)
],
),
))
],
),
),
),
sizedBoxHeight(40.h),
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: ShapeDecoration(
shape: RoundedRectangleBorder(
side: BorderSide(
width: 1,
strokeAlign: BorderSide.strokeAlignCenter,
color: Color(0xFF858585),
),
),
),
),
),
sizedBoxHeight(30.h),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
ActivityContainer(
index: 0,
titleString: 'Rowing',
image: 'assets/images/svg/individualact1.svg',
isSelected: _selectedIndices.contains(0),
gradientColor: _getGradientColor(0),
onTap: _onContainerTap,
),
ActivityContainer(
index: 1,
titleString: 'Badminton',
image: 'assets/images/svg/badminton.svg',
isSelected: _selectedIndices.contains(1),
gradientColor: _getGradientColor(1),
onTap: _onContainerTap,
),
ActivityContainer(
index: 2,
titleString: 'Cycling',
image: 'assets/images/svg/individualact2.svg',
isSelected: _selectedIndices.contains(2),
gradientColor: _getGradientColor(2),
onTap: _onContainerTap,
),
],
),
SizedBox(height: 20.h),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
ActivityContainer(
index: 3,
titleString: 'Football',
image: 'assets/images/svg/individualact7.svg',
isSelected: _selectedIndices.contains(3),
gradientColor: _getGradientColor(3),
onTap: _onContainerTap,
),
ActivityContainer(
index: 4,
titleString: 'Weightlifting',
image: 'assets/images/svg/weightlifting.svg',
isSelected: _selectedIndices.contains(4),
gradientColor: _getGradientColor(4),
onTap: _onContainerTap,
),
ActivityContainer(
index: 5,
titleString: 'Running',
image: 'assets/images/svg/individualact3.svg',
isSelected: _selectedIndices.contains(5),
gradientColor: _getGradientColor(5),
onTap: _onContainerTap,
),
],
),
SizedBox(height: 20.h),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
ActivityContainer(
index: 6,
titleString: 'Social',
image: 'assets/images/svg/individualact7.svg',
isSelected: _selectedIndices.contains(6),
gradientColor: _getGradientColor(6),
onTap: _onContainerTap,
),
SizedBox(width: 20.w),
ActivityContainer(
index: 7,
titleString: 'Special Interest (Societies)',
image:
'assets/images/svg/special interest.svg',
isSelected: _selectedIndices.contains(7),
gradientColor: _getGradientColor(7),
onTap: _onContainerTap,
),
],
),
],
),
sizedBoxHeight(30.h),
text20400FCFCFC("Select other activity"),
sizedBoxHeight(25.h),
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),
CustomButton(
text: "Continue",
onPressed: () {
Get.toNamed(RouteName.individualgroupstep3);
})
],
),
),
],
);
},
),
),
//
),
);
}
Widget _buildNoDataBody(context) {
return const Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [Text("No Data Found")],
);
),
),
)
],
));
}
}
class ActivityContainer extends StatelessWidget {
final int index;
final String titleString;
final String? image;
final String image;
final bool isSelected;
final Color gradientColor;
final Function(int) onTap;
@@ -442,12 +384,12 @@ class ActivityContainer extends StatelessWidget {
return GestureDetector(
onTap: () => onTap(index),
child: Container(
// width: 110.w,
// height: 120.h,
width: 110.w,
height: 120.h,
decoration: ShapeDecoration(
gradient: LinearGradient(
begin: const Alignment(0.98, -0.21),
end: const Alignment(-0.98, 0.21),
end: Alignment(-0.98, 0.21),
colors: isSelected
? [
gradientColor.withOpacity(0.80),
@@ -461,40 +403,21 @@ class ActivityContainer extends StatelessWidget {
],
),
shape: RoundedRectangleBorder(
side: const BorderSide(width: 1, color: Color(0xFF434A53)),
side: BorderSide(width: 1, color: Color(0xFF434A53)),
borderRadius: BorderRadius.circular(10),
),
),
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 0.w, vertical: 10.h),
padding: EdgeInsets.symmetric(horizontal: 10.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),
SvgPicture.asset(
image,
width: 50.w,
height: 50.h,
),
SizedBox(height: 10.h),
SizedBox(
child: Text(
titleString,

View File

@@ -1,20 +1,14 @@
import 'dart:async';
import 'package:flutter/cupertino.dart';
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/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';
import 'package:regroup/onboarding/Signup/Model/Onboarding/Individual/GroupModel.dart';
import 'package:regroup/onboarding/Signup/view_model/getmethod.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';
@@ -26,326 +20,250 @@ class SelectIndividualGroup extends StatefulWidget {
}
class _SelectIndividualGroupState extends State<SelectIndividualGroup> {
StreamController<GrouplistModel> searchcontroller = StreamController();
@override
void initState() {
var updata = "";
Getonboard().getGroupsearch(updata, streamController: searchcontroller);
super.initState();
}
@override
void dispose() {
searchcontroller.close();
super.dispose();
}
final List<int> _selectedIndices = [];
void _onContainerTap(int id) {
setState(() {
if (_selectedIndices.contains(id)) {
_selectedIndices.remove(id);
} else {
_selectedIndices.add(id);
}
});
}
Uploadata() async {
utils.loader();
String selectedIndicesString = '[${_selectedIndices.join(',')}]';
print('Selected Indices: $selectedIndicesString');
Map<String, dynamic> updata = {
"manage_group_xid": selectedIndicesString,
};
print('Payload: $updata');
final data = await Onboard().postGroups(updata);
if (data.status == ResponseStatus.SUCCESS) {
Get.back();
print("groups selected");
Get.toNamed(RouteName.individualcommunitystep4);
return utils.showToast(data.message);
} else {
Get.back();
print("Not done");
return utils.showToast(data.message);
}
}
TextEditingController searchcontroller = TextEditingController();
// StreamController<BlogsModel> blogsController = StreamController();
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
child: Scaffold(
backgroundColor: Color.fromARGB(255, 18, 32, 47),
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, vertical: 40.h),
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 2 of 3')),
sizedBoxHeight(20.h),
Container(
width: double.infinity,
height: 25.h,
decoration: ShapeDecoration(
shape: RoundedRectangleBorder(
side: 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: 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)
],
),
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),
),
),
)
],
))
],
),
),
),
sizedBoxHeight(40.h),
Center(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
return Scaffold(
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(
padding:
EdgeInsets.symmetric(horizontal: 16.w, vertical: 50.h),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
text20400white('Find your group'),
sizedBoxWidth(5.w),
Image.asset('assets/images/png/informationicon.png')
],
)),
sizedBoxHeight(10.w),
Center(
child: Container(
width: 108.w,
decoration: ShapeDecoration(
shape: RoundedRectangleBorder(
side: BorderSide(
width: 1,
strokeAlign: BorderSide.strokeAlignCenter,
color: Color(0xFF858585),
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),
CustomTextFormField(
// textEditingController: searchcontroller,
texttype: TextInputType.text,
hintText: "Search groups",
leadingIcon:
// const Icon(Icons.mail_outline),
// SvgPicture.asset(
// // width: 23.w,
// // height: 23.h,
// 'assets/images/svg/search.svg',
// ),
Padding(
padding: EdgeInsets.symmetric(horizontal: 16.w),
child: Icon(
Icons.search,
size: 35,
color: Colors.white,
),
),
// validatorText: "Enter your full name",
inputFormatters: [
// LengthLimitingTextInputFormatter(20),
RemoveEmojiInputFormatter(),
],
onInput: (value) {
// Onboard().postGroupsearch({"search": value},
// streamController: searchcontroller);
// searchGroups(value!);
Getonboard().getGroupsearch(value,
streamController: searchcontroller);
},
),
sizedBoxHeight(30.h),
StreamBuilder<GrouplistModel>(
stream: searchcontroller.stream,
builder: (ctx, snapshot) {
if (snapshot.connectionState ==
ConnectionState.waiting) {
// Display shimmer effect while waiting for data
return Center(child: CircularProgressIndicator());
} else if (snapshot.hasError) {
// Handle error state
return Center(
child: Text(
'${snapshot.error} occurred',
style: TextStyle(fontSize: 18),
sizedBoxHeight(30.h),
Align(
alignment: Alignment.center,
child: text16400white('Step 3 of 4')),
sizedBoxHeight(20.h),
Container(
width: double.infinity,
height: 25.h,
decoration: ShapeDecoration(
shape: RoundedRectangleBorder(
side: BorderSide(
width: 1, color: Color(0xFF434A53)),
borderRadius: BorderRadius.circular(30),
),
);
} else {
// Data has been loaded, show actual UI
return grouplistobj!.data!.isEmpty
? _buildNoDataBody(context)
: Expanded(
child: GridView.builder(
physics: ScrollPhysics(),
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
crossAxisSpacing: 12.0,
mainAxisSpacing: 12.0,
),
child: Padding(
padding: EdgeInsets.symmetric(
horizontal: 8.w, vertical: 2.h),
child: Row(
children: [
Container(
width: 240.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)
],
),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(30),
),
),
itemCount: grouplistobj!.data!.length,
itemBuilder: (context, index) {
return SizedBox(
height:
150.0, // Adjust this height according to your design
child: GroupSelect(
titleString:
grouplistobj!.data![index].title!,
image: grouplistobj
?.data?[index]?.groupImage ??
'',
index: grouplistobj!.data![index].id!,
isSelected: _selectedIndices.contains(
grouplistobj!.data![index].id!),
onTap: _onContainerTap,
),
);
},
),
);
}
},
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),
),
),
)
],
))
],
),
),
),
sizedBoxHeight(40.h),
Center(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
text20400white('Find your group'),
sizedBoxWidth(5.w),
Image.asset('assets/images/png/informationicon.png')
],
)),
sizedBoxHeight(10.w),
Center(
child: Container(
width: 108.w,
decoration: ShapeDecoration(
shape: RoundedRectangleBorder(
side: BorderSide(
width: 1,
strokeAlign: BorderSide.strokeAlignCenter,
color: Color(0xFF858585),
),
),
),
),
),
sizedBoxHeight(30.h),
CustomTextFormField(
textEditingController: searchcontroller,
texttype: TextInputType.text,
hintText: "Search groups",
leadingIcon:
// const Icon(Icons.mail_outline),
// SvgPicture.asset(
// // width: 23.w,
// // height: 23.h,
// 'assets/images/svg/search.svg',
// ),
Padding(
padding: EdgeInsets.symmetric(horizontal: 16.w),
child: Icon(
Icons.search,
size: 35,
color: Colors.white,
),
),
// validatorText: "Enter your full name",
inputFormatters: [
// LengthLimitingTextInputFormatter(20),
RemoveEmojiInputFormatter(),
],
),
sizedBoxHeight(30.h),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
GroupSelect(
titleString: 'Cambridge university Boat ..',
image: 'assets/images/png/groupindividual.png'),
GroupSelect(
titleString: 'Liverpool FC',
image:
'assets/images/png/groupindividual2.png'),
],
),
sizedBoxHeight(30.h),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
GroupSelect(
titleString: 'Cambridge rugby Club',
image:
'assets/images/png/groupindividual3.png'),
GroupSelect(
titleString: 'Cambridge university Boat ..',
image: 'assets/images/png/groupindividual.png'),
],
),
Spacer(flex: 1),
CustomButton(
text: "Continue",
onPressed: () {
Get.toNamed(RouteName.individualcommunitystep4);
})
],
),
// sizedBoxHeight(40.h),
CustomButton(
text: "Continue",
onPressed: () {
// Get.toNamed(RouteName.individualcommunitystep4);
if (_selectedIndices.isEmpty) {
utils.showToast('Please select activity');
} else {
print(_selectedIndices.toString());
// String selectedIndicesString =
// _selectedIndices.join(',');
// print(
// 'Selected Indices: [$selectedIndicesString]');
Uploadata();
}
},
),
],
),
),
],
)),
);
}
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 GroupSelect extends StatelessWidget {
class GroupSelect extends StatefulWidget {
final String titleString;
final String? image;
final int index;
final Function(int) onTap;
final bool isSelected;
final String image;
GroupSelect({
Key? key,
required this.titleString,
required this.image,
required this.index,
required this.onTap,
required this.isSelected,
}) : super(key: key);
@override
State<GroupSelect> createState() => _GroupSelectState();
}
class _GroupSelectState extends State<GroupSelect> {
bool _text = false;
@override
Widget build(BuildContext context) {
return Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
@@ -353,29 +271,24 @@ class GroupSelect extends StatelessWidget {
width: 169,
height: 74,
decoration: ShapeDecoration(
image: image == null || image!.isEmpty
? DecorationImage(
image: AssetImage("assets/images/png/groupindividual3.png"),
fit: BoxFit.fill,
)
: DecorationImage(
image: NetworkImage(image!),
fit: BoxFit.fill,
),
image: DecorationImage(
image: AssetImage(
// "https://via.placeholder.com/169x74"
widget.image),
fit: BoxFit.fill,
),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(5)),
),
),
SizedBox(height: 15.0),
Text(
titleString,
style: TextStyle(
color: Colors.white,
fontSize: 12.0,
overflow: TextOverflow.ellipsis),
),
SizedBox(height: 15.0),
sizedBoxHeight(15.h),
text12400white(widget.titleString),
sizedBoxHeight(15.h),
GestureDetector(
onTap: () => onTap(index),
onTap: () {
setState(() {
_text = !_text;
});
},
child: Container(
width: 169,
height: 23,
@@ -388,11 +301,7 @@ class GroupSelect extends StatelessWidget {
child: Row(
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))
_text ? text10400white('Regrouping') : text10400white('Join')
],
),
),

View File

@@ -1,20 +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/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';
import 'package:regroup/onboarding/Signup/Model/Onboarding/Individual/CommunitiesModel.dart';
import 'package:regroup/onboarding/Signup/view_model/getmethod.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';
@@ -27,143 +20,111 @@ class SelectIndividualCommunity extends StatefulWidget {
}
class _SelectIndividualCommunityState extends State<SelectIndividualCommunity> {
StreamController<GetcommunitiesModel> searchcontroller = StreamController();
@override
void initState() {
var updata = "";
Getonboard().getCommunitysearch(updata, streamController: searchcontroller);
super.initState();
}
@override
void dispose() {
searchcontroller.close();
super.dispose();
}
final List<int> _selectedIndices = [];
void _onContainerTap(int id) {
setState(() {
if (_selectedIndices.contains(id)) {
_selectedIndices.remove(id);
} else {
_selectedIndices.add(id);
}
});
}
Uploadata() async {
utils.loader();
String selectedIndicesString = '[${_selectedIndices.join(',')}]';
print('Selected Indices: $selectedIndicesString');
Map<String, dynamic> updata = {
"manage_community_xid": selectedIndicesString,
};
print('Payload: $updata');
final data = await Onboard().postCommunities(updata);
if (data.status == ResponseStatus.SUCCESS) {
// Get.back();
print("groups selected");
Get.toNamed(RouteName.communitycommitscreen);
return utils.showToast(data.message);
} else {
Get.back();
print("Not done");
return utils.showToast(data.message);
}
}
TextEditingController searchcontroller = TextEditingController();
// StreamController<BlogsModel> blogsController = StreamController();
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
child: Scaffold(
backgroundColor: Color.fromARGB(255, 18, 32, 47),
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, vertical: 40.h),
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 3 of 3')),
sizedBoxHeight(20.h),
Container(
width: double.infinity,
height: 25.h,
decoration: ShapeDecoration(
shape: RoundedRectangleBorder(
side: BorderSide(width: 1, color: Color(0xFF434A53)),
borderRadius: BorderRadius.circular(30),
),
),
child: Padding(
padding: EdgeInsets.symmetric(
horizontal: 8.w, vertical: 2.h),
child: Row(
children: [
Expanded(
child: 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)
],
),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(30),
),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Container(
width: 15,
height: 15,
return Scaffold(
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(
padding:
EdgeInsets.symmetric(horizontal: 16.w, vertical: 50.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 4 of 4')),
sizedBoxHeight(20.h),
Container(
width: double.infinity,
height: 25.h,
decoration: ShapeDecoration(
shape: RoundedRectangleBorder(
side: BorderSide(
width: 1, color: Color(0xFF434A53)),
borderRadius: BorderRadius.circular(30),
),
),
child: Padding(
padding: EdgeInsets.symmetric(
horizontal: 8.w, vertical: 2.h),
child: Row(
children: [
Expanded(
child: Container(
width: double.infinity,
child: Container(
height: 15.h,
decoration: ShapeDecoration(
gradient: LinearGradient(
begin: Alignment(0.98, -0.21),
end: Alignment(-0.98, 0.21),
colors: [
Color(0xFFD90B2E),
Color(0x60D90B2E)
Color(0xA5D90B2E),
Color(0x42D90B2E)
],
),
shape: RoundedRectangleBorder(
@@ -171,186 +132,159 @@ class _SelectIndividualCommunityState extends State<SelectIndividualCommunity> {
BorderRadius.circular(30),
),
),
)
],
)))
],
),
),
),
sizedBoxHeight(40.h),
Center(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
text20400white('Find your community'),
sizedBoxWidth(5.w),
Image.asset(
'assets/images/png/informationicon.png',
)
],
)),
sizedBoxHeight(10.w),
Center(
child: Container(
width: 108.w,
decoration: ShapeDecoration(
shape: RoundedRectangleBorder(
side: BorderSide(
width: 1,
strokeAlign: BorderSide.strokeAlignCenter,
color: Color(0xFF858585),
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),
),
),
)
],
)),
),
)
],
),
),
),
),
),
),
sizedBoxHeight(30.h),
CustomTextFormField(
texttype: TextInputType.text,
hintText: "Search community",
leadingIcon:
// const Icon(Icons.mail_outline),
// SvgPicture.asset(
// // width: 23.w,
// // height: 23.h,
// 'assets/images/svg/search.svg',
// ),
Padding(
padding: EdgeInsets.symmetric(horizontal: 16.w),
child: Icon(
Icons.search,
size: 35,
color: Colors.white,
),
),
// validatorText: "Enter your full name",
inputFormatters: [
// LengthLimitingTextInputFormatter(20),
RemoveEmojiInputFormatter(),
],
onInput: (value) {
// Onboard().postGroupsearch({"search": value},
// streamController: searchcontroller);
// searchGroups(value!);
Getonboard().getCommunitysearch(value,
streamController: searchcontroller);
},
),
sizedBoxHeight(30.h),
StreamBuilder<GetcommunitiesModel>(
stream: searchcontroller.stream,
builder: (ctx, snapshot) {
if (snapshot.connectionState ==
ConnectionState.waiting) {
// Display shimmer effect while waiting for data
return Center(child: CircularProgressIndicator());
} else if (snapshot.hasError) {
// Handle error state
return Center(
child: Text(
'${snapshot.error} occurred',
style: TextStyle(fontSize: 18),
),
);
} else {
// Data has been loaded, show actual UI
return communitylistobj!.data!.isEmpty
? _buildNoDataBody(context)
: Expanded(
child: GridView.builder(
physics: ScrollPhysics(),
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
crossAxisSpacing: 12.0,
mainAxisSpacing: 12.0,
),
itemCount: communitylistobj!.data!.length,
itemBuilder: (context, index) {
return SizedBox(
height:
150.0, // Adjust this height according to your design
child: CommunitySelect(
titleString: communitylistobj!
.data![index].communityName!,
image: communitylistobj?.data?[index]
?.communityProfilePhoto ??
'',
index: communitylistobj!
.data![index].id!,
isSelected: _selectedIndices.contains(
communitylistobj!
.data![index].id!),
onTap: _onContainerTap,
),
);
},
sizedBoxHeight(40.h),
Center(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
text20400white('Find your community'),
sizedBoxWidth(5.w),
Image.asset(
'assets/images/png/informationicon.png',
)
],
)),
sizedBoxHeight(10.w),
Center(
child: Container(
width: 108.w,
decoration: ShapeDecoration(
shape: RoundedRectangleBorder(
side: BorderSide(
width: 1,
strokeAlign: BorderSide.strokeAlignCenter,
color: Color(0xFF858585),
),
);
}
},
),
),
),
),
sizedBoxHeight(30.h),
CustomTextFormField(
textEditingController: searchcontroller,
texttype: TextInputType.text,
hintText: "Search community",
leadingIcon:
// const Icon(Icons.mail_outline),
// SvgPicture.asset(
// // width: 23.w,
// // height: 23.h,
// 'assets/images/svg/search.svg',
// ),
Padding(
padding: EdgeInsets.symmetric(horizontal: 16.w),
child: Icon(
Icons.search,
size: 35,
color: Colors.white,
),
),
// validatorText: "Enter your full name",
inputFormatters: [
// LengthLimitingTextInputFormatter(20),
RemoveEmojiInputFormatter(),
],
),
sizedBoxHeight(30.h),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
CommunitySelect(
titleString: 'Liverpool FC ',
image:
'assets/images/png/groupindividual2.png'),
CommunitySelect(
titleString: 'Cambridge rugby Club',
image: 'assets/images/png/community2.png'),
CommunitySelect(
titleString: 'Cambridge rugby Club',
image: 'assets/images/png/community2.png'),
],
),
sizedBoxHeight(30.h),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
CommunitySelect(
titleString: 'The athletic town',
image:
'assets/images/png/groupindividual3.png'),
CommunitySelect(
titleString: 'Football Fever',
image:
'assets/images/png/groupindividual2.png'),
CommunitySelect(
titleString: 'Football Fever',
image:
'assets/images/png/groupindividual2.png'),
],
),
// Spacer(flex: 1),
sizedBoxHeight(40.h),
CustomButton(
text: "Continue",
onPressed: () {
Get.toNamed(RouteName.communitycommitscreen);
})
],
),
),
// sizedBoxHeight(30),
CustomButton(
text: "Continue",
onPressed: () {
// Get.toNamed(RouteName.individualcommunitystep4);
if (_selectedIndices.isEmpty) {
utils.showToast('Please select activity');
} else {
print(_selectedIndices.toString());
// String selectedIndicesString =
// _selectedIndices.join(',');
// print(
// 'Selected Indices: [$selectedIndicesString]');
Uploadata();
}
},
),
],
),
),
],
)),
);
}
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 CommunitySelect extends StatelessWidget {
class CommunitySelect extends StatefulWidget {
final String titleString;
final String? image;
final int index;
final Function(int) onTap;
final bool isSelected;
final String image;
CommunitySelect({
Key? key,
required this.titleString,
required this.image,
required this.index,
required this.onTap,
required this.isSelected,
}) : super(key: key);
@override
State<CommunitySelect> createState() => _CommunitySelectState();
}
class _CommunitySelectState extends State<CommunitySelect> {
bool _text = false;
@override
Widget build(BuildContext context) {
return Column(crossAxisAlignment: CrossAxisAlignment.center, children: [
@@ -358,34 +292,29 @@ class CommunitySelect extends StatelessWidget {
width: 73.w,
height: 73.h,
decoration: ShapeDecoration(
image: image == null || image!.isEmpty
? DecorationImage(
image: AssetImage("assets/images/png/groupindividual2.png"),
fit: BoxFit.fill,
)
: DecorationImage(
image: NetworkImage(image!),
fit: BoxFit.fill,
),
image: DecorationImage(
image: AssetImage(
// "https://via.placeholder.com/169x74"
widget.image),
fit: BoxFit.fill,
),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(100),
),
),
),
sizedBoxHeight(15.h),
Text(
titleString,
style: TextStyle(
color: Colors.white,
fontSize: 12.0,
overflow: TextOverflow.ellipsis),
),
SizedBox(width: 94.w, child: text12400white(widget.titleString)),
sizedBoxHeight(15.h),
GestureDetector(
onTap: () => onTap(index),
onTap: () {
setState(() {
_text = !_text;
});
},
child: Container(
width: 169,
height: 23,
width: 100.w,
height: 23.h,
decoration: ShapeDecoration(
shape: RoundedRectangleBorder(
side: BorderSide(width: 1, color: Color(0xFFFF002B)),
@@ -395,11 +324,7 @@ class CommunitySelect extends StatelessWidget {
child: Row(
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))
_text ? text10400white('Regrouping') : text10400white('Join')
],
),
),

View File

@@ -1,14 +1,11 @@
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:get/get.dart';
import 'package:glassmorphism/glassmorphism.dart';
import 'package:regroup/Common/CommonWidget.dart';
import 'package:regroup/Common/base_manager.dart';
import 'package:regroup/Common/controller/profileimagecontroller.dart';
import 'package:regroup/Utils/Common/CommonDropdown.dart';
import 'package:regroup/Utils/Common/CustomNextButton.dart';
@@ -18,10 +15,8 @@ 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});
@@ -34,8 +29,6 @@ class _TellusaboutIndividualState extends State<TellusaboutIndividual> {
TextEditingController fullNameController = TextEditingController();
TextEditingController userNameController = TextEditingController();
TextEditingController datecontroller = TextEditingController();
TextEditingController locationcontroller = TextEditingController();
DateTime? _selectedDate;
final photographController = TextEditingController();
@@ -43,24 +36,9 @@ class _TellusaboutIndividualState extends State<TellusaboutIndividual> {
Get.put(ProfileImageController());
Future<void> _selectDate(BuildContext context) async {
DateTime yesterday = DateTime.now().subtract(const Duration(days: 1));
DateTime yesterday = DateTime.now().subtract(Duration(days: 1));
DateTime eighteenYearsAgo =
DateTime.now().subtract(const Duration(days: 365 * 18));
final ThemeData customTheme = Theme.of(context).copyWith(
colorScheme: const ColorScheme.light(
primary: Color(0xFFD90B2E),
surfaceTint: Color(0xFF222935),
surface: Color(0xFF222935),
onPrimary: Colors.white,
onSurface: Colors.white,
onSecondary: Colors.white),
textButtonTheme: TextButtonThemeData(
style: TextButton.styleFrom(
foregroundColor: const Color(0xFFD90B2E),
),
));
final DateTime? pickedDate = await showDatePicker(
context: context,
initialDate: yesterday,
@@ -68,54 +46,60 @@ class _TellusaboutIndividualState extends State<TellusaboutIndividual> {
lastDate: DateTime(2026),
builder: (BuildContext context, Widget? child) {
return Theme(
data: customTheme,
// ThemeData.light().copyWith(
// colorScheme: ColorScheme.dark(
// primary: Color(0XFF222935).withOpacity(0.60),
// onPrimary: Colors.white, // Change text color
// ),
// textButtonTheme: TextButtonThemeData(
// style: TextButton.styleFrom(
// foregroundColor: Colors.white, // Change button text color
// ),
// ),
// dialogBackgroundColor: Color(0XFF222935)
// .withOpacity(0.60), // Change dialog background color
// ),
data: ThemeData.light().copyWith(
colorScheme: ColorScheme.dark(
primary:
Color(0XFF222935).withOpacity(0.60), // Change primary color
onPrimary:
// Color(0XFF222935).withOpacity(0.60), // Change primary color
Colors.white
// Colors.white, // Change text color
),
textButtonTheme: TextButtonThemeData(
style: TextButton.styleFrom(
foregroundColor: Colors.white, // Change button text color
),
),
dialogBackgroundColor:
// Color(0xFF434A53),
Color(0XFF222935).withOpacity(0.60), // Change primary color
// // Change dialog background color
),
child: child!,
);
},
);
if (pickedDate != null) {
if (pickedDate.isBefore(eighteenYearsAgo)) {
setState(() {
_selectedDate = pickedDate;
datecontroller.text =
"${_selectedDate!.year.toString().padLeft(2, '0')}-${_selectedDate!.month.toString().padLeft(2, '0')}-${_selectedDate!.day.toString().padLeft(2, '0')}";
});
} else {
setState(() {
_selectedDate = null;
datecontroller.text = ''; // Clear the text field
});
// if (pickedDate.isBefore(eighteenYearsAgo)) {
Get.snackbar(
"Error!",
'User should be 18+',
duration: const Duration(seconds: 2),
colorText: Colors.white,
backgroundColor: Colors.red,
margin: const EdgeInsets.all(8),
snackStyle: SnackStyle.FLOATING,
snackPosition: SnackPosition.BOTTOM,
);
// ScaffoldMessenger.of(context).showSnackBar(
// SnackBar(
// content: Text('User should be 18+'),
// ),
// );
}
setState(() {
// selectedDate.value = pickedDate;
_selectedDate = pickedDate;
datecontroller.text =
"${_selectedDate!.day.toString().padLeft(2, '0')}-${_selectedDate!.month.toString().padLeft(2, '0')}-${_selectedDate!.year.toString().padLeft(2, '0')}";
});
// }
// else {
// showDialog(
// context: context,
// builder: (context) {
// return AlertDialog(
// title: const Text("Age Restriction"),
// content: const Text("Sorry, you must be above 18 years age"),
// actions: [
// TextButton(
// onPressed: () {
// Navigator.of(context).pop();
// },
// child: const Text("OK"),
// ),
// ],
// );
// },
// );
// }
}
}
@@ -129,319 +113,318 @@ class _TellusaboutIndividualState extends State<TellusaboutIndividual> {
});
}
void TellusUploadData() async {
utils.loader();
var imageFile;
if (editProfileImage.profilePicPath.value.isNotEmpty) {
imageFile = await MultipartFile.fromFile(
editProfileImage.profilePicPath.value,
filename: path.basename(editProfileImage.profilePicPath.value),
);
}
FormData formData = FormData.fromMap({
"full_name": fullNameController.text,
"username": userNameController.text,
"date_of_birth": datecontroller.text,
"gender": _selectedgendertype,
'profile_photo': imageFile,
'location': locationcontroller.text,
});
final data = await Onboard().PosttellusIndividual(formData);
if (data.status == ResponseStatus.SUCCESS) {
Get.back();
Get.toNamed(RouteName.individualactivitystep2);
} else {
Get.back();
return utils.showToast(data.message);
}
}
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
child: Scaffold(
backgroundColor: const Color.fromARGB(255, 18, 32, 47),
body: 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: [
// const Spacer(flex: 1),
sizedBoxHeight(50.h),
Center(child: text20400white('Tell us about yourself')),
sizedBoxHeight(10.w),
Center(
child: Container(
width: 154,
decoration: const ShapeDecoration(
shape: RoundedRectangleBorder(
side: BorderSide(
width: 1,
strokeAlign: BorderSide.strokeAlignCenter,
color: Color(0xFF858585),
),
),
)),
),
sizedBoxHeight(20.h),
GestureDetector(
onTap: () {
ImageUploadBottomSheet().showModal(
context,
false,
(result) {
print("File path is $result");
editProfileImage.profilePicPath.value = result;
var filenameresult = extractFileName(result);
print("File name is $filenameresult");
photographController.text = filenameresult;
},
);
},
child: Center(
child: Column(
children: [
Stack(
alignment: Alignment.center,
children: [
// Outer circle
Container(
width: 139.w,
height: 139.h,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.transparent,
border: Border.all(
color: const Color(0XFFD90B2E)
.withOpacity(0.50),
width: 2),
return Scaffold(
backgroundColor: Color.fromARGB(255, 18, 32, 47),
body: Stack(
children: [
Positioned(top: 70, left: -30, child: CommonBlurLeftSecond()),
Positioned(top: 310, right: -30, child: CommonBlurRightSecond()),
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: [
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: ListView(physics: ScrollPhysics(), children: [
Padding(
padding: EdgeInsets.symmetric(horizontal: 16.w),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// const Spacer(flex: 1),
sizedBoxHeight(50.h),
Center(child: text20400white('Tell us about yourself')),
sizedBoxHeight(10.w),
Center(
child: Container(
width: 154,
decoration: ShapeDecoration(
shape: RoundedRectangleBorder(
side: BorderSide(
width: 1,
strokeAlign: BorderSide.strokeAlignCenter,
color: Color(0xFF858585),
),
),
// Middle circle
Container(
width: 119.w,
height: 119.h,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.transparent,
border: Border.all(
color: const Color(0XFFD90B2E)
.withOpacity(0.50),
width: 2),
),
),
// Inner circle
Container(
)),
),
sizedBoxHeight(20.h),
GestureDetector(
onTap: () {
ImageUploadBottomSheet().showModal(
context,
false,
(result) {
print("File path is $result");
editProfileImage.profilePicPath.value = result;
var filenameresult = extractFileName(result);
print("File name is $filenameresult");
photographController.text = filenameresult;
},
);
},
child: Center(
child: Column(
children: [
Stack(
alignment: Alignment.center,
children: [
// Outer circle
Container(
width: 139.w,
height: 139.h,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.transparent,
border: Border.all(
color: const Color(0XFFD90B2E)
color: Color(0XFFD90B2E)
.withOpacity(0.50),
width: 2),
),
child: Obx(() => editProfileImage
.profilePicPath.value !=
''
? ClipOval(
child: SizedBox.fromSize(
size: Size.fromRadius(50.r),
child: Image(
image: FileImage(
File(
editProfileImage
.profilePicPath
.value,
),
// Middle circle
Container(
width: 119.w,
height: 119.h,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.transparent,
border: Border.all(
color: Color(0XFFD90B2E)
.withOpacity(0.50),
width: 2),
),
),
// Inner circle
Container(
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.transparent,
border: Border.all(
color: Color(0XFFD90B2E)
.withOpacity(0.50),
width: 2),
),
child: Obx(() =>
// editProfileImage
// .profilePicPath.value !=
// ''
// ?
editProfileImage.profilePicPath
.value !=
''
? ClipOval(
child: SizedBox.fromSize(
size: Size.fromRadius(
50.r),
child: Image(
image: FileImage(
File(
editProfileImage
.profilePicPath
.value,
),
),
fit: BoxFit.cover,
width: 200.w,
height: 200.h,
),
),
),
fit: BoxFit.cover,
width: 200.w,
height: 200.h,
),
),
)
: Image.asset(
"assets/images/png/camera.png")
// : Image.asset(
// "assets/images/png/camera.png")
)),
// Main button
],
),
const SizedBox(height: 9),
text16400white('Add profile picture')
],
)),
),
sizedBoxHeight(20.h),
text16400white('Full name'),
sizedBoxHeight(10.h),
CustomTextFormField(
textEditingController: fullNameController,
texttype: TextInputType.text,
hintText: "Enter your full name",
leadingIcon:
// const Icon(Icons.mail_outline),
Image.asset(
width: 22.w,
height: 17.h,
'assets/images/png/user.png',
)
: Image.asset(
"assets/images/png/camera.png")
// : Image.asset(
// "assets/images/png/camera.png")
)),
// Main button
],
),
const SizedBox(height: 9),
text16400white('Add profile picture')
],
)),
),
// 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(10.h),
text16400white('User name'),
sizedBoxHeight(10.h),
CustomTextFormField(
textEditingController: userNameController,
texttype: TextInputType.text,
hintText: "Enter your user name",
leadingIcon:
// const Icon(Icons.mail_outline),
Image.asset(
width: 22.w,
height: 17.h,
'assets/images/png/user.png',
),
// validatorText: "Enter your user name",
validator: (value) {
if (value!.isEmpty) {
return 'Enter your user name ';
}
return null;
},
inputFormatters: [
// LengthLimitingTextInputFormatter(20),
RemoveEmojiInputFormatter(),
FilteringTextInputFormatter.allow(RegExp('[a-zA-Z ]'))
],
),
sizedBoxHeight(10.h),
text16400white('Date of birth'),
sizedBoxHeight(10.h),
CustomTextFormField(
textEditingController: datecontroller,
readonly: true,
onTap: () {
_selectDate(context);
},
// texttype: TextInputType.text,
hintText: "Enter your date of birth",
leadingIcon:
// const Icon(Icons.mail_outline),
Image.asset(
width: 22.w,
height: 17.h,
'assets/images/png/dateimage.png',
),
// validatorText: "Enter date of birth",
validator: (value) {
if (value!.isEmpty) {
return 'Enter your date of birth';
}
return null;
},
),
sizedBoxHeight(10.h),
text16400white('Gender'),
sizedBoxHeight(10.h),
CustomDropDownRadio(
header: 'Select gender',
title: '',
listData: _gender,
onItemSelected: _onItemSelected,
leadingImage:
Image.asset('assets/images/png/gendericon.png'),
),
sizedBoxHeight(10.h),
Row(
children: [
text16400white('Location'),
sizedBoxWidth(5.w),
Image.asset('assets/images/png/informationicon.png')
],
),
sizedBoxHeight(10.h),
CustomTextFormField(
textEditingController: locationcontroller,
texttype: TextInputType.text,
hintText: "Enter your location",
leadingIcon:
// const Icon(Icons.mail_outline),
Image.asset(
width: 22.w,
height: 17.h,
'assets/images/png/location.png',
),
// validatorText: "Enter your location",
validator: (value) {
if (value!.isEmpty) {
return 'Enter your location ';
}
return null;
},
inputFormatters: [
// LengthLimitingTextInputFormatter(20),
RemoveEmojiInputFormatter(),
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');
} else {
TellusUploadData();
sizedBoxHeight(20.h),
text16400white('Full name'),
sizedBoxHeight(10.h),
CustomTextFormField(
textEditingController: fullNameController,
texttype: TextInputType.text,
hintText: "Enter your full name",
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 ';
}
// if (_selectedgendertype.isNotEmpty) {
// Get.toNamed(RouteName.individualprofilestep1);
return null;
},
inputFormatters: [
// LengthLimitingTextInputFormatter(20),
RemoveEmojiInputFormatter(),
FilteringTextInputFormatter.allow(
RegExp('[a-zA-Z ]'))
],
),
sizedBoxHeight(0.h),
text16400white('User name'),
sizedBoxHeight(10.h),
CustomTextFormField(
textEditingController: userNameController,
texttype: TextInputType.text,
hintText: "Enter your user name",
leadingIcon:
// const Icon(Icons.mail_outline),
Image.asset(
width: 22.w,
height: 17.h,
'assets/images/png/user.png',
),
// validatorText: "Enter your user name",
validator: (value) {
if (value!.isEmpty) {
return 'Enter your user name ';
}
return null;
},
inputFormatters: [
// LengthLimitingTextInputFormatter(20),
RemoveEmojiInputFormatter(),
FilteringTextInputFormatter.allow(
RegExp('[a-zA-Z ]'))
],
),
sizedBoxHeight(0.h),
text16400white('Date of birth'),
sizedBoxHeight(10.h),
CustomTextFormField(
textEditingController: datecontroller,
readonly: true,
onTap: () {
_selectDate(context);
},
// texttype: TextInputType.text,
hintText: "Enter your date of birth",
leadingIcon:
// const Icon(Icons.mail_outline),
Image.asset(
width: 22.w,
height: 17.h,
'assets/images/png/dateimage.png',
),
// validatorText: "Enter date of birth",
validator: (value) {
if (value!.isEmpty) {
return 'Enter your date of birth';
}
return null;
},
),
sizedBoxHeight(0.h),
text16400white('Gender'),
sizedBoxHeight(10.h),
CustomDropDownWidgetSignup(
header: 'Select gender',
title: '',
listData: _gender,
onItemSelected: _onItemSelected,
leadingImage:
Image.asset('assets/images/png/gendericon.png'),
),
sizedBoxHeight(20.h),
Row(
children: [
text16400white('Location'),
sizedBoxWidth(5.w),
Image.asset('assets/images/png/informationicon.png')
],
),
sizedBoxHeight(10.h),
CustomTextFormField(
textEditingController: userNameController,
texttype: TextInputType.text,
hintText: "Enter your location",
leadingIcon:
// const Icon(Icons.mail_outline),
Image.asset(
width: 22.w,
height: 17.h,
'assets/images/png/location.png',
),
// validatorText: "Enter your location",
validator: (value) {
if (value!.isEmpty) {
return 'Enter your location ';
}
return null;
},
inputFormatters: [
// LengthLimitingTextInputFormatter(20),
RemoveEmojiInputFormatter(),
FilteringTextInputFormatter.allow(
RegExp('[a-zA-Z ]'))
],
),
sizedBoxHeight(20.h),
CustomButton(
text: "Continue",
onPressed: () {
if (_selectedgendertype.isNotEmpty) {
Get.toNamed(RouteName.individualprofilestep1);
// // Get.to(() => BusinessPage());
// } else {
// // Handle case where no selection is made
// utils.showToast('Please select an gender type');
// }
}),
sizedBoxHeight(30.h),
// const Spacer(
// flex: 3,
// )
],
// Get.to(() => BusinessPage());
} else {
// Handle case where no selection is made
utils.showToast('Please select an gender type');
}
}),
sizedBoxHeight(30.h),
// const Spacer(
// flex: 3,
// )
],
),
),
),
])
],
)),
);
])),
],
));
}
}

View File

@@ -23,95 +23,130 @@ class _CommunitycommitmentState extends State<Communitycommitment> {
backgroundColor: Color.fromARGB(255, 18, 32, 47),
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, vertical: 50.h),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// SvgPicture.asset('assets/images/svg/redregroupicon.svg'),
Image.asset('assets/images/png/redregroup.png'),
sizedBoxHeight(30.h),
Container(
width: 358.w,
height: 519.h,
decoration: ShapeDecoration(
gradient: LinearGradient(
begin: Alignment(0.98, -0.21),
end: Alignment(-0.98, 0.21),
colors: [
Colors.white.withOpacity(0.05999999865889549),
Colors.white.withOpacity(0.07999999821186066)
],
),
shape: RoundedRectangleBorder(
side: BorderSide(width: 0.80, color: Color(0xFF434A53)),
borderRadius: BorderRadius.circular(5),
),
),
child: Padding(
padding:
EdgeInsets.symmetric(horizontal: 16.w, vertical: 0.h),
child: Scrollbar(
thumbVisibility: true,
radius: Radius.circular(20.r),
// thickness: 6,
controller: _scrollController,
child: SingleChildScrollView(
controller: _scrollController,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
sizedBoxHeight(10.h),
text16400white('Our community commitment'),
sizedBoxHeight(10.h),
Container(
width: 222.w,
decoration: ShapeDecoration(
shape: RoundedRectangleBorder(
side: BorderSide(
width: 1,
strokeAlign: BorderSide.strokeAlignCenter,
color: Color(0xFF858585),
// Positioned(top: 220, left: -30, child: CommonBlurLeftSecond()),
Positioned(top: 230, right: -30, child: CommonBlurRightSecond()),
// Positioned(top: 530, 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(
padding:
EdgeInsets.symmetric(horizontal: 16.w, vertical: 50.h),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// SvgPicture.asset('assets/images/svg/redregroupicon.svg'),
Image.asset('assets/images/png/redregroup.png'),
sizedBoxHeight(30.h),
Container(
width: 358.w,
height: 519.h,
decoration: ShapeDecoration(
gradient: LinearGradient(
begin: Alignment(0.98, -0.21),
end: Alignment(-0.98, 0.21),
colors: [
Colors.white.withOpacity(0.05999999865889549),
Colors.white.withOpacity(0.07999999821186066)
],
),
shape: RoundedRectangleBorder(
side: BorderSide(
width: 0.80, color: Color(0xFF434A53)),
borderRadius: BorderRadius.circular(5),
),
),
child: Padding(
padding: EdgeInsets.symmetric(
horizontal: 16.w, vertical: 0.h),
child: Scrollbar(
thumbVisibility: true,
radius: Radius.circular(20.r),
// thickness: 6,
controller: _scrollController,
child: SingleChildScrollView(
controller: _scrollController,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
sizedBoxHeight(10.h),
text16400white('Our community commitment'),
sizedBoxHeight(10.h),
Container(
width: 222.w,
decoration: ShapeDecoration(
shape: RoundedRectangleBorder(
side: BorderSide(
width: 1,
strokeAlign:
BorderSide.strokeAlignCenter,
color: Color(0xFF858585),
),
),
),
),
),
sizedBoxHeight(20.h),
text20400white(
'Regroup is a community where everyone ca belong'),
sizedBoxHeight(15.h),
text16400white(
'''Lorem ipsum dolor sit amet, consectetur adipis elit. Ut et massa mi. Aliquam in hendrerit urna.\n\nPellentesque sit amet sapien fringilla, mattis ligula consectetur, ultrices mauris. Maecenas vitae mattis tellus. Nullam quis imperdiet augue. Vestibulum auctor ornare leo, non suscipit magna interdum eu. Curabitur pellentesque nibh nibh, at maximus ante fermentum sit amet. Pellentesque commodo lacus at sodales sodales. Quisque sagittis orci ut diam condimentum, vel euismod erat placerat. In iaculis arcu eros, Quisque sagittis orci ut diam condimentum, vel euismod erat placerat. In iaculis arcu eros, Quisque sagittis orci ut diam condimentum, vel euismod erat placerat. '''),
sizedBoxHeight(10.h),
],
),
sizedBoxHeight(20.h),
text20400white(
'Regroup is a community where everyone ca belong'),
sizedBoxHeight(15.h),
text16400white(
'''Lorem ipsum dolor sit amet, consectetur adipis elit. Ut et massa mi. Aliquam in hendrerit urna.\n\nPellentesque sit amet sapien fringilla, mattis ligula consectetur, ultrices mauris. Maecenas vitae mattis tellus. Nullam quis imperdiet augue. Vestibulum auctor ornare leo, non suscipit magna interdum eu. Curabitur pellentesque nibh nibh, at maximus ante fermentum sit amet. Pellentesque commodo lacus at sodales sodales. Quisque sagittis orci ut diam condimentum, vel euismod erat placerat. In iaculis arcu eros, Quisque sagittis orci ut diam condimentum, vel euismod erat placerat. In iaculis arcu eros, Quisque sagittis orci ut diam condimentum, vel euismod erat placerat. '''),
sizedBoxHeight(10.h),
],
),
),
),
),
),
Spacer(
flex: 2,
),
CustomButton(
text: 'Agree & continue',
onPressed: () {
Get.toNamed(RouteName.signupendpage);
}),
sizedBoxHeight(20.h),
CustomButton2(
text: 'Decline',
onPressed: () {
Get.offAllNamed(RouteName.loginScreen);
})
],
),
Spacer(
flex: 2,
),
CustomButton(
text: 'Agree & continue',
onPressed: () {
Get.toNamed(RouteName.signupendpage);
}),
sizedBoxHeight(20.h),
CustomButton2(
text: 'Decline',
onPressed: () {
Get.offAllNamed(RouteName.loginScreen);
})
],
),
)
)),
],
));
}

View File

@@ -23,62 +23,97 @@ class _SignupendPageState extends State<SignupendPage> {
backgroundColor: Color.fromARGB(255, 18, 32, 47),
body: Stack(
children: [
Container(
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/images/png/Ellipse 1496.png"),
fit: BoxFit.fill)),
),
Center(
child: Container(
width: 358.w,
height: 519.h,
decoration: ShapeDecoration(
gradient: LinearGradient(
begin: Alignment(0.98, -0.21),
end: Alignment(-0.98, 0.21),
colors: [
Colors.white.withOpacity(0.05999999865889549),
Colors.white.withOpacity(0.07999999821186066)
],
),
shape: RoundedRectangleBorder(
side: 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: Color(0xCCFCFCFC),
fontSize: 16.sp,
fontFamily: 'Helvetica',
fontWeight: FontWeight.w400,
),
Positioned(top: 100, left: -30, child: CommonBlurLeftSecond()),
Positioned(top: 300, right: -30, child: CommonBlurRightSecond()),
Positioned(top: 530, left: -30, child: CommonBlurLeftBlue()),
Positioned(top: 750, right: 40, child: CommonBlurRightSecond()),
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: Center(
child: Container(
width: 358.w,
height: 519.h,
decoration: ShapeDecoration(
gradient: LinearGradient(
begin: Alignment(0.98, -0.21),
end: Alignment(-0.98, 0.21),
colors: [
Colors.white.withOpacity(0.05999999865889549),
Colors.white.withOpacity(0.07999999821186066)
],
),
sizedBoxHeight(20.h),
CustomButton(
text: "Let's begin",
onPressed: () {
Get.toNamed(RouteName.mainscreen);
})
],
),
)),
)
shape: RoundedRectangleBorder(
side:
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: Color(0xCCFCFCFC),
fontSize: 16.sp,
fontFamily: 'Helvetica',
fontWeight: FontWeight.w400,
),
),
sizedBoxHeight(20.h),
CustomButton(
text: "Let's begin",
onPressed: () {
Get.toNamed(RouteName.mainscreen);
})
],
),
)),
)),
],
));
}

View File

@@ -1,25 +1,15 @@
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/base_manager.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 SignupScreen extends StatefulWidget {
const SignupScreen({super.key});
@@ -32,15 +22,11 @@ class _SignupScreenState extends State<SignupScreen> {
TextEditingController emailidcontroller = TextEditingController();
TextEditingController passwordController = TextEditingController();
TextEditingController confirmpasscontroller = TextEditingController();
AccessToken? _accessToken;
final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
GoogleAuthService googleSigninController = Get.put(GoogleAuthService());
final Map<String, int> _accountTypeMap = {
'Individual': 1,
'Business': 2,
};
List<String> _dropdownProductItems = [
'Individual',
'Business',
];
String _selectedAccountType = '';
@@ -50,504 +36,363 @@ class _SignupScreenState extends State<SignupScreen> {
});
}
_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());
void _Signincheck() async {
if (emailidcontroller.text.isBlank! ||
passwordController.text.isBlank! ||
confirmpasscontroller.text.isBlank!) {
Get.snackbar(
'Error',
'Enter your credentials',
snackPosition: SnackPosition.BOTTOM,
backgroundColor: Colors.red,
colorText: Colors.white,
);
} else if (!emailidcontroller.text.isEmail) {
Get.snackbar(
'Error',
'Enter a valid e-mail address',
snackPosition: SnackPosition.BOTTOM,
backgroundColor: Colors.red,
colorText: Colors.white,
);
} else if (_selectedAccountType == 'Individual') {
print('individual selected');
Get.toNamed(RouteName.verifyusercreen, arguments: _selectedAccountType);
} else if (_selectedAccountType == 'Business') {
print('business selected');
Get.toNamed(RouteName.verifyusercreen, arguments: _selectedAccountType);
} 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<String, dynamic> updata = {
"email_address": emailidcontroller.text,
"password": passwordController.text,
"account_type": accountTypeValue,
};
final data = await Onboard().Postregisteration(updata);
if (data.status == ResponseStatus.SUCCESS) {
Get.back();
print("Sign up done");
String selectedCategory = _selectedAccountType;
Get.toNamed(RouteName.verifyusercreen, arguments: {
"emailid": emailidcontroller.text,
"password": passwordController.text,
"accounttype": selectedCategory,
'accountypenumber': accountTypeValue
});
await prefs.setString(
'accountTypeValue', accountTypeValue.toString() ?? "");
return utils.showToast(data.message);
} else {
Get.back();
print("registration not done");
return utils.showToast(data.message);
utils.showToast('Please select an account type');
}
}
@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/Choice screen.png"),
fit: BoxFit.fill)),
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(top: 150.h),
child: Center(child: text22400white('Create account')),
),
Expanded(
child: SingleChildScrollView(
child: Padding(
padding: EdgeInsets.symmetric(
horizontal: 16.w, vertical: 30.h),
child: Form(
key: _formKey,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
return 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/Choice screen.png"),
fit: BoxFit.fill)),
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(top: 150.h),
child: Center(child: text22400white('Create account')),
),
Expanded(
child: SingleChildScrollView(
child: Padding(
padding: EdgeInsets.symmetric(
horizontal: 16.w, vertical: 30.h),
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(20),
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(20),
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(20),
RemoveEmojiInputFormatter()
],
),
sizedBoxHeight(10.h),
Row(
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: [
'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,
text16400white('Account type'),
sizedBoxWidth(5.w),
Image.asset(
'assets/images/png/informationicon.png')
],
),
sizedBoxHeight(10.h),
CustomDropDownRadio(
header: 'Select account type',
title: '',
listData: [
'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: [
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'))),
),
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,
),
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'))),
),
),
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),
),
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'))),
),
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),
],
),
),
sizedBoxHeight(20.h),
CustomButton(
text: "Continue",
onPressed: () {
_Signincheck();
}),
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(
children: [
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'))),
),
const Spacer(),
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'))),
),
const Spacer(),
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),
],
),
),
)
],
),
],
)),
);
),
)
],
),
],
));
}
}

View File

@@ -2,17 +2,18 @@ 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/dialogs.dart';
import 'package:regroup/Utils/texts.dart';
import 'package:regroup/onboarding/Signup/view_model/postmethod.dart';
import 'package:regroup/onboarding/forgotPass/ViewModel/ForgotPassAPI.dart';
import 'package:regroup/resources/routes/route_name.dart';
import 'package:timer_button/timer_button.dart';
import 'package:shared_preferences/shared_preferences.dart';
class VerifyuserScreenState extends StatefulWidget {
const VerifyuserScreenState({super.key});
@@ -23,118 +24,62 @@ class VerifyuserScreenState extends StatefulWidget {
class _VerifyuserScreenStateState extends State<VerifyuserScreenState> {
// String accounttype = Get.arguments;
TextEditingController? pincode = TextEditingController();
final String emailAddress = Get.arguments;
TextEditingController pincode = TextEditingController();
String? principleId;
String email = Get.arguments['emailid'];
String userpassword = Get.arguments['password'];
String accounttype = Get.arguments['accounttype'];
int accounttypenumber = Get.arguments["accountypenumber"];
// principleId = prefs.getString('email').toString();
Uploadata() async {
utils.loader();
Map<String, dynamic> updata = {
"email_address": email,
"password": userpassword,
"account_type": accounttypenumber,
"otp": pincode.text
};
// final data = res
final res = await Onboard().Postverifyregisteration(updata);
if (res.status == ResponseStatus.SUCCESS) {
Get.back();
print("verification done");
if (accounttype == 'Individual') {
print('individual selected');
Get.toNamed(
RouteName.tellusindividualscreen,
// arguments: {
// 'pageroute' : "nextscreen"
// }
checkValidation() async {
SharedPreferences prefs = await SharedPreferences.getInstance();
principleId = prefs.getString('principal_xid');
if (pincode!.text.isEmpty) {
utils.showToast('Pin field is empty');
} else {
Map<String, String> updata = {
"iam_principal_xid": principleId.toString(),
"otp": pincode!.text,
};
final data = await ForgotPassAPI().verifyotp(updata);
if (data.status == ResponseStatus.SUCCESS) {
// btnController.success();
// btnController.reset();
Get.snackbar(
"Success!",
'OTP verification successful!',
duration: Duration(seconds: 2),
colorText: Colors.white,
backgroundColor: Colors.green,
margin: EdgeInsets.all(8),
snackStyle: SnackStyle.FLOATING,
snackPosition: SnackPosition.BOTTOM,
);
} else if (accounttype == 'Business') {
print('business selected');
Get.toNamed(
RouteName.tellusbusinessscreen,
// arguments: {
// 'pageroute' : "nextscreen"
// }
Future.delayed(Duration(seconds: 1), () {
Get.toNamed(RouteName.newpassword, arguments: emailAddress);
});
// print('success');
} else {
// btnController.error();
// btnController.reset();
Get.snackbar(
"Error!",
data.data['message'],
duration: Duration(seconds: 2),
colorText: Colors.white,
backgroundColor: Colors.red,
margin: EdgeInsets.all(8),
snackStyle: SnackStyle.FLOATING,
snackPosition: SnackPosition.BOTTOM,
);
}
return utils.showToast(res.message);
} else {
Get.back();
// btnController.error();
// btnController.reset();
Get.snackbar(
"Error!",
res.data['message'],
duration: Duration(seconds: 2),
colorText: Colors.white,
backgroundColor: Colors.red,
margin: EdgeInsets.all(8),
snackStyle: SnackStyle.FLOATING,
snackPosition: SnackPosition.BOTTOM,
);
}
// else {
// Get.back();
// print("verification not done");
// return utils.showToast(data.message);
// }
}
Uploadataresendotp() async {
utils.loader();
Map<String, dynamic> updata = {
"email_address": email,
"password": userpassword,
"account_type": accounttypenumber,
};
final data = await Onboard().Postregisteration(updata);
if (data.status == ResponseStatus.SUCCESS) {
Get.back();
// print("resend up done");
// return utils.showToast(data.message);
Get.snackbar(
"Success!",
'OTP has been sent to your email address!',
duration: Duration(seconds: 2),
colorText: Colors.white,
backgroundColor: Colors.green,
margin: EdgeInsets.all(8),
snackStyle: SnackStyle.FLOATING,
snackPosition: SnackPosition.BOTTOM,
);
setState(() {
pincode.clear();
// turnValidation = false;
});
}
// else {
// Get.back();
// print("resend not done");
// return utils.showToast(data.message);
// }
else {
Get.back();
// btnController.error();
// btnController.reset();
Get.snackbar(
"Error!",
data.data['message'],
duration: Duration(seconds: 2),
colorText: Colors.white,
backgroundColor: Colors.red,
margin: EdgeInsets.all(8),
snackStyle: SnackStyle.FLOATING,
snackPosition: SnackPosition.BOTTOM,
);
}
@override
void initState() {
print(emailAddress);
super.initState();
}
@override
@@ -146,13 +91,45 @@ class _VerifyuserScreenStateState extends State<VerifyuserScreenState> {
),
body: Stack(
children: [
Container(
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/images/png/Ellipse 1496.png"),
fit: BoxFit.fill)),
),
Padding(
// 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(
padding: EdgeInsets.symmetric(horizontal: 16.w),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
@@ -162,7 +139,7 @@ class _VerifyuserScreenStateState extends State<VerifyuserScreenState> {
text22400white('Check your email'),
sizedBoxHeight(10.h),
text14400white(
'Enter the verification code that we sent to $email'),
'Enter the verification code that we sent to $emailAddress'),
sizedBoxHeight(40.h),
text16400white('Enter code'),
sizedBoxHeight(20.h),
@@ -223,54 +200,31 @@ class _VerifyuserScreenStateState extends State<VerifyuserScreenState> {
},
appContext: context,
),
sizedBoxHeight(10.h),
Center(
child: TimerButton(
disabledTextStyle: TextStyle(color: Colors.red),
activeTextStyle: TextStyle(color: Colors.white),
disabledColor: Color(0XFF222935).withOpacity(0.10),
buttonType: ButtonType.textButton,
label: "Resend OTP",
timeOutInSeconds: 120,
//mobile.text.isEmpty ? 1 : 60,
onPressed: () {
setState(() {
Uploadataresendotp();
});
},
// disabledColor: Colors.white,
color: Color(0XFF222935).withOpacity(0.10),
),
),
const Spacer(
flex: 3,
),
CustomButton(
text: 'Continue',
onPressed: () {
if (pincode.text.isEmpty) {
utils.showToast('Pin field is empty');
} else if (pincode.text.length < 4) {
utils.showToast(
'Pin field must be at least 4 characters long');
} else {
Uploadata();
// if (accounttype == 'Individual') {
// print('individual selected');
// Get.toNamed(RouteName.tellusindividualscreen);
// } else if (accounttype == 'Business') {
// print('business selected');
// Get.toNamed(RouteName.tellusbusinessscreen);
// }
}
// if (pincode!.text.isEmpty) {
// utils.showToast('Pin field is empty');
// } else {
// if (accounttype == 'Individual') {
// print('individual selected');
// Get.toNamed(RouteName.tellusindividualscreen);
// } else if (accounttype == 'Business') {
// print('business selected');
// Get.toNamed(RouteName.tellusbusinessscreen);
// }
// }
checkValidation();
}),
const Spacer(
// flex: 2,
),
],
),
)
)),
],
),
);

View File

@@ -1,72 +0,0 @@
import 'dart:convert';
import 'package:get/get.dart';
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/Global.dart';
import 'package:regroup/Utils/dialogs.dart';
import 'package:regroup/onboarding/Signup/Model/GetUserdetailsModel.dart';
import 'package:regroup/resources/routes/route_name.dart';
import 'package:shared_preferences/shared_preferences.dart';
GetuserdetailsModel? getuserobj;
class Getuserdetails {
Getuserdetails();
Future<ResponseData<dynamic>> Getuser() async {
SharedPreferences prefs = await SharedPreferences.getInstance();
final response = await NetworkApiServices().getApi(ApiUrls.getuserdetails);
if (response.status == ResponseStatus.SUCCESS) {
dynamic responseData = response.data;
if (responseData is Map<String, dynamic>) {
// Assuming response data is a map
getuserobj = GetuserdetailsModel.fromJson(responseData);
await prefs.setString('fullname', getuserobj?.data?.userData?.fullName ?? "");
await prefs.setString('username', getuserobj?.data?.userData?.userName ?? "");
await prefs.setString('email', getuserobj?.data?.userData?.emailAddress ?? "");
await prefs.setString('phone', getuserobj?.data?.userData?.phoneNumber ?? "");
emailid = prefs.getString('email');
myusername = prefs.getString('username');
fullname = prefs.getString('fullname');
phonenumber = prefs.getString('phone');
} else if (responseData is String) {
// Parse the JSON string into a map
Map<String, dynamic> jsonMap;
try {
jsonMap = json.decode(responseData);
} catch (e) {
return ResponseData<dynamic>(
"Error decoding JSON string: $responseData",
ResponseStatus.FAILED);
}
await prefs.setString('fullname', getuserobj?.data?.userData?.fullName ?? "");
await prefs.setString('username', getuserobj?.data?.userData?.userName ?? "");
await prefs.setString('email', getuserobj?.data?.userData?.emailAddress ?? "");
await prefs.setString('phone', getuserobj?.data?.userData?.phoneNumber ?? "");
emailid = prefs.getString('email');
myusername = prefs.getString('username');
fullname = prefs.getString('fullname');
phonenumber = prefs.getString('phone');
} else {
// Handle other types if necessary
return ResponseData<dynamic>(
"Unexpected response format", ResponseStatus.FAILED);
}
}
return response;
}
}

View File

@@ -1,65 +0,0 @@
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/onboarding/Signup/Model/Onboarding/Individual/CommunitiesModel.dart';
import 'package:regroup/onboarding/Signup/Model/Onboarding/Individual/GroupModel.dart';
import 'package:regroup/onboarding/Signup/Model/Onboarding/IndividualModel.dart';
GetIndividualactivityModel? indiactivityobj;
GrouplistModel? grouplistobj;
GetcommunitiesModel? communitylistobj;
class Getonboard {
Future<ResponseData<dynamic>> getIndividualactivity() async {
final response = await NetworkApiServices()
.getApi(
ApiUrls.getIndividualactivity,
// optionalpar: false
);
if (response.status == ResponseStatus.SUCCESS) {
indiactivityobj = GetIndividualactivityModel.fromJson(response.data);
log(indiactivityobj!.data.toString());
}
return response;
}
Future<ResponseData<dynamic>> getGroupsearch(updata,
{required StreamController<GrouplistModel> streamController}) async {
final response =
await NetworkApiServices().getApi(
"${ApiUrls.getgroups}?search_data=$updata",
);
if (response.status == ResponseStatus.SUCCESS) {
grouplistobj = GrouplistModel.fromJson(response.data);
if (!streamController.isClosed) streamController.sink.add(grouplistobj!);
}
return response;
}
Future<ResponseData<dynamic>> getCommunitysearch(updata,
{required StreamController<GetcommunitiesModel> streamController}) async {
final response =
await NetworkApiServices().getApi(
"${ApiUrls.getcommunities}?search_data=$updata",
);
if (response.status == ResponseStatus.SUCCESS) {
communitylistobj = GetcommunitiesModel.fromJson(response.data);
if (!streamController.isClosed) streamController.sink.add(communitylistobj!);
}
return response;
}
}

View File

@@ -1,127 +0,0 @@
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/Global.dart';
import 'package:regroup/Utils/dialogs.dart';
import 'package:regroup/onboarding/Signup/Model/Onboarding/Individual/tellusIndividual.dart';
import 'package:shared_preferences/shared_preferences.dart';
class Onboard {
Onboard();
Future<ResponseData<dynamic>> Postregisteration(updata) async {
print("updata is $updata");
final response = await NetworkApiServices()
.postApi(updata, ApiUrls.registeration, optionalpar: true);
print("response is ${response.data}");
print("response message is ${response.message}");
if (response.status == ResponseStatus.SUCCESS) {
//Map<String, dynamic> responseData = jsonDecode(response.data);
return ResponseData<dynamic>(
response.data['message'], ResponseStatus.SUCCESS);
}
return response;
}
Future<ResponseData<dynamic>> Postverifyregisteration(updata) async {
print("updata is $updata");
final response = await NetworkApiServices()
.postApi(updata, ApiUrls.verifyregisteration, optionalpar: true);
print("response is ${response.data}");
print("response message is ${response.message}");
// final SharedPreferences prefs = await SharedPreferences.getInstance();
// Map<String, dynamic> res = response.data;
// print("res is $res");
// await prefs.setString('access-token', res['data']['token']);
// await prefs.setInt('isprofileupdate', res['data']['is_profile_updated']);
// token = res['data']['token'];
print("token is $token");
print("email is $emailid");
print("profile update value is $isprofileupdated");
if (response.status == ResponseStatus.SUCCESS) {
//Map<String, dynamic> responseData = jsonDecode(response.data);
final SharedPreferences prefs = await SharedPreferences.getInstance();
Map<String, dynamic> res = response.data;
print("res is $res");
await prefs.setString('access-token', res['data']['token']);
token = res['data']['token'];
// if (response.data['status'] == "error") {
// // return ResponseData<dynamic>(
// // response.data['message'], ResponseStatus.SUCCESS);
// return utils.showToast(response.data['message']);
// }
return ResponseData<dynamic>(
response.data['message'], ResponseStatus.SUCCESS);
}
return response;
}
Future<ResponseData> PosttellusIndividual(updata) async {
print("updata is $updata");
SharedPreferences prefs = await SharedPreferences.getInstance();
final response =
await NetworkApiServices().postApi(updata, ApiUrls.tellusIndividual);
print("response is ${response.data}");
print("response message is ${response.message}");
if (response.status == ResponseStatus.SUCCESS) {
if (response.data['status'] == 'success') {
TellusIndividualModel tellusindiObj =
TellusIndividualModel.fromJson(response.data);
// await prefs.setString('fullname', tellusindiObj.data?.profile?.fullName ?? "");
// await prefs.setString('username', tellusindiObj.data?.profile?.userName ?? "");
// await prefs.setString('email', tellusindiObj.data?.profile?.emailAddress ?? "");
// await prefs.setString('phone', tellusindiObj.data?.profile?.phoneNumber ?? "");
// emailid = tellusindiObj.data?.profile?.emailAddress;
// myusername = tellusindiObj.data?.profile?.userName;
// fullname = tellusindiObj.data?.profile?.fullName;
// phonenumber = tellusindiObj.data?.profile?.phoneNumber;
} else {
return ResponseData<dynamic>(
response.data['message'], ResponseStatus.FAILED);
}
}
return response;
}
Future<ResponseData<dynamic>> PostIndividualActivity(updata) async {
print("updata is $updata");
final response = await NetworkApiServices().postApi(
updata,
ApiUrls.postindividualactivity,
);
print("response is ${response.data}");
print("response message is ${response.message}");
return response;
}
Future<ResponseData<dynamic>> postGroups(updata) async {
print("updata is $updata");
final response = await NetworkApiServices().postApi(
updata,
ApiUrls.postgroups,
);
print("response is ${response.data}");
print("response message is ${response.message}");
return response;
}
Future<ResponseData<dynamic>> postCommunities(updata) async {
print("updata is $updata");
final response = await NetworkApiServices().postApi(
updata,
ApiUrls.postcommunities,
);
print("response is ${response.data}");
print("response message is ${response.message}");
return response;
}
}

View File

@@ -7,11 +7,8 @@ import 'package:flutter/services.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_svg/svg.dart';
import 'package:get/get.dart';
import 'package:regroup/Global.dart';
import 'package:regroup/Utils/Common/NoInternet.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';
// import 'package:shared_preferences/shared_preferences.dart';
class SplashScreen extends StatefulWidget {
@@ -22,36 +19,72 @@ class SplashScreen extends StatefulWidget {
}
class _SplashScreenState extends State<SplashScreen> {
// var _connectionStatus;
final Connectivity _connectivity = Connectivity();
List<ConnectivityResult> _connectionStatus = [ConnectivityResult.none];
Future<void> checkInternet() async {
final connectivityResult = await (Connectivity().checkConnectivity());
if (connectivityResult == ConnectivityResult.wifi ||
connectivityResult == ConnectivityResult.mobile) {
setState(() {
_connectionStatus = connectivityResult;
});
} else {
setState(() {
_connectionStatus = connectivityResult;
});
}
}
Future<void> initConnectivity() async {
late List<ConnectivityResult> result;
try {
result = await _connectivity.checkConnectivity();
} on PlatformException catch (e) {
log('Couldn\'t check connectivity status', error: e);
return;
}
if (!mounted) {
return Future.value(null);
}
return _updateConnectionStatus(result);
}
Future<void> _updateConnectionStatus(List<ConnectivityResult> result) async {
setState(() {
_connectionStatus = result;
});
// ignore: avoid_print
print('Connectivity changed: $_connectionStatus');
}
@override
void initState() {
// TODO: implement initState
super.initState();
initConnectivity();
Future.delayed(const Duration(seconds: 2), () async {
SharedPreferences prefs = await SharedPreferences.getInstance();
token = prefs.getString('access-token');
emailid = prefs.getString('email');
myusername = prefs.getString('username');
fullname = prefs.getString('fullname');
phonenumber = prefs.getString('phone');
if (token == null || token!.isEmpty) {
Get.toNamed(RouteName.onboarding1);
log(_connectionStatus.toString());
Future.delayed(Duration(seconds: 2), () async {
if (_connectionStatus.contains(ConnectivityResult.none)) {
var result = await Get.to(NoInternet());
if (result != null && result) {
Timer(const Duration(seconds: 1), () async {
Get.toNamed(RouteName.onboarding1);
});
}
} else {
await Getuserdetails().Getuser().then((value) {
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"});
}
} else {
Get.toNamed(RouteName.mainscreen);
}
Timer(const Duration(seconds: 2), () async {
Get.toNamed(RouteName.onboarding1);
});
}
});
@@ -69,22 +102,22 @@ class _SplashScreenState extends State<SplashScreen> {
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: [
const Color(0xff009DAB).withOpacity(0.25),
const Color(0xff35798C).withOpacity(0.44),
const Color(0xffD90B2E).withOpacity(0.33),
const Color(0xffD90B2E).withOpacity(0.52),
const Color(0xffD90B2E).withOpacity(0.59),
Color(0xff009DAB).withOpacity(0.25),
Color(0xff35798C).withOpacity(0.44),
Color(0xffD90B2E).withOpacity(0.33),
Color(0xffD90B2E).withOpacity(0.52),
Color(0xffD90B2E).withOpacity(0.59),
],
)),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
SvgPicture.asset(
"assets/images/svg/mainsplash.svg",
width: 211.w,
height: 211.h,
SvgPicture.asset("assets/images/svg/mainsplash.svg",
width: 211.w,
height: 211.h,
)
],
),
),

Some files were not shown because too many files have changed in this diff Show More