Code Formatted
This commit is contained in:
@@ -1,47 +1,47 @@
|
||||
import 'package:dio/dio.dart';
|
||||
|
||||
class Branch{
|
||||
final String branch_code;
|
||||
final String branch_name;
|
||||
final String zone;
|
||||
final String tehsil;
|
||||
final String block;
|
||||
final String block_code;
|
||||
final String distt_name;
|
||||
final String distt_code_slbc;
|
||||
final String date_of_opening;
|
||||
final String rbi_code_1;
|
||||
final String rbi_code_2;
|
||||
final String telephone_no;
|
||||
final String type_of_branch;
|
||||
final String rtgs_acct_no;
|
||||
final String br_lattitude;
|
||||
final String br_longitude;
|
||||
final String pincode;
|
||||
final String post_office;
|
||||
class Branch {
|
||||
final String branch_code;
|
||||
final String branch_name;
|
||||
final String zone;
|
||||
final String tehsil;
|
||||
final String block;
|
||||
final String block_code;
|
||||
final String distt_name;
|
||||
final String distt_code_slbc;
|
||||
final String date_of_opening;
|
||||
final String rbi_code_1;
|
||||
final String rbi_code_2;
|
||||
final String telephone_no;
|
||||
final String type_of_branch;
|
||||
final String rtgs_acct_no;
|
||||
final String br_lattitude;
|
||||
final String br_longitude;
|
||||
final String pincode;
|
||||
final String post_office;
|
||||
|
||||
Branch({
|
||||
required this.branch_code,
|
||||
required this.branch_name,
|
||||
required this.zone,
|
||||
required this.tehsil,
|
||||
required this.block,
|
||||
required this.block_code,
|
||||
required this.distt_name,
|
||||
required this.distt_code_slbc,
|
||||
required this.date_of_opening,
|
||||
required this.rbi_code_1,
|
||||
required this.rbi_code_2,
|
||||
required this.telephone_no,
|
||||
required this.type_of_branch,
|
||||
required this.rtgs_acct_no,
|
||||
required this.br_lattitude,
|
||||
required this.br_longitude,
|
||||
required this.pincode,
|
||||
required this.post_office,
|
||||
});
|
||||
Branch({
|
||||
required this.branch_code,
|
||||
required this.branch_name,
|
||||
required this.zone,
|
||||
required this.tehsil,
|
||||
required this.block,
|
||||
required this.block_code,
|
||||
required this.distt_name,
|
||||
required this.distt_code_slbc,
|
||||
required this.date_of_opening,
|
||||
required this.rbi_code_1,
|
||||
required this.rbi_code_2,
|
||||
required this.telephone_no,
|
||||
required this.type_of_branch,
|
||||
required this.rtgs_acct_no,
|
||||
required this.br_lattitude,
|
||||
required this.br_longitude,
|
||||
required this.pincode,
|
||||
required this.post_office,
|
||||
});
|
||||
|
||||
factory Branch.fromJson(Map<String, dynamic> json) {
|
||||
factory Branch.fromJson(Map<String, dynamic> json) {
|
||||
return Branch(
|
||||
branch_code: json['branch_code'] ?? json['branch_code'] ?? '',
|
||||
branch_name: json['branch_name'] ?? json['branch_name'] ?? '',
|
||||
@@ -60,33 +60,32 @@ factory Branch.fromJson(Map<String, dynamic> json) {
|
||||
br_lattitude: json['br_lattitude'] ?? json['br_lattitude'] ?? '',
|
||||
br_longitude: json['br_longitude'] ?? json['br_longitude'] ?? '',
|
||||
pincode: json['pincode'] ?? json['pincode'] ?? '',
|
||||
post_office: json['post_office'] ?? json['post_office'] ?? '',
|
||||
post_office: json['post_office'] ?? json['post_office'] ?? '',
|
||||
);
|
||||
}
|
||||
|
||||
static List<Branch> listFromJson(List<dynamic> jsonList) {
|
||||
final beneficiaryList = jsonList
|
||||
.map((beneficiary) => Branch.fromJson(beneficiary))
|
||||
.toList();
|
||||
static List<Branch> listFromJson(List<dynamic> jsonList) {
|
||||
final beneficiaryList =
|
||||
jsonList.map((beneficiary) => Branch.fromJson(beneficiary)).toList();
|
||||
return beneficiaryList;
|
||||
}
|
||||
}
|
||||
|
||||
class Atm {
|
||||
final String name;
|
||||
class Atm {
|
||||
final String name;
|
||||
|
||||
Atm({required this.name});
|
||||
Atm({required this.name});
|
||||
|
||||
factory Atm.fromJson(Map<String, dynamic> json) {
|
||||
return Atm(
|
||||
name: json['name'] ?? '', // Assuming the API returns a 'name' field
|
||||
);
|
||||
}
|
||||
factory Atm.fromJson(Map<String, dynamic> json) {
|
||||
return Atm(
|
||||
name: json['name'] ?? '', // Assuming the API returns a 'name' field
|
||||
);
|
||||
}
|
||||
|
||||
static List<Atm> listFromJson(List<dynamic> jsonList) {
|
||||
return jsonList.map((atm) => Atm.fromJson(atm)).toList();
|
||||
}
|
||||
}
|
||||
static List<Atm> listFromJson(List<dynamic> jsonList) {
|
||||
return jsonList.map((atm) => Atm.fromJson(atm)).toList();
|
||||
}
|
||||
}
|
||||
|
||||
class BranchService {
|
||||
final Dio _dio;
|
||||
@@ -113,7 +112,7 @@ class BranchService {
|
||||
}
|
||||
}
|
||||
|
||||
Future<List<Atm>> fetchAtmList() async {
|
||||
Future<List<Atm>> fetchAtmList() async {
|
||||
try {
|
||||
final response = await _dio.get(
|
||||
"/api/atm",
|
||||
@@ -134,4 +133,4 @@ class BranchService {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user