This commit is contained in:
jayesh
2024-07-12 09:14:15 +05:30
parent efb9f7c4c6
commit 2345ce8496
23 changed files with 292 additions and 302 deletions

View File

@@ -12,10 +12,10 @@ import 'package:tanami_app/features/MainScreens/Wallet/presentation/pages/deposi
import 'package:tanami_app/features/MainScreens/Wallet/presentation/pages/deposit/preview.dart';
import 'package:tanami_app/features/MainScreens/Wallet/presentation/pages/deposit/select_deposit_method_screen.dart';
import 'package:tanami_app/features/MainScreens/Wallet/presentation/pages/filter_screen.dart';
import 'package:tanami_app/features/MainScreens/Wallet/presentation/pages/walletDetails.dart';
import 'package:tanami_app/features/MainScreens/Wallet/presentation/pages/wallet_details.dart';
import 'package:tanami_app/features/MainScreens/Wallet/presentation/pages/withdrawal/confirmation.dart';
import 'package:tanami_app/features/MainScreens/Wallet/presentation/pages/withdrawal/preview.dart';
import 'package:tanami_app/features/MainScreens/Wallet/presentation/pages/withdrawal/withdrawalScreen.dart';
import 'package:tanami_app/features/MainScreens/Wallet/presentation/pages/withdrawal/withdrawal_screen.dart';
import 'package:tanami_app/features/biometric/presentation/pages/biometric_screen.dart';
import 'package:tanami_app/features/changePassword/presentation/pages/change_password_screen.dart';
import 'package:tanami_app/features/contactAdmin/presentation/pages/contact_admin_screen.dart';

View File

@@ -169,106 +169,100 @@ class DepositLayout extends StatelessWidget {
],
),
),
Container(
// decoration: BoxDecoration(
// color: const Color(0xFFD8D8D8).withOpacity(0.4),
// ),
child: Padding(
padding: const EdgeInsets.symmetric(
vertical: 16.0, horizontal: 12.0),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
'SAR',
Padding(
padding: const EdgeInsets.symmetric(
vertical: 16.0, horizontal: 12.0),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
'SAR',
style: GoogleFonts.dmSans(
color: const Color(0xFF363636),
fontSize: 15.sp,
fontWeight: FontWeight.w400,
),
),
SizedBox(
width: 12.w,
),
SizedBox(
width: 280.w,
child: TextFormField(
inputFormatters: [
CommaTextInputFormatter(),
FilteringTextInputFormatter.deny(
RegExp(r'\s')),
LengthLimitingTextInputFormatter(20),
],
validator: (value) {
if (depositPaymentBloc
.amountController.text.isEmpty) {
return localizations.translate(
AppText.pleaseEnterAmountText);
}
return null;
},
onChanged: (value) {
depositPaymentBloc
.add(FormTextChanged(text: value));
},
controller: depositPaymentBloc.amountController,
cursorColor: Colors.black,
keyboardType: TextInputType.number,
textAlign: TextAlign.center,
style: GoogleFonts.dmSans(
color: const Color(0xFF363636),
fontSize: 15.sp,
color: Colors.black,
fontSize: 16.sp,
fontWeight: FontWeight.w400,
),
),
SizedBox(
width: 12.w,
),
SizedBox(
width: 280.w,
child: TextFormField(
inputFormatters: [
CommaTextInputFormatter(),
FilteringTextInputFormatter.deny(
RegExp(r'\s')),
LengthLimitingTextInputFormatter(20),
],
validator: (value) {
if (depositPaymentBloc
.amountController.text.isEmpty) {
return localizations.translate(
AppText.pleaseEnterAmountText);
}
return null;
},
onChanged: (value) {
depositPaymentBloc
.add(FormTextChanged(text: value));
},
controller:
depositPaymentBloc.amountController,
cursorColor: Colors.black,
keyboardType: TextInputType.number,
textAlign: TextAlign.center,
style: GoogleFonts.dmSans(
color: Colors.black,
decoration: InputDecoration(
hintText: '1000',
hintStyle: GoogleFonts.dmSans(
color: const Color(0xFFC6C6C6),
fontSize: 16.sp,
fontWeight: FontWeight.w400,
),
decoration: InputDecoration(
hintText: '1000',
hintStyle: GoogleFonts.dmSans(
color: const Color(0xFFC6C6C6),
fontSize: 16.sp,
fontWeight: FontWeight.w400,
),
labelStyle:
const TextStyle(color: Colors.black),
contentPadding: const EdgeInsets.symmetric(
vertical: 15, horizontal: 10),
filled: true,
fillColor: Colors.white,
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
borderSide: const BorderSide(
color: Colors.white, width: 1),
),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
borderSide: const BorderSide(
color: Colors.white, width: 1),
),
disabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
borderSide: const BorderSide(
color: Colors.white, width: 1),
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
borderSide: const BorderSide(
color: Colors.white, width: 1),
),
errorBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
borderSide: const BorderSide(
color: Colors.red, width: 1),
),
focusedErrorBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
borderSide: const BorderSide(
color: Colors.red, width: 1),
),
labelStyle:
const TextStyle(color: Colors.black),
contentPadding: const EdgeInsets.symmetric(
vertical: 15, horizontal: 10),
filled: true,
fillColor: Colors.white,
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
borderSide: const BorderSide(
color: Colors.white, width: 1),
),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
borderSide: const BorderSide(
color: Colors.white, width: 1),
),
disabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
borderSide: const BorderSide(
color: Colors.white, width: 1),
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
borderSide: const BorderSide(
color: Colors.white, width: 1),
),
errorBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
borderSide: const BorderSide(
color: Colors.red, width: 1),
),
focusedErrorBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
borderSide: const BorderSide(
color: Colors.red, width: 1),
),
),
),
],
),
),
],
),
),
// Container(

