Update: 2026-06-27 05:42:53
This commit is contained in:
@@ -558,7 +558,9 @@ class ScanDocumentsByApi extends GetxController {
|
|||||||
try {
|
try {
|
||||||
final decoded = jsonDecode(responseString);
|
final decoded = jsonDecode(responseString);
|
||||||
if (decoded['status'] == 'success' && decoded['message']['file_link'] != null) {
|
if (decoded['status'] == 'success' && decoded['message']['file_link'] != null) {
|
||||||
box.write(BoxName.driverPhotoUrl, decoded['message']['file_link'].toString());
|
String rawUrl = decoded['message']['file_link'].toString();
|
||||||
|
String filename = rawUrl.split('/').last;
|
||||||
|
box.write(BoxName.driverPhotoUrl, '${AppLink.server}/portrate_captain_image/$filename');
|
||||||
}
|
}
|
||||||
} catch (_) {}
|
} catch (_) {}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import 'package:path_provider/path_provider.dart' as path_provider;
|
|||||||
import '../../constant/box_name.dart';
|
import '../../constant/box_name.dart';
|
||||||
import '../../constant/colors.dart';
|
import '../../constant/colors.dart';
|
||||||
import '../../constant/info.dart';
|
import '../../constant/info.dart';
|
||||||
|
import '../../constant/links.dart';
|
||||||
import '../../main.dart';
|
import '../../main.dart';
|
||||||
import '../../print.dart';
|
import '../../print.dart';
|
||||||
import 'encrypt_decrypt.dart';
|
import 'encrypt_decrypt.dart';
|
||||||
@@ -434,7 +435,9 @@ class ImageController extends GetxController {
|
|||||||
|
|
||||||
if (response != null && response['status'] == 'success' && response['message'] != null) {
|
if (response != null && response['status'] == 'success' && response['message'] != null) {
|
||||||
if (response['message']['file_link'] != null) {
|
if (response['message']['file_link'] != null) {
|
||||||
box.write(BoxName.driverPhotoUrl, response['message']['file_link'].toString());
|
String rawUrl = response['message']['file_link'].toString();
|
||||||
|
String filename = rawUrl.split('/').last;
|
||||||
|
box.write(BoxName.driverPhotoUrl, '${AppLink.server}/portrate_captain_image/$filename');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|||||||
@@ -333,13 +333,13 @@ class UserHeader extends StatelessWidget {
|
|||||||
child: controller.isloading
|
child: controller.isloading
|
||||||
? const CircularProgressIndicator(color: Colors.white)
|
? const CircularProgressIndicator(color: Colors.white)
|
||||||
: CircleAvatar(
|
: CircleAvatar(
|
||||||
backgroundImage: NetworkImage((box
|
backgroundImage: (box
|
||||||
.read(BoxName.driverPhotoUrl)
|
.read(BoxName.driverPhotoUrl)
|
||||||
?.toString()
|
?.toString()
|
||||||
.isNotEmpty ==
|
.isNotEmpty ==
|
||||||
true)
|
true)
|
||||||
? box.read(BoxName.driverPhotoUrl)
|
? NetworkImage(box.read(BoxName.driverPhotoUrl))
|
||||||
: '${AppLink.server}/portrate_captain_image/${box.read(BoxName.driverID)}.jpg'),
|
: null,
|
||||||
|
|
||||||
// [تعديل هام]: في حال فشل تحميل الصورة (غير موجودة)
|
// [تعديل هام]: في حال فشل تحميل الصورة (غير موجودة)
|
||||||
onBackgroundImageError: (exception, stackTrace) {
|
onBackgroundImageError: (exception, stackTrace) {
|
||||||
|
|||||||
Reference in New Issue
Block a user