3
.vscode/settings.json
vendored
Normal file
3
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"dart.flutterSdkPath": "D:\\pooja\\fluttersdk\\flutter_3.22.2\\flutter"
|
||||||
|
}
|
||||||
64
assets/images/welcome_screen/svg/tanamibg.svg
Normal file
64
assets/images/welcome_screen/svg/tanamibg.svg
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 44 KiB |
18
lib/Api_Helper/base_manager.dart
Normal file
18
lib/Api_Helper/base_manager.dart
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
class ResponseData<T> {
|
||||||
|
ResponseData(this.message, this.status, {this.data});
|
||||||
|
|
||||||
|
final T? data;
|
||||||
|
final String message;
|
||||||
|
final ResponseStatus status;
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() => message;
|
||||||
|
}
|
||||||
|
|
||||||
|
enum ResponseStatus {
|
||||||
|
SUCCESS,
|
||||||
|
|
||||||
|
FAILED,
|
||||||
|
|
||||||
|
PRIVATE,
|
||||||
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
class AppImages {
|
class AppImages {
|
||||||
//Splash
|
//Splash
|
||||||
static const String splashBg =
|
static const String splashBg =
|
||||||
"assets/images/welcome_screen/svg/Splash_BG.svg";
|
"assets/images/welcome_screen/svg/tanamibg.svg";
|
||||||
static const String splashLogo =
|
static const String splashLogo =
|
||||||
"assets/images/welcome_screen/svg/Tanami_Capital_Splash_Logo.svg";
|
"assets/images/welcome_screen/svg/Tanami_Capital_Splash_Logo.svg";
|
||||||
|
|
||||||
|
|||||||
72
lib/domain/model/GetCountry_model.dart
Normal file
72
lib/domain/model/GetCountry_model.dart
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
class GetCountryModel {
|
||||||
|
List<Data>? 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));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
if (this.data != null) {
|
||||||
|
data['data'] = this.data!.map((v) => v.toJson()).toList();
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class Data {
|
||||||
|
String? id;
|
||||||
|
String? countryName;
|
||||||
|
String? countryCode;
|
||||||
|
String? isdCode;
|
||||||
|
String? flagIcon;
|
||||||
|
Null? currencyXid;
|
||||||
|
bool? isActive;
|
||||||
|
Null? createdBy;
|
||||||
|
Null? modifiedBy;
|
||||||
|
|
||||||
|
Data(
|
||||||
|
{this.id,
|
||||||
|
this.countryName,
|
||||||
|
this.countryCode,
|
||||||
|
this.isdCode,
|
||||||
|
this.flagIcon,
|
||||||
|
this.currencyXid,
|
||||||
|
this.isActive,
|
||||||
|
this.createdBy,
|
||||||
|
this.modifiedBy});
|
||||||
|
|
||||||
|
Data.fromJson(Map<String, dynamic> json) {
|
||||||
|
id = json['id'];
|
||||||
|
countryName = json['countryName'];
|
||||||
|
countryCode = json['countryCode'];
|
||||||
|
isdCode = json['isdCode'];
|
||||||
|
flagIcon = json['flagIcon'];
|
||||||
|
currencyXid = json['currency_xid'];
|
||||||
|
isActive = json['isActive'];
|
||||||
|
createdBy = json['createdBy'];
|
||||||
|
modifiedBy = json['modifiedBy'];
|
||||||
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
|
||||||
|
import '../../../../../Api_Helper/base_manager.dart';
|
||||||
|
import '../../../../../shared/api/api_endpoints.dart';
|
||||||
|
import '../../../../../shared/api/network_api_services.dart';
|
||||||
|
|
||||||
|
class GetCountryAPI {
|
||||||
|
GetCountryAPI();
|
||||||
|
Future<ResponseData> getcountryAPI() async {
|
||||||
|
String url=ApiEndpoints.getcountryurl;
|
||||||
|
final response = await NetworkApiService().get(
|
||||||
|
url,
|
||||||
|
);
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
import 'package:bloc/bloc.dart';
|
||||||
|
import 'package:tanami_app/features/countrySelection/presentation/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"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
import '../../../../../domain/model/GetCountry_model.dart';
|
||||||
|
|
||||||
|
abstract class GetCountryEvent {
|
||||||
|
const GetCountryEvent();
|
||||||
|
|
||||||
|
get props => [];
|
||||||
|
}
|
||||||
|
|
||||||
|
class GetCountry extends GetCountryEvent {
|
||||||
|
GetCountry();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
abstract class GetCountryState{}
|
||||||
|
// Define states
|
||||||
|
//enum GetCountryState { initial, loading, success, failure, error }
|
||||||
|
class CountryInitial extends GetCountryState {}
|
||||||
|
|
||||||
|
class CountryLoading extends GetCountryState {}
|
||||||
|
|
||||||
|
class CountryLoaded extends GetCountryState {
|
||||||
|
final GetCountryModel countryModel;
|
||||||
|
|
||||||
|
CountryLoaded(this.countryModel);
|
||||||
|
}
|
||||||
|
|
||||||
|
class CountryError extends GetCountryState {
|
||||||
|
final String message;
|
||||||
|
|
||||||
|
CountryError(this.message);
|
||||||
|
}
|
||||||
@@ -3,6 +3,8 @@ import 'package:flutter_bloc/flutter_bloc.dart';
|
|||||||
import 'package:gap/gap.dart';
|
import 'package:gap/gap.dart';
|
||||||
import 'package:tanami_app/core/styles/app_color.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/core/utils/constant/country_flag_data.dart';
|
||||||
|
import 'package:tanami_app/features/countrySelection/presentation/bloc/GetCountry/getcountry_bloc.dart';
|
||||||
|
import 'package:tanami_app/features/countrySelection/presentation/bloc/GetCountry/getcountryevent_bloc.dart';
|
||||||
import 'package:tanami_app/shared/components/text_widget.dart';
|
import 'package:tanami_app/shared/components/text_widget.dart';
|
||||||
|
|
||||||
import '../bloc/choose_country_bloc.dart';
|
import '../bloc/choose_country_bloc.dart';
|
||||||
@@ -15,6 +17,56 @@ class CountrySelectionList extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final radioBloc = context.read<RadioBloc>();
|
final radioBloc = context.read<RadioBloc>();
|
||||||
|
/* return BlocConsumer<GetCountryBlock, GetCountryState>(
|
||||||
|
listener: (context, state) {
|
||||||
|
/* if (state == GetCountryState.success) {
|
||||||
|
const SnackBar(content: Text("Successfully fetch"));
|
||||||
|
} else if (state == GetCountryState.error) {
|
||||||
|
const SnackBar(content: Text(" error"));
|
||||||
|
} else {
|
||||||
|
const SnackBar(content: Text(" not fetch"));
|
||||||
|
} */
|
||||||
|
}, builder: (context, state) {
|
||||||
|
print(state);
|
||||||
|
if (state is CountryLoading) {
|
||||||
|
return Center(child: CircularProgressIndicator());
|
||||||
|
} else if (state is CountryLoaded) {
|
||||||
|
return ListView.builder(
|
||||||
|
itemCount: state.countryModel.data?.length ?? 0,
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
var country = state.countryModel.data![index];
|
||||||
|
return ListTile(
|
||||||
|
title: Row(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
// Adjust according to how you handle flags
|
||||||
|
Image.asset(
|
||||||
|
countryFlag[index],
|
||||||
|
width: 24,
|
||||||
|
height: 24,
|
||||||
|
),
|
||||||
|
const SizedBox(width: 10),
|
||||||
|
Text(country.countryName ?? ''),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
leading: Radio<int>(
|
||||||
|
activeColor: Colors.blue,
|
||||||
|
value: index,
|
||||||
|
groupValue: -1, // You can update this to manage selected index
|
||||||
|
onChanged: (int? value) {
|
||||||
|
// Handle radio button change
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
} else if (state is CountryError) {
|
||||||
|
return Center(child: Text(state.message));
|
||||||
|
} else {
|
||||||
|
return Center(child: Text('Press button to fetch country data'));
|
||||||
|
}
|
||||||
|
}); */
|
||||||
|
|
||||||
return BlocBuilder<RadioBloc, RadioState>(
|
return BlocBuilder<RadioBloc, RadioState>(
|
||||||
builder: (context, state) {
|
builder: (context, state) {
|
||||||
int selectedIndex = -1;
|
int selectedIndex = -1;
|
||||||
@@ -22,35 +74,60 @@ class CountrySelectionList extends StatelessWidget {
|
|||||||
selectedIndex = state.selectedIndex;
|
selectedIndex = state.selectedIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
return Column(
|
return BlocConsumer<GetCountryBlock, GetCountryState>(
|
||||||
children: List<Widget>.generate(countryFlag.length, (int index) {
|
listener: (context, state) {
|
||||||
return ListTile(
|
if (state == CountryLoaded) {
|
||||||
title: Row(
|
const SnackBar(content: Text("Successfully fetch"));
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
} else if (state == CountryError) {
|
||||||
children: [
|
const SnackBar(content: Text("error while fetching data"));
|
||||||
Image.asset(
|
Future.delayed(Duration(milliseconds: 3), () {
|
||||||
countryFlag[index],
|
context.read<GetCountryBlock>().add(GetCountry());
|
||||||
width: 24,
|
});
|
||||||
height: 24,
|
} else {
|
||||||
|
const SnackBar(content: Text(" not fetch"));
|
||||||
|
}
|
||||||
|
}, builder: (context, state) {
|
||||||
|
print(state);
|
||||||
|
if (state is CountryLoading) {
|
||||||
|
return Center(child: CircularProgressIndicator());
|
||||||
|
} else if (state is CountryLoaded) {
|
||||||
|
return ListView.builder(
|
||||||
|
itemCount: state.countryModel.data?.length ?? 0,
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
var country = state.countryModel.data![index];
|
||||||
|
return ListTile(
|
||||||
|
title: Row(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Image.asset(
|
||||||
|
countryFlag[index],
|
||||||
|
width: 24,
|
||||||
|
height: 24,
|
||||||
|
),
|
||||||
|
const Gap(10),
|
||||||
|
TextWidget().text14W500(country.countryName.toString(),
|
||||||
|
clr: AppColor.charcoalColor),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
const Gap(10),
|
leading: Radio<int>(
|
||||||
TextWidget().text14W500(countryName[index],
|
activeColor: AppColor.radioActiveColor,
|
||||||
clr: AppColor.charcoalColor),
|
value: index,
|
||||||
],
|
groupValue: selectedIndex,
|
||||||
),
|
onChanged: (int? value) {
|
||||||
leading: Radio<int>(
|
if (value != null) {
|
||||||
activeColor: AppColor.radioActiveColor,
|
radioBloc.add(RadioSelected(value));
|
||||||
value: index,
|
}
|
||||||
groupValue: selectedIndex,
|
},
|
||||||
onChanged: (int? value) {
|
),
|
||||||
if (value != null) {
|
);
|
||||||
radioBloc.add(RadioSelected(value));
|
},
|
||||||
}
|
|
||||||
},
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}),
|
} else if (state is CountryError) {
|
||||||
);
|
return Center(child: Text(state.message));
|
||||||
|
} else {
|
||||||
|
return Center(child: Text('Press button to fetch country data'));
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ class SplashLayout extends StatelessWidget {
|
|||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Positioned.fill(
|
/* Positioned.fill(
|
||||||
child: Align(
|
child: Align(
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
child: SvgPicture.asset(
|
child: SvgPicture.asset(
|
||||||
@@ -39,7 +39,7 @@ class SplashLayout extends StatelessWidget {
|
|||||||
alignment: Alignment.bottomCenter,
|
alignment: Alignment.bottomCenter,
|
||||||
child: BottomVersionWidget(),
|
child: BottomVersionWidget(),
|
||||||
),
|
),
|
||||||
),
|
), */
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:gap/gap.dart';
|
import 'package:gap/gap.dart';
|
||||||
import 'package:tanami_app/core/routes/route_name.dart';
|
import 'package:tanami_app/core/routes/route_name.dart';
|
||||||
import 'package:tanami_app/core/routes/routes.dart';
|
import 'package:tanami_app/core/routes/routes.dart';
|
||||||
import 'package:tanami_app/core/styles/app_color.dart';
|
import 'package:tanami_app/core/styles/app_color.dart';
|
||||||
|
import 'package:tanami_app/features/countrySelection/presentation/bloc/GetCountry/getcountry_bloc.dart';
|
||||||
|
import 'package:tanami_app/features/countrySelection/presentation/bloc/GetCountry/getcountryevent_bloc.dart';
|
||||||
import 'package:tanami_app/shared/components/button_widget.dart';
|
import 'package:tanami_app/shared/components/button_widget.dart';
|
||||||
|
|
||||||
import '../../../../core/styles/app_text.dart';
|
import '../../../../core/styles/app_text.dart';
|
||||||
@@ -28,6 +31,7 @@ class LoginSignUpButton extends StatelessWidget {
|
|||||||
height: 56.h,
|
height: 56.h,
|
||||||
child: ButtonWidget().elevatedBtn(
|
child: ButtonWidget().elevatedBtn(
|
||||||
function: () {
|
function: () {
|
||||||
|
context.read<GetCountryBlock>().add(GetCountry());
|
||||||
goRouter.goNamed(RouteName.registerStepScreen, pathParameters: {
|
goRouter.goNamed(RouteName.registerStepScreen, pathParameters: {
|
||||||
"fromScreentype": "welcome",
|
"fromScreentype": "welcome",
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import 'core/utils/language/localizations_delegate.dart';
|
|||||||
import 'core/utils/secure/secure_storage_service.dart';
|
import 'core/utils/secure/secure_storage_service.dart';
|
||||||
import 'features/biometric/presentation/bloc/biometric_bloc.dart';
|
import 'features/biometric/presentation/bloc/biometric_bloc.dart';
|
||||||
import 'features/biometric/presentation/bloc/biometric_event.dart';
|
import 'features/biometric/presentation/bloc/biometric_event.dart';
|
||||||
|
import 'features/countrySelection/presentation/bloc/GetCountry/getcountry_bloc.dart';
|
||||||
import 'features/countrySelection/presentation/bloc/choose_country_bloc.dart';
|
import 'features/countrySelection/presentation/bloc/choose_country_bloc.dart';
|
||||||
import 'shared/components/bloc/bottom_nav_bar/bottom_navigation_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_bloc.dart';
|
||||||
@@ -98,6 +99,12 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
|
|||||||
create: (_) =>
|
create: (_) =>
|
||||||
BiometricBloc(LocalAuthentication())..add(CheckBiometricEvent()),
|
BiometricBloc(LocalAuthentication())..add(CheckBiometricEvent()),
|
||||||
),
|
),
|
||||||
|
BlocProvider(
|
||||||
|
create: (_) => LocalizationBloc(),
|
||||||
|
),
|
||||||
|
BlocProvider(
|
||||||
|
create: (_) => GetCountryBlock(),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
child: ScreenUtilInit(
|
child: ScreenUtilInit(
|
||||||
builder: (BuildContext context, Widget? child) =>
|
builder: (BuildContext context, Widget? child) =>
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
class ApiEndpoints {
|
class ApiEndpoints {
|
||||||
static const base = ""; //App Base url
|
static const baseurl =
|
||||||
|
"https://tanami.betadelivery.com/api/development/v1/"; //App Base url
|
||||||
|
|
||||||
|
static const getcountryurl = baseurl + "country/getAllCountry";
|
||||||
}
|
}
|
||||||
|
|||||||
0
lib/shared/api/commonAPI.dart
Normal file
0
lib/shared/api/commonAPI.dart
Normal file
@@ -1,42 +1,63 @@
|
|||||||
// common_api.dart
|
// common_api.dart
|
||||||
|
|
||||||
import 'package:dio/dio.dart';
|
import 'package:dio/dio.dart';
|
||||||
|
import 'package:flutter/foundation.dart';
|
||||||
|
|
||||||
|
import '../../Api_Helper/base_manager.dart';
|
||||||
|
|
||||||
class NetworkApiService {
|
class NetworkApiService {
|
||||||
final Dio _dio = Dio();
|
final Dio _dio = Dio();
|
||||||
|
|
||||||
// Common function for GET requests
|
// Common function for GET requests
|
||||||
Future<Response> get(String endpoint,
|
Future<ResponseData> get(String url,
|
||||||
{Map<String, dynamic>? queryParameters}) async {
|
{Map<String, dynamic>? queryParameters}) async {
|
||||||
|
if (kDebugMode) {
|
||||||
|
print("api url is >>> $url");
|
||||||
|
}
|
||||||
|
Response response;
|
||||||
try {
|
try {
|
||||||
return await _dio.get(endpoint, queryParameters: queryParameters);
|
response = await _dio.get(url);
|
||||||
|
if (response.statusCode == 201 || response.statusCode == 200) {
|
||||||
|
return ResponseData<dynamic>("success", ResponseStatus.SUCCESS,
|
||||||
|
data: response.data);
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
return ResponseData<dynamic>(
|
||||||
|
response.data['message'].toString(), ResponseStatus.FAILED);
|
||||||
|
} catch (_) {
|
||||||
|
return ResponseData<dynamic>(
|
||||||
|
data: response.data,
|
||||||
|
response.statusMessage!,
|
||||||
|
ResponseStatus.FAILED);
|
||||||
|
}}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
throw _handleError(e);
|
return ResponseData<dynamic>(
|
||||||
|
"Something went wrong", ResponseStatus.FAILED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Common function for POST requests
|
// Common function for POST requests
|
||||||
Future<Response> post(String endpoint, dynamic data) async {
|
Future<Response> post(String url, dynamic data) async {
|
||||||
try {
|
try {
|
||||||
return await _dio.post(endpoint, data: data);
|
return await _dio.post(url, data: data);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
throw _handleError(e);
|
throw _handleError(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Common function for PUT requests
|
// Common function for PUT requests
|
||||||
Future<Response> put(String endpoint, dynamic data) async {
|
Future<Response> put(String url, dynamic data) async {
|
||||||
try {
|
try {
|
||||||
return await _dio.put(endpoint, data: data);
|
return await _dio.put(url, data: data);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
throw _handleError(e);
|
throw _handleError(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Common function for DELETE requests
|
// Common function for DELETE requests
|
||||||
Future<Response> delete(String endpoint) async {
|
Future<Response> delete(String url) async {
|
||||||
try {
|
try {
|
||||||
return await _dio.delete(endpoint);
|
return await _dio.delete(url);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
throw _handleError(e);
|
throw _handleError(e);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user