View File

@@ -1,37 +0,0 @@
abstract class OTPEvent {
const OTPEvent();
List<Object> get props => [];
}
class RequestOTP extends OTPEvent {
final Map<String, dynamic> OTPRequestData;
RequestOTP(this.OTPRequestData);
@override
List<Object> get props => [OTPRequestData];
}
class VerifyOTP extends OTPEvent {
VerifyOTP();
}
abstract class OTPState{}
class OTPInitial extends OTPState {}
class OTPLoading extends OTPState {}
class OTPLoaded extends OTPState {}
class OTPFailed extends OTPState {
final String failedmessage;
OTPFailed(this.failedmessage);
}
class OTPError extends OTPState {
final String errormessage;
OTPError(this.errormessage);
}

View File

@@ -0,0 +1,27 @@
import 'package:bloc/bloc.dart';
import 'package:tanami_app/features/countrySelection/bloc/GetCountry/get_country_event.dart';
import '../../../../Api_Helper/base_manager.dart';
import '../../domain/model/get_country_model.dart';
import '../../domain/repositories/get_country_api.dart';
import 'get_country_state.dart';
class GetCountryBlock extends Bloc<GetCountryEvent, GetCountryState> {
GetCountryBlock() : super(CountryInitial()) {
on<GetCountry>(mapEventToState);
}
Future<void> mapEventToState(
GetCountry event, Emitter<GetCountryState> emit) async {
emit(CountryLoading());
try {
ResponseData response = await GetCountryAPI().getcountryAPI();
if (response.status == ResponseStatus.SUCCESS) {
GetCountryModel countryModel = GetCountryModel.fromJson(response.data);
emit(CountryLoaded(countryModel));
}
print("//");
} catch (e) {
emit(CountryError("Oops Something went wrong"));
}
}
}

View File

@@ -0,0 +1,9 @@
abstract class GetCountryEvent {
const GetCountryEvent();
get props => [];
}
class GetCountry extends GetCountryEvent {
GetCountry();
}

View File

@@ -1,17 +1,7 @@
import '../../domain/model/GetCountry_model.dart';
import '../../domain/model/get_country_model.dart';
abstract class GetCountryEvent {
const GetCountryEvent();
abstract class GetCountryState {}
get props => [];
}
class GetCountry extends GetCountryEvent {
GetCountry();
}
abstract class GetCountryState{}
// Define states
//enum GetCountryState { initial, loading, success, failure, error }
class CountryInitial extends GetCountryState {}
@@ -28,4 +18,4 @@ class CountryError extends GetCountryState {
final String message;
CountryError(this.message);
}
}

View File

@@ -1,30 +0,0 @@
import 'package:bloc/bloc.dart';
import 'package:tanami_app/features/countrySelection/bloc/GetCountry/getcountryevent_bloc.dart';
import '../../../../Api_Helper/base_manager.dart';
import '../../domain/model/GetCountry_model.dart';
import 'GetCountryAPI.dart';
class GetCountryBlock extends Bloc<GetCountryEvent, GetCountryState> {
GetCountryBlock() : super(CountryInitial()) {
on<GetCountry>(mapEventToState);
}
Future<void> mapEventToState(
GetCountry event, Emitter<GetCountryState> emit) async {
if (event is GetCountry) {
emit(CountryLoading());
try {
ResponseData response = await GetCountryAPI().getcountryAPI();
if (response.status == ResponseStatus.SUCCESS) {
GetCountryModel countryModel =
GetCountryModel.fromJson(response.data);
emit(CountryLoaded(countryModel));
}
print("//");
} catch (e) {
emit(CountryError("Oops Something went wrong"));
}
}
}
}

View File

@@ -1,20 +1,19 @@
class GetCountryModel {
List<Data>? data;
GetCountryModel({ this.data});
GetCountryModel({this.data});
GetCountryModel.fromJson(Map<String, dynamic> json) {
if (json['data'] != null) {
data = <Data>[];
json['data'].forEach((v) {
data!.add(new Data.fromJson(v));
data!.add(Data.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
final Map<String, dynamic> data = <String, dynamic>{};
if (this.data != null) {
data['data'] = this.data!.map((v) => v.toJson()).toList();
}
@@ -28,10 +27,10 @@ class Data {
String? countryCode;
String? isdCode;
String? flagIcon;
Null? currencyXid;
Null currencyXid;
bool? isActive;
Null? createdBy;
Null? modifiedBy;
Null createdBy;
Null modifiedBy;
Data(
{this.id,
@@ -57,16 +56,16 @@ class Data {
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['countryName'] = this.countryName;
data['countryCode'] = this.countryCode;
data['isdCode'] = this.isdCode;
data['flagIcon'] = this.flagIcon;
data['currency_xid'] = this.currencyXid;
data['isActive'] = this.isActive;
data['createdBy'] = this.createdBy;
data['modifiedBy'] = this.modifiedBy;
final Map<String, dynamic> data = <String, dynamic>{};
data['id'] = id;
data['countryName'] = countryName;
data['countryCode'] = countryCode;
data['isdCode'] = isdCode;
data['flagIcon'] = flagIcon;
data['currency_xid'] = currencyXid;
data['isActive'] = isActive;
data['createdBy'] = createdBy;
data['modifiedBy'] = modifiedBy;
return data;
}
}

View File

@@ -4,12 +4,12 @@ import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:gap/gap.dart';
import 'package:tanami_app/core/styles/app_color.dart';
import 'package:tanami_app/core/utils/constant/country_flag_data.dart';
import 'package:tanami_app/features/countrySelection/bloc/GetCountry/getcountry_bloc.dart';
import 'package:tanami_app/features/countrySelection/bloc/GetCountry/getcountryevent_bloc.dart';
import 'package:tanami_app/features/countrySelection/bloc/GetCountry/get_country_bloc.dart';
import 'package:tanami_app/features/countrySelection/bloc/GetCountry/get_country_event.dart';
import 'package:tanami_app/shared/components/text_widget.dart';
import '../../../../shared/api/api_endpoints.dart';
import '../../bloc/GetCountry/get_country_state.dart';
import '../../bloc/choose_country_bloc.dart';
import '../../bloc/choose_country_event.dart';
import '../../bloc/choose_country_state.dart';
@@ -30,11 +30,11 @@ class CountrySelectionList extends StatelessWidget {
return BlocConsumer<GetCountryBlock, GetCountryState>(
listener: (context, state) {
if (state == CountryLoaded) {
if (state is CountryLoaded) {
const SnackBar(content: Text("Successfully fetch"));
} else if (state == CountryError) {
} else if (state is CountryError) {
const SnackBar(content: Text("error while fetching data"));
Future.delayed(Duration(milliseconds: 3), () {
Future.delayed(const Duration(milliseconds: 3), () {
context.read<GetCountryBlock>().add(GetCountry());
});
} else {
@@ -43,7 +43,7 @@ class CountrySelectionList extends StatelessWidget {
}, builder: (context, state) {
print(state);
if (state is CountryLoading) {
return Center(child: CircularProgressIndicator());
return const Center(child: CircularProgressIndicator());
} else if (state is CountryLoaded) {
return ListView.builder(
itemCount: state.countryModel.data?.length ?? 0,
@@ -54,26 +54,28 @@ class CountrySelectionList extends StatelessWidget {
title: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
SizedBox(
height: 24.h,
width: 24.w,
child: ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(100)),
borderRadius:
const BorderRadius.all(Radius.circular(100)),
child: CachedNetworkImage(
maxHeightDiskCache: 200,
maxWidthDiskCache: 200,
cacheKey: country.countryName,
key: UniqueKey(),
imageUrl: "${ApiEndpoints.base}${country.flagIcon}",
imageUrl:
"${ApiEndpoints.base}${country.flagIcon}",
height: 24.h,
width: 24.w,
placeholder: (context, url) => Container(
placeholder: (context, url) => SizedBox(
height: 24.h,
width: 24.w,
child: CircularProgressIndicator(),
child: const CircularProgressIndicator(),
),
errorWidget: (context, url, error) =>
Icon(Icons.error),
const Icon(Icons.error),
fit: BoxFit.cover),
),
),
@@ -103,7 +105,8 @@ class CountrySelectionList extends StatelessWidget {
} else if (state is CountryError) {
return Center(child: Text(state.message));
} else {
return Center(child: Text('Press button to fetch country data'));
return const Center(
child: Text('Press button to fetch country data'));
}
});
},

View File

@@ -1,30 +1,29 @@
import 'package:bloc/bloc.dart';
import 'package:tanami_app/features/OTP/bloc/OTPStateEvent.dart';
import '../../../Api_Helper/base_manager.dart';
import '../Repository/OTP_API.dart';
import '../domain/Repository/otp_api.dart';
import 'otp_event.dart';
import 'otp_state.dart';
class OTPBloc extends Bloc<OTPEvent, OTPState> {
OTPBloc() : super (OTPInitial()) {
on<RequestOTP>(RequestOTPCall);
OTPBloc() : super(OTPInitial()) {
on<RequestOTP>(requestOTPCall);
// on<VerifyOTP>(VerifyOTPCall);
}
Future<void> RequestOTPCall(RequestOTP event, Emitter<OTPState> emit) async {
if (event is RequestOTP) {
emit(OTPLoading());
final otprequestdata = event.OTPRequestData;
Future<void> requestOTPCall(RequestOTP event, Emitter<OTPState> emit) async {
emit(OTPLoading());
final otprequestdata = event.OTPRequestData;
try {
ResponseData response = await OTPAPI().RequestOTP(otprequestdata);
if (response.status == ResponseStatus.SUCCESS) {
emit(OTPLoaded());
} else {
emit(OTPFailed("Oops something went wrong"));
}
print("//");
} catch (e) {
emit(OTPError("Oops something went wrong"));
try {
ResponseData response = await OTPAPI().requestOTP(otprequestdata);
if (response.status == ResponseStatus.SUCCESS) {
emit(OTPLoaded());
} else {
emit(OTPFailed("Oops something went wrong"));
}
print("//");
} catch (e) {
emit(OTPError("Oops something went wrong"));
}
}

View File

@@ -0,0 +1,17 @@
abstract class OTPEvent {
const OTPEvent();
List<Object> get props => [];
}
class RequestOTP extends OTPEvent {
final Map<String, dynamic> OTPRequestData;
RequestOTP(this.OTPRequestData);
@override
List<Object> get props => [OTPRequestData];
}
class VerifyOTP extends OTPEvent {
VerifyOTP();
}

View File

@@ -0,0 +1,19 @@
abstract class OTPState {}
class OTPInitial extends OTPState {}
class OTPLoading extends OTPState {}
class OTPLoaded extends OTPState {}
class OTPFailed extends OTPState {
final String failedmessage;
OTPFailed(this.failedmessage);
}
class OTPError extends OTPState {
final String errormessage;
OTPError(this.errormessage);
}

View File

@@ -1,21 +1,22 @@
import '../../../../Api_Helper/base_manager.dart';
import '../../../../shared/api/api_endpoints.dart';
import '../../../../shared/api/network_api_services.dart';
import '../../../../../Api_Helper/base_manager.dart';
import '../../../../../shared/api/api_endpoints.dart';
import '../../../../../shared/api/network_api_services.dart';
class OTPAPI {
OTPAPI();
Future<ResponseData> RequestOTP(Map<String, dynamic> data) async {
Future<ResponseData> requestOTP(Map<String, dynamic> data) async {
String url = ApiEndpoints.requestotpapi;
final response = await NetworkApiService().post(url, data);
return response;
}
Future<ResponseData> ResendOTPRequest(Map<String, dynamic> data) async {
Future<ResponseData> resendOTPRequest(Map<String, dynamic> data) async {
String url = ApiEndpoints.requestresendotp;
final response = await NetworkApiService().post(url, data);
return response;
}
Future<ResponseData> VerifyOTP(Map<String, dynamic> data) async {
Future<ResponseData> verifyOTP(Map<String, dynamic> data) async {
String url = ApiEndpoints.verifyotp;
final response = await NetworkApiService().post(url, data);
return response;

View File

@@ -4,7 +4,8 @@ import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:sms_autofill/sms_autofill.dart';
import 'package:tanami_app/Api_Helper/base_manager.dart';
import 'package:tanami_app/Globalconst.dart';
import '../../../OTP/Repository/OTP_API.dart';
import '../../domain/Repository/otp_api.dart';
import 'otp_event.dart';
import 'otp_state.dart';
@@ -31,14 +32,14 @@ class OtpBloc extends Bloc<OtpEvent, OtpState> {
void _onOtpSubmit(OtpSubmit event, Emitter<OtpState> emit) async {
emit(OtpSubmitting());
try {
Map<String,dynamic> otpdata= {
"token":Globalconst.token,
"otp":otpController.text
Map<String, dynamic> otpdata = {
"token": Globalconst.token,
"otp": otpController.text
};
ResponseData response= await OTPAPI().VerifyOTP(otpdata);
ResponseData response = await OTPAPI().verifyOTP(otpdata);
// Add your OTP verification logic here
// await Future.delayed(const Duration(seconds: 2));
if (response.status==ResponseStatus.SUCCESS) {
// await Future.delayed(const Duration(seconds: 2));
if (response.status == ResponseStatus.SUCCESS) {
emit(OtpSubmissionSuccess());
} else {
emit(const OtpSubmissionFailure("Otp Invalid !"));

View File

@@ -1,7 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:tanami_app/core/styles/app_color.dart';
import 'package:tanami_app/core/styles/app_text.dart';
import 'package:tanami_app/shared/components/text_widget.dart';
@@ -24,9 +22,9 @@ class ResendOtpSection extends StatelessWidget {
Widget build(BuildContext context) {
String token = "";
var loginBloc = context.read<RegisterBloc>();
loginBloc.isdcode=Globalconst.isdcode;
loginBloc.phoneNumberTextField.text=Globalconst.phonenumber;
loginBloc.countrySelectionTextField.text=Globalconst.name;
loginBloc.isdcode = Globalconst.isdcode;
loginBloc.phoneNumberTextField.text = Globalconst.phonenumber;
loginBloc.countrySelectionTextField.text = Globalconst.name;
var localizations = AppLocalizations.of(context);
return BlocBuilder<TimerBloc, TimerState>(
builder: (context, state) {
@@ -45,14 +43,14 @@ class ResendOtpSection extends StatelessWidget {
if (state is RegisterLoading) {
Loader.loader(context);
} else if (state is RegisterSuccess) {
successToastMessage(context, "OTP Resend Sucessfully !");
successToastMessage(context, "OTP Resend Sucessfully !");
goRouter.pop();
} else if (state is RegisterFailure) {
goRouter.pop();
errorToastMessage(
context,
state.error,
);
context,
state.error,
);
}
},
builder: (context, state) {
@@ -66,11 +64,11 @@ class ResendOtpSection extends StatelessWidget {
}
return GestureDetector(
onTap: () {
loginBloc.add(
loginBloc.add(
Resendotp(Globalconst.token),
);
print("///");
// successToastMessage(context, "OTP Resend Sucessfully !");
},
child: TextWidget().text14W500(

View File

@@ -1,8 +1,9 @@
import 'package:bloc/bloc.dart';
import 'package:flutter/material.dart';
import '../../../../Api_Helper/base_manager.dart';
import '../../../../Globalconst.dart';
import '../../../OTP/Repository/OTP_API.dart';
import '../../../otpVerification/domain/Repository/otp_api.dart';
import 'register_event.dart';
import 'register_state.dart';
@@ -10,7 +11,7 @@ class RegisterBloc extends Bloc<RegisterEvent, RegisterState> {
final GlobalKey<FormState> formKey = GlobalKey<FormState>();
final TextEditingController countrySelectionTextField =
TextEditingController();
String isdcode="";
String isdcode = "";
final TextEditingController phoneNumberTextField = TextEditingController();
GlobalKey<FormState> getFormKey() {
@@ -27,17 +28,17 @@ class RegisterBloc extends Bloc<RegisterEvent, RegisterState> {
}
emit(RegisterLoading());
try {
Map<String,dynamic> requestdata={
"isdCode":event.isdcode,
"phoneNumber":event.phoneNumber
Map<String, dynamic> requestdata = {
"isdCode": event.isdcode,
"phoneNumber": event.phoneNumber
};
ResponseData response = await OTPAPI().RequestOTP(requestdata);
ResponseData response = await OTPAPI().requestOTP(requestdata);
if (response.status == ResponseStatus.SUCCESS) {
print("///////success");
var data=response.data["data"];
String token=data["token"];
Globalconst.token=token;
emit(RegisterSuccess(token));//emit(OTPLoaded());
var data = response.data["data"];
String token = data["token"];
Globalconst.token = token;
emit(RegisterSuccess(token)); //emit(OTPLoaded());
} else {
emit(const RegisterFailure(
"Register failed. Please check your credentials."));
@@ -48,15 +49,15 @@ class RegisterBloc extends Bloc<RegisterEvent, RegisterState> {
}
});
on<Resendotp>((event, emit) async {
on<Resendotp>((event, emit) async {
emit(RegisterLoading());
try {
Map<String,dynamic> requestdata={
"token":Globalconst.token,
Map<String, dynamic> requestdata = {
"token": Globalconst.token,
};
ResponseData response = await OTPAPI().ResendOTPRequest(requestdata);
ResponseData response = await OTPAPI().resendOTPRequest(requestdata);
if (response.status == ResponseStatus.SUCCESS) {
emit(RegisterSuccess(event.token));//emit(OTPLoaded());
emit(RegisterSuccess(event.token)); //emit(OTPLoaded());
} else {
emit(const RegisterFailure(
"Register failed. Please check your credentials."));

View File

@@ -4,13 +4,13 @@ import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:gap/gap.dart';
import 'package:tanami_app/core/styles/app_text.dart';
import 'package:tanami_app/features/countrySelection/bloc/GetCountry/getcountryevent_bloc.dart';
import '../../../../Globalconst.dart';
import '../../../../core/utils/language/localizations_delegate.dart';
import '../../../../shared/api/api_endpoints.dart';
import '../../../../shared/components/form_label_textfield.dart';
import '../../../countrySelection/bloc/GetCountry/getcountry_bloc.dart';
import '../../../countrySelection/bloc/GetCountry/get_country_bloc.dart';
import '../../../countrySelection/bloc/GetCountry/get_country_state.dart';
import '../../../countrySelection/bloc/choose_country_bloc.dart';
import '../../../countrySelection/bloc/choose_country_state.dart';
import '../bloc/register_bloc.dart';
@@ -35,16 +35,18 @@ class RegisterForm extends StatelessWidget {
.toString();
loginBloc.phoneNumberTextField.text =
"${countryState.countryModel.data![selectedCountry].isdCode}";
loginBloc.isdcode="${countryState.countryModel.data![selectedCountry].isdCode}";
loginBloc.isdcode =
"${countryState.countryModel.data![selectedCountry].isdCode}";
flag =
"${ApiEndpoints.base}${countryState.countryModel.data![selectedCountry].flagIcon}";
Globalconst.phonenumber=loginBloc.phoneNumberTextField.text;
Globalconst.phonenumber = loginBloc.phoneNumberTextField.text;
Globalconst.name=countryState
Globalconst.name = countryState
.countryModel.data![selectedCountry].countryName
.toString();
Globalconst.isdcode="${countryState.countryModel.data![selectedCountry].isdCode}";
}
Globalconst.isdcode =
"${countryState.countryModel.data![selectedCountry].isdCode}";
}
}
}, builder: (context, state) {
if (state is RadioSelectionChanged) {
@@ -68,8 +70,8 @@ class RegisterForm extends StatelessWidget {
prefixWidget: selectedCountry == -1
? null
: Padding(
padding: EdgeInsets.only(left: 12.w),
child: SizedBox(
padding: EdgeInsets.only(left: 12.w),
child: SizedBox(
height: 50.h,
width: 30.w,
child: Align(
@@ -78,8 +80,8 @@ class RegisterForm extends StatelessWidget {
height: 30.h,
width: 30.w,
child: ClipRRect(
borderRadius:
BorderRadius.all(Radius.circular(100)),
borderRadius: const BorderRadius.all(
Radius.circular(100)),
child: CachedNetworkImage(
maxHeightDiskCache: 200,
maxWidthDiskCache: 200,
@@ -89,19 +91,20 @@ class RegisterForm extends StatelessWidget {
imageUrl: flag,
height: 30.h,
width: 30.w,
placeholder: (context, url) => Container(
placeholder: (context, url) => SizedBox(
height: 30.h,
width: 30.w,
child: CircularProgressIndicator(),
child:
const CircularProgressIndicator(),
),
errorWidget: (context, url, error) =>
Icon(Icons.error),
const Icon(Icons.error),
fit: BoxFit.cover),
),
),
),
),
),
),
/* Image.asset(
countryFlag[selectedCountry],
width: 20,
@@ -114,11 +117,11 @@ class RegisterForm extends StatelessWidget {
),
const Gap(20),
FormLabelTextField(
prefixWidget: selectedCountry == -1 ||flag.isEmpty
prefixWidget: selectedCountry == -1 || flag.isEmpty
? null
: Padding(
padding: EdgeInsets.only(left: 12.w),
child: SizedBox(
: Padding(
padding: EdgeInsets.only(left: 12.w),
child: SizedBox(
height: 50.h,
width: 30.w,
child: Align(
@@ -127,8 +130,8 @@ class RegisterForm extends StatelessWidget {
height: 30.h,
width: 30.w,
child: ClipRRect(
borderRadius:
BorderRadius.all(Radius.circular(100)),
borderRadius: const BorderRadius.all(
Radius.circular(100)),
child: CachedNetworkImage(
maxHeightDiskCache: 200,
maxWidthDiskCache: 200,
@@ -138,19 +141,21 @@ class RegisterForm extends StatelessWidget {
imageUrl: flag,
height: 30.h,
width: 30.w,
placeholder: (context, url) => Container(
placeholder: (context, url) => SizedBox(
height: 30.h,
width: 30.w,
child: CircularProgressIndicator(),
child:
const CircularProgressIndicator(),
),
errorWidget: (context, url, error) =>
Icon(Icons.error),
const Icon(Icons.error),
fit: BoxFit.cover),
),
),
),
),
),/* Image.asset(
),
/* Image.asset(
countryFlag[selectedCountry],
width: 20,
height: 20,

View File

@@ -5,8 +5,8 @@ import 'package:gap/gap.dart';
import 'package:tanami_app/core/routes/route_name.dart';
import 'package:tanami_app/core/routes/routes.dart';
import 'package:tanami_app/core/styles/app_color.dart';
import 'package:tanami_app/features/countrySelection/bloc/GetCountry/getcountry_bloc.dart';
import 'package:tanami_app/features/countrySelection/bloc/GetCountry/getcountryevent_bloc.dart';
import 'package:tanami_app/features/countrySelection/bloc/GetCountry/get_country_bloc.dart';
import 'package:tanami_app/features/countrySelection/bloc/GetCountry/get_country_event.dart';
import 'package:tanami_app/shared/components/button_widget.dart';
import '../../../../core/styles/app_text.dart';
@@ -31,7 +31,7 @@ class LoginSignUpButton extends StatelessWidget {
height: 56.h,
child: ButtonWidget().elevatedBtn(
function: () {
context.read<GetCountryBlock>().add(GetCountry());
context.read<GetCountryBlock>().add(GetCountry());
goRouter.goNamed(RouteName.registerStepScreen, pathParameters: {
"fromScreentype": "welcome",
});

View File

@@ -9,16 +9,11 @@ import 'core/routes/routes.dart';
import 'core/utils/connectivity/network_connectivity.dart';
import 'core/utils/language/localizations_delegate.dart';
import 'core/utils/secure/secure_storage_service.dart';
import 'features/OTP/bloc/OTP_bloc.dart';
import 'features/biometric/presentation/bloc/biometric_bloc.dart';
import 'features/biometric/presentation/bloc/biometric_event.dart';
import 'features/countrySelection/bloc/GetCountry/getcountry_bloc.dart';
import 'features/countrySelection/bloc/GetCountry/get_country_bloc.dart';
import 'features/countrySelection/bloc/choose_country_bloc.dart';
import 'features/otpVerification/presentation/bloc/otp_bloc.dart';
import 'features/otpVerification/presentation/bloc/otp_event.dart';
import 'features/otpVerification/presentation/bloc/timer/timer_bloc.dart';
import 'features/otpVerification/presentation/bloc/timer/timer_event.dart';
import 'features/register/presentation/bloc/register_bloc.dart';
import 'features/otpVerification/bloc/otp_bloc.dart';
import 'shared/components/bloc/bottom_nav_bar/bottom_navigation_bloc.dart';
import 'shared/components/bloc/language/lng_bloc.dart';
import 'shared/components/bloc/language/lng_event.dart';
@@ -114,7 +109,6 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
BlocProvider(
create: (_) => OTPBloc(),
),
],
child: ScreenUtilInit(
builder: (BuildContext context, Widget? child) =>

View File

@@ -1,10 +1,10 @@
class ApiEndpoints {
static const base="https://tanami.betadelivery.com/";
static const base = "https://tanami.betadelivery.com/";
static const baseurl =
"https://tanami.betadelivery.com/api/development/v1/"; //App Base url
static const getcountryurl = baseurl + "country/getAllCountry";
static const requestotpapi=baseurl +"auth/public/register";
static const requestresendotp=baseurl+"auth/public/resend-otp";
static const verifyotp=baseurl+"auth/public/verify-otp";
static const getcountryurl = "${baseurl}country/getAllCountry";
static const requestotpapi = "${baseurl}auth/public/register";
static const requestresendotp = "${baseurl}auth/public/resend-otp";
static const verifyotp = "${baseurl}auth/public/verify-otp";
}