added pengiriman_detail page in kurir user
This commit is contained in:
@ -15,6 +15,12 @@ import '../globals.dart' as globals;
|
|||||||
class KurirApi {
|
class KurirApi {
|
||||||
static var client = http.Client();
|
static var client = http.Client();
|
||||||
|
|
||||||
|
static var storage = GetStorage();
|
||||||
|
|
||||||
|
static var username = storage.read("username");
|
||||||
|
static var password = storage.read("password");
|
||||||
|
static var id = storage.read("id");
|
||||||
|
|
||||||
static clientClose(http.Client client) {
|
static clientClose(http.Client client) {
|
||||||
client.close();
|
client.close();
|
||||||
}
|
}
|
||||||
@ -28,10 +34,6 @@ class KurirApi {
|
|||||||
bool _cek_jaringan = await cek_jaringan(client);
|
bool _cek_jaringan = await cek_jaringan(client);
|
||||||
|
|
||||||
log("cek jaringan : " + _cek_jaringan.toString());
|
log("cek jaringan : " + _cek_jaringan.toString());
|
||||||
var storage = GetStorage();
|
|
||||||
var username = storage.read("username");
|
|
||||||
var password = storage.read("password");
|
|
||||||
var id = storage.read("id");
|
|
||||||
|
|
||||||
if (!_cek_jaringan) {
|
if (!_cek_jaringan) {
|
||||||
result = {
|
result = {
|
||||||
@ -88,10 +90,6 @@ class KurirApi {
|
|||||||
bool _cek_jaringan = await cek_jaringan(client);
|
bool _cek_jaringan = await cek_jaringan(client);
|
||||||
|
|
||||||
log("cek jaringan : " + _cek_jaringan.toString());
|
log("cek jaringan : " + _cek_jaringan.toString());
|
||||||
var storage = GetStorage();
|
|
||||||
var username = storage.read("username");
|
|
||||||
var password = storage.read("password");
|
|
||||||
var id = storage.read("id");
|
|
||||||
|
|
||||||
if (!_cek_jaringan) {
|
if (!_cek_jaringan) {
|
||||||
result = {
|
result = {
|
||||||
@ -152,10 +150,6 @@ class KurirApi {
|
|||||||
bool _cek_jaringan = await cek_jaringan(client);
|
bool _cek_jaringan = await cek_jaringan(client);
|
||||||
|
|
||||||
log("cek jaringan : " + _cek_jaringan.toString());
|
log("cek jaringan : " + _cek_jaringan.toString());
|
||||||
var storage = GetStorage();
|
|
||||||
var username = storage.read("username");
|
|
||||||
var password = storage.read("password");
|
|
||||||
var id = storage.read("id");
|
|
||||||
if (!_cek_jaringan) {
|
if (!_cek_jaringan) {
|
||||||
result = {
|
result = {
|
||||||
'status': 500,
|
'status': 500,
|
||||||
@ -206,6 +200,180 @@ class KurirApi {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// terima pengiriman kurir dan ubah status ke 'Pengiriman Disahkan kurir'
|
||||||
|
static Future<Map<String, dynamic>> sahkanPengiriman(
|
||||||
|
String? idPengiriman) async {
|
||||||
|
client = http.Client();
|
||||||
|
late Map<String, dynamic> result;
|
||||||
|
bool _cek_jaringan = await cek_jaringan(client);
|
||||||
|
|
||||||
|
// log("cek jaringan : " + _cek_jaringan.toString());
|
||||||
|
|
||||||
|
if (!_cek_jaringan) {
|
||||||
|
result = {
|
||||||
|
'status': 500,
|
||||||
|
'message':
|
||||||
|
"Tidak dapat terhubung ke server, Sila periksa koneksi internet anda"
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
// wait for 3 sec
|
||||||
|
// await Future.delayed(Duration(seconds: 3));
|
||||||
|
// result = {'status': 200, 'message': "sini dia"};
|
||||||
|
|
||||||
|
try {
|
||||||
|
var response = await client.post(
|
||||||
|
Uri.parse(
|
||||||
|
"${globals.http_to_server}api/kurir/sahkan_pengiriman?username=$username&password=$password&id=$id"),
|
||||||
|
headers: {
|
||||||
|
"Accept": "application/json",
|
||||||
|
// "authorization":
|
||||||
|
// "Basic ${base64Encode(utf8.encode("Kicap_karan:bb10c6d9f01ec0cb16726b59e36c2f73"))}",
|
||||||
|
"crossDomain": "true"
|
||||||
|
},
|
||||||
|
body: {
|
||||||
|
"id_pengiriman": idPengiriman
|
||||||
|
}).timeout(const Duration(seconds: 60));
|
||||||
|
final data = jsonDecode(response.body);
|
||||||
|
// log(data.toString());
|
||||||
|
// log("ini status : " + response.statusCode.toString());
|
||||||
|
if (response.statusCode == 200) {
|
||||||
|
result = {
|
||||||
|
'status': 200,
|
||||||
|
'message': data['message'],
|
||||||
|
'data': data['data']
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
result = {
|
||||||
|
'status': response.statusCode,
|
||||||
|
'message': data['message'],
|
||||||
|
'data': data
|
||||||
|
};
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
result = {
|
||||||
|
'status': 500,
|
||||||
|
'message':
|
||||||
|
"Tidak dapat terhubung ke server, Sila periksa koneksi internet anda"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
static Future<Map<String, dynamic>> detailPengiriman(
|
||||||
|
String idPengiriman) async {
|
||||||
|
client = http.Client();
|
||||||
|
late Map<String, dynamic> result;
|
||||||
|
bool _cek_jaringan = await cek_jaringan(client);
|
||||||
|
if (!_cek_jaringan) {
|
||||||
|
result = {
|
||||||
|
'status': 500,
|
||||||
|
'message':
|
||||||
|
"Tidak dapat terhubung ke server, Sila periksa koneksi internet anda"
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
// wait for 3 sec
|
||||||
|
// await Future.delayed(Duration(seconds: 3));
|
||||||
|
// result = {'status': 200, 'message': "sini dia"};
|
||||||
|
try {
|
||||||
|
var response = await client.get(
|
||||||
|
Uri.parse(
|
||||||
|
"${globals.http_to_server}api/kurir/detail_pengiriman?username=$username&password=$password&id=$id&id_pengiriman=$idPengiriman"),
|
||||||
|
headers: {
|
||||||
|
"Accept": "application/json",
|
||||||
|
// "authorization":
|
||||||
|
// "Basic ${base64Encode(utf8.encode("Kicap_karan:bb10c6d9f01ec0cb16726b59e36c2f73"))}",
|
||||||
|
"crossDomain": "true"
|
||||||
|
}).timeout(const Duration(seconds: 60));
|
||||||
|
final data = jsonDecode(response.body);
|
||||||
|
// log(data.toString());
|
||||||
|
// log("ini status : " + response.statusCode.toString());
|
||||||
|
if (response.statusCode == 200) {
|
||||||
|
result = {
|
||||||
|
'status': 200,
|
||||||
|
'message': data['message'],
|
||||||
|
'data': data['data']
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
result = {
|
||||||
|
'status': response.statusCode,
|
||||||
|
'message': data['message'],
|
||||||
|
'data': data
|
||||||
|
};
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
result = {
|
||||||
|
'status': 500,
|
||||||
|
'message':
|
||||||
|
"Tidak dapat terhubung ke server, Sila periksa koneksi internet anda"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
static Future<Map<String, dynamic>> mengambilPaketPengiriman(
|
||||||
|
String? idPengiriman) async {
|
||||||
|
client = http.Client();
|
||||||
|
late Map<String, dynamic> result;
|
||||||
|
bool _cek_jaringan = await cek_jaringan(client);
|
||||||
|
|
||||||
|
// log("cek jaringan : " + _cek_jaringan.toString());
|
||||||
|
|
||||||
|
if (!_cek_jaringan) {
|
||||||
|
result = {
|
||||||
|
'status': 500,
|
||||||
|
'message':
|
||||||
|
"Tidak dapat terhubung ke server, Sila periksa koneksi internet anda"
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
// wait for 3 sec
|
||||||
|
// await Future.delayed(Duration(seconds: 3));
|
||||||
|
// result = {'status': 200, 'message': "sini dia"};
|
||||||
|
|
||||||
|
try {
|
||||||
|
var response = await client.post(
|
||||||
|
Uri.parse(
|
||||||
|
"${globals.http_to_server}api/kurir/mengambil_paket_pengiriman?username=$username&password=$password&id=$id"),
|
||||||
|
headers: {
|
||||||
|
"Accept": "application/json",
|
||||||
|
// "authorization":
|
||||||
|
// "Basic ${base64Encode(utf8.encode("Kicap_karan:bb10c6d9f01ec0cb16726b59e36c2f73"))}",
|
||||||
|
"crossDomain": "true"
|
||||||
|
},
|
||||||
|
body: {
|
||||||
|
"id_pengiriman": idPengiriman
|
||||||
|
}).timeout(const Duration(seconds: 60));
|
||||||
|
final data = jsonDecode(response.body);
|
||||||
|
// log(data.toString());
|
||||||
|
// log("ini status : " + response.statusCode.toString());
|
||||||
|
if (response.statusCode == 200) {
|
||||||
|
result = {
|
||||||
|
'status': 200,
|
||||||
|
'message': data['message'],
|
||||||
|
'data': data['data']
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
result = {
|
||||||
|
'status': response.statusCode,
|
||||||
|
'message': data['message'],
|
||||||
|
'data': data
|
||||||
|
};
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
result = {
|
||||||
|
'status': 500,
|
||||||
|
'message':
|
||||||
|
"Tidak dapat terhubung ke server, Sila periksa koneksi internet anda"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
// checking connection to server
|
// checking connection to server
|
||||||
static Future<bool> cek_jaringan(http.Client client) async {
|
static Future<bool> cek_jaringan(http.Client client) async {
|
||||||
late bool result;
|
late bool result;
|
||||||
|
|||||||
12
lib/binding/progressPenghantaranKurirBinding.dart
Normal file
12
lib/binding/progressPenghantaranKurirBinding.dart
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
// ignore_for_file: file_names
|
||||||
|
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
import '../controller/after_login/kurir/progressPenghantaranController.dart';
|
||||||
|
|
||||||
|
class ProgressPenghantaranKurirBinding extends Bindings {
|
||||||
|
@override
|
||||||
|
void dependencies() {
|
||||||
|
Get.put(ProgressPenghantaranControllerKurir());
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -84,7 +84,7 @@ class KurirIndexController extends GetxController {
|
|||||||
log("sini on item tapped");
|
log("sini on item tapped");
|
||||||
_indexTap.value = index;
|
_indexTap.value = index;
|
||||||
if (index == 3) {
|
if (index == 3) {
|
||||||
Get.offAllNamed('/profileKurir');
|
Get.offAllNamed('/kurirIndex/profileKurir');
|
||||||
}
|
}
|
||||||
FocusScope.of(context).unfocus();
|
FocusScope.of(context).unfocus();
|
||||||
// Get.delete<PengaturanKurirController>();
|
// Get.delete<PengaturanKurirController>();
|
||||||
|
|||||||
@ -37,10 +37,18 @@ class PengirimanKurirController extends GetxController {
|
|||||||
@override
|
@override
|
||||||
void onReady() {
|
void onReady() {
|
||||||
super.onReady();
|
super.onReady();
|
||||||
dev.log("sini on ready pengiriman");
|
|
||||||
pengirimanAll();
|
pengirimanAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
super.dispose();
|
||||||
|
mapController.dispose();
|
||||||
|
_polylineCoordinates.clear();
|
||||||
|
markers.clear();
|
||||||
|
polylines.clear();
|
||||||
|
}
|
||||||
|
|
||||||
pengirimanAll() async {
|
pengirimanAll() async {
|
||||||
loadPengiriman.value = 0;
|
loadPengiriman.value = 0;
|
||||||
pengirimanModelList.value = [];
|
pengirimanModelList.value = [];
|
||||||
@ -61,35 +69,6 @@ class PengirimanKurirController extends GetxController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String timeZoneAdd8(time) {
|
|
||||||
// add 8 hours to timezone
|
|
||||||
// createdAt.add(Duration(hours: 8));
|
|
||||||
// dev.log(createdAt.toString());
|
|
||||||
var _time = DateTime.parse(time).add(const Duration(hours: 8));
|
|
||||||
// dev.log(_time.toString());
|
|
||||||
// seperate date and time
|
|
||||||
var _date = _time.toString().split(" ")[0];
|
|
||||||
var _time2 = _time.toString().split(" ")[1];
|
|
||||||
// only take the hour and minute
|
|
||||||
_time2 = _time2.split(":")[0] + ":" + _time2.split(":")[1];
|
|
||||||
// if the hour is less than 10, add 0 before
|
|
||||||
if (_time2.split(":")[0].length == 1) {
|
|
||||||
_time2 = "0" + _time2;
|
|
||||||
}
|
|
||||||
// if the minute is less than 10, add 0 before
|
|
||||||
if (_time2.split(":")[1].length == 1) {
|
|
||||||
_time2 = _time2 + "0";
|
|
||||||
}
|
|
||||||
// if past 12:00, add "PM"
|
|
||||||
if (int.parse(_time2.split(":")[0]) >= 12) {
|
|
||||||
_time2 = _time2 + " PM";
|
|
||||||
} else {
|
|
||||||
_time2 = _time2 + " AM";
|
|
||||||
}
|
|
||||||
|
|
||||||
return _date + " | " + _time2;
|
|
||||||
}
|
|
||||||
|
|
||||||
String cekHarga(
|
String cekHarga(
|
||||||
double distance, int biayaMinimal, int biayaMaksimal, int biayaPerKilo) {
|
double distance, int biayaMinimal, int biayaMaksimal, int biayaPerKilo) {
|
||||||
//
|
//
|
||||||
@ -104,30 +83,16 @@ class PengirimanKurirController extends GetxController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
cekDistance(LatLng latLngPengiriman, LatLng latLngPermulaan) async {
|
cekDistance(LatLng latLngPengiriman, LatLng latLngPermulaan) async {
|
||||||
dev.log("sini dia berlaku");
|
double distance = await PengirimApi.jarak_route(
|
||||||
PolylineResult _result = await _polylinePoints.getRouteBetweenCoordinates(
|
latLngPermulaan.latitude,
|
||||||
_googleAPiKey,
|
latLngPermulaan.longitude,
|
||||||
PointLatLng(latLngPermulaan.latitude, latLngPermulaan.longitude),
|
latLngPengiriman.latitude,
|
||||||
PointLatLng(latLngPengiriman.latitude, latLngPengiriman.longitude),
|
latLngPengiriman.longitude,
|
||||||
travelMode: TravelMode.driving,
|
|
||||||
// travelMode: TravelMode.driving,
|
|
||||||
);
|
);
|
||||||
|
|
||||||
// log(_result.points.toString() + "ini dia");
|
dev.log(distance.toString() + "ini dia");
|
||||||
if (_result.points.isNotEmpty) {
|
|
||||||
double distance = await PengirimApi.jarak_route(
|
|
||||||
latLngPermulaan.latitude,
|
|
||||||
latLngPermulaan.longitude,
|
|
||||||
latLngPengiriman.latitude,
|
|
||||||
latLngPengiriman.longitude,
|
|
||||||
);
|
|
||||||
|
|
||||||
dev.log(distance.toString() + "ini dia");
|
return distance;
|
||||||
|
|
||||||
return distance;
|
|
||||||
} else {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void showMapDialog(BuildContext context, PengirimanModel data) async {
|
void showMapDialog(BuildContext context, PengirimanModel data) async {
|
||||||
@ -141,19 +106,19 @@ class PengirimanKurirController extends GetxController {
|
|||||||
_listLatLng = null;
|
_listLatLng = null;
|
||||||
// _polylinePoints.clear();
|
// _polylinePoints.clear();
|
||||||
|
|
||||||
LatLng _latLng_pengiriman = LatLng(
|
LatLng latLngPengiriman = LatLng(
|
||||||
double.parse(data.kordinatPengiriman!.lat!),
|
double.parse(data.kordinatPengiriman!.lat!),
|
||||||
double.parse(data.kordinatPengiriman!.lng!),
|
double.parse(data.kordinatPengiriman!.lng!),
|
||||||
);
|
);
|
||||||
|
|
||||||
LatLng _latLng_permulaan = LatLng(
|
LatLng latLngPermulaan = LatLng(
|
||||||
double.parse(data.kordinatPermulaan!.lat!),
|
double.parse(data.kordinatPermulaan!.lat!),
|
||||||
double.parse(data.kordinatPermulaan!.lng!),
|
double.parse(data.kordinatPermulaan!.lng!),
|
||||||
);
|
);
|
||||||
|
|
||||||
await setPolylines(
|
await setPolylines(
|
||||||
_latLng_pengiriman,
|
latLngPengiriman,
|
||||||
_latLng_permulaan,
|
latLngPermulaan,
|
||||||
);
|
);
|
||||||
|
|
||||||
markers.add(
|
markers.add(
|
||||||
@ -191,11 +156,11 @@ class PengirimanKurirController extends GetxController {
|
|||||||
await EasyLoading.dismiss();
|
await EasyLoading.dismiss();
|
||||||
}
|
}
|
||||||
|
|
||||||
setPolylines(LatLng latLng_pengiriman, LatLng latLng_permulaan) async {
|
setPolylines(LatLng latLngPengiriman, LatLng latLngPermulaan) async {
|
||||||
PolylineResult _result = await _polylinePoints.getRouteBetweenCoordinates(
|
PolylineResult _result = await _polylinePoints.getRouteBetweenCoordinates(
|
||||||
_googleAPiKey,
|
_googleAPiKey,
|
||||||
PointLatLng(latLng_permulaan.latitude, latLng_permulaan.longitude),
|
PointLatLng(latLngPermulaan.latitude, latLngPermulaan.longitude),
|
||||||
PointLatLng(latLng_pengiriman.latitude, latLng_pengiriman.longitude),
|
PointLatLng(latLngPengiriman.latitude, latLngPengiriman.longitude),
|
||||||
travelMode: TravelMode.driving,
|
travelMode: TravelMode.driving,
|
||||||
// travelMode: TravelMode.driving,
|
// travelMode: TravelMode.driving,
|
||||||
);
|
);
|
||||||
@ -204,12 +169,12 @@ class PengirimanKurirController extends GetxController {
|
|||||||
if (_result.points.isNotEmpty) {
|
if (_result.points.isNotEmpty) {
|
||||||
// loop through all PointLatLng points and convert them
|
// loop through all PointLatLng points and convert them
|
||||||
// to a list of LatLng, required by the Polyline
|
// to a list of LatLng, required by the Polyline
|
||||||
_listLatLng = [latLng_permulaan];
|
_listLatLng = [latLngPermulaan];
|
||||||
for (var point in _result.points) {
|
for (var point in _result.points) {
|
||||||
_polylineCoordinates.add(LatLng(point.latitude, point.longitude));
|
_polylineCoordinates.add(LatLng(point.latitude, point.longitude));
|
||||||
_listLatLng!.add(LatLng(point.latitude, point.longitude));
|
_listLatLng!.add(LatLng(point.latitude, point.longitude));
|
||||||
}
|
}
|
||||||
_listLatLng!.add(latLng_pengiriman);
|
_listLatLng!.add(latLngPengiriman);
|
||||||
|
|
||||||
Polyline polyline = Polyline(
|
Polyline polyline = Polyline(
|
||||||
polylineId: const PolylineId("poly"),
|
polylineId: const PolylineId("poly"),
|
||||||
@ -231,7 +196,7 @@ class PengirimanKurirController extends GetxController {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
lihat_foto_kiriman(BuildContext context, String fotoPengiriman) {
|
lihatFotoKiriman(BuildContext context, String fotoPengiriman) {
|
||||||
if (fotoPengiriman != "") {
|
if (fotoPengiriman != "") {
|
||||||
Get.dialog(
|
Get.dialog(
|
||||||
_FotoPengirimanDialogBox(
|
_FotoPengirimanDialogBox(
|
||||||
@ -252,6 +217,257 @@ class PengirimanKurirController extends GetxController {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void terimaPengiriman(String? sId) {
|
||||||
|
// dev.log("terima pengiriman");
|
||||||
|
// create get alert dialog
|
||||||
|
Get.dialog(
|
||||||
|
_TerimaBatalPengiriman(
|
||||||
|
text: "terima",
|
||||||
|
id: sId,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// coba() {
|
||||||
|
// loadPengiriman.value = 0;
|
||||||
|
// pengirimanModelList.clear();
|
||||||
|
// dev.log(loadPengiriman.value.toString());
|
||||||
|
// dev.log(pengirimanModelList.toString());
|
||||||
|
// }
|
||||||
|
|
||||||
|
konfirmTerimaPengiriman(String? id) async {
|
||||||
|
// dev.log("konfirm terima pengiriman $id");
|
||||||
|
// coba();
|
||||||
|
await EasyLoading.show(
|
||||||
|
status: 'Loading...',
|
||||||
|
maskType: EasyLoadingMaskType.black,
|
||||||
|
);
|
||||||
|
Map<String, dynamic> _data = await KurirApi.sahkanPengiriman(id);
|
||||||
|
if (_data['status'] == 200) {
|
||||||
|
// loadPengiriman.value = 0;
|
||||||
|
Get.snackbar(
|
||||||
|
"Info",
|
||||||
|
"Pengiriman Disahkan Oleh Anda\nBisa Klik 'Mengambil Paket' jika ingin mengambil paket",
|
||||||
|
icon: const Icon(
|
||||||
|
Icons.info_outline_rounded,
|
||||||
|
color: Color.fromARGB(255, 2, 72, 72),
|
||||||
|
),
|
||||||
|
backgroundColor: Colors.white,
|
||||||
|
duration: const Duration(seconds: 3),
|
||||||
|
snackPosition: SnackPosition.TOP,
|
||||||
|
);
|
||||||
|
|
||||||
|
// Get.back();
|
||||||
|
// futre 1 sec
|
||||||
|
// await Future.delayed(Duration(seconds: 1));
|
||||||
|
// loadPengiriman.value = 0;
|
||||||
|
// pengirimanModelList.value = [];
|
||||||
|
// await pengirimanAll();
|
||||||
|
// onReady();
|
||||||
|
final ctrl = Get.put<PengirimanKurirController>(
|
||||||
|
PengirimanKurirController(),
|
||||||
|
);
|
||||||
|
ctrl.onReady();
|
||||||
|
} else {
|
||||||
|
Get.snackbar(
|
||||||
|
"Info",
|
||||||
|
_data['message'],
|
||||||
|
icon: const Icon(
|
||||||
|
Icons.info_outline_rounded,
|
||||||
|
color: Colors.red,
|
||||||
|
),
|
||||||
|
backgroundColor: const Color.fromARGB(255, 199, 214, 234),
|
||||||
|
duration: const Duration(seconds: 3),
|
||||||
|
snackPosition: SnackPosition.TOP,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
await EasyLoading.dismiss();
|
||||||
|
}
|
||||||
|
|
||||||
|
void batalkanPengiriman(String? sId) {
|
||||||
|
// Get
|
||||||
|
Get.dialog(
|
||||||
|
_TerimaBatalPengiriman(
|
||||||
|
text: "batalkan",
|
||||||
|
id: sId,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
void konfirmBatalPengiriman(String? id) {
|
||||||
|
dev.log("konfirm batal pengiriman $id");
|
||||||
|
}
|
||||||
|
|
||||||
|
void mengambilPaket(String? sId) {
|
||||||
|
// Get
|
||||||
|
Get.dialog(
|
||||||
|
_TerimaBatalPengiriman(id: sId, text: 'mengambil' // mengambil paket
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
void konfirmasiMengambilPaket(String? id) async {
|
||||||
|
// dev.log("konfirm terima pengiriman $id");
|
||||||
|
// coba();
|
||||||
|
await EasyLoading.show(
|
||||||
|
status: 'Loading...',
|
||||||
|
maskType: EasyLoadingMaskType.black,
|
||||||
|
);
|
||||||
|
Map<String, dynamic> _data = await KurirApi.mengambilPaketPengiriman(id);
|
||||||
|
if (_data['status'] == 200) {
|
||||||
|
// loadPengiriman.value = 0;
|
||||||
|
Get.snackbar(
|
||||||
|
"Info",
|
||||||
|
"Pengiriman Disahkan Oleh Anda\nBisa Klik 'Mengambil Paket' jika ingin mengambil paket",
|
||||||
|
icon: const Icon(
|
||||||
|
Icons.info_outline_rounded,
|
||||||
|
color: Color.fromARGB(255, 2, 72, 72),
|
||||||
|
),
|
||||||
|
backgroundColor: Colors.white,
|
||||||
|
duration: const Duration(seconds: 3),
|
||||||
|
snackPosition: SnackPosition.TOP,
|
||||||
|
);
|
||||||
|
|
||||||
|
// Get.back();
|
||||||
|
// futre 1 sec
|
||||||
|
// await Future.delayed(Duration(seconds: 1));
|
||||||
|
// loadPengiriman.value = 0;
|
||||||
|
// pengirimanModelList.value = [];
|
||||||
|
// await pengirimanAll();
|
||||||
|
// onReady();
|
||||||
|
final ctrl = Get.put<PengirimanKurirController>(
|
||||||
|
PengirimanKurirController(),
|
||||||
|
);
|
||||||
|
ctrl.onReady();
|
||||||
|
} else {
|
||||||
|
Get.snackbar(
|
||||||
|
"Info",
|
||||||
|
_data['message'],
|
||||||
|
icon: const Icon(
|
||||||
|
Icons.info_outline_rounded,
|
||||||
|
color: Colors.red,
|
||||||
|
),
|
||||||
|
backgroundColor: const Color.fromARGB(255, 199, 214, 234),
|
||||||
|
duration: const Duration(seconds: 3),
|
||||||
|
snackPosition: SnackPosition.TOP,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
await EasyLoading.dismiss();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class _TerimaBatalPengiriman extends StatelessWidget {
|
||||||
|
_TerimaBatalPengiriman({
|
||||||
|
Key? key,
|
||||||
|
this.id,
|
||||||
|
required this.text,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
final PengirimanKurirController controller = PengirimanKurirController();
|
||||||
|
final String? id;
|
||||||
|
final String text;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
late String _text;
|
||||||
|
switch (text) {
|
||||||
|
case "terima":
|
||||||
|
_text = "Anda akan menyetujui permintaan pengiriman ini";
|
||||||
|
break;
|
||||||
|
case "batalkan":
|
||||||
|
_text = "Anda akan membatalkan permintaan pengiriman ini";
|
||||||
|
break;
|
||||||
|
case "mengambil":
|
||||||
|
_text = "Anda akan mengambil paket pengiriman ini?";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return AlertDialog(
|
||||||
|
content: Container(
|
||||||
|
height: MediaQuery.of(context).size.height * 0.2,
|
||||||
|
alignment: Alignment.topCenter,
|
||||||
|
padding: const EdgeInsets.only(left: 10, right: 10),
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
const Text(
|
||||||
|
"Info",
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 20,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
_text,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: const TextStyle(
|
||||||
|
fontSize: 15,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
|
children: [
|
||||||
|
SizedBox(
|
||||||
|
width: 75,
|
||||||
|
height: 40,
|
||||||
|
child: ElevatedButton(
|
||||||
|
style: ElevatedButton.styleFrom(
|
||||||
|
primary: (text != 'batalkan')
|
||||||
|
? const Color.fromARGB(255, 2, 72, 72)
|
||||||
|
: Colors.red,
|
||||||
|
),
|
||||||
|
onPressed: () {
|
||||||
|
Get.back();
|
||||||
|
switch (text) {
|
||||||
|
case "terima":
|
||||||
|
controller.konfirmTerimaPengiriman(id);
|
||||||
|
break;
|
||||||
|
case "batalkan":
|
||||||
|
controller.konfirmBatalPengiriman(id);
|
||||||
|
break;
|
||||||
|
case "mengambil":
|
||||||
|
controller.konfirmasiMengambilPaket(id);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// if (text == 'terima') {
|
||||||
|
// controller.konfirmTerimaPengiriman(id);
|
||||||
|
// } else {
|
||||||
|
// controller.konfirmBatalPengiriman(id);
|
||||||
|
// }
|
||||||
|
},
|
||||||
|
child: const Text("Ya"),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: 75,
|
||||||
|
height: 40,
|
||||||
|
child: ElevatedButton(
|
||||||
|
style: ElevatedButton.styleFrom(
|
||||||
|
primary: const Color.fromARGB(255, 104, 164, 164),
|
||||||
|
),
|
||||||
|
onPressed: () {
|
||||||
|
Get.back();
|
||||||
|
},
|
||||||
|
child: const Text("Tidak"),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class _MapDialogBox extends StatelessWidget {
|
class _MapDialogBox extends StatelessWidget {
|
||||||
@ -275,8 +491,8 @@ class _MapDialogBox extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return AlertDialog(
|
return AlertDialog(
|
||||||
backgroundColor: Color.fromARGB(255, 104, 164, 164),
|
backgroundColor: const Color.fromARGB(255, 104, 164, 164),
|
||||||
content: Container(
|
content: SizedBox(
|
||||||
height: Get.height * 0.5,
|
height: Get.height * 0.5,
|
||||||
child: GoogleMap(
|
child: GoogleMap(
|
||||||
mapType: MapType.normal,
|
mapType: MapType.normal,
|
||||||
@ -304,15 +520,15 @@ class _MapDialogBox extends StatelessWidget {
|
|||||||
double.parse(data.kordinatPermulaan!.lng!))),
|
double.parse(data.kordinatPermulaan!.lng!))),
|
||||||
builder: (context, snapshot) {
|
builder: (context, snapshot) {
|
||||||
if (snapshot.hasData) {
|
if (snapshot.hasData) {
|
||||||
return Container(
|
return SizedBox(
|
||||||
width: 200,
|
width: 200,
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
enabled: false,
|
enabled: false,
|
||||||
style: TextStyle(color: Colors.white),
|
style: const TextStyle(color: Colors.white),
|
||||||
initialValue: snapshot.data.toString() + " km",
|
initialValue: snapshot.data.toString() + " km",
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
labelText: 'Jarak Pengiriman',
|
labelText: 'Jarak Pengiriman',
|
||||||
labelStyle: TextStyle(color: Colors.white),
|
labelStyle: const TextStyle(color: Colors.white),
|
||||||
filled: true,
|
filled: true,
|
||||||
fillColor: Colors.transparent,
|
fillColor: Colors.transparent,
|
||||||
disabledBorder: OutlineInputBorder(
|
disabledBorder: OutlineInputBorder(
|
||||||
@ -330,16 +546,16 @@ class _MapDialogBox extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
} else if (snapshot.hasError) {
|
} else if (snapshot.hasError) {
|
||||||
return Text(
|
return const Text(
|
||||||
"Error mengambil data",
|
"Error mengambil data",
|
||||||
style: const TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 15,
|
fontSize: 15,
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return Center(
|
return const Center(
|
||||||
child: CircularProgressIndicator(
|
child: CircularProgressIndicator(
|
||||||
valueColor: AlwaysStoppedAnimation<Color>(
|
valueColor: AlwaysStoppedAnimation<Color>(
|
||||||
Colors.white,
|
Colors.white,
|
||||||
@ -369,7 +585,7 @@ class _FotoPengirimanDialogBox extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return AlertDialog(
|
return AlertDialog(
|
||||||
backgroundColor: Color.fromARGB(255, 104, 164, 164),
|
backgroundColor: const Color.fromARGB(255, 104, 164, 164),
|
||||||
title: const Text(
|
title: const Text(
|
||||||
"Foto Pengiriman",
|
"Foto Pengiriman",
|
||||||
style: TextStyle(color: Colors.white),
|
style: TextStyle(color: Colors.white),
|
||||||
@ -399,13 +615,25 @@ class _FotoPengirimanDialogBox extends StatelessWidget {
|
|||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: Container(
|
// child: Container(
|
||||||
decoration: BoxDecoration(
|
// decoration: BoxDecoration(
|
||||||
image: DecorationImage(
|
// image: DecorationImage(
|
||||||
image: NetworkImage(fotoPengiriman),
|
// image: NetworkImage(fotoPengiriman),
|
||||||
fit: BoxFit.cover,
|
// fit: BoxFit.cover,
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
|
// ),
|
||||||
|
child: Image.network(
|
||||||
|
fotoPengiriman,
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
errorBuilder: (context, error, stackTrace) {
|
||||||
|
return const Center(
|
||||||
|
child: Icon(
|
||||||
|
Icons.error,
|
||||||
|
color: Colors.black,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@ -0,0 +1,281 @@
|
|||||||
|
// ignore_for_file: file_names
|
||||||
|
|
||||||
|
import 'dart:developer' as dev;
|
||||||
|
|
||||||
|
import 'package:enhance_stepper/enhance_stepper.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:kurir/function/allFunction.dart';
|
||||||
|
import 'package:kurir/models/pengirimimanModel.dart';
|
||||||
|
|
||||||
|
import '../../../api/kurirApi.dart';
|
||||||
|
|
||||||
|
class ProgressPenghantaranControllerKurir extends GetxController {
|
||||||
|
Rx<String> text = "heheh".obs;
|
||||||
|
String id = Get.arguments;
|
||||||
|
Rx<Widget> enhanceStepContainer = Container(
|
||||||
|
height: Get.height * 0.6,
|
||||||
|
width: double.infinity,
|
||||||
|
color: Colors.transparent,
|
||||||
|
child: const Center(
|
||||||
|
child: CircularProgressIndicator(
|
||||||
|
valueColor: AlwaysStoppedAnimation<Color>(Colors.white),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
).obs;
|
||||||
|
RxInt currentStep = 0.obs;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void onInit() {
|
||||||
|
super.onInit();
|
||||||
|
// text.value = "heheh222";
|
||||||
|
dev.log("disini progress penghantaran bagian kurir berlaku");
|
||||||
|
|
||||||
|
// future 3 sec
|
||||||
|
getData();
|
||||||
|
}
|
||||||
|
|
||||||
|
void getData() async {
|
||||||
|
Map<String, dynamic> _data = await KurirApi.detailPengiriman(id);
|
||||||
|
if (_data["status"] == 200) {
|
||||||
|
final PengirimanModel _pengiriman =
|
||||||
|
PengirimanModel.fromJson(_data["data"]);
|
||||||
|
List<EnhanceStep> _step = [];
|
||||||
|
var _history = _data["data"]["history"];
|
||||||
|
currentStep.value = _history.length - 1;
|
||||||
|
for (var i = 0; i < _history.length; i++) {
|
||||||
|
final History _historyItem = History.fromJson(_history[i]);
|
||||||
|
_step.add(
|
||||||
|
_enhanceStepChild(_historyItem, _pengiriman),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
enhanceStepContainer.value = Container(
|
||||||
|
height: Get.height * 0.6,
|
||||||
|
width: double.infinity,
|
||||||
|
color: Colors.transparent,
|
||||||
|
child: _EnhanceStepper(step: _step, currentStep: currentStep),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
EnhanceStep _enhanceStepChild(History data, PengirimanModel pengiriman) {
|
||||||
|
late Icon _icon;
|
||||||
|
late Widget _title, _content;
|
||||||
|
Widget _subtitle = Text(
|
||||||
|
AllFunction.timeZoneAdd8(data.waktu),
|
||||||
|
style: const TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 15,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
switch (data.statusPengiriman) {
|
||||||
|
case "Dalam Pengesahan Kurir":
|
||||||
|
_icon = const Icon(
|
||||||
|
Icons.info_outline,
|
||||||
|
color: Colors.white,
|
||||||
|
size: 30,
|
||||||
|
);
|
||||||
|
_title = const Text(
|
||||||
|
"Dalam Pengesahan Kurir",
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 20,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
_content = Text(
|
||||||
|
"Pengirim melakukan pengiriman dan menunggu pengesahan kurir pada waktu ${AllFunction.timeZoneAdd8(data.waktu)}",
|
||||||
|
style: const TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 15,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
case "Disahkan Kurir":
|
||||||
|
_icon = const Icon(
|
||||||
|
Icons.check_box,
|
||||||
|
color: Colors.white,
|
||||||
|
size: 30,
|
||||||
|
);
|
||||||
|
_title = const Text(
|
||||||
|
"Disahkan Kurir",
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 20,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
_content = Text(
|
||||||
|
"Kurir mengkonfirmasi pengiriman pada waktu ${AllFunction.timeZoneAdd8(data.waktu)}",
|
||||||
|
style: const TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 15,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
case "Mengambil Paket Pengiriman Dari Pengirim":
|
||||||
|
_icon = const Icon(
|
||||||
|
Icons.motorcycle_outlined,
|
||||||
|
color: Colors.white,
|
||||||
|
size: 30,
|
||||||
|
);
|
||||||
|
_title = const Text(
|
||||||
|
"Mengambil Paket Pengiriman Dari Pengirim",
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 20,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
_content = const _MengambilPaketKirimanRichtext();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return EnhanceStep(
|
||||||
|
icon: _icon,
|
||||||
|
title: _title,
|
||||||
|
subtitle: _subtitle,
|
||||||
|
content: _content,
|
||||||
|
isActive: true,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class _MengambilPaketKirimanRichtext extends StatelessWidget {
|
||||||
|
const _MengambilPaketKirimanRichtext({
|
||||||
|
Key? key,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Column(
|
||||||
|
children: [
|
||||||
|
RichText(
|
||||||
|
textAlign: TextAlign.justify,
|
||||||
|
text: const TextSpan(
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 15,
|
||||||
|
),
|
||||||
|
children: [
|
||||||
|
TextSpan(
|
||||||
|
text:
|
||||||
|
"Dalam perjalanan mengambail paker dari pengirim. Klik "),
|
||||||
|
TextSpan(
|
||||||
|
text: "'Terima Paket Pengiriman' ",
|
||||||
|
style: TextStyle(
|
||||||
|
fontStyle: FontStyle.italic,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
TextSpan(text: "jika sampai ke lokasi pengirim & scan "),
|
||||||
|
TextSpan(
|
||||||
|
text: "QRcode ",
|
||||||
|
style: TextStyle(
|
||||||
|
fontStyle: FontStyle.italic,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
TextSpan(text: "yang ada pada aplikasi pengirim. Klik "),
|
||||||
|
TextSpan(
|
||||||
|
text: "'Rute Lokasi' ",
|
||||||
|
style: TextStyle(
|
||||||
|
fontStyle: FontStyle.italic,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
TextSpan(text: "untuk melihat rute lokasi pengirim."),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: double.infinity,
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
|
children: const [
|
||||||
|
_ExpandedButton(flex: 2, text: 'Terima Paket\nPengiriman'),
|
||||||
|
Expanded(flex: 1, child: SizedBox()),
|
||||||
|
_ExpandedButton(flex: 2, text: 'Rute Lokasi'),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class _ExpandedButton extends StatelessWidget {
|
||||||
|
const _ExpandedButton({
|
||||||
|
Key? key,
|
||||||
|
required this.text,
|
||||||
|
required this.flex,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
final String text;
|
||||||
|
final int flex;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Expanded(
|
||||||
|
flex: flex,
|
||||||
|
child: FittedBox(
|
||||||
|
child: SizedBox(
|
||||||
|
width: 100,
|
||||||
|
height: 35,
|
||||||
|
child: ElevatedButton(
|
||||||
|
style: ElevatedButton.styleFrom(
|
||||||
|
primary: Colors.white,
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(20),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
onPressed: () {},
|
||||||
|
child: FittedBox(
|
||||||
|
child: Text(
|
||||||
|
text,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: const TextStyle(
|
||||||
|
color: Color.fromARGB(255, 2, 72, 72),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class _EnhanceStepper extends StatelessWidget {
|
||||||
|
const _EnhanceStepper({
|
||||||
|
Key? key,
|
||||||
|
required List<EnhanceStep> step,
|
||||||
|
required this.currentStep,
|
||||||
|
}) : _step = step,
|
||||||
|
super(key: key);
|
||||||
|
|
||||||
|
final List<EnhanceStep> _step;
|
||||||
|
final RxInt currentStep;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return GetX<ProgressPenghantaranControllerKurir>(
|
||||||
|
init: ProgressPenghantaranControllerKurir(),
|
||||||
|
builder: (c) {
|
||||||
|
return EnhanceStepper(
|
||||||
|
stepIconSize: 30,
|
||||||
|
controlsBuilder: (BuildContext context, ControlsDetails details) {
|
||||||
|
return const SizedBox();
|
||||||
|
},
|
||||||
|
type: StepperType.vertical,
|
||||||
|
steps: _step,
|
||||||
|
currentStep: c.currentStep.value,
|
||||||
|
onStepTapped: (int index) {
|
||||||
|
c.currentStep.value = index;
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -231,10 +231,26 @@ class InfoPengirimanController extends GetxController {
|
|||||||
backgroundColor: Colors.white,
|
backgroundColor: Colors.white,
|
||||||
child: CircleAvatar(
|
child: CircleAvatar(
|
||||||
radius: 50.0,
|
radius: 50.0,
|
||||||
backgroundImage: NetworkImage(
|
// backgroundImage: NetworkImage(
|
||||||
pengirimanModel.kurir!.photo_url ??
|
// pengirimanModel.kurir!.photo_url ??
|
||||||
'https://via.placeholder.com/150'),
|
// 'https://via.placeholder.com/150'),
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
|
child: ClipOval(
|
||||||
|
child: Image.network(
|
||||||
|
pengirimanModel.kurir!.photo_url ??
|
||||||
|
'https://via.placeholder.com/150',
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
width: 100,
|
||||||
|
height: 100,
|
||||||
|
errorBuilder: (context, url, error) {
|
||||||
|
return const Center(
|
||||||
|
child: Icon(
|
||||||
|
Icons.error,
|
||||||
|
size: 20,
|
||||||
|
));
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -265,6 +281,13 @@ class InfoPengirimanController extends GetxController {
|
|||||||
pengirimanModel.kurir!.kenderaan_url ??
|
pengirimanModel.kurir!.kenderaan_url ??
|
||||||
"https://via.placeholder.com/150",
|
"https://via.placeholder.com/150",
|
||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
|
errorBuilder: (context, url, error) {
|
||||||
|
return const Center(
|
||||||
|
child: Icon(
|
||||||
|
Icons.error,
|
||||||
|
size: 20,
|
||||||
|
));
|
||||||
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -357,16 +380,27 @@ class InfoPengirimanController extends GetxController {
|
|||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: Container(
|
child: Image.network(
|
||||||
decoration: BoxDecoration(
|
pengirimanModel.fotoPengiriman ?? "https://via.placeholder.com/150",
|
||||||
// borderRadius: BorderRadius.circular(100),
|
fit: BoxFit.cover,
|
||||||
image: DecorationImage(
|
errorBuilder: (context, url, error) {
|
||||||
image: NetworkImage(pengirimanModel.fotoPengiriman ??
|
return const Center(
|
||||||
"https://via.placeholder.com/150"),
|
child: Icon(
|
||||||
fit: BoxFit.fill,
|
Icons.error,
|
||||||
),
|
size: 20,
|
||||||
),
|
));
|
||||||
|
},
|
||||||
),
|
),
|
||||||
|
// child: Container(
|
||||||
|
// decoration: BoxDecoration(
|
||||||
|
// // borderRadius: BorderRadius.circular(100),
|
||||||
|
// image: DecorationImage(
|
||||||
|
// image: NetworkImage(pengirimanModel.fotoPengiriman ??
|
||||||
|
// "https://via.placeholder.com/150"),
|
||||||
|
// fit: BoxFit.fill,
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@ -768,9 +768,30 @@ class KirimBarangController extends GetxController {
|
|||||||
backgroundColor: Colors.white,
|
backgroundColor: Colors.white,
|
||||||
child: CircleAvatar(
|
child: CircleAvatar(
|
||||||
radius: 40.0,
|
radius: 40.0,
|
||||||
backgroundImage: NetworkImage(kurirModel.photo_url ??
|
// backgroundImage: NetworkImage(
|
||||||
'https://via.placeholder.com/150'),
|
// kurirModel.photo_url ??
|
||||||
|
// 'https://via.placeholder.com/150',
|
||||||
|
|
||||||
|
// ),
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
|
child: ClipOval(
|
||||||
|
child: Image.network(
|
||||||
|
kurirModel.photo_url ??
|
||||||
|
'https://via.placeholder.com/150',
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
width: 100,
|
||||||
|
height: 100,
|
||||||
|
errorBuilder: (context, error, stackTrace) {
|
||||||
|
return Center(
|
||||||
|
child: const Icon(
|
||||||
|
Icons.error,
|
||||||
|
color: Colors.grey,
|
||||||
|
size: 20,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -1184,9 +1205,26 @@ class KirimBarangController extends GetxController {
|
|||||||
backgroundColor: Colors.white,
|
backgroundColor: Colors.white,
|
||||||
child: CircleAvatar(
|
child: CircleAvatar(
|
||||||
radius: 50.0,
|
radius: 50.0,
|
||||||
backgroundImage: NetworkImage(kurirModel.photo_url ??
|
// backgroundImage: NetworkImage(kurirModel.photo_url ??
|
||||||
'https://via.placeholder.com/150'),
|
// 'https://via.placeholder.com/150'),
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
|
child: ClipOval(
|
||||||
|
child: Image.network(
|
||||||
|
kurirModel.photo_url ??
|
||||||
|
'https://via.placeholder.com/150',
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
width: 100,
|
||||||
|
height: 100,
|
||||||
|
errorBuilder: (context, url, error) {
|
||||||
|
return Center(
|
||||||
|
child: const Icon(
|
||||||
|
Icons.error,
|
||||||
|
size: 20,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -1216,6 +1254,15 @@ class KirimBarangController extends GetxController {
|
|||||||
child: Image.network(
|
child: Image.network(
|
||||||
kurirModel.kenderaan_url.toString(),
|
kurirModel.kenderaan_url.toString(),
|
||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
|
width: 100,
|
||||||
|
errorBuilder: (context, url, error) {
|
||||||
|
return Center(
|
||||||
|
child: const Icon(
|
||||||
|
Icons.error,
|
||||||
|
size: 20,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -1342,9 +1389,25 @@ class KirimBarangController extends GetxController {
|
|||||||
backgroundColor: Colors.white,
|
backgroundColor: Colors.white,
|
||||||
child: CircleAvatar(
|
child: CircleAvatar(
|
||||||
radius: 50.0,
|
radius: 50.0,
|
||||||
backgroundImage: NetworkImage(kurirModel.photo_url ??
|
// backgroundImage: NetworkImage(kurirModel.photo_url ??
|
||||||
'https://via.placeholder.com/150'),
|
// 'https://via.placeholder.com/150'),
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
|
child: ClipOval(
|
||||||
|
child: Image.network(
|
||||||
|
kurirModel.photo_url ?? 'https://via.placeholder.com/150',
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
width: 100,
|
||||||
|
height: 100,
|
||||||
|
errorBuilder: (context, url, error) {
|
||||||
|
return Center(
|
||||||
|
child: const Icon(
|
||||||
|
Icons.error,
|
||||||
|
size: 20,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@ -119,7 +119,7 @@ class LogKirimanController extends GetxController {
|
|||||||
|
|
||||||
String _status = _pengirimanModel.statusPengiriman!;
|
String _status = _pengirimanModel.statusPengiriman!;
|
||||||
|
|
||||||
String _foto_pengiriman = _pengirimanModel.fotoPengiriman!;
|
String _foto_pengiriman = _pengirimanModel.fotoPengiriman ?? '';
|
||||||
// log(_foto_pengiriman + " foto pengiriman");
|
// log(_foto_pengiriman + " foto pengiriman");
|
||||||
|
|
||||||
var _kordinat_pengiriman = _pengirimanModel.kordinatPengiriman!;
|
var _kordinat_pengiriman = _pengirimanModel.kordinatPengiriman!;
|
||||||
@ -270,14 +270,26 @@ class LogKirimanController extends GetxController {
|
|||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: Container(
|
child: Image.network(
|
||||||
decoration: BoxDecoration(
|
foto_pengiriman,
|
||||||
image: DecorationImage(
|
fit: BoxFit.cover,
|
||||||
image: NetworkImage(foto_pengiriman),
|
errorBuilder: (context, error, stackTrace) {
|
||||||
fit: BoxFit.cover,
|
return const Center(
|
||||||
),
|
child: Icon(
|
||||||
),
|
Icons.error,
|
||||||
|
size: 20,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
|
// child: Container(
|
||||||
|
// decoration: BoxDecoration(
|
||||||
|
// image: DecorationImage(
|
||||||
|
// image: NetworkImage(foto_pengiriman),
|
||||||
|
// fit: BoxFit.cover,
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@ -97,4 +97,35 @@ class AllFunction {
|
|||||||
cos(lat1 * p) * cos(lat2 * p) * (1 - cos((lon2 - lon1) * p)) / 2;
|
cos(lat1 * p) * cos(lat2 * p) * (1 - cos((lon2 - lon1) * p)) / 2;
|
||||||
return 12742 * asin(sqrt(a));
|
return 12742 * asin(sqrt(a));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static String timeZoneAdd8(time) {
|
||||||
|
// add 8 hours to timezone
|
||||||
|
// createdAt.add(Duration(hours: 8));
|
||||||
|
// dev.log(createdAt.toString());
|
||||||
|
var _time = DateTime.parse(time).add(const Duration(hours: 8));
|
||||||
|
// dev.log(_time.toString());
|
||||||
|
// seperate date and time
|
||||||
|
var _date = _time.toString().split(" ")[0];
|
||||||
|
var _time2 = _time.toString().split(" ")[1];
|
||||||
|
// only take the hour and minute
|
||||||
|
_time2 = _time2.split(":")[0] + ":" + _time2.split(":")[1];
|
||||||
|
// if the hour is less than 10, add 0 before
|
||||||
|
if (_time2.split(":")[0].length == 1) {
|
||||||
|
_time2 = "0" + _time2;
|
||||||
|
}
|
||||||
|
// if the minute is less than 10, add 0 before
|
||||||
|
if (_time2.split(":")[1].length == 1) {
|
||||||
|
_time2 = _time2 + "0";
|
||||||
|
}
|
||||||
|
// if past 12:00, add "PM"
|
||||||
|
if (int.parse(_time2.split(":")[0]) >= 12) {
|
||||||
|
_time2 = _time2 + " PM";
|
||||||
|
} else {
|
||||||
|
_time2 = _time2 + " AM";
|
||||||
|
}
|
||||||
|
|
||||||
|
return _date + " | " + _time2;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,22 +17,25 @@ class PengirimanModel {
|
|||||||
String? updatedAt;
|
String? updatedAt;
|
||||||
int? iV;
|
int? iV;
|
||||||
String? fotoPengiriman;
|
String? fotoPengiriman;
|
||||||
|
List<History>? history;
|
||||||
|
|
||||||
PengirimanModel(
|
PengirimanModel({
|
||||||
{this.kordinatPengiriman,
|
this.kordinatPengiriman,
|
||||||
this.kordinatPermulaan,
|
this.kordinatPermulaan,
|
||||||
this.biaya,
|
this.biaya,
|
||||||
this.sId,
|
this.sId,
|
||||||
this.namaPenerima,
|
this.namaPenerima,
|
||||||
this.noTelponPenerima,
|
this.noTelponPenerima,
|
||||||
this.alamatPenerima,
|
this.alamatPenerima,
|
||||||
this.statusPengiriman,
|
this.statusPengiriman,
|
||||||
this.kurir,
|
this.kurir,
|
||||||
this.pengirim,
|
this.pengirim,
|
||||||
this.createdAt,
|
this.createdAt,
|
||||||
this.updatedAt,
|
this.updatedAt,
|
||||||
this.iV,
|
this.iV,
|
||||||
this.fotoPengiriman});
|
this.fotoPengiriman,
|
||||||
|
this.history,
|
||||||
|
});
|
||||||
|
|
||||||
PengirimanModel.fromJson(Map<String, dynamic> json) {
|
PengirimanModel.fromJson(Map<String, dynamic> json) {
|
||||||
kordinatPengiriman = json['kordinat_pengiriman'] != null
|
kordinatPengiriman = json['kordinat_pengiriman'] != null
|
||||||
@ -55,6 +58,12 @@ class PengirimanModel {
|
|||||||
updatedAt = json['updated_at'];
|
updatedAt = json['updated_at'];
|
||||||
iV = json['__v'];
|
iV = json['__v'];
|
||||||
fotoPengiriman = json['foto_pengiriman'];
|
fotoPengiriman = json['foto_pengiriman'];
|
||||||
|
if (json['history'] != null) {
|
||||||
|
history = <History>[];
|
||||||
|
json['history'].forEach((v) {
|
||||||
|
history!.add(History.fromJson(v));
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
@ -83,6 +92,9 @@ class PengirimanModel {
|
|||||||
data['updated_at'] = updatedAt;
|
data['updated_at'] = updatedAt;
|
||||||
data['__v'] = iV;
|
data['__v'] = iV;
|
||||||
data['foto_pengiriman'] = fotoPengiriman;
|
data['foto_pengiriman'] = fotoPengiriman;
|
||||||
|
if (history != null) {
|
||||||
|
data['history'] = history!.map((v) => v.toJson()).toList();
|
||||||
|
}
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -149,3 +161,22 @@ class Biaya {
|
|||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class History {
|
||||||
|
String? statusPengiriman;
|
||||||
|
String? waktu;
|
||||||
|
|
||||||
|
History({this.statusPengiriman, this.waktu});
|
||||||
|
|
||||||
|
History.fromJson(Map<String, dynamic> json) {
|
||||||
|
statusPengiriman = json['status_pengiriman'];
|
||||||
|
waktu = json['waktu'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
data['status_pengiriman'] = statusPengiriman;
|
||||||
|
data['waktu'] = waktu;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@ -1,9 +1,11 @@
|
|||||||
// ignore_for_file: file_names
|
// ignore_for_file: file_names
|
||||||
|
import 'dart:developer' as dev;
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_slidable/flutter_slidable.dart';
|
import 'package:flutter_slidable/flutter_slidable.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||||
|
import 'package:kurir/function/allFunction.dart';
|
||||||
|
|
||||||
import '../../../controller/after_login/kurir/pengirimanController.dart';
|
import '../../../controller/after_login/kurir/pengirimanController.dart';
|
||||||
import '../../../models/pengirimimanModel.dart';
|
import '../../../models/pengirimimanModel.dart';
|
||||||
@ -66,8 +68,8 @@ class _MainWidget extends StatelessWidget {
|
|||||||
_SlidableWidget(data: data, controller: controller),
|
_SlidableWidget(data: data, controller: controller),
|
||||||
if (controller.loadPengiriman.value == 1 &&
|
if (controller.loadPengiriman.value == 1 &&
|
||||||
controller.pengirimanModelList.isEmpty)
|
controller.pengirimanModelList.isEmpty)
|
||||||
Center(
|
const Center(
|
||||||
child: const TiadaDataWIdget(
|
child: TiadaDataWIdget(
|
||||||
text: "Tiada data pengiriman\ndalam proses pengesahan")),
|
text: "Tiada data pengiriman\ndalam proses pengesahan")),
|
||||||
if (controller.loadPengiriman.value == 2)
|
if (controller.loadPengiriman.value == 2)
|
||||||
const ErrorLoadDataWidget(),
|
const ErrorLoadDataWidget(),
|
||||||
@ -90,6 +92,25 @@ class _SlidableWidget extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
late String _text;
|
||||||
|
late IconData _icon;
|
||||||
|
|
||||||
|
switch (data.statusPengiriman) {
|
||||||
|
case "Dalam Pengesahan Kurir":
|
||||||
|
_text = "Terima Pengiriman";
|
||||||
|
_icon = Icons.check_box;
|
||||||
|
break;
|
||||||
|
case "Disahkan Kurir":
|
||||||
|
_text = "Mengambil Paket\nKiriman";
|
||||||
|
_icon = Icons.motorcycle_outlined;
|
||||||
|
break;
|
||||||
|
case "Mengambil Paket Pengiriman Dari Pengirim":
|
||||||
|
_text = "Paket Diterima\nDari Pengirim";
|
||||||
|
_icon = Icons.handshake_outlined;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
}
|
||||||
|
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.only(bottom: 10),
|
padding: const EdgeInsets.only(bottom: 10),
|
||||||
child: Slidable(
|
child: Slidable(
|
||||||
@ -102,22 +123,21 @@ class _SlidableWidget extends StatelessWidget {
|
|||||||
SlidableAction(
|
SlidableAction(
|
||||||
flex: 5,
|
flex: 5,
|
||||||
onPressed: (context) {
|
onPressed: (context) {
|
||||||
// Get.offAndToNamed(
|
if (data.statusPengiriman == "Dalam Pengesahan Kurir") {
|
||||||
// '/pengirimIndex/infoPengiriman',
|
controller.terimaPengiriman(data.sId);
|
||||||
// arguments: {
|
} else if (data.statusPengiriman == "Disahkan Kurir") {
|
||||||
// 'pengiriman_model': _pengirimanModel,
|
controller.mengambilPaket(data.sId);
|
||||||
// },
|
}
|
||||||
// );
|
|
||||||
},
|
},
|
||||||
backgroundColor: const Color.fromARGB(255, 104, 164, 164),
|
backgroundColor: const Color.fromARGB(255, 104, 164, 164),
|
||||||
foregroundColor: Colors.white,
|
foregroundColor: Colors.white,
|
||||||
icon: Icons.check_box,
|
icon: _icon,
|
||||||
label: 'Terima Pengiriman',
|
label: _text,
|
||||||
),
|
),
|
||||||
SlidableAction(
|
SlidableAction(
|
||||||
flex: 5,
|
flex: 5,
|
||||||
onPressed: (context) {
|
onPressed: (context) {
|
||||||
controller.lihat_foto_kiriman(context, data.fotoPengiriman!);
|
controller.lihatFotoKiriman(context, data.fotoPengiriman!);
|
||||||
},
|
},
|
||||||
backgroundColor: const Color.fromARGB(255, 4, 103, 103),
|
backgroundColor: const Color.fromARGB(255, 4, 103, 103),
|
||||||
foregroundColor: Colors.white,
|
foregroundColor: Colors.white,
|
||||||
@ -128,18 +148,19 @@ class _SlidableWidget extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
endActionPane: ActionPane(
|
endActionPane: ActionPane(
|
||||||
motion: const DrawerMotion(),
|
motion: const DrawerMotion(),
|
||||||
extentRatio: 0.5,
|
extentRatio:
|
||||||
|
(data.statusPengiriman == "Dalam Pengesahan Kurir") ? 0.5 : 0.01,
|
||||||
children: [
|
children: [
|
||||||
SlidableAction(
|
if (data.statusPengiriman == 'Dalam Pengesahan Kurir')
|
||||||
onPressed: (context) {
|
SlidableAction(
|
||||||
// _lihat_rute_pengiriman(
|
onPressed: (context) {
|
||||||
// context, _kordinat_pengiriman, _kordinat_permulaan);
|
controller.batalkanPengiriman(data.sId);
|
||||||
},
|
},
|
||||||
backgroundColor: Colors.red,
|
backgroundColor: Colors.red,
|
||||||
foregroundColor: Colors.white,
|
foregroundColor: Colors.white,
|
||||||
icon: Icons.cancel_rounded,
|
icon: Icons.cancel_rounded,
|
||||||
label: "Batalkan Permintaan\nPengirim",
|
label: "Batalkan Permintaan\nPengirim",
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
child: _MainChild(data: data, controller: controller),
|
child: _MainChild(data: data, controller: controller),
|
||||||
@ -162,7 +183,7 @@ class _MainChild extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Container(
|
return Container(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: 115,
|
height: 132,
|
||||||
padding: const EdgeInsets.all(10),
|
padding: const EdgeInsets.all(10),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
@ -200,13 +221,32 @@ class _MainChild extends StatelessWidget {
|
|||||||
fit: BoxFit.fitHeight,
|
fit: BoxFit.fitHeight,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: CircleAvatar(
|
child: Center(
|
||||||
radius: 30.0,
|
child: CircleAvatar(
|
||||||
backgroundImage: NetworkImage(
|
radius: 30.0,
|
||||||
data.pengirim!.photoUrl ?? 'https://via.placeholder.com/150',
|
// backgroundImage: NetworkImage(
|
||||||
scale: 0.5,
|
// data.pengirim!.photoUrl ?? 'https://via.placeholder.com/150',
|
||||||
|
// scale: 0.5,
|
||||||
|
// ),
|
||||||
|
backgroundColor: Colors.transparent,
|
||||||
|
child: ClipOval(
|
||||||
|
child: Image.network(
|
||||||
|
data.pengirim!.photoUrl ??
|
||||||
|
'https://via.placeholder.com/150',
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
width: 100,
|
||||||
|
height: 100,
|
||||||
|
errorBuilder: (context, error, stackTrace) {
|
||||||
|
return const Center(
|
||||||
|
child: Icon(
|
||||||
|
Icons.error,
|
||||||
|
size: 20,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
backgroundColor: Colors.transparent,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -214,67 +254,83 @@ class _MainChild extends StatelessWidget {
|
|||||||
flex: 4,
|
flex: 4,
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
const SizedBox(height: 10),
|
FittedBox(
|
||||||
Text(
|
child: Text(
|
||||||
controller.timeZoneAdd8(data.createdAt),
|
AllFunction.timeZoneAdd8(data.createdAt),
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Text(
|
FittedBox(
|
||||||
data.pengirim!.nama!,
|
child: Text(
|
||||||
style: const TextStyle(
|
data.pengirim!.nama!,
|
||||||
fontSize: 15,
|
style: const TextStyle(
|
||||||
color: Colors.grey,
|
fontSize: 15,
|
||||||
overflow: TextOverflow.ellipsis,
|
color: Colors.grey,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
// Coba(data:data,controller:controller)
|
// Coba(data:data,controller:controller)
|
||||||
_FutureBuilderHargaJarak(
|
FittedBox(
|
||||||
controller: controller,
|
child: _FutureBuilderHargaJarak(
|
||||||
data: data,
|
controller: controller,
|
||||||
|
data: data,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
Text(
|
FittedBox(
|
||||||
data.statusPengiriman!,
|
child: Text(
|
||||||
style: const TextStyle(
|
data.statusPengiriman!,
|
||||||
fontSize: 15,
|
style: const TextStyle(
|
||||||
color: Colors.grey,
|
fontSize: 15,
|
||||||
overflow: TextOverflow.ellipsis,
|
color: Colors.grey,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
flex: 1,
|
flex: 2,
|
||||||
child: Container(
|
child: Column(
|
||||||
padding: const EdgeInsets.all(2),
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
width: 50,
|
// crossAxisAlignment: CrossAxisAlignment.end,
|
||||||
height: 50,
|
|
||||||
decoration: BoxDecoration(
|
children: [
|
||||||
color: Color.fromARGB(255, 2, 72, 72),
|
_IconContainer(
|
||||||
shape: BoxShape.circle,
|
icon: const Icon(
|
||||||
boxShadow: [
|
Icons.turn_sharp_right_outlined,
|
||||||
BoxShadow(
|
color: Color.fromARGB(255, 199, 214, 234),
|
||||||
color: const Color.fromARGB(255, 104, 164, 164)
|
|
||||||
.withOpacity(0.5),
|
|
||||||
blurRadius: 10,
|
|
||||||
spreadRadius: 5,
|
|
||||||
),
|
),
|
||||||
],
|
color: const Color.fromARGB(255, 2, 72, 72),
|
||||||
),
|
shadowColor: const Color.fromARGB(255, 104, 164, 164),
|
||||||
child: IconButton(
|
onPressed: () {
|
||||||
onPressed: () {
|
controller.showMapDialog(context, data);
|
||||||
controller.showMapDialog(context, data);
|
// dev.log("ini ditekan");
|
||||||
},
|
},
|
||||||
icon: Icon(
|
|
||||||
Icons.turn_sharp_right_outlined,
|
|
||||||
color: Color.fromARGB(255, 199, 214, 234),
|
|
||||||
),
|
),
|
||||||
),
|
if (data.statusPengiriman != "Dalam Pengesahan Kurir")
|
||||||
|
_IconContainer(
|
||||||
|
icon: const Icon(
|
||||||
|
Icons.info_outlined,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
color: const Color.fromARGB(255, 104, 164, 164),
|
||||||
|
shadowColor: const Color.fromARGB(255, 199, 214, 234),
|
||||||
|
onPressed: () {
|
||||||
|
// controller.showMapDialog(context, data);
|
||||||
|
Get.toNamed('/kurirIndex/progressPenghantaran',
|
||||||
|
arguments: data.sId);
|
||||||
|
dev.log("ini ditekan");
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@ -283,6 +339,45 @@ class _MainChild extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class _IconContainer extends StatelessWidget {
|
||||||
|
const _IconContainer({
|
||||||
|
Key? key,
|
||||||
|
required this.icon,
|
||||||
|
required this.color,
|
||||||
|
required this.shadowColor,
|
||||||
|
required this.onPressed,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
final Icon icon;
|
||||||
|
final Color color;
|
||||||
|
final Color shadowColor;
|
||||||
|
final VoidCallback onPressed;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Container(
|
||||||
|
padding: const EdgeInsets.all(2),
|
||||||
|
width: 50,
|
||||||
|
height: 50,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: color,
|
||||||
|
shape: BoxShape.circle,
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: shadowColor.withOpacity(0.5),
|
||||||
|
blurRadius: 10,
|
||||||
|
spreadRadius: 5,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
child: IconButton(
|
||||||
|
onPressed: onPressed,
|
||||||
|
icon: icon,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class TopSeachInput extends StatelessWidget {
|
class TopSeachInput extends StatelessWidget {
|
||||||
const TopSeachInput({
|
const TopSeachInput({
|
||||||
Key? key,
|
Key? key,
|
||||||
@ -390,16 +485,16 @@ class _FutureBuilderHargaJarak extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
);
|
);
|
||||||
} else if (snapshot.hasError) {
|
} else if (snapshot.hasError) {
|
||||||
return Text(
|
return const Text(
|
||||||
"Error mengambil data",
|
"Error mengambil data",
|
||||||
style: const TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 15,
|
fontSize: 15,
|
||||||
color: Colors.grey,
|
color: Colors.grey,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return Center(
|
return const Center(
|
||||||
child: CircularProgressIndicator(
|
child: CircularProgressIndicator(
|
||||||
valueColor: AlwaysStoppedAnimation<Color>(
|
valueColor: AlwaysStoppedAnimation<Color>(
|
||||||
Color.fromARGB(
|
Color.fromARGB(
|
||||||
|
|||||||
@ -33,7 +33,7 @@ class ProfileKurirPage extends GetView<KurirProfileController> {
|
|||||||
ElevatedButton(
|
ElevatedButton(
|
||||||
child: const Text('Yes'),
|
child: const Text('Yes'),
|
||||||
style: ElevatedButton.styleFrom(
|
style: ElevatedButton.styleFrom(
|
||||||
primary: Color.fromARGB(
|
primary: const Color.fromARGB(
|
||||||
255, 104, 164, 164), //background color
|
255, 104, 164, 164), //background color
|
||||||
// onPrimary: Colors.black, //ripple color
|
// onPrimary: Colors.black, //ripple color
|
||||||
),
|
),
|
||||||
@ -46,8 +46,8 @@ class ProfileKurirPage extends GetView<KurirProfileController> {
|
|||||||
ElevatedButton(
|
ElevatedButton(
|
||||||
child: const Text('No'),
|
child: const Text('No'),
|
||||||
style: ElevatedButton.styleFrom(
|
style: ElevatedButton.styleFrom(
|
||||||
primary:
|
primary: const Color.fromARGB(
|
||||||
Color.fromARGB(255, 2, 72, 72), //background color
|
255, 2, 72, 72), //background color
|
||||||
// onPrimary: Colors.black, //ripple color
|
// onPrimary: Colors.black, //ripple color
|
||||||
),
|
),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
@ -69,8 +69,8 @@ class ProfileKurirPage extends GetView<KurirProfileController> {
|
|||||||
);
|
);
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
child: BoxBackgroundDecoration(
|
child: const BoxBackgroundDecoration(
|
||||||
child: const Center(
|
child: Center(
|
||||||
child: Text('Profile'),
|
child: Text('Profile'),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
30
lib/pages/after_login/kurir/progressPenghantaranPage.dart
Normal file
30
lib/pages/after_login/kurir/progressPenghantaranPage.dart
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
// ignore_for_file: file_names
|
||||||
|
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
import '../../../controller/after_login/kurir/progressPenghantaranController.dart';
|
||||||
|
import '../../../widgets/appbar.dart';
|
||||||
|
import '../../../widgets/boxBackgroundDecoration.dart';
|
||||||
|
|
||||||
|
class ProgressPenghantaranPage
|
||||||
|
extends GetView<ProgressPenghantaranControllerKurir> {
|
||||||
|
const ProgressPenghantaranPage({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
appBar: PreferredSize(
|
||||||
|
preferredSize:
|
||||||
|
Size.fromHeight(MediaQuery.of(context).size.height * 0.08),
|
||||||
|
child: const AppBarWidget(
|
||||||
|
header: "Progress Penghantaran",
|
||||||
|
autoLeading: true,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
body: BoxBackgroundDecoration(
|
||||||
|
child: Obx(() => controller.enhanceStepContainer.value),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -83,17 +83,21 @@ class InfoPengirimanPage extends GetView<InfoPengirimanController> {
|
|||||||
fit: BoxFit.fill,
|
fit: BoxFit.fill,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: Container(
|
child: (controller.pengirimanModel.fotoPengiriman !=
|
||||||
decoration: BoxDecoration(
|
null)
|
||||||
borderRadius: BorderRadius.circular(100),
|
? Container(
|
||||||
image: DecorationImage(
|
decoration: BoxDecoration(
|
||||||
image: NetworkImage(
|
borderRadius: BorderRadius.circular(100),
|
||||||
controller.pengirimanModel.fotoPengiriman!,
|
image: DecorationImage(
|
||||||
),
|
image: NetworkImage(
|
||||||
fit: BoxFit.fill,
|
controller
|
||||||
),
|
.pengirimanModel.fotoPengiriman!,
|
||||||
),
|
),
|
||||||
),
|
fit: BoxFit.fill,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: const SizedBox(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@ -30,7 +30,7 @@ class ListKurirPage extends GetView<ListKurirController> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
_TopSearchInputField(),
|
const _TopSearchInputField(),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@ -168,33 +168,32 @@ class _KurirDetailBox extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
flex: 2,
|
flex: 2,
|
||||||
child: Container(
|
child: Center(
|
||||||
width: 60,
|
child: Container(
|
||||||
height: 60,
|
width: 70,
|
||||||
decoration: BoxDecoration(
|
height: 70,
|
||||||
color: Colors.white,
|
decoration: const BoxDecoration(
|
||||||
shape: BoxShape.circle,
|
shape: BoxShape.circle,
|
||||||
boxShadow: [
|
),
|
||||||
BoxShadow(
|
child: CircleAvatar(
|
||||||
color: const Color.fromARGB(255, 165, 163, 163)
|
radius: 50.0,
|
||||||
.withOpacity(0.5),
|
// backgroundImage: NetworkImage(
|
||||||
blurRadius: 10,
|
// pengirimanModel.kurir!.photo_url ??
|
||||||
spreadRadius: 5,
|
// 'https://via.placeholder.com/150'),
|
||||||
|
backgroundColor: Colors.transparent,
|
||||||
|
child: ClipOval(
|
||||||
|
child: Image.network(
|
||||||
|
data.photo_url ?? 'https://via.placeholder.com/150',
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
width: 100,
|
||||||
|
height: 100,
|
||||||
|
errorBuilder: (context, url, error) {
|
||||||
|
return const Icon(Icons.error);
|
||||||
|
},
|
||||||
|
),
|
||||||
),
|
),
|
||||||
],
|
|
||||||
image: const DecorationImage(
|
|
||||||
image: AssetImage('assets/loading.gif'),
|
|
||||||
fit: BoxFit.fitHeight,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: CircleAvatar(
|
|
||||||
radius: 30.0,
|
|
||||||
backgroundImage: NetworkImage(
|
|
||||||
data.photo_url ?? 'https://via.placeholder.com/150',
|
|
||||||
scale: 0.5,
|
|
||||||
),
|
|
||||||
backgroundColor: Colors.transparent,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
|
|||||||
@ -1,26 +1,27 @@
|
|||||||
import 'package:flutter/animation.dart';
|
import 'package:flutter/animation.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:kurir/binding/beforeEnterBinding.dart';
|
|
||||||
import 'package:kurir/binding/infoPengirimanBinding.dart';
|
|
||||||
import 'package:kurir/binding/kurirIndexBinding.dart';
|
|
||||||
import 'package:kurir/binding/kurirProfileBinding.dart';
|
|
||||||
// import 'package:kurir/binding/indexBinding.dart';
|
|
||||||
import 'package:kurir/binding/pendaftaranKurirBinding.dart';
|
|
||||||
import 'package:kurir/binding/pengirimIndexBinding.dart';
|
|
||||||
import 'package:kurir/binding/pengirimProfileBinding.dart';
|
|
||||||
import 'package:kurir/pages/after_login/before_enter.dart';
|
|
||||||
import 'package:kurir/pages/after_login/kurir/profilePage.dart';
|
|
||||||
import 'package:kurir/pages/after_login/pengirim/infoPengirimanPage.dart';
|
|
||||||
import 'package:kurir/pages/after_login/pengirim/pengirimProfilePage.dart';
|
|
||||||
import 'package:kurir/pages/before_login/daftar.dart';
|
|
||||||
import 'package:kurir/pages/before_login/login.dart';
|
|
||||||
|
|
||||||
|
import '../binding/beforeEnterBinding.dart';
|
||||||
|
import '../binding/infoPengirimanBinding.dart';
|
||||||
|
import '../binding/kurirIndexBinding.dart';
|
||||||
|
import '../binding/kurirProfileBinding.dart';
|
||||||
import '../binding/loginBinding.dart';
|
import '../binding/loginBinding.dart';
|
||||||
|
import '../binding/pendaftaranKurirBinding.dart';
|
||||||
import '../binding/pendaftaranPengirim.dart';
|
import '../binding/pendaftaranPengirim.dart';
|
||||||
|
import '../binding/pengirimIndexBinding.dart';
|
||||||
|
import '../binding/pengirimProfileBinding.dart';
|
||||||
|
import '../binding/progressPenghantaranKurirBinding.dart';
|
||||||
import '../binding/splashBinding.dart';
|
import '../binding/splashBinding.dart';
|
||||||
|
import '../pages/after_login/before_enter.dart';
|
||||||
import '../pages/after_login/kurir/indexPage.dart';
|
import '../pages/after_login/kurir/indexPage.dart';
|
||||||
|
import '../pages/after_login/kurir/profilePage.dart';
|
||||||
|
import '../pages/after_login/kurir/progressPenghantaranPage.dart';
|
||||||
import '../pages/after_login/pengirim/indexPage.dart';
|
import '../pages/after_login/pengirim/indexPage.dart';
|
||||||
|
import '../pages/after_login/pengirim/infoPengirimanPage.dart';
|
||||||
|
import '../pages/after_login/pengirim/pengirimProfilePage.dart';
|
||||||
|
import '../pages/before_login/daftar.dart';
|
||||||
import '../pages/before_login/index.dart';
|
import '../pages/before_login/index.dart';
|
||||||
|
import '../pages/before_login/login.dart';
|
||||||
import '../pages/before_login/pendaftaran_kurir.dart';
|
import '../pages/before_login/pendaftaran_kurir.dart';
|
||||||
import '../pages/before_login/pendaftaran_pengirirm.dart';
|
import '../pages/before_login/pendaftaran_pengirirm.dart';
|
||||||
import '../splashScreen.dart';
|
import '../splashScreen.dart';
|
||||||
@ -93,14 +94,24 @@ class Routes {
|
|||||||
transition: Transition.native,
|
transition: Transition.native,
|
||||||
transitionDuration: const Duration(seconds: 1),
|
transitionDuration: const Duration(seconds: 1),
|
||||||
curve: Curves.easeInOut,
|
curve: Curves.easeInOut,
|
||||||
),
|
children: [
|
||||||
GetPage(
|
GetPage(
|
||||||
name: '/profileKurir',
|
name: '/progressPenghantaran',
|
||||||
page: () => const ProfileKurirPage(),
|
page: () => const ProgressPenghantaranPage(),
|
||||||
binding: KurirProfileBinding(),
|
binding: ProgressPenghantaranKurirBinding(),
|
||||||
transition: Transition.native,
|
transition: Transition.native,
|
||||||
transitionDuration: const Duration(seconds: 1),
|
transitionDuration: const Duration(seconds: 1),
|
||||||
curve: Curves.easeInOut,
|
curve: Curves.easeInOut,
|
||||||
|
),
|
||||||
|
GetPage(
|
||||||
|
name: '/profileKurir',
|
||||||
|
page: () => const ProfileKurirPage(),
|
||||||
|
binding: KurirProfileBinding(),
|
||||||
|
transition: Transition.native,
|
||||||
|
transitionDuration: const Duration(seconds: 1),
|
||||||
|
curve: Curves.easeInOut,
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
GetPage(
|
GetPage(
|
||||||
name: '/pengirimIndex',
|
name: '/pengirimIndex',
|
||||||
|
|||||||
@ -37,7 +37,7 @@ class TiadaDataWIdget extends StatelessWidget {
|
|||||||
child: Center(
|
child: Center(
|
||||||
child: Text(
|
child: Text(
|
||||||
text,
|
text,
|
||||||
style: TextStyle(
|
style: const TextStyle(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
),
|
),
|
||||||
|
|||||||
@ -127,6 +127,13 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.0"
|
version: "2.1.0"
|
||||||
|
enhance_stepper:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: enhance_stepper
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "0.1.1"
|
||||||
fake_async:
|
fake_async:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|||||||
@ -36,25 +36,19 @@ dependencies:
|
|||||||
# Use with the CupertinoIcons class for iOS style icons.
|
# Use with the CupertinoIcons class for iOS style icons.
|
||||||
cupertino_icons: ^1.0.2
|
cupertino_icons: ^1.0.2
|
||||||
get: ^4.6.1
|
get: ^4.6.1
|
||||||
# navigation_history_observer: ^1.1.0
|
|
||||||
double_back_to_close_app: ^2.0.1
|
double_back_to_close_app: ^2.0.1
|
||||||
# back_button_interceptor: ^5.0.2
|
|
||||||
image_picker: ^0.8.5
|
image_picker: ^0.8.5
|
||||||
path_provider: ^2.0.9
|
path_provider: ^2.0.9
|
||||||
# flutter_cache_manager: ^3.3.0
|
|
||||||
# ensure_visible_when_focused: ^1.0.0+1
|
|
||||||
http: ^0.13.4
|
http: ^0.13.4
|
||||||
flutter_easyloading: ^3.0.3
|
flutter_easyloading: ^3.0.3
|
||||||
crypto: ^3.0.1
|
crypto: ^3.0.1
|
||||||
# provider: ^6.0.2
|
# provider: ^6.0.2
|
||||||
get_storage: ^2.0.3
|
get_storage: ^2.0.3
|
||||||
# dio: ^4.0.6
|
|
||||||
intl: ^0.17.0
|
intl: ^0.17.0
|
||||||
google_maps_flutter: ^2.1.6
|
google_maps_flutter: ^2.1.6
|
||||||
maps_toolkit: ^2.0.0
|
maps_toolkit: ^2.0.0
|
||||||
flutter_slidable:
|
flutter_slidable:
|
||||||
socket_io_client:
|
socket_io_client:
|
||||||
# geolocator:
|
|
||||||
geocoding:
|
geocoding:
|
||||||
location: ^4.2.0
|
location: ^4.2.0
|
||||||
flutter_polyline_points:
|
flutter_polyline_points:
|
||||||
@ -69,6 +63,8 @@ dependencies:
|
|||||||
flutter_background_service_android: ^2.0.2
|
flutter_background_service_android: ^2.0.2
|
||||||
device_info_plus: ^3.2.4
|
device_info_plus: ^3.2.4
|
||||||
|
|
||||||
|
enhance_stepper: ^0.1.1
|
||||||
|
|
||||||
# flutter_background_service_platform_interface: ^0.0.1
|
# flutter_background_service_platform_interface: ^0.0.1
|
||||||
|
|
||||||
# flutter_foreground_task: ^3.7.3 #ini jalan kalau pakai if true
|
# flutter_foreground_task: ^3.7.3 #ini jalan kalau pakai if true
|
||||||
|
|||||||
Reference in New Issue
Block a user