Merge pull request 'Development' (#17) from Development into main
Reviewed-on: #17
This commit is contained in:
4
.vscode/settings.json
vendored
4
.vscode/settings.json
vendored
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"CodeGPT.apiKey": "CodeGPT Plus Beta",
|
||||
"dart.flutterSdkPath": "D:\\pooja\\fluttersdk\\flutter_3.16.9\\flutter"
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<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>
|
||||
<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>
|
||||
</resources>
|
||||
@@ -151,6 +151,8 @@
|
||||
dependencies = (
|
||||
);
|
||||
name = Runner;
|
||||
packageProductDependencies = (
|
||||
);
|
||||
productName = Runner;
|
||||
productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
@@ -179,6 +181,8 @@
|
||||
Base,
|
||||
);
|
||||
mainGroup = 97C146E51CF9000F007C117D;
|
||||
packageReferences = (
|
||||
);
|
||||
productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"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
|
||||
}
|
||||
@@ -51,5 +51,29 @@
|
||||
<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>
|
||||
|
||||
@@ -27,9 +27,17 @@ class ApiUrls {
|
||||
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";
|
||||
|
||||
//profile
|
||||
|
||||
static const postnotification = "${baseUrl}update-notification-settings";
|
||||
static const getnotification = "${baseUrl}fetch-notification-settings";
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -1,76 +0,0 @@
|
||||
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;
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
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';
|
||||
@@ -9,6 +10,7 @@ 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});
|
||||
@@ -146,18 +148,26 @@ class _SettingsState extends State<Settings> {
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
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),
|
||||
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),
|
||||
),
|
||||
Container(
|
||||
height: 40.h,
|
||||
width: 140.w,
|
||||
width: 130.w,
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0xFFD90B2E),
|
||||
borderRadius: BorderRadius.circular(30.r),
|
||||
|
||||
@@ -0,0 +1,172 @@
|
||||
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();
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
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['success'] == true) {
|
||||
return ResponseData<dynamic>(
|
||||
response.data['message'], ResponseStatus.SUCCESS,
|
||||
data: response.data);
|
||||
} else {
|
||||
return ResponseData<dynamic>(
|
||||
response.data['message'], ResponseStatus.FAILED);
|
||||
}
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
}
|
||||
@@ -50,46 +50,48 @@ class _AnnouncementsState extends State<Announcements> {
|
||||
titleTxt: "Announcements",
|
||||
),
|
||||
body: Stack(children: [
|
||||
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)
|
||||
],
|
||||
);
|
||||
}),
|
||||
)
|
||||
]))))
|
||||
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)
|
||||
],
|
||||
);
|
||||
}),
|
||||
)
|
||||
])),
|
||||
),
|
||||
]),
|
||||
floatingActionButton: Container(
|
||||
height: 55.h,
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
@@ -13,6 +15,7 @@ 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';
|
||||
@@ -27,9 +30,7 @@ class LoginScreen extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _LoginScreenState extends State<LoginScreen> {
|
||||
String _accessToken = "";
|
||||
Map _userData = {};
|
||||
bool _checking = true;
|
||||
AccessToken? _accessToken;
|
||||
final TextEditingController _emailController = TextEditingController();
|
||||
RxBool isObscured = true.obs;
|
||||
final TextEditingController _passwordController = TextEditingController();
|
||||
@@ -46,13 +47,20 @@ class _LoginScreenState extends State<LoginScreen> {
|
||||
|
||||
_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') {
|
||||
final resp = await LoginAPI().storeGoogleSignin(
|
||||
{"google_access_token": value, "one_signal_player_id": "ABCD"});
|
||||
if (resp.message == "go-to-signin-via-oauth") {
|
||||
// Get.to(()=> );
|
||||
Get.toNamed(RouteName.verifygoogleapplepage);
|
||||
logger.d("go to sign in");
|
||||
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!",
|
||||
@@ -64,14 +72,13 @@ class _LoginScreenState extends State<LoginScreen> {
|
||||
snackStyle: SnackStyle.FLOATING,
|
||||
snackPosition: SnackPosition.BOTTOM,
|
||||
);
|
||||
|
||||
Get.toNamed(RouteName.mainscreen);
|
||||
//Get.toNamed(RouteName.mainscreen);
|
||||
logger.d("go to login");
|
||||
}
|
||||
} else {
|
||||
Get.snackbar(
|
||||
'Error',
|
||||
'Google Sign-In canceled',
|
||||
resp.data["message"][0],
|
||||
snackPosition: SnackPosition.BOTTOM,
|
||||
backgroundColor: Colors.red,
|
||||
colorText: Colors.white,
|
||||
@@ -80,54 +87,46 @@ class _LoginScreenState extends State<LoginScreen> {
|
||||
});
|
||||
}
|
||||
|
||||
// _checkIfisLoggedIn() async {
|
||||
// //user token
|
||||
// final accessToken = await FacebookAuth.instance.accessToken;
|
||||
_checkIfisLoggedIn() async {
|
||||
await _logout();
|
||||
final accessToken = await FacebookAuth.instance.accessToken;
|
||||
if (accessToken != null) {
|
||||
print("/////////////////////////////////////////xcheck");
|
||||
|
||||
// setState(() {
|
||||
// _checking = false;
|
||||
// });
|
||||
final userData = await FacebookAuth.instance.getUserData();
|
||||
|
||||
// if (accessToken != null) {
|
||||
// print("/////////////////////////////////////////xcheck");
|
||||
// print("worked");
|
||||
// print(accessToken.toJson());
|
||||
// final userData = await FacebookAuth.instance.getUserData();
|
||||
// // _accessToken = accessToken;
|
||||
// setState(() {
|
||||
// _userData = userData;
|
||||
// });
|
||||
// } else {
|
||||
// print("/////////////////////////////////////////check");
|
||||
logger.i(accessToken.token);
|
||||
logger.i(userData.toString());
|
||||
} else {
|
||||
print("/////////////////////////////////////////check");
|
||||
_login();
|
||||
}
|
||||
}
|
||||
|
||||
// print("not worked");
|
||||
// _login();
|
||||
// }
|
||||
// }
|
||||
_login() async {
|
||||
final LoginResult result = await FacebookAuth.instance.login();
|
||||
|
||||
// _login() async {
|
||||
// final LoginResult result = await FacebookAuth.instance.login();
|
||||
if (result.status == LoginStatus.success) {
|
||||
_accessToken = result.accessToken;
|
||||
|
||||
// if (result.status == LoginStatus.success) {
|
||||
// _accessToken = result.accessToken;
|
||||
final userData = await FacebookAuth.instance.getUserData();
|
||||
logger.i(userData['email']);
|
||||
logger.i(userData['id']);
|
||||
|
||||
// final userData = await FacebookAuth.instance.getUserData();
|
||||
// _userData = userData;
|
||||
// } else {
|
||||
// print(result.status);
|
||||
// print(result.message);
|
||||
// }
|
||||
// setState(() {
|
||||
// _checking = false;
|
||||
// });
|
||||
// }
|
||||
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;
|
||||
// _userData = null;
|
||||
// setState(() {});
|
||||
// }
|
||||
_logout() async {
|
||||
await FacebookAuth.instance.logOut();
|
||||
_accessToken = null;
|
||||
setState(() {});
|
||||
}
|
||||
|
||||
_logincheck() async {
|
||||
if (_emailController.text.isBlank! || _passwordController.text.isBlank!) {
|
||||
@@ -397,79 +396,71 @@ class _LoginScreenState extends State<LoginScreen> {
|
||||
child: SizedBox(
|
||||
width: 220.w,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
_loginWithApple();
|
||||
Get.toNamed(
|
||||
RouteName.verifygoogleapplepage);
|
||||
},
|
||||
child: Container(
|
||||
width: 55,
|
||||
height: 55,
|
||||
decoration: ShapeDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: const Alignment(0.71, -0.70),
|
||||
end: const Alignment(-0.71, 0.7),
|
||||
colors: [
|
||||
Colors.white.withOpacity(
|
||||
0.07999999821186066),
|
||||
Colors.white.withOpacity(
|
||||
0.12999999523162842)
|
||||
],
|
||||
),
|
||||
shape: const OvalBorder(
|
||||
side: BorderSide(
|
||||
width: 0.50,
|
||||
color: Color(0xFF434A53)),
|
||||
),
|
||||
image: const DecorationImage(
|
||||
image: AssetImage(
|
||||
'assets/images/png/login2.png'))),
|
||||
if (Platform.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(),
|
||||
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(),
|
||||
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(),
|
||||
// const Spacer(),
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
/* FacebookAuth.instance.login(
|
||||
permissions: ['public_profile', 'email'],
|
||||
).then((value) {
|
||||
FacebookAuth.instance.getUserData().then((userData) {
|
||||
setState(() {
|
||||
/* _isLoggedIn = true;
|
||||
_userObj = userData; */
|
||||
});
|
||||
});
|
||||
}); */
|
||||
_checkIfisLoggedIn();
|
||||
},
|
||||
child: Container(
|
||||
width: 55,
|
||||
@@ -499,7 +490,7 @@ class _LoginScreenState extends State<LoginScreen> {
|
||||
),
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(100)
|
||||
// sizedBoxHeight(100)
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -1,8 +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: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';
|
||||
@@ -10,10 +14,13 @@ 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 {
|
||||
const Verifygoogleandapple({super.key});
|
||||
Verifygoogleandapple({
|
||||
super.key,
|
||||
});
|
||||
|
||||
@override
|
||||
State<Verifygoogleandapple> createState() => _VerifygoogleandappleState();
|
||||
@@ -22,20 +29,53 @@ class Verifygoogleandapple extends StatefulWidget {
|
||||
class _VerifygoogleandappleState extends State<Verifygoogleandapple> {
|
||||
TextEditingController emailidcontroller = TextEditingController();
|
||||
|
||||
final Map<String, int> _accountTypeMap = {
|
||||
'Individual': 1,
|
||||
'Business': 2,
|
||||
};
|
||||
|
||||
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) {
|
||||
@@ -169,13 +209,11 @@ class _VerifygoogleandappleState extends State<Verifygoogleandapple> {
|
||||
CustomButton(
|
||||
text: "Continue",
|
||||
onPressed: () {
|
||||
if (
|
||||
// isValid!
|
||||
emailidcontroller.text.isEmpty &&
|
||||
_selectedAccountType.isEmpty) {
|
||||
if (emailidcontroller.text.isEmpty &&
|
||||
_selectedAccountType.isEmpty) {
|
||||
utils.showToast('Please fill all fields');
|
||||
} else {
|
||||
// Uploadata();
|
||||
_createAccountWithOAuth();
|
||||
}
|
||||
}),
|
||||
const Spacer()
|
||||
|
||||
@@ -4,6 +4,7 @@ import 'package:regroup/Common/base_manager.dart';
|
||||
import 'package:regroup/Common/controller/data/network/network_api.dart';
|
||||
import 'package:regroup/Global.dart';
|
||||
import 'package:regroup/Login/Model/LoginModel.dart';
|
||||
import 'package:regroup/onboarding/Signup/view_model/getUserprofile.dart';
|
||||
import 'package:regroup/resources/routes/route_name.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
@@ -40,18 +41,20 @@ class LoginAPI {
|
||||
|
||||
if (accountype == "1") {
|
||||
print('tell us individyal');
|
||||
Get.toNamed(RouteName.tellusindividualscreen,
|
||||
// arguments: {
|
||||
// 'pageroute' : "mainscreen"
|
||||
// }
|
||||
Get.toNamed(
|
||||
RouteName.tellusindividualscreen,
|
||||
// arguments: {
|
||||
// 'pageroute' : "mainscreen"
|
||||
// }
|
||||
);
|
||||
} else if (accountype == "2") {
|
||||
print('tell us business');
|
||||
|
||||
Get.toNamed(RouteName.tellusbusinessscreen,
|
||||
// arguments: {
|
||||
// 'pageroute' : "mainscreen"
|
||||
// }
|
||||
Get.toNamed(
|
||||
RouteName.tellusbusinessscreen,
|
||||
// arguments: {
|
||||
// 'pageroute' : "mainscreen"
|
||||
// }
|
||||
);
|
||||
}
|
||||
} else {
|
||||
@@ -73,9 +76,52 @@ class LoginAPI {
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -85,10 +131,12 @@ class LoginAPI {
|
||||
|
||||
Future<ResponseData> storeUserDetailsWhenComingFromGoogleAppleSignin(
|
||||
var data) async {
|
||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
final response = await NetworkApiServices()
|
||||
.postApi(data, ApiUrls.storeDetailsOfOAuth, optionalpar: true);
|
||||
if (response.status == ResponseStatus.SUCCESS) {}
|
||||
.postApi(data, ApiUrls.storeDetailsOfOAuth, optionalpar: false);
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
return ResponseData<dynamic>(
|
||||
response.data['message'], ResponseStatus.SUCCESS);
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
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';
|
||||
|
||||
@@ -14,7 +15,9 @@ class AppleOAuthService {
|
||||
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");
|
||||
}
|
||||
|
||||
@@ -492,6 +492,8 @@ class _CustomDropDownTagState extends State<CustomDropDownTag> {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
///
|
||||
class CustomDropDownRadio extends StatefulWidget {
|
||||
const CustomDropDownRadio({
|
||||
Key? key,
|
||||
@@ -664,7 +666,9 @@ class _CustomDropDownRadioState extends State<CustomDropDownRadio> {
|
||||
width: double.infinity,
|
||||
height: 50.h,
|
||||
padding: EdgeInsets.only(
|
||||
top: 14.0, bottom: 14.0, right: 22.w, left: 12.w),
|
||||
right: 22.w,
|
||||
left: 12.w,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFFFFFFFF).withOpacity(0.10),
|
||||
borderRadius: onDropTap.value
|
||||
|
||||
@@ -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: [
|
||||
|
||||
@@ -32,16 +32,6 @@ class GoogleAuthService extends GetxController {
|
||||
}
|
||||
|
||||
Future<String?> handleGoogleSignIn() async {
|
||||
// await FirebaseAuth.instance.signOut();
|
||||
|
||||
// Map<String, dynamic> updata = {
|
||||
// "username": "kishan1",
|
||||
// "email": "kishan1@gmail.com",
|
||||
// "phone": "123456564",
|
||||
// "ID": "efsfsfsefsef"
|
||||
// };
|
||||
// GoogleSigninApi().googleSigninApi(updata);
|
||||
|
||||
try {
|
||||
// Sign out the user if they are already signed in
|
||||
await _googleSignIn.signOut();
|
||||
@@ -88,7 +78,7 @@ class GoogleAuthService extends GetxController {
|
||||
} catch (error) {
|
||||
// Handle any errors that occurred during the sign-in process.
|
||||
print('Error during Google Sign-In: $error');
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,15 +15,13 @@ class utils {
|
||||
elevation: 0,
|
||||
backgroundColor: Colors.transparent,
|
||||
child: WillPopScope(
|
||||
child: Container(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
CircularProgressIndicator(
|
||||
color: Color(0xffc18948),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: const Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
CircularProgressIndicator(
|
||||
color: Color(0xffc18948),
|
||||
),
|
||||
],
|
||||
),
|
||||
onWillPop: () async => false),
|
||||
),
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'dart:async';
|
||||
import 'dart:io';
|
||||
import 'package:connectivity_plus/connectivity_plus.dart';
|
||||
import 'package:device_info_plus/device_info_plus.dart';
|
||||
import 'package:firebase_core/firebase_core.dart';
|
||||
@@ -45,10 +46,10 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
|
||||
// final Connectivity _connectivity = Connectivity();
|
||||
// late StreamSubscription<ConnectivityResult> _connectivitySubscription;
|
||||
|
||||
List<ConnectivityResult> _connectionStatus = [ConnectivityResult.none];
|
||||
List<ConnectivityResult> _connectionStatus = [ConnectivityResult.none];
|
||||
final Connectivity _connectivity = Connectivity();
|
||||
late StreamSubscription<List<ConnectivityResult>> _connectivitySubscription;
|
||||
|
||||
|
||||
// Future<void> checkInternet() async {
|
||||
// final connectivityResult = await (Connectivity().checkConnectivity());
|
||||
|
||||
@@ -97,25 +98,25 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
|
||||
// setState(() {
|
||||
// _connectionStatus = result;
|
||||
// });
|
||||
|
||||
if (result.contains(ConnectivityResult.wifi) || result.contains(ConnectivityResult.mobile)) {
|
||||
setState(() {
|
||||
_connectionStatus = result;
|
||||
Get.back(result: true);
|
||||
|
||||
});
|
||||
if (result.contains(ConnectivityResult.wifi) ||
|
||||
result.contains(ConnectivityResult.mobile)) {
|
||||
setState(() {
|
||||
_connectionStatus = result;
|
||||
Get.back(result: true);
|
||||
});
|
||||
} else {
|
||||
setState(() {
|
||||
_connectionStatus = result;
|
||||
Get.toNamed(RouteName.nointernet);
|
||||
});
|
||||
setState(() {
|
||||
_connectionStatus = result;
|
||||
Get.toNamed(RouteName.nointernet);
|
||||
});
|
||||
// Get.toNamed(RouteName.nointernet);
|
||||
}
|
||||
// ignore: avoid_print
|
||||
print('Connectivity changed: $_connectionStatus');
|
||||
}
|
||||
|
||||
Future<void> _getStoragePermission() async {
|
||||
Future<void> _getStoragePermission() async {
|
||||
DeviceInfoPlugin plugin = DeviceInfoPlugin();
|
||||
AndroidDeviceInfo android = await plugin.androidInfo;
|
||||
if (android.version.sdkInt < 33) {
|
||||
@@ -155,13 +156,13 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
|
||||
void initState() {
|
||||
initConnectivity();
|
||||
WidgetsBinding.instance.addObserver(this);
|
||||
_connectivitySubscription =
|
||||
_connectivitySubscription =
|
||||
_connectivity.onConnectivityChanged.listen(_updateConnectionStatus);
|
||||
|
||||
//do not remove this coomented code
|
||||
// if (Platform.isAndroid) {
|
||||
// _getStoragePermission();
|
||||
// }
|
||||
if (Platform.isAndroid) {
|
||||
_getStoragePermission();
|
||||
}
|
||||
super.initState();
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,6 @@ class _TellusaboutBusinessState extends State<TellusaboutBusiness> {
|
||||
];
|
||||
|
||||
String _selectedbusinesstype = '';
|
||||
// String business_type = '';
|
||||
|
||||
void _onItemSelected(String value) {
|
||||
setState(() {
|
||||
@@ -46,8 +45,6 @@ class _TellusaboutBusinessState extends State<TellusaboutBusiness> {
|
||||
});
|
||||
}
|
||||
|
||||
// String pagename = Get.arguments["pageroute"];
|
||||
|
||||
String getBusinessTypeId(String selectedBusinessType) {
|
||||
if (selectedBusinessType.contains("Retail")) {
|
||||
return '1';
|
||||
@@ -91,244 +88,172 @@ class _TellusaboutBusinessState extends State<TellusaboutBusiness> {
|
||||
};
|
||||
final data = await BusinessAPI().tellUsBusinessApi(updata);
|
||||
if (data.status == ResponseStatus.SUCCESS) {
|
||||
// await global.setname();
|
||||
Get.snackbar(
|
||||
"Success!",
|
||||
'success!',
|
||||
duration: Duration(seconds: 2),
|
||||
duration: const Duration(seconds: 2),
|
||||
colorText: Colors.white,
|
||||
backgroundColor: Colors.green,
|
||||
margin: EdgeInsets.all(8),
|
||||
margin: const EdgeInsets.all(8),
|
||||
snackStyle: SnackStyle.FLOATING,
|
||||
snackPosition: SnackPosition.BOTTOM,
|
||||
);
|
||||
|
||||
// if (pagename == "nextscreen") {
|
||||
Get.toNamed(RouteName.businessletusunderstandstep1);
|
||||
|
||||
// } else if (pagename == "mainscreen") {
|
||||
// Get.toNamed(RouteName.mainscreen);
|
||||
// }
|
||||
|
||||
Get.toNamed(RouteName.businessletusunderstandstep1);
|
||||
} else if (data.status == ResponseStatus.FAILED) {
|
||||
Get.snackbar(
|
||||
"Error!",
|
||||
data.message,
|
||||
duration: Duration(seconds: 2),
|
||||
duration: const Duration(seconds: 2),
|
||||
colorText: Colors.white,
|
||||
backgroundColor: Colors.red,
|
||||
margin: EdgeInsets.all(8),
|
||||
margin: const EdgeInsets.all(8),
|
||||
snackStyle: SnackStyle.FLOATING,
|
||||
snackPosition: SnackPosition.BOTTOM,
|
||||
);
|
||||
// _controller.isTextFieldEnabled.value = true;
|
||||
} else {
|
||||
// btnController.reset();
|
||||
Get.snackbar(
|
||||
"Error!",
|
||||
data.data['message'],
|
||||
duration: Duration(seconds: 2),
|
||||
duration: const Duration(seconds: 2),
|
||||
colorText: Colors.white,
|
||||
backgroundColor: Colors.red,
|
||||
margin: EdgeInsets.all(8),
|
||||
margin: const EdgeInsets.all(8),
|
||||
snackStyle: SnackStyle.FLOATING,
|
||||
snackPosition: SnackPosition.BOTTOM,
|
||||
);
|
||||
// _controller.isTextFieldEnabled.value = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@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),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
),
|
||||
|
||||
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: businesslocationController,
|
||||
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: () {
|
||||
_tellUsBusinessDone();
|
||||
// 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,
|
||||
// )
|
||||
],
|
||||
),
|
||||
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),
|
||||
],
|
||||
),
|
||||
),
|
||||
])
|
||||
])),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,17 +8,11 @@ class BusinessAPI {
|
||||
|
||||
Future<ResponseData<dynamic>> tellUsBusinessApi(var data) async {
|
||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
final response = await NetworkApiServices().postApi(
|
||||
data,
|
||||
ApiUrls.tellUsBusinessApi
|
||||
// "https://regroup.betadelivery.com/api/v1/tell-us-about-your-business",
|
||||
// optionalpar: true
|
||||
);
|
||||
final response =
|
||||
await NetworkApiServices().postApi(data, ApiUrls.tellUsBusinessApi);
|
||||
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
//Map<String, dynamic> responseData = jsonDecode(response.data);
|
||||
if (response.data['status'] == 'success') {
|
||||
// LoginModel loginObj = LoginModel.fromJson(response.data);
|
||||
} else {
|
||||
return ResponseData<dynamic>(
|
||||
response.data['message'], ResponseStatus.FAILED);
|
||||
@@ -27,16 +21,13 @@ class BusinessAPI {
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
Future<ResponseData<dynamic>> letUsUnderstandApi(var data) async {
|
||||
Future<ResponseData<dynamic>> letUsUnderstandApi(var data) async {
|
||||
final response = await NetworkApiServices().postApi(
|
||||
data,
|
||||
ApiUrls.letUsUnderstandApi,
|
||||
// "https://regroup.betadelivery.com/api/v1/update-business-profile-step-1",
|
||||
);
|
||||
|
||||
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);
|
||||
|
||||
@@ -74,7 +74,7 @@ class _SelectIndividualActivityState extends State<SelectIndividualActivity> {
|
||||
|
||||
Color _getGradientColor(int id) {
|
||||
if (_selectedIndices.contains(id)) {
|
||||
return Color(0XFFD90B2E); // Selected color
|
||||
return const Color(0XFFD90B2E); // Selected color
|
||||
}
|
||||
return Colors.transparent; // Default color
|
||||
}
|
||||
@@ -108,7 +108,7 @@ class _SelectIndividualActivityState extends State<SelectIndividualActivity> {
|
||||
return GestureDetector(
|
||||
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
|
||||
child: Scaffold(
|
||||
backgroundColor: Color.fromARGB(255, 18, 32, 47),
|
||||
backgroundColor: const Color.fromARGB(255, 18, 32, 47),
|
||||
bottomNavigationBar: Padding(
|
||||
padding: const EdgeInsets.only(bottom: 10, left: 16, right: 16),
|
||||
child: CustomButton(
|
||||
@@ -129,67 +129,38 @@ class _SelectIndividualActivityState extends State<SelectIndividualActivity> {
|
||||
// RouteName.individualgroupstep3);
|
||||
}),
|
||||
),
|
||||
body: 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),
|
||||
),
|
||||
body: SafeArea(
|
||||
child: FutureBuilder(
|
||||
future: Getonboard().getIndividualactivity(),
|
||||
builder: (ctx, snapshot) {
|
||||
if (snapshot.data == null) {
|
||||
return const Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [Center(child: CircularProgressIndicator())],
|
||||
);
|
||||
}
|
||||
}
|
||||
if (snapshot.connectionState == ConnectionState.done) {
|
||||
if (snapshot.hasError) {
|
||||
return Center(
|
||||
child: Text(
|
||||
'${snapshot.error} occured',
|
||||
style: TextStyle(fontSize: 18.spMin),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return Stack(
|
||||
children: [
|
||||
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),
|
||||
|
||||
// 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),
|
||||
],
|
||||
return Stack(
|
||||
children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage(
|
||||
"assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
),
|
||||
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(
|
||||
padding:
|
||||
EdgeInsets.symmetric(horizontal: 16.w, vertical: 0.h),
|
||||
child: SingleChildScrollView(
|
||||
@@ -224,7 +195,7 @@ class _SelectIndividualActivityState extends State<SelectIndividualActivity> {
|
||||
height: 25.h,
|
||||
decoration: ShapeDecoration(
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(
|
||||
side: const BorderSide(
|
||||
width: 1, color: Color(0xFF434A53)),
|
||||
borderRadius: BorderRadius.circular(30),
|
||||
),
|
||||
@@ -238,7 +209,7 @@ class _SelectIndividualActivityState extends State<SelectIndividualActivity> {
|
||||
width: 120.w,
|
||||
height: 15.h,
|
||||
decoration: ShapeDecoration(
|
||||
gradient: LinearGradient(
|
||||
gradient: const LinearGradient(
|
||||
begin: Alignment(0.98, -0.21),
|
||||
end: Alignment(-0.98, 0.21),
|
||||
colors: [
|
||||
@@ -259,7 +230,7 @@ class _SelectIndividualActivityState extends State<SelectIndividualActivity> {
|
||||
width: 15,
|
||||
height: 15,
|
||||
decoration: ShapeDecoration(
|
||||
gradient: LinearGradient(
|
||||
gradient: const LinearGradient(
|
||||
begin: Alignment(0.98, -0.21),
|
||||
end: Alignment(-0.98, 0.21),
|
||||
colors: [
|
||||
@@ -296,7 +267,7 @@ class _SelectIndividualActivityState extends State<SelectIndividualActivity> {
|
||||
Center(
|
||||
child: Container(
|
||||
width: 154.w,
|
||||
decoration: ShapeDecoration(
|
||||
decoration: const ShapeDecoration(
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(
|
||||
width: 1,
|
||||
@@ -310,7 +281,7 @@ class _SelectIndividualActivityState extends State<SelectIndividualActivity> {
|
||||
),
|
||||
sizedBoxHeight(30.h),
|
||||
GridView.builder(
|
||||
physics: ScrollPhysics(),
|
||||
physics: const ScrollPhysics(),
|
||||
shrinkWrap: true,
|
||||
gridDelegate:
|
||||
SliverGridDelegateWithFixedCrossAxisCount(
|
||||
@@ -430,10 +401,10 @@ class _SelectIndividualActivityState extends State<SelectIndividualActivity> {
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
);
|
||||
},
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
|
||||
//
|
||||
@@ -471,12 +442,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: Alignment(-0.98, 0.21),
|
||||
end: const Alignment(-0.98, 0.21),
|
||||
colors: isSelected
|
||||
? [
|
||||
gradientColor.withOpacity(0.80),
|
||||
@@ -490,12 +461,12 @@ class ActivityContainer extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(width: 1, color: Color(0xFF434A53)),
|
||||
side: const BorderSide(width: 1, color: Color(0xFF434A53)),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 10.w, vertical: 10.h),
|
||||
padding: EdgeInsets.symmetric(horizontal: 0.w, vertical: 10.h),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
@@ -523,7 +494,7 @@ class ActivityContainer extends StatelessWidget {
|
||||
width: 50.w,
|
||||
height: 50.h,
|
||||
),
|
||||
Spacer(flex: 3),
|
||||
const Spacer(flex: 3),
|
||||
SizedBox(
|
||||
child: Text(
|
||||
titleString,
|
||||
|
||||
@@ -83,121 +83,85 @@ class _SelectIndividualGroupState extends State<SelectIndividualGroup> {
|
||||
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
|
||||
child: Scaffold(
|
||||
backgroundColor: Color.fromARGB(255, 18, 32, 47),
|
||||
bottomNavigationBar: Padding(
|
||||
padding: const EdgeInsets.only(bottom: 10, left: 16, right: 16),
|
||||
child: 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();
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
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),
|
||||
],
|
||||
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),
|
||||
),
|
||||
),
|
||||
),
|
||||
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: [
|
||||
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,
|
||||
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(0xA5D90B2E),
|
||||
Color(0x42D90B2E)
|
||||
Color(0xFFD90B2E),
|
||||
Color(0x60D90B2E)
|
||||
],
|
||||
),
|
||||
shape: RoundedRectangleBorder(
|
||||
@@ -205,152 +169,142 @@ class _SelectIndividualGroupState extends State<SelectIndividualGroup> {
|
||||
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,
|
||||
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(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(),
|
||||
],
|
||||
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),
|
||||
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),
|
||||
),
|
||||
);
|
||||
} 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,
|
||||
),
|
||||
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,
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
} 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,
|
||||
),
|
||||
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,
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
)),
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
// 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();
|
||||
}
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
)),
|
||||
|
||||
@@ -84,121 +84,86 @@ class _SelectIndividualCommunityState extends State<SelectIndividualCommunity> {
|
||||
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
|
||||
child: Scaffold(
|
||||
backgroundColor: Color.fromARGB(255, 18, 32, 47),
|
||||
bottomNavigationBar: Padding(
|
||||
padding: const EdgeInsets.only(bottom: 10, left: 16, right: 16),
|
||||
child: 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();
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
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),
|
||||
],
|
||||
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),
|
||||
),
|
||||
),
|
||||
),
|
||||
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: [
|
||||
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,
|
||||
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,
|
||||
decoration: ShapeDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment(0.98, -0.21),
|
||||
end: Alignment(-0.98, 0.21),
|
||||
colors: [
|
||||
Color(0xA5D90B2E),
|
||||
Color(0x42D90B2E)
|
||||
Color(0xFFD90B2E),
|
||||
Color(0x60D90B2E)
|
||||
],
|
||||
),
|
||||
shape: RoundedRectangleBorder(
|
||||
@@ -206,156 +171,145 @@ class _SelectIndividualCommunityState extends State<SelectIndividualCommunity> {
|
||||
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,
|
||||
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(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(
|
||||
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),
|
||||
),
|
||||
),
|
||||
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,
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
} 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(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();
|
||||
}
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
)),
|
||||
|
||||
@@ -36,9 +36,6 @@ class _TellusaboutIndividualState extends State<TellusaboutIndividual> {
|
||||
TextEditingController datecontroller = TextEditingController();
|
||||
TextEditingController locationcontroller = TextEditingController();
|
||||
|
||||
// String pagename = Get.arguments["pageroute"];
|
||||
|
||||
|
||||
DateTime? _selectedDate;
|
||||
final photographController = TextEditingController();
|
||||
|
||||
@@ -46,9 +43,9 @@ class _TellusaboutIndividualState extends State<TellusaboutIndividual> {
|
||||
Get.put(ProfileImageController());
|
||||
|
||||
Future<void> _selectDate(BuildContext context) async {
|
||||
DateTime yesterday = DateTime.now().subtract(Duration(days: 1));
|
||||
DateTime yesterday = DateTime.now().subtract(const Duration(days: 1));
|
||||
DateTime eighteenYearsAgo =
|
||||
DateTime.now().subtract(Duration(days: 365 * 18));
|
||||
DateTime.now().subtract(const Duration(days: 365 * 18));
|
||||
|
||||
final ThemeData customTheme = Theme.of(context).copyWith(
|
||||
colorScheme: const ColorScheme.light(
|
||||
@@ -60,7 +57,7 @@ class _TellusaboutIndividualState extends State<TellusaboutIndividual> {
|
||||
onSecondary: Colors.white),
|
||||
textButtonTheme: TextButtonThemeData(
|
||||
style: TextButton.styleFrom(
|
||||
foregroundColor: Color(0xFFD90B2E),
|
||||
foregroundColor: const Color(0xFFD90B2E),
|
||||
),
|
||||
));
|
||||
|
||||
@@ -141,36 +138,20 @@ class _TellusaboutIndividualState extends State<TellusaboutIndividual> {
|
||||
filename: path.basename(editProfileImage.profilePicPath.value),
|
||||
);
|
||||
}
|
||||
// else {
|
||||
// imageFile = await Helper.assetImageToMultipartFile(
|
||||
// "assets/images/png/camera.png", "profile");
|
||||
// }
|
||||
|
||||
FormData formData = FormData.fromMap({
|
||||
"full_name": fullNameController.text,
|
||||
"username": userNameController.text,
|
||||
"date_of_birth": datecontroller.text,
|
||||
"gender": _selectedgendertype,
|
||||
'profile_photo':
|
||||
// editProfileImage.profilePicPath.value.isNotEmpty ?
|
||||
imageFile,
|
||||
// : null,
|
||||
'profile_photo': imageFile,
|
||||
'location': locationcontroller.text,
|
||||
});
|
||||
|
||||
print("formData is $formData");
|
||||
log(formData.toString());
|
||||
final data = await Onboard().PosttellusIndividual(formData);
|
||||
if (data.status == ResponseStatus.SUCCESS) {
|
||||
utils.showToast("tell us done Successfully!");
|
||||
Get.back();
|
||||
// Get.toNamed(RouteName.individualprofilestep1);
|
||||
// if (pagename == "nextscreen") {
|
||||
Get.toNamed(RouteName.individualactivitystep2);
|
||||
|
||||
// } else if (pagename == "mainscreen") {
|
||||
// Get.toNamed(RouteName.mainscreen);
|
||||
// }
|
||||
Get.toNamed(RouteName.individualactivitystep2);
|
||||
} else {
|
||||
Get.back();
|
||||
return utils.showToast(data.message);
|
||||
@@ -182,54 +163,16 @@ class _TellusaboutIndividualState extends State<TellusaboutIndividual> {
|
||||
return GestureDetector(
|
||||
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
|
||||
child: Scaffold(
|
||||
backgroundColor: Color.fromARGB(255, 18, 32, 47),
|
||||
backgroundColor: const Color.fromARGB(255, 18, 32, 47),
|
||||
body: Stack(
|
||||
children: [
|
||||
// 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),
|
||||
// ],
|
||||
// ),
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
),
|
||||
ListView(physics: ScrollPhysics(), children: [
|
||||
ListView(physics: const ScrollPhysics(), children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: Column(
|
||||
@@ -242,7 +185,7 @@ class _TellusaboutIndividualState extends State<TellusaboutIndividual> {
|
||||
Center(
|
||||
child: Container(
|
||||
width: 154,
|
||||
decoration: ShapeDecoration(
|
||||
decoration: const ShapeDecoration(
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(
|
||||
width: 1,
|
||||
@@ -281,8 +224,8 @@ class _TellusaboutIndividualState extends State<TellusaboutIndividual> {
|
||||
shape: BoxShape.circle,
|
||||
color: Colors.transparent,
|
||||
border: Border.all(
|
||||
color:
|
||||
Color(0XFFD90B2E).withOpacity(0.50),
|
||||
color: const Color(0XFFD90B2E)
|
||||
.withOpacity(0.50),
|
||||
width: 2),
|
||||
),
|
||||
),
|
||||
@@ -294,8 +237,8 @@ class _TellusaboutIndividualState extends State<TellusaboutIndividual> {
|
||||
shape: BoxShape.circle,
|
||||
color: Colors.transparent,
|
||||
border: Border.all(
|
||||
color:
|
||||
Color(0XFFD90B2E).withOpacity(0.50),
|
||||
color: const Color(0XFFD90B2E)
|
||||
.withOpacity(0.50),
|
||||
width: 2),
|
||||
),
|
||||
),
|
||||
@@ -305,38 +248,32 @@ class _TellusaboutIndividualState extends State<TellusaboutIndividual> {
|
||||
shape: BoxShape.circle,
|
||||
color: Colors.transparent,
|
||||
border: Border.all(
|
||||
color: Color(0XFFD90B2E)
|
||||
color: const 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,
|
||||
child: Obx(() => editProfileImage
|
||||
.profilePicPath.value !=
|
||||
''
|
||||
? ClipOval(
|
||||
child: SizedBox.fromSize(
|
||||
size: Size.fromRadius(50.r),
|
||||
child: Image(
|
||||
image: FileImage(
|
||||
File(
|
||||
editProfileImage
|
||||
.profilePicPath
|
||||
.value,
|
||||
),
|
||||
),
|
||||
)
|
||||
: Image.asset(
|
||||
"assets/images/png/camera.png")
|
||||
fit: BoxFit.cover,
|
||||
width: 200.w,
|
||||
height: 200.h,
|
||||
),
|
||||
),
|
||||
)
|
||||
: Image.asset(
|
||||
"assets/images/png/camera.png")
|
||||
// : Image.asset(
|
||||
// "assets/images/png/camera.png")
|
||||
)),
|
||||
@@ -431,7 +368,7 @@ class _TellusaboutIndividualState extends State<TellusaboutIndividual> {
|
||||
sizedBoxHeight(10.h),
|
||||
text16400white('Gender'),
|
||||
sizedBoxHeight(10.h),
|
||||
CustomDropDownWidgetSignup(
|
||||
CustomDropDownRadio(
|
||||
header: 'Select gender',
|
||||
title: '',
|
||||
listData: _gender,
|
||||
@@ -476,22 +413,12 @@ class _TellusaboutIndividualState extends State<TellusaboutIndividual> {
|
||||
CustomButton(
|
||||
text: "Continue",
|
||||
onPressed: () {
|
||||
if (
|
||||
// isValid!
|
||||
// fullNameController.text.isBlank! &&
|
||||
// userNameController.text.isBlank! &&
|
||||
// datecontroller.text.isBlank! &&
|
||||
// _selectedgendertype.isEmpty &&
|
||||
// locationcontroller.text.isBlank! &&
|
||||
// editProfileImage.profilePicPath.value ==
|
||||
// ''
|
||||
fullNameController.text.isBlank! ||
|
||||
userNameController.text.isBlank! ||
|
||||
datecontroller.text.isBlank! ||
|
||||
_selectedgendertype.isEmpty ||
|
||||
locationcontroller.text.isBlank! ||
|
||||
editProfileImage.profilePicPath.value ==
|
||||
'') {
|
||||
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();
|
||||
|
||||
@@ -23,130 +23,95 @@ class _CommunitycommitmentState extends State<Communitycommitment> {
|
||||
backgroundColor: Color.fromARGB(255, 18, 32, 47),
|
||||
body: Stack(
|
||||
children: [
|
||||
// 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),
|
||||
),
|
||||
),
|
||||
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),
|
||||
),
|
||||
),
|
||||
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);
|
||||
})
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
));
|
||||
}
|
||||
|
||||
@@ -23,97 +23,62 @@ class _SignupendPageState extends State<SignupendPage> {
|
||||
backgroundColor: Color.fromARGB(255, 18, 32, 47),
|
||||
body: Stack(
|
||||
children: [
|
||||
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)
|
||||
],
|
||||
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,
|
||||
),
|
||||
),
|
||||
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);
|
||||
})
|
||||
],
|
||||
),
|
||||
)),
|
||||
)),
|
||||
sizedBoxHeight(20.h),
|
||||
CustomButton(
|
||||
text: "Let's begin",
|
||||
onPressed: () {
|
||||
Get.toNamed(RouteName.mainscreen);
|
||||
})
|
||||
],
|
||||
),
|
||||
)),
|
||||
)
|
||||
],
|
||||
));
|
||||
}
|
||||
|
||||
@@ -1,11 +1,18 @@
|
||||
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';
|
||||
@@ -24,13 +31,10 @@ class _SignupScreenState extends State<SignupScreen> {
|
||||
TextEditingController emailidcontroller = TextEditingController();
|
||||
TextEditingController passwordController = TextEditingController();
|
||||
TextEditingController confirmpasscontroller = TextEditingController();
|
||||
AccessToken? _accessToken;
|
||||
|
||||
final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
|
||||
|
||||
List<String> _dropdownProductItems = [
|
||||
'Individual',
|
||||
'Business',
|
||||
];
|
||||
GoogleAuthService googleSigninController = Get.put(GoogleAuthService());
|
||||
|
||||
final Map<String, int> _accountTypeMap = {
|
||||
'Individual': 1,
|
||||
@@ -45,35 +49,93 @@ class _SignupScreenState extends State<SignupScreen> {
|
||||
});
|
||||
}
|
||||
|
||||
// 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 {
|
||||
// utils.showToast('Please select an account type');
|
||||
// }
|
||||
// }
|
||||
_loginWithApple() {
|
||||
AppleOAuthService().logIn();
|
||||
}
|
||||
|
||||
_loginWithGoogle() {
|
||||
googleSigninController.handleGoogleSignIn().then((value) async {
|
||||
final resp = await LoginAPI().storeGoogleSignin(
|
||||
{"google_access_token": value, "one_signal_player_id": "ABCD"});
|
||||
if (value != 'Google Sign-In canceled') {
|
||||
if (resp.message == "go-to-signin-via-oauth") {
|
||||
Get.toNamed(RouteName.verifygoogleapplepage,
|
||||
arguments: {"email": resp.data});
|
||||
} else if (value == null) {
|
||||
Get.snackbar(
|
||||
'Error',
|
||||
resp.data["message"][0],
|
||||
duration: const Duration(seconds: 2),
|
||||
snackPosition: SnackPosition.BOTTOM,
|
||||
backgroundColor: Colors.red,
|
||||
colorText: Colors.white,
|
||||
);
|
||||
} else {
|
||||
Get.snackbar(
|
||||
"Success!",
|
||||
'Login successful!',
|
||||
duration: const Duration(seconds: 2),
|
||||
colorText: Colors.white,
|
||||
backgroundColor: Colors.green,
|
||||
margin: const EdgeInsets.all(8),
|
||||
snackStyle: SnackStyle.FLOATING,
|
||||
snackPosition: SnackPosition.BOTTOM,
|
||||
);
|
||||
//Get.toNamed(RouteName.mainscreen);
|
||||
logger.d("go to login");
|
||||
}
|
||||
} else {
|
||||
Get.snackbar(
|
||||
'Error',
|
||||
resp.data["message"][0],
|
||||
snackPosition: SnackPosition.BOTTOM,
|
||||
backgroundColor: Colors.red,
|
||||
colorText: Colors.white,
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
_checkIfisLoggedIn() async {
|
||||
await _logout();
|
||||
final accessToken = await FacebookAuth.instance.accessToken;
|
||||
if (accessToken != null) {
|
||||
print("/////////////////////////////////////////xcheck");
|
||||
|
||||
final userData = await FacebookAuth.instance.getUserData();
|
||||
|
||||
logger.i(accessToken.token);
|
||||
logger.i(userData.toString());
|
||||
} else {
|
||||
print("/////////////////////////////////////////check");
|
||||
_login();
|
||||
}
|
||||
}
|
||||
|
||||
_login() async {
|
||||
final LoginResult result = await FacebookAuth.instance.login();
|
||||
|
||||
if (result.status == LoginStatus.success) {
|
||||
_accessToken = result.accessToken;
|
||||
|
||||
final userData = await FacebookAuth.instance.getUserData();
|
||||
logger.i(userData['email']);
|
||||
logger.i(userData['id']);
|
||||
|
||||
await LoginAPI().storeFacebookSignin(
|
||||
{"facebook_auth_token": userData['id']},
|
||||
emailReceived: userData['email']);
|
||||
} else {
|
||||
print(result.status);
|
||||
print(result.message);
|
||||
}
|
||||
}
|
||||
|
||||
_logout() async {
|
||||
await FacebookAuth.instance.logOut();
|
||||
_accessToken = null;
|
||||
setState(() {});
|
||||
}
|
||||
|
||||
Uploadata() async {
|
||||
utils.loader();
|
||||
@@ -97,31 +159,6 @@ class _SignupScreenState extends State<SignupScreen> {
|
||||
'accountypenumber': accountTypeValue
|
||||
});
|
||||
|
||||
// if (selectedCategory == "Individual") {
|
||||
// Get.toNamed(RouteName.verifyusercreen,
|
||||
// arguments:
|
||||
// {
|
||||
// "emailid" : emailidcontroller.text,
|
||||
// "password" : passwordController.text,
|
||||
// "accounttype" : selectedCategory,
|
||||
// 'accountypenumber' : accountTypeValue
|
||||
|
||||
// }
|
||||
|
||||
// );
|
||||
// } else if (selectedCategory == "Individual") {
|
||||
// Get.toNamed(RouteName.verifyusercreen,
|
||||
// arguments:
|
||||
// {
|
||||
// "emailid" : emailidcontroller.text,
|
||||
// "password" : passwordController.text,
|
||||
// "accounttype" : selectedCategory,
|
||||
// 'accountypenumber' : accountTypeValue
|
||||
|
||||
// }
|
||||
// );
|
||||
// }
|
||||
|
||||
return utils.showToast(data.message);
|
||||
} else {
|
||||
Get.back();
|
||||
@@ -397,11 +434,74 @@ class _SignupScreenState extends State<SignupScreen> {
|
||||
child: SizedBox(
|
||||
width: 220.w,
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
if (Platform.isIOS)
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
_loginWithApple();
|
||||
},
|
||||
child: Container(
|
||||
width: 55,
|
||||
height: 55,
|
||||
decoration: ShapeDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: const Alignment(
|
||||
0.71, -0.70),
|
||||
end: const Alignment(
|
||||
-0.71, 0.7),
|
||||
colors: [
|
||||
Colors.white.withOpacity(
|
||||
0.07999999821186066),
|
||||
Colors.white.withOpacity(
|
||||
0.12999999523162842)
|
||||
],
|
||||
),
|
||||
shape: const OvalBorder(
|
||||
side: BorderSide(
|
||||
width: 0.50,
|
||||
color: Color(0xFF434A53)),
|
||||
),
|
||||
image: const DecorationImage(
|
||||
image: AssetImage(
|
||||
'assets/images/png/login2.png'))),
|
||||
),
|
||||
),
|
||||
if (Platform.isAndroid)
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
_loginWithGoogle();
|
||||
},
|
||||
child: Container(
|
||||
width: 55,
|
||||
height: 55,
|
||||
decoration: ShapeDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: const Alignment(
|
||||
0.71, -0.70),
|
||||
end: const Alignment(
|
||||
-0.71, 0.7),
|
||||
colors: [
|
||||
Colors.white.withOpacity(
|
||||
0.07999999821186066),
|
||||
Colors.white.withOpacity(
|
||||
0.12999999523162842)
|
||||
],
|
||||
),
|
||||
shape: const OvalBorder(
|
||||
side: BorderSide(
|
||||
width: 0.50,
|
||||
color: Color(0xFF434A53)),
|
||||
),
|
||||
image: const DecorationImage(
|
||||
image: AssetImage(
|
||||
'assets/images/png/login3.png'))),
|
||||
),
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(
|
||||
RouteName.verifygoogleapplepage);
|
||||
onTap: () async {
|
||||
_checkIfisLoggedIn();
|
||||
},
|
||||
child: Container(
|
||||
width: 55,
|
||||
@@ -426,66 +526,9 @@ class _SignupScreenState extends State<SignupScreen> {
|
||||
),
|
||||
image: const DecorationImage(
|
||||
image: AssetImage(
|
||||
'assets/images/png/login2.png'))),
|
||||
'assets/images/png/login4.png'))),
|
||||
),
|
||||
),
|
||||
const Spacer(),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(
|
||||
RouteName.verifygoogleapplepage);
|
||||
},
|
||||
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(),
|
||||
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'))),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -2,22 +2,16 @@ 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/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/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:shared_preferences/shared_preferences.dart';
|
||||
import 'package:timer_button/timer_button.dart';
|
||||
|
||||
class VerifyuserScreenState extends StatefulWidget {
|
||||
@@ -38,50 +32,53 @@ class _VerifyuserScreenStateState extends State<VerifyuserScreenState> {
|
||||
int accounttypenumber = Get.arguments["accountypenumber"];
|
||||
|
||||
Uploadata() async {
|
||||
utils.loader();
|
||||
// utils.loader();
|
||||
Map<String, dynamic> updata = {
|
||||
"email_address": email,
|
||||
"password": userpassword,
|
||||
"account_type": accounttypenumber,
|
||||
"otp": pincode.text
|
||||
};
|
||||
final data = await Onboard().Postverifyregisteration(updata);
|
||||
if (data.status == ResponseStatus.SUCCESS) {
|
||||
// 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"
|
||||
// }
|
||||
Get.toNamed(
|
||||
RouteName.tellusindividualscreen,
|
||||
// arguments: {
|
||||
// 'pageroute' : "nextscreen"
|
||||
// }
|
||||
);
|
||||
} else if (accounttype == 'Business') {
|
||||
print('business selected');
|
||||
Get.toNamed(RouteName.tellusbusinessscreen,
|
||||
// arguments: {
|
||||
// 'pageroute' : "nextscreen"
|
||||
// }
|
||||
Get.toNamed(
|
||||
RouteName.tellusbusinessscreen,
|
||||
// arguments: {
|
||||
// 'pageroute' : "nextscreen"
|
||||
// }
|
||||
);
|
||||
}
|
||||
|
||||
return utils.showToast(data.message);
|
||||
}
|
||||
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 {
|
||||
// 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");
|
||||
@@ -90,7 +87,7 @@ class _VerifyuserScreenStateState extends State<VerifyuserScreenState> {
|
||||
}
|
||||
|
||||
Uploadataresendotp() async {
|
||||
utils.loader();
|
||||
// utils.loader();
|
||||
Map<String, dynamic> updata = {
|
||||
"email_address": email,
|
||||
"password": userpassword,
|
||||
@@ -98,13 +95,43 @@ class _VerifyuserScreenStateState extends State<VerifyuserScreenState> {
|
||||
};
|
||||
final data = await Onboard().Postregisteration(updata);
|
||||
if (data.status == ResponseStatus.SUCCESS) {
|
||||
Get.back();
|
||||
print("resend up done");
|
||||
return utils.showToast(data.message);
|
||||
} else {
|
||||
Get.back();
|
||||
print("resend not done");
|
||||
return utils.showToast(data.message);
|
||||
// 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 {
|
||||
// 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,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,45 +144,13 @@ class _VerifyuserScreenStateState extends State<VerifyuserScreenState> {
|
||||
),
|
||||
body: Stack(
|
||||
children: [
|
||||
// CommonBlurLeftSecond(),
|
||||
Positioned(top: 150, right: -30, child: CommonBlurRightSecond()),
|
||||
Positioned(top: 350, left: -30, child: CommonBlurLeftBlue()),
|
||||
GlassmorphicContainer(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height:
|
||||
// 500.h,
|
||||
MediaQuery.of(context).size.height,
|
||||
borderRadius: 2,
|
||||
blur: 6,
|
||||
alignment: Alignment.bottomLeft,
|
||||
border: 2,
|
||||
linearGradient: LinearGradient(
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
colors: [
|
||||
Color(0XFF222935).withOpacity(0.60),
|
||||
Color(0XFF222935).withOpacity(0.60),
|
||||
Color(0XFF222935).withOpacity(0.60),
|
||||
Color(0XFF222935).withOpacity(0.60),
|
||||
|
||||
// Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
||||
// Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
||||
// Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
||||
// Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
||||
],
|
||||
),
|
||||
borderGradient: LinearGradient(
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
colors: [
|
||||
// Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
||||
// Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
||||
Color(0XFF222935).withOpacity(0.60),
|
||||
|
||||
Color(0XFF222935).withOpacity(0.60),
|
||||
],
|
||||
),
|
||||
child: Padding(
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
@@ -273,7 +268,7 @@ class _VerifyuserScreenStateState extends State<VerifyuserScreenState> {
|
||||
),
|
||||
],
|
||||
),
|
||||
)),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
@@ -4,6 +4,7 @@ import 'package:regroup/Common/api_urls.dart';
|
||||
import 'package:regroup/Common/base_manager.dart';
|
||||
import 'package:regroup/Common/controller/data/network/network_api.dart';
|
||||
import 'package:regroup/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';
|
||||
|
||||
@@ -16,6 +17,12 @@ class Onboard {
|
||||
.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;
|
||||
}
|
||||
|
||||
@@ -25,18 +32,34 @@ class Onboard {
|
||||
.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']);
|
||||
// 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'];
|
||||
// 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;
|
||||
}
|
||||
|
||||
@@ -50,7 +73,8 @@ class Onboard {
|
||||
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
if (response.data['status'] == 'success') {
|
||||
TellusIndividualModel tellusindiObj = TellusIndividualModel.fromJson(response.data);
|
||||
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 ?? "");
|
||||
@@ -60,7 +84,6 @@ class Onboard {
|
||||
// myusername = tellusindiObj.data?.profile?.userName;
|
||||
// fullname = tellusindiObj.data?.profile?.fullName;
|
||||
// phonenumber = tellusindiObj.data?.profile?.phoneNumber;
|
||||
|
||||
} else {
|
||||
return ResponseData<dynamic>(
|
||||
response.data['message'], ResponseStatus.FAILED);
|
||||
|
||||
@@ -22,167 +22,39 @@ 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();
|
||||
log(_connectionStatus.toString());
|
||||
|
||||
Future.delayed(Duration(seconds: 2), () async {
|
||||
if (_connectionStatus.contains(ConnectivityResult.none)) {
|
||||
var result = await Get.to(NoInternet());
|
||||
if (result != null && result) {
|
||||
print('this is first');
|
||||
Timer(const Duration(seconds: 1), () async {
|
||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
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');
|
||||
|
||||
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);
|
||||
} else {
|
||||
Getuserdetails().Getuser().then((value) {
|
||||
print(getuserobj!.data!.userData!.isProfileUpdated!);
|
||||
// .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);
|
||||
}
|
||||
});
|
||||
// print(getuserobj!.data!.userData!.isProfileUpdated!);
|
||||
|
||||
// // .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);
|
||||
// }
|
||||
// } else {
|
||||
// Get.toNamed(RouteName.mainscreen);
|
||||
// }
|
||||
// }
|
||||
// );
|
||||
}
|
||||
});
|
||||
}
|
||||
if (token == null || token!.isEmpty) {
|
||||
Get.toNamed(RouteName.onboarding1);
|
||||
} else {
|
||||
Timer(const Duration(seconds: 2), () async {
|
||||
print('this is second');
|
||||
await Getuserdetails().Getuser().then((value) {
|
||||
if (getuserobj?.data?.userData?.isProfileUpdated == 0) {
|
||||
String? accountype =
|
||||
getuserobj?.data?.userData?.principalTypeXid.toString();
|
||||
|
||||
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);
|
||||
if (accountype == "1") {
|
||||
Get.toNamed(RouteName.tellusindividualscreen,
|
||||
arguments: {'pageroute': "mainscreen"});
|
||||
} else if (accountype == "2") {
|
||||
Get.toNamed(RouteName.tellusbusinessscreen,
|
||||
arguments: {'pageroute': "mainscreen"});
|
||||
}
|
||||
} else {
|
||||
Getuserdetails().Getuser().then((value) {
|
||||
print(getuserobj!.data!.userData!.isProfileUpdated!);
|
||||
// .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);
|
||||
}
|
||||
});
|
||||
|
||||
// }
|
||||
// );
|
||||
Get.toNamed(RouteName.mainscreen);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// Future.delayed(Duration(seconds: 2), () async {
|
||||
// Timer(const Duration(seconds: 1), () async {
|
||||
// Get.toNamed(RouteName.onboarding1);
|
||||
// });
|
||||
// });
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -197,11 +69,11 @@ class _SplashScreenState extends State<SplashScreen> {
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [
|
||||
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),
|
||||
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),
|
||||
],
|
||||
)),
|
||||
child: Column(
|
||||
|
||||
@@ -52,11 +52,9 @@ class _ForgotPassState extends State<ForgotPass> {
|
||||
snackPosition: SnackPosition.BOTTOM,
|
||||
);
|
||||
prefs.setString('email', emailController.text);
|
||||
prefs.setInt(
|
||||
'principal_xid', resp.data['data']['iam_principal_xid']);
|
||||
prefs.setInt('principal_xid', resp.data['data']['iam_principal_xid']);
|
||||
Future.delayed(Duration(seconds: 1), () {
|
||||
Get.toNamed(RouteName.forgotOtp,
|
||||
arguments: emailController.text);
|
||||
Get.toNamed(RouteName.forgotOtp, arguments: emailController.text);
|
||||
});
|
||||
// print('success');
|
||||
} else if (resp.status == ResponseStatus.FAILED) {
|
||||
@@ -134,7 +132,7 @@ class _ForgotPassState extends State<ForgotPass> {
|
||||
),
|
||||
),
|
||||
),
|
||||
hintText: "loremipsum@gmail.comess",
|
||||
// hintText: "loremipsum@gmail.comess",
|
||||
validator: (value) {
|
||||
if (value!.isEmpty) {
|
||||
return 'Enter your e-mail address';
|
||||
|
||||
@@ -45,7 +45,7 @@ import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Settings/ContactUs
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Settings/DeleteAccount.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Settings/FaqScreen.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Settings/HelpAndSupport.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Settings/Notification.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Settings/View/Notification.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Settings/PrivacyPolicy.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Settings/ReportABug.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Settings/Settings.dart';
|
||||
@@ -495,7 +495,7 @@ class AppRoutes {
|
||||
),
|
||||
GetPage(
|
||||
name: RouteName.verifygoogleapplepage,
|
||||
page: () => const Verifygoogleandapple(),
|
||||
page: () => Verifygoogleandapple(),
|
||||
),
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user