kyc and update risk profile api integration and issues fixed
This commit is contained in:
@@ -12,6 +12,7 @@
|
|||||||
<application
|
<application
|
||||||
android:label="Traders Circuit"
|
android:label="Traders Circuit"
|
||||||
android:requestLegacyExternalStorage="true"
|
android:requestLegacyExternalStorage="true"
|
||||||
|
android:usesCleartextTraffic="true"
|
||||||
android:name="${applicationName}"
|
android:name="${applicationName}"
|
||||||
android:icon="@mipmap/ic_launcher">
|
android:icon="@mipmap/ic_launcher">
|
||||||
<activity
|
<activity
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ class CustomTextFormField extends StatefulWidget {
|
|||||||
this.inputFormatters,
|
this.inputFormatters,
|
||||||
this.onInput,
|
this.onInput,
|
||||||
this.onTap,
|
this.onTap,
|
||||||
|
this.textCapV,
|
||||||
this.suffixIcon,
|
this.suffixIcon,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
@@ -38,6 +39,7 @@ class CustomTextFormField extends StatefulWidget {
|
|||||||
final dynamic inputFormatters;
|
final dynamic inputFormatters;
|
||||||
final Function(String)? onInput;
|
final Function(String)? onInput;
|
||||||
final VoidCallback? onTap;
|
final VoidCallback? onTap;
|
||||||
|
final TextCapitalization? textCapV;
|
||||||
final Widget? suffixIcon;
|
final Widget? suffixIcon;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -93,6 +95,7 @@ class _CustomTextFormFieldState extends State<CustomTextFormField> {
|
|||||||
autovalidateMode: AutovalidateMode.onUserInteraction,
|
autovalidateMode: AutovalidateMode.onUserInteraction,
|
||||||
obscureText: obscureText,
|
obscureText: obscureText,
|
||||||
controller: widget.textEditingController,
|
controller: widget.textEditingController,
|
||||||
|
textCapitalization: widget.textCapV ?? TextCapitalization.none,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
hintStyle: TextStyle(color: Colors.white),
|
hintStyle: TextStyle(color: Colors.white),
|
||||||
hintText: widget.hintText,
|
hintText: widget.hintText,
|
||||||
|
|||||||
@@ -133,20 +133,24 @@ class _CustomDropDownWidgetState extends State<CustomDropDownWidget> {
|
|||||||
Positioned(
|
Positioned(
|
||||||
left: 14,
|
left: 14,
|
||||||
top: 16,
|
top: 16,
|
||||||
child: Text(
|
child: Container(
|
||||||
widget.type == "risk"
|
width: 310,
|
||||||
? (selectedValue.isNotEmpty
|
child: Text(
|
||||||
? selectedValue.value
|
widget.type == "risk"
|
||||||
: widget.header)
|
? (selectedValue.isNotEmpty
|
||||||
: (contactUsController.selectedValue.isNotEmpty
|
? selectedValue.value
|
||||||
? contactUsController.selectedValue.value
|
: widget.header)
|
||||||
: widget.header),
|
: (contactUsController.selectedValue.isNotEmpty
|
||||||
style: const TextStyle(
|
? contactUsController.selectedValue.value
|
||||||
color: Color(0xFFADADAD),
|
: widget.header),
|
||||||
fontSize: 16,
|
overflow: TextOverflow.ellipsis,
|
||||||
fontFamily: 'hiragino',
|
style: const TextStyle(
|
||||||
fontWeight: FontWeight.w400,
|
color: Color(0xFFADADAD),
|
||||||
height: 0,
|
fontSize: 16,
|
||||||
|
fontFamily: 'hiragino',
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
height: 0,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ class ApiUrls {
|
|||||||
//RISK PROFILE API
|
//RISK PROFILE API
|
||||||
static String getRiskProfileQuestionAnswerApi = "${base}riskProfileQueAns";
|
static String getRiskProfileQuestionAnswerApi = "${base}riskProfileQueAns";
|
||||||
static String addRiskProfileQuestionAnswerApi = "${base}addUserRiskProfile";
|
static String addRiskProfileQuestionAnswerApi = "${base}addUserRiskProfile";
|
||||||
|
static String getRiskProfile = "${base}get-user-risk-profile-data";
|
||||||
|
|
||||||
//CONTENT BYTES API
|
//CONTENT BYTES API
|
||||||
static String getContentBytesCategoriesApi =
|
static String getContentBytesCategoriesApi =
|
||||||
@@ -78,4 +79,7 @@ class ApiUrls {
|
|||||||
|
|
||||||
//explore unseen
|
//explore unseen
|
||||||
static String getExplore = "${base}get-explore-the-unseen-recommendations";
|
static String getExplore = "${base}get-explore-the-unseen-recommendations";
|
||||||
|
|
||||||
|
//kyc
|
||||||
|
static String getKyc = "${base}get-kyc-images";
|
||||||
}
|
}
|
||||||
|
|||||||
76
lib/model/KycModel/kyc_model.dart
Normal file
76
lib/model/KycModel/kyc_model.dart
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
class GetKYCModel {
|
||||||
|
String? status;
|
||||||
|
int? statusCode;
|
||||||
|
String? message;
|
||||||
|
List<Data>? data;
|
||||||
|
|
||||||
|
GetKYCModel({this.status, this.statusCode, this.message, this.data});
|
||||||
|
|
||||||
|
GetKYCModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
status = json['status'];
|
||||||
|
statusCode = json['status_code'];
|
||||||
|
message = json['message'];
|
||||||
|
if (json['data'] != null) {
|
||||||
|
data = <Data>[];
|
||||||
|
json['data'].forEach((v) {
|
||||||
|
data!.add(Data.fromJson(v));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
data['status'] = status;
|
||||||
|
data['status_code'] = statusCode;
|
||||||
|
data['message'] = message;
|
||||||
|
if (this.data != null) {
|
||||||
|
data['data'] = this.data!.map((v) => v.toJson()).toList();
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class Data {
|
||||||
|
int? id;
|
||||||
|
int? userId;
|
||||||
|
String? adharcardNumber;
|
||||||
|
String? panNumber;
|
||||||
|
String? pancardImageFront;
|
||||||
|
String? pancardImageBack;
|
||||||
|
String? adharcardImageFront;
|
||||||
|
String? adharcardImageBack;
|
||||||
|
|
||||||
|
Data(
|
||||||
|
{this.id,
|
||||||
|
this.userId,
|
||||||
|
this.adharcardNumber,
|
||||||
|
this.panNumber,
|
||||||
|
this.pancardImageFront,
|
||||||
|
this.pancardImageBack,
|
||||||
|
this.adharcardImageFront,
|
||||||
|
this.adharcardImageBack});
|
||||||
|
|
||||||
|
Data.fromJson(Map<String, dynamic> json) {
|
||||||
|
id = json['id'];
|
||||||
|
userId = json['user_id'];
|
||||||
|
adharcardNumber = json['adharcard_number'];
|
||||||
|
panNumber = json['pan_number'] ?? "";
|
||||||
|
pancardImageFront = json['pancard_image_front'];
|
||||||
|
pancardImageBack = json['pancard_image_back'];
|
||||||
|
adharcardImageFront = json['adharcard_image_front'];
|
||||||
|
adharcardImageBack = json['adharcard_image_back'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
data['id'] = id;
|
||||||
|
data['user_id'] = userId;
|
||||||
|
data['adharcard_number'] = adharcardNumber;
|
||||||
|
data['pan_number'] = panNumber;
|
||||||
|
data['pancard_image_front'] = pancardImageFront;
|
||||||
|
data['pancard_image_back'] = pancardImageBack;
|
||||||
|
data['adharcard_image_front'] = adharcardImageFront;
|
||||||
|
data['adharcard_image_back'] = adharcardImageBack;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
118
lib/model/RiskProfileModel/get_user_risk_profile_model.dart
Normal file
118
lib/model/RiskProfileModel/get_user_risk_profile_model.dart
Normal file
@@ -0,0 +1,118 @@
|
|||||||
|
class GetUserRiskProfileModel {
|
||||||
|
String? status;
|
||||||
|
int? statusCode;
|
||||||
|
String? message;
|
||||||
|
List<Data>? data;
|
||||||
|
|
||||||
|
GetUserRiskProfileModel(
|
||||||
|
{this.status, this.statusCode, this.message, this.data});
|
||||||
|
|
||||||
|
GetUserRiskProfileModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
status = json['status'];
|
||||||
|
statusCode = json['status_code'];
|
||||||
|
message = json['message'];
|
||||||
|
if (json['data'] != null) {
|
||||||
|
data = <Data>[];
|
||||||
|
json['data'].forEach((v) {
|
||||||
|
data!.add(Data.fromJson(v));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
data['status'] = status;
|
||||||
|
data['status_code'] = statusCode;
|
||||||
|
data['message'] = message;
|
||||||
|
if (this.data != null) {
|
||||||
|
data['data'] = this.data!.map((v) => v.toJson()).toList();
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class Data {
|
||||||
|
int? id;
|
||||||
|
int? userId;
|
||||||
|
int? questionId;
|
||||||
|
int? answerId;
|
||||||
|
QuestionData? questionData;
|
||||||
|
AnswerData? answerData;
|
||||||
|
|
||||||
|
Data(
|
||||||
|
{this.id,
|
||||||
|
this.userId,
|
||||||
|
this.questionId,
|
||||||
|
this.answerId,
|
||||||
|
this.questionData,
|
||||||
|
this.answerData});
|
||||||
|
|
||||||
|
Data.fromJson(Map<String, dynamic> json) {
|
||||||
|
id = json['id'];
|
||||||
|
userId = json['user_id'];
|
||||||
|
questionId = json['question_id'];
|
||||||
|
answerId = json['answer_id'];
|
||||||
|
questionData = json['question_data'] != null
|
||||||
|
? QuestionData.fromJson(json['question_data'])
|
||||||
|
: null;
|
||||||
|
answerData = json['answer_data'] != null
|
||||||
|
? AnswerData.fromJson(json['answer_data'])
|
||||||
|
: null;
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
data['id'] = id;
|
||||||
|
data['user_id'] = userId;
|
||||||
|
data['question_id'] = questionId;
|
||||||
|
data['answer_id'] = answerId;
|
||||||
|
if (questionData != null) {
|
||||||
|
data['question_data'] = questionData!.toJson();
|
||||||
|
}
|
||||||
|
if (answerData != null) {
|
||||||
|
data['answer_data'] = answerData!.toJson();
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class QuestionData {
|
||||||
|
int? id;
|
||||||
|
String? question;
|
||||||
|
String? hint;
|
||||||
|
|
||||||
|
QuestionData({this.id, this.question, this.hint});
|
||||||
|
|
||||||
|
QuestionData.fromJson(Map<String, dynamic> json) {
|
||||||
|
id = json['id'];
|
||||||
|
question = json['question'];
|
||||||
|
hint = json['hint'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
data['id'] = id;
|
||||||
|
data['question'] = question;
|
||||||
|
data['hint'] = hint;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class AnswerData {
|
||||||
|
int? id;
|
||||||
|
String? answer;
|
||||||
|
|
||||||
|
AnswerData({this.id, this.answer});
|
||||||
|
|
||||||
|
AnswerData.fromJson(Map<String, dynamic> json) {
|
||||||
|
id = json['id'];
|
||||||
|
answer = json['answer'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
data['id'] = id;
|
||||||
|
data['answer'] = answer;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -35,7 +35,7 @@ class Data {
|
|||||||
int? id;
|
int? id;
|
||||||
String? question;
|
String? question;
|
||||||
String? isActive;
|
String? isActive;
|
||||||
|
String? hint;
|
||||||
String? createdAt;
|
String? createdAt;
|
||||||
String? updatedAt;
|
String? updatedAt;
|
||||||
List<Answer>? answer;
|
List<Answer>? answer;
|
||||||
@@ -43,6 +43,7 @@ class Data {
|
|||||||
Data(
|
Data(
|
||||||
{this.id,
|
{this.id,
|
||||||
this.question,
|
this.question,
|
||||||
|
this.hint,
|
||||||
this.isActive,
|
this.isActive,
|
||||||
this.createdAt,
|
this.createdAt,
|
||||||
this.updatedAt,
|
this.updatedAt,
|
||||||
@@ -52,7 +53,7 @@ class Data {
|
|||||||
id = json['id'];
|
id = json['id'];
|
||||||
question = json['question'];
|
question = json['question'];
|
||||||
isActive = json['is_active'];
|
isActive = json['is_active'];
|
||||||
|
hint = json['hint'];
|
||||||
createdAt = json['created_at'];
|
createdAt = json['created_at'];
|
||||||
updatedAt = json['updated_at'];
|
updatedAt = json['updated_at'];
|
||||||
if (json['answer'] != null) {
|
if (json['answer'] != null) {
|
||||||
@@ -68,7 +69,7 @@ class Data {
|
|||||||
data['id'] = id;
|
data['id'] = id;
|
||||||
data['question'] = question;
|
data['question'] = question;
|
||||||
data['is_active'] = isActive;
|
data['is_active'] = isActive;
|
||||||
|
data['hint'] = hint;
|
||||||
data['created_at'] = createdAt;
|
data['created_at'] = createdAt;
|
||||||
data['updated_at'] = updatedAt;
|
data['updated_at'] = updatedAt;
|
||||||
if (answer != null) {
|
if (answer != null) {
|
||||||
@@ -84,7 +85,6 @@ class Answer {
|
|||||||
String? answer;
|
String? answer;
|
||||||
int? points;
|
int? points;
|
||||||
String? isActive;
|
String? isActive;
|
||||||
|
|
||||||
String? createdAt;
|
String? createdAt;
|
||||||
String? updatedAt;
|
String? updatedAt;
|
||||||
|
|
||||||
|
|||||||
@@ -309,7 +309,7 @@ class _ShortTradeState extends State<ShortTrade> {
|
|||||||
date: callRecommendationsModel
|
date: callRecommendationsModel
|
||||||
.data!.activeCalls![index].createdAt!,
|
.data!.activeCalls![index].createdAt!,
|
||||||
premium:
|
premium:
|
||||||
"₹ ${callRecommendationsModel.data!.activeCalls![index].stopLoss}",
|
"₹ ${callRecommendationsModel.data!.activeCalls![index].currentPrice}",
|
||||||
price1:
|
price1:
|
||||||
"₹ ${callRecommendationsModel.data!.activeCalls![index].targetPrice}",
|
"₹ ${callRecommendationsModel.data!.activeCalls![index].targetPrice}",
|
||||||
stoploss:
|
stoploss:
|
||||||
@@ -425,7 +425,7 @@ class _ShortTradeState extends State<ShortTrade> {
|
|||||||
date: callRecommendationsModel
|
date: callRecommendationsModel
|
||||||
.data!.exitedCalls![index].createdAt!,
|
.data!.exitedCalls![index].createdAt!,
|
||||||
premium:
|
premium:
|
||||||
"₹ ${callRecommendationsModel.data!.exitedCalls![index].stopLoss}",
|
"₹ ${callRecommendationsModel.data!.exitedCalls![index].currentPrice}",
|
||||||
price1:
|
price1:
|
||||||
"₹ ${callRecommendationsModel.data!.exitedCalls![index].targetPrice}",
|
"₹ ${callRecommendationsModel.data!.exitedCalls![index].targetPrice}",
|
||||||
stoploss:
|
stoploss:
|
||||||
|
|||||||
@@ -245,7 +245,9 @@ class _SideMenuState extends State<SideMenu> {
|
|||||||
),
|
),
|
||||||
selected: true,
|
selected: true,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Get.toNamed(RouteName.kyc);
|
Get.toNamed(RouteName.kyc, arguments: {
|
||||||
|
"fromScreen": "sidemenu-flow",
|
||||||
|
});
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
@@ -276,7 +278,9 @@ class _SideMenuState extends State<SideMenu> {
|
|||||||
selected: true,
|
selected: true,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
setState(() {
|
setState(() {
|
||||||
Get.toNamed(RouteName.updateriskprofile);
|
Get.toNamed(RouteName.updateriskprofile, arguments: {
|
||||||
|
"fromScreen": "sidemenu-flow",
|
||||||
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -94,7 +94,9 @@ class _AddDetailsState extends State<AddDetails> {
|
|||||||
final resp = await AddDetailsAPI(updata).adddetailsApi();
|
final resp = await AddDetailsAPI(updata).adddetailsApi();
|
||||||
if (resp.status == ResponseStatus.SUCCESS) {
|
if (resp.status == ResponseStatus.SUCCESS) {
|
||||||
Get.back();
|
Get.back();
|
||||||
Get.toNamed(RouteName.kyc);
|
Get.toNamed(RouteName.kyc, arguments: {
|
||||||
|
"fromScreen": "login-flow",
|
||||||
|
});
|
||||||
} else if (resp.status == ResponseStatus.PRIVATE) {
|
} else if (resp.status == ResponseStatus.PRIVATE) {
|
||||||
Get.back();
|
Get.back();
|
||||||
String? message = resp.data['message'];
|
String? message = resp.data['message'];
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
import 'dart:ui';
|
import 'dart:ui';
|
||||||
|
|
||||||
|
import 'package:cached_network_image/cached_network_image.dart';
|
||||||
import 'package:dio/dio.dart';
|
import 'package:dio/dio.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
@@ -12,17 +13,42 @@ import 'package:traderscircuit/Utils/Common/CommonAppbar.dart';
|
|||||||
import 'package:traderscircuit/Utils/Common/CustomTextFormField.dart';
|
import 'package:traderscircuit/Utils/Common/CustomTextFormField.dart';
|
||||||
import 'package:traderscircuit/Utils/Common/commonBotton.dart';
|
import 'package:traderscircuit/Utils/Common/commonBotton.dart';
|
||||||
import 'package:traderscircuit/Utils/base_manager.dart';
|
import 'package:traderscircuit/Utils/base_manager.dart';
|
||||||
|
import 'package:traderscircuit/Utils/dialogs.dart';
|
||||||
import 'package:traderscircuit/Utils/text.dart';
|
import 'package:traderscircuit/Utils/text.dart';
|
||||||
import 'package:traderscircuit/Utils/utils.dart';
|
import 'package:traderscircuit/Utils/utils.dart';
|
||||||
|
import 'package:traderscircuit/model/KycModel/kyc_model.dart';
|
||||||
import 'package:traderscircuit/resources/routes/route_name.dart';
|
import 'package:traderscircuit/resources/routes/route_name.dart';
|
||||||
import 'package:traderscircuit/view/onBoarding/splashScreen1.dart';
|
import 'package:traderscircuit/view/onBoarding/splashScreen1.dart';
|
||||||
|
import 'package:traderscircuit/view_model/KycApi/kyc_api.dart';
|
||||||
import 'package:traderscircuit/view_model/Login/add_kyc_api.dart';
|
import 'package:traderscircuit/view_model/Login/add_kyc_api.dart';
|
||||||
|
|
||||||
import '../../controller/kyc_controller.dart';
|
import '../../controller/kyc_controller.dart';
|
||||||
import '../../view_model/RiskProfileApi/risk_profile_api.dart';
|
|
||||||
|
|
||||||
import 'package:path/path.dart' as path;
|
import 'package:path/path.dart' as path;
|
||||||
|
|
||||||
|
class AlphaNumericTextFormatter extends TextInputFormatter {
|
||||||
|
@override
|
||||||
|
TextEditingValue formatEditUpdate(
|
||||||
|
TextEditingValue oldValue, TextEditingValue newValue) {
|
||||||
|
final regExp = RegExp(r'^[a-zA-Z0-9]*$');
|
||||||
|
if (regExp.hasMatch(newValue.text)) {
|
||||||
|
return newValue;
|
||||||
|
}
|
||||||
|
return oldValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class UpperCaseTextFormatter extends TextInputFormatter {
|
||||||
|
@override
|
||||||
|
TextEditingValue formatEditUpdate(
|
||||||
|
TextEditingValue oldValue, TextEditingValue newValue) {
|
||||||
|
return TextEditingValue(
|
||||||
|
text: newValue.text.toUpperCase(),
|
||||||
|
selection: newValue.selection,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class Kyc extends StatefulWidget {
|
class Kyc extends StatefulWidget {
|
||||||
const Kyc({super.key});
|
const Kyc({super.key});
|
||||||
|
|
||||||
@@ -39,12 +65,21 @@ class _KycState extends State<Kyc> {
|
|||||||
|
|
||||||
KYCController kycController = Get.put(KYCController());
|
KYCController kycController = Get.put(KYCController());
|
||||||
|
|
||||||
|
String fromScreen = Get.arguments['fromScreen'];
|
||||||
|
|
||||||
var panFMulti;
|
var panFMulti;
|
||||||
var panBMulti;
|
var panBMulti;
|
||||||
var aadFMulti;
|
var aadFMulti;
|
||||||
var aadBMulti;
|
var aadBMulti;
|
||||||
|
|
||||||
_addKyc() async {
|
_addKyc() async {
|
||||||
|
if (kycController.panFrontImage.value.isEmpty ||
|
||||||
|
kycController.panBackImage.value.isEmpty ||
|
||||||
|
kycController.aadharFrontImage.value.isEmpty ||
|
||||||
|
kycController.aadharBackImage.value.isEmpty) {
|
||||||
|
utils.showToast("Please add images to proceed further");
|
||||||
|
return;
|
||||||
|
}
|
||||||
panFMulti = await MultipartFile.fromFile(
|
panFMulti = await MultipartFile.fromFile(
|
||||||
kycController.panFrontImage.value,
|
kycController.panFrontImage.value,
|
||||||
filename: path.basename(kycController.panFrontImage.value),
|
filename: path.basename(kycController.panFrontImage.value),
|
||||||
@@ -76,7 +111,9 @@ class _KycState extends State<Kyc> {
|
|||||||
final resp = await AddKycAPI(formdata).addkycApi();
|
final resp = await AddKycAPI(formdata).addkycApi();
|
||||||
if (resp.status == ResponseStatus.SUCCESS) {
|
if (resp.status == ResponseStatus.SUCCESS) {
|
||||||
Get.back();
|
Get.back();
|
||||||
Get.toNamed(RouteName.updateriskprofile);
|
Get.toNamed(RouteName.updateriskprofile, arguments: {
|
||||||
|
"fromScreen": "login-flow",
|
||||||
|
});
|
||||||
} else if (resp.status == ResponseStatus.PRIVATE) {
|
} else if (resp.status == ResponseStatus.PRIVATE) {
|
||||||
Get.back();
|
Get.back();
|
||||||
String? message = resp.data['message'];
|
String? message = resp.data['message'];
|
||||||
@@ -93,6 +130,26 @@ class _KycState extends State<Kyc> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
if (fromScreen == "sidemenu-flow") {
|
||||||
|
KycApi().getKycUserApi().then((value) {
|
||||||
|
GetKYCModel getKYCModel = GetKYCModel.fromJson(value.data);
|
||||||
|
pannumber.text = getKYCModel.data![0].panNumber!;
|
||||||
|
aadhaarnumber.text = getKYCModel.data![0].adharcardNumber!;
|
||||||
|
kycController.panFrontImage.value =
|
||||||
|
getKYCModel.data![0].pancardImageFront!;
|
||||||
|
kycController.panBackImage.value =
|
||||||
|
getKYCModel.data![0].pancardImageBack!;
|
||||||
|
kycController.aadharFrontImage.value =
|
||||||
|
getKYCModel.data![0].adharcardImageFront!;
|
||||||
|
kycController.aadharBackImage.value =
|
||||||
|
getKYCModel.data![0].adharcardImageBack!;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
super.initState();
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Obx(
|
return Obx(
|
||||||
@@ -122,17 +179,23 @@ class _KycState extends State<Kyc> {
|
|||||||
child: ListView(
|
child: ListView(
|
||||||
physics: const BouncingScrollPhysics(),
|
physics: const BouncingScrollPhysics(),
|
||||||
children: [
|
children: [
|
||||||
|
fromScreen == "sidemenu-flow"
|
||||||
|
? SizedBox()
|
||||||
|
: Row(
|
||||||
|
children: [
|
||||||
|
text18W500("Step 1 : Personal Information"),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
fromScreen == "sidemenu-flow"
|
||||||
|
? SizedBox()
|
||||||
|
: SizedBox(
|
||||||
|
height: 30.h,
|
||||||
|
),
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
text18W500("Step 1 : Personal Information"),
|
fromScreen == "sidemenu-flow"
|
||||||
],
|
? text18W400("View pan card image")
|
||||||
),
|
: text18W400("Upload pan card image"),
|
||||||
SizedBox(
|
|
||||||
height: 30.h,
|
|
||||||
),
|
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
text18W400("Upload pan card image"),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
@@ -185,33 +248,46 @@ class _KycState extends State<Kyc> {
|
|||||||
const EdgeInsets.symmetric(
|
const EdgeInsets.symmetric(
|
||||||
vertical: 20,
|
vertical: 20,
|
||||||
horizontal: 40),
|
horizontal: 40),
|
||||||
child: Image(
|
child: fromScreen ==
|
||||||
image: FileImage(
|
"sidemenu-flow"
|
||||||
File(
|
? CachedNetworkImage(
|
||||||
kycController
|
imageUrl: kycController
|
||||||
.panFrontImage.value,
|
.panFrontImage.value,
|
||||||
),
|
fit: BoxFit.cover,
|
||||||
),
|
width: Get.width,
|
||||||
fit: BoxFit.cover,
|
height: 50.h,
|
||||||
width: Get.width,
|
)
|
||||||
height: 50.h,
|
: Image(
|
||||||
),
|
image: FileImage(
|
||||||
|
File(
|
||||||
|
kycController
|
||||||
|
.panFrontImage
|
||||||
|
.value,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
width: Get.width,
|
||||||
|
height: 50.h,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
Positioned(
|
fromScreen == "sidemenu-flow"
|
||||||
top: 6,
|
? SizedBox()
|
||||||
right: 10,
|
: Positioned(
|
||||||
child: InkWell(
|
top: 6,
|
||||||
onTap: () {
|
right: 10,
|
||||||
kycController
|
child: InkWell(
|
||||||
.panFrontImage.value = "";
|
onTap: () {
|
||||||
},
|
kycController
|
||||||
child: SvgPicture.asset(
|
.panFrontImage
|
||||||
"assets/images/svg/cancel.svg",
|
.value = "";
|
||||||
width: 18,
|
},
|
||||||
height: 18,
|
child: SvgPicture.asset(
|
||||||
),
|
"assets/images/svg/cancel.svg",
|
||||||
),
|
width: 18,
|
||||||
)
|
height: 18,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
: Center(
|
: Center(
|
||||||
@@ -276,33 +352,46 @@ class _KycState extends State<Kyc> {
|
|||||||
const EdgeInsets.symmetric(
|
const EdgeInsets.symmetric(
|
||||||
vertical: 20,
|
vertical: 20,
|
||||||
horizontal: 40),
|
horizontal: 40),
|
||||||
child: Image(
|
child: fromScreen ==
|
||||||
image: FileImage(
|
"sidemenu-flow"
|
||||||
File(
|
? CachedNetworkImage(
|
||||||
kycController
|
imageUrl: kycController
|
||||||
.panBackImage.value,
|
.panBackImage.value,
|
||||||
),
|
fit: BoxFit.cover,
|
||||||
),
|
width: Get.width,
|
||||||
fit: BoxFit.cover,
|
height: 50.h,
|
||||||
width: Get.width,
|
)
|
||||||
height: 50.h,
|
: Image(
|
||||||
),
|
image: FileImage(
|
||||||
|
File(
|
||||||
|
kycController
|
||||||
|
.panBackImage
|
||||||
|
.value,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
width: Get.width,
|
||||||
|
height: 50.h,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
Positioned(
|
fromScreen == "sidemenu-flow"
|
||||||
top: 6,
|
? SizedBox()
|
||||||
right: 10,
|
: Positioned(
|
||||||
child: InkWell(
|
top: 6,
|
||||||
onTap: () {
|
right: 10,
|
||||||
kycController
|
child: InkWell(
|
||||||
.panBackImage.value = "";
|
onTap: () {
|
||||||
},
|
kycController
|
||||||
child: SvgPicture.asset(
|
.panBackImage
|
||||||
"assets/images/svg/cancel.svg",
|
.value = "";
|
||||||
width: 18,
|
},
|
||||||
height: 18,
|
child: SvgPicture.asset(
|
||||||
),
|
"assets/images/svg/cancel.svg",
|
||||||
),
|
width: 18,
|
||||||
)
|
height: 18,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
: Center(
|
: Center(
|
||||||
@@ -338,7 +427,15 @@ class _KycState extends State<Kyc> {
|
|||||||
height: 15.h,
|
height: 15.h,
|
||||||
),
|
),
|
||||||
CustomTextFormField(
|
CustomTextFormField(
|
||||||
|
enabled:
|
||||||
|
fromScreen == "sidemenu-flow" ? false : true,
|
||||||
|
textCapV: TextCapitalization.characters,
|
||||||
textEditingController: pannumber,
|
textEditingController: pannumber,
|
||||||
|
inputFormatters: [
|
||||||
|
AlphaNumericTextFormatter(),
|
||||||
|
UpperCaseTextFormatter(),
|
||||||
|
LengthLimitingTextInputFormatter(10),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 15.h,
|
height: 15.h,
|
||||||
@@ -352,15 +449,24 @@ class _KycState extends State<Kyc> {
|
|||||||
height: 15.h,
|
height: 15.h,
|
||||||
),
|
),
|
||||||
CustomTextFormField(
|
CustomTextFormField(
|
||||||
|
enabled:
|
||||||
|
fromScreen == "sidemenu-flow" ? false : true,
|
||||||
textEditingController: aadhaarnumber,
|
textEditingController: aadhaarnumber,
|
||||||
texttype: TextInputType.phone,
|
texttype: TextInputType.phone,
|
||||||
|
inputFormatters: [
|
||||||
|
FilteringTextInputFormatter.allow(
|
||||||
|
RegExp(r'[0-9]')),
|
||||||
|
LengthLimitingTextInputFormatter(12),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 30.h,
|
height: 30.h,
|
||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
text18W400("Upload Aadhar card image"),
|
fromScreen == "sidemenu-flow"
|
||||||
|
? text18W400("View Aadhar card image")
|
||||||
|
: text18W400("Upload Aadhar card image"),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
@@ -413,33 +519,47 @@ class _KycState extends State<Kyc> {
|
|||||||
const EdgeInsets.symmetric(
|
const EdgeInsets.symmetric(
|
||||||
vertical: 20,
|
vertical: 20,
|
||||||
horizontal: 40),
|
horizontal: 40),
|
||||||
child: Image(
|
child:
|
||||||
image: FileImage(
|
fromScreen == "sidemenu-flow"
|
||||||
File(
|
? CachedNetworkImage(
|
||||||
kycController
|
imageUrl: kycController
|
||||||
.aadharFrontImage.value,
|
.aadharFrontImage
|
||||||
),
|
.value,
|
||||||
),
|
fit: BoxFit.cover,
|
||||||
fit: BoxFit.cover,
|
width: Get.width,
|
||||||
width: Get.width,
|
height: 50.h,
|
||||||
height: 50.h,
|
)
|
||||||
),
|
: Image(
|
||||||
|
image: FileImage(
|
||||||
|
File(
|
||||||
|
kycController
|
||||||
|
.aadharFrontImage
|
||||||
|
.value,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
width: Get.width,
|
||||||
|
height: 50.h,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
Positioned(
|
fromScreen == "sidemenu-flow"
|
||||||
top: 6,
|
? SizedBox()
|
||||||
right: 10,
|
: Positioned(
|
||||||
child: InkWell(
|
top: 6,
|
||||||
onTap: () {
|
right: 10,
|
||||||
kycController.aadharFrontImage
|
child: InkWell(
|
||||||
.value = "";
|
onTap: () {
|
||||||
},
|
kycController
|
||||||
child: SvgPicture.asset(
|
.aadharFrontImage
|
||||||
"assets/images/svg/cancel.svg",
|
.value = "";
|
||||||
width: 18,
|
},
|
||||||
height: 18,
|
child: SvgPicture.asset(
|
||||||
),
|
"assets/images/svg/cancel.svg",
|
||||||
),
|
width: 18,
|
||||||
)
|
height: 18,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
: Center(
|
: Center(
|
||||||
@@ -505,33 +625,47 @@ class _KycState extends State<Kyc> {
|
|||||||
const EdgeInsets.symmetric(
|
const EdgeInsets.symmetric(
|
||||||
vertical: 20,
|
vertical: 20,
|
||||||
horizontal: 40),
|
horizontal: 40),
|
||||||
child: Image(
|
child:
|
||||||
image: FileImage(
|
fromScreen == "sidemenu-flow"
|
||||||
File(
|
? CachedNetworkImage(
|
||||||
kycController
|
imageUrl: kycController
|
||||||
.aadharBackImage.value,
|
.aadharBackImage
|
||||||
),
|
.value,
|
||||||
),
|
fit: BoxFit.cover,
|
||||||
fit: BoxFit.cover,
|
width: Get.width,
|
||||||
width: Get.width,
|
height: 50.h,
|
||||||
height: 50.h,
|
)
|
||||||
),
|
: Image(
|
||||||
|
image: FileImage(
|
||||||
|
File(
|
||||||
|
kycController
|
||||||
|
.aadharBackImage
|
||||||
|
.value,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
width: Get.width,
|
||||||
|
height: 50.h,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
Positioned(
|
fromScreen == "sidemenu-flow"
|
||||||
top: 6,
|
? SizedBox()
|
||||||
right: 10,
|
: Positioned(
|
||||||
child: InkWell(
|
top: 6,
|
||||||
onTap: () {
|
right: 10,
|
||||||
kycController.aadharBackImage
|
child: InkWell(
|
||||||
.value = "";
|
onTap: () {
|
||||||
},
|
kycController
|
||||||
child: SvgPicture.asset(
|
.aadharBackImage
|
||||||
"assets/images/svg/cancel.svg",
|
.value = "";
|
||||||
width: 18,
|
},
|
||||||
height: 18,
|
child: SvgPicture.asset(
|
||||||
),
|
"assets/images/svg/cancel.svg",
|
||||||
),
|
width: 18,
|
||||||
)
|
height: 18,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
: Center(
|
: Center(
|
||||||
@@ -558,13 +692,15 @@ class _KycState extends State<Kyc> {
|
|||||||
SizedBox(
|
SizedBox(
|
||||||
height: 70.h,
|
height: 70.h,
|
||||||
),
|
),
|
||||||
CommonBtn(
|
fromScreen == "sidemenu-flow"
|
||||||
text: "Next",
|
? SizedBox()
|
||||||
onTap: () {
|
: CommonBtn(
|
||||||
_addKyc();
|
text: "Next",
|
||||||
// Get.toNamed(RouteName.updateriskprofile);
|
onTap: () {
|
||||||
},
|
_addKyc();
|
||||||
),
|
// Get.toNamed(RouteName.updateriskprofile);
|
||||||
|
},
|
||||||
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 10.h,
|
height: 10.h,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -8,7 +8,9 @@ import 'package:get/get.dart' hide FormData;
|
|||||||
import 'package:traderscircuit/Utils/Common/CommonAppbar.dart';
|
import 'package:traderscircuit/Utils/Common/CommonAppbar.dart';
|
||||||
import 'package:traderscircuit/Utils/dialogs.dart';
|
import 'package:traderscircuit/Utils/dialogs.dart';
|
||||||
import 'package:traderscircuit/Utils/text.dart';
|
import 'package:traderscircuit/Utils/text.dart';
|
||||||
|
import 'package:traderscircuit/Utils/utils.dart';
|
||||||
import 'package:traderscircuit/controller/risk_profile_controller.dart';
|
import 'package:traderscircuit/controller/risk_profile_controller.dart';
|
||||||
|
import 'package:traderscircuit/model/RiskProfileModel/get_user_risk_profile_model.dart';
|
||||||
import 'package:traderscircuit/model/RiskProfileModel/risk_profile_ques_answer_model.dart';
|
import 'package:traderscircuit/model/RiskProfileModel/risk_profile_ques_answer_model.dart';
|
||||||
import 'package:traderscircuit/view/onBoarding/splashScreen1.dart';
|
import 'package:traderscircuit/view/onBoarding/splashScreen1.dart';
|
||||||
|
|
||||||
@@ -32,6 +34,8 @@ class _UpdateRiskProfileState extends State<UpdateRiskProfile> {
|
|||||||
List<int> answerIdList = [];
|
List<int> answerIdList = [];
|
||||||
List<Map<String, List<String>>> dropHeader = [];
|
List<Map<String, List<String>>> dropHeader = [];
|
||||||
|
|
||||||
|
String fromScreen = Get.arguments["fromScreen"];
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
RiskProfileApi().getRiskProfileData().then((value) {
|
RiskProfileApi().getRiskProfileData().then((value) {
|
||||||
@@ -47,8 +51,23 @@ class _UpdateRiskProfileState extends State<UpdateRiskProfile> {
|
|||||||
dropHeader.add({a.question!: titleTxt});
|
dropHeader.add({a.question!: titleTxt});
|
||||||
}
|
}
|
||||||
|
|
||||||
log(dropHeader.toString());
|
if (fromScreen == "sidemenu-flow") {
|
||||||
isLoading.value = false;
|
riskProfileController.selectedData.clear();
|
||||||
|
RiskProfileApi().getUserRiskProfileData().then((value) {
|
||||||
|
GetUserRiskProfileModel getUserRiskProfileModel =
|
||||||
|
GetUserRiskProfileModel.fromJson(value.data);
|
||||||
|
for (var a in getUserRiskProfileModel.data!) {
|
||||||
|
questionIdList.add(a.questionId!);
|
||||||
|
answerIdList.add(a.answerId!);
|
||||||
|
riskProfileController.selectedData
|
||||||
|
.add({a.questionData!.question!: a.answerData!.answer!});
|
||||||
|
}
|
||||||
|
isLoading.value = false;
|
||||||
|
setState(() {});
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
isLoading.value = false;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
super.initState();
|
super.initState();
|
||||||
}
|
}
|
||||||
@@ -98,6 +117,9 @@ class _UpdateRiskProfileState extends State<UpdateRiskProfile> {
|
|||||||
CommonBtn(
|
CommonBtn(
|
||||||
text: "Submit",
|
text: "Submit",
|
||||||
onTap: () {
|
onTap: () {
|
||||||
|
log(riskProfileController
|
||||||
|
.selectedData.length
|
||||||
|
.toString());
|
||||||
questionIdList.clear();
|
questionIdList.clear();
|
||||||
answerIdList.clear();
|
answerIdList.clear();
|
||||||
if (riskProfileController
|
if (riskProfileController
|
||||||
@@ -109,6 +131,7 @@ class _UpdateRiskProfileState extends State<UpdateRiskProfile> {
|
|||||||
utils.showToast(
|
utils.showToast(
|
||||||
"All Fields Required");
|
"All Fields Required");
|
||||||
} else {
|
} else {
|
||||||
|
Utils.loader();
|
||||||
// Iterate through selected data and match with provided data
|
// Iterate through selected data and match with provided data
|
||||||
for (var entry
|
for (var entry
|
||||||
in riskProfileController
|
in riskProfileController
|
||||||
@@ -157,6 +180,7 @@ class _UpdateRiskProfileState extends State<UpdateRiskProfile> {
|
|||||||
jsonEncode(answerIdList),
|
jsonEncode(answerIdList),
|
||||||
}))
|
}))
|
||||||
.then((value) {
|
.then((value) {
|
||||||
|
Get.back();
|
||||||
Map<String, dynamic>
|
Map<String, dynamic>
|
||||||
responseData =
|
responseData =
|
||||||
Map<String, dynamic>.from(
|
Map<String, dynamic>.from(
|
||||||
@@ -179,7 +203,10 @@ class _UpdateRiskProfileState extends State<UpdateRiskProfile> {
|
|||||||
.riskProfileQuestionAnswerModel
|
.riskProfileQuestionAnswerModel
|
||||||
.data![index]
|
.data![index]
|
||||||
.question!,
|
.question!,
|
||||||
"Select your goal",
|
riskProfileController
|
||||||
|
.riskProfileQuestionAnswerModel
|
||||||
|
.data![index]
|
||||||
|
.hint!,
|
||||||
index);
|
index);
|
||||||
})),
|
})),
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -84,9 +84,13 @@ class _VerifyOTPState extends State<VerifyOTP> {
|
|||||||
isProfileUpdated == 0
|
isProfileUpdated == 0
|
||||||
? Get.toNamed(RouteName.adddetails)
|
? Get.toNamed(RouteName.adddetails)
|
||||||
: isKycUpdated == 0
|
: isKycUpdated == 0
|
||||||
? Get.toNamed(RouteName.kyc)
|
? Get.toNamed(RouteName.kyc, arguments: {
|
||||||
|
"fromScreen": "login-flow",
|
||||||
|
})
|
||||||
: isriskProfileUpdated == 0
|
: isriskProfileUpdated == 0
|
||||||
? Get.toNamed(RouteName.updateriskprofile)
|
? Get.toNamed(RouteName.updateriskprofile, arguments: {
|
||||||
|
"fromScreen": "login-flow",
|
||||||
|
})
|
||||||
: Get.toNamed(RouteName.mainscreen);
|
: Get.toNamed(RouteName.mainscreen);
|
||||||
|
|
||||||
// Get.toNamed(RouteName.mainscreen);
|
// Get.toNamed(RouteName.mainscreen);
|
||||||
|
|||||||
21
lib/view_model/KycApi/kyc_api.dart
Normal file
21
lib/view_model/KycApi/kyc_api.dart
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
import 'package:traderscircuit/Utils/api_urls.dart';
|
||||||
|
import 'package:traderscircuit/Utils/base_manager.dart';
|
||||||
|
import 'package:traderscircuit/data/network/network_api_services.dart';
|
||||||
|
|
||||||
|
class KycApi {
|
||||||
|
Future<ResponseData<dynamic>> getKycUserApi() async {
|
||||||
|
final response =
|
||||||
|
await NetworkApiServices().getApi(ApiUrls.getKyc, isAuth: true);
|
||||||
|
if (response.status == ResponseStatus.SUCCESS) {
|
||||||
|
Map<String, dynamic> responseData =
|
||||||
|
Map<String, dynamic>.from(response.data);
|
||||||
|
if (responseData['status'] == "success") {
|
||||||
|
return response;
|
||||||
|
} else {
|
||||||
|
return ResponseData<dynamic>(
|
||||||
|
responseData['message'], ResponseStatus.FAILED);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -10,7 +10,7 @@ class RiskProfileApi {
|
|||||||
Future<ResponseData<dynamic>> getRiskProfileData() async {
|
Future<ResponseData<dynamic>> getRiskProfileData() async {
|
||||||
final response = await NetworkApiServices()
|
final response = await NetworkApiServices()
|
||||||
.getApi(ApiUrls.getRiskProfileQuestionAnswerApi, isAuth: true);
|
.getApi(ApiUrls.getRiskProfileQuestionAnswerApi, isAuth: true);
|
||||||
log(response.data.toString());
|
// log(response.data.toString());
|
||||||
if (response.status == ResponseStatus.SUCCESS) {
|
if (response.status == ResponseStatus.SUCCESS) {
|
||||||
Map<String, dynamic> responseData =
|
Map<String, dynamic> responseData =
|
||||||
Map<String, dynamic>.from(response.data);
|
Map<String, dynamic>.from(response.data);
|
||||||
@@ -42,4 +42,22 @@ class RiskProfileApi {
|
|||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<ResponseData<dynamic>> getUserRiskProfileData() async {
|
||||||
|
final response = await NetworkApiServices().getApi(
|
||||||
|
ApiUrls.getRiskProfile,
|
||||||
|
);
|
||||||
|
// log(response.data.toString());
|
||||||
|
if (response.status == ResponseStatus.SUCCESS) {
|
||||||
|
Map<String, dynamic> responseData =
|
||||||
|
Map<String, dynamic>.from(response.data);
|
||||||
|
if (responseData['status'] == "success") {
|
||||||
|
return response;
|
||||||
|
} else {
|
||||||
|
return ResponseData<dynamic>(
|
||||||
|
responseData['message'], ResponseStatus.FAILED);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return response;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
58
pubspec.lock
58
pubspec.lock
@@ -616,6 +616,30 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.4.9"
|
version: "0.4.9"
|
||||||
|
leak_tracker:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: leak_tracker
|
||||||
|
sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "10.0.0"
|
||||||
|
leak_tracker_flutter_testing:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: leak_tracker_flutter_testing
|
||||||
|
sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.1"
|
||||||
|
leak_tracker_testing:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: leak_tracker_testing
|
||||||
|
sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.1"
|
||||||
lints:
|
lints:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -684,26 +708,26 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: matcher
|
name: matcher
|
||||||
sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e"
|
sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.12.16"
|
version: "0.12.16+1"
|
||||||
material_color_utilities:
|
material_color_utilities:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: material_color_utilities
|
name: material_color_utilities
|
||||||
sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41"
|
sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.5.0"
|
version: "0.8.0"
|
||||||
meta:
|
meta:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: meta
|
name: meta
|
||||||
sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e
|
sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.10.0"
|
version: "1.11.0"
|
||||||
mime:
|
mime:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -748,10 +772,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: path
|
name: path
|
||||||
sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917"
|
sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.8.3"
|
version: "1.9.0"
|
||||||
path_drawing:
|
path_drawing:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -1302,6 +1326,14 @@ packages:
|
|||||||
url: "https://github.com/kishan06/videoPlayerKB.git"
|
url: "https://github.com/kishan06/videoPlayerKB.git"
|
||||||
source: git
|
source: git
|
||||||
version: "0.0.2"
|
version: "0.0.2"
|
||||||
|
vm_service:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: vm_service
|
||||||
|
sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "13.0.0"
|
||||||
wakelock:
|
wakelock:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -1342,14 +1374,6 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.2.1"
|
version: "0.2.1"
|
||||||
web:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: web
|
|
||||||
sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "0.3.0"
|
|
||||||
win32:
|
win32:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -1375,7 +1399,5 @@ packages:
|
|||||||
source: hosted
|
source: hosted
|
||||||
version: "6.3.0"
|
version: "6.3.0"
|
||||||
sdks:
|
sdks:
|
||||||
|
|
||||||
dart: ">=3.2.0-0 <4.0.0"
|
dart: ">=3.2.0-0 <4.0.0"
|
||||||
flutter: ">=3.16.0"
|
flutter: ">=3.16.0"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user