اريد تحسين شكل هذة القائمة لكن دون التاثير على عملها
 void _showTransferLogsDialog() {
    showDialog(
      context: context,
      builder: (context) {
        return AlertDialog(
          title: const Text(
            'سجل عمليات التحويل',
            textAlign: TextAlign.right,
            style: TextStyle(fontFamily: tajawalFont),
          ),
          content: SizedBox(
            width: double.maxFinite,
            child:
                _transferLogs.isEmpty
                    ? Center(
                      child: Text(
                        'لا توجد عمليات تحويل حتى الآن',
                        style: Theme.of(context).textTheme.bodyMedium?.copyWith(
                          fontFamily: tajawalFont,
                          color: Theme.of(context).colorScheme.onSurfaceVariant,
                        ),
                      ),
                    )
                    : Directionality(
                      textDirection: TextDirection.rtl,
                      child: ListView.builder(
                        shrinkWrap: true,
                        physics: const ClampingScrollPhysics(),
                        itemCount: _transferLogs.length,
                        itemBuilder: (_, i) {
                          final log = _transferLogs[i];
                          final success = log['success'] as bool;
                          final timestamp =
                              log['timestamp'] != null
                                  ? DateTime.parse(log['timestamp'])
                                  : null;
                          final timeFormatted =
                              timestamp != null
                                  ? '${timestamp.year}-${timestamp.month.toString().padLeft(2, '0')}-${timestamp.day.toString().padLeft(2, '0')} ${timestamp.hour.toString().padLeft(2, '0')}:${timestamp.minute.toString().padLeft(2, '0')}'
                                  : '';

                          return ListTile(
                            contentPadding: EdgeInsets.zero,
                            leading: Container(
                              width: 36,
                              height: 36,
                              decoration: BoxDecoration(
                                color:
                                    success
                                        ? Theme.of(
                                          context,
                                        ).colorScheme.primaryContainer
                                        : Theme.of(
                                          context,
                                        ).colorScheme.errorContainer,
                                shape: BoxShape.circle,
                              ),
                              child: Icon(
                                success ? Icons.check : Icons.close,
                                color:
                                    success
                                        ? Theme.of(context).colorScheme.primary
                                        : Theme.of(context).colorScheme.error,
                              ),
                            ),
                            title: Text(
                              '${_getMethodName(log['method'])} - ${log['number']}',
                              style: const TextStyle(
                                fontWeight: FontWeight.w600,
                                fontFamily: tajawalFont,
                              ),
                            ),
                            subtitle: Column(
                              crossAxisAlignment: CrossAxisAlignment.start,
                              children: [
                                Text(
                                  'المبلغ: ${_formatWithThousandsSeparator(log['amount'] ?? 0)}',
                                  style: TextStyle(fontFamily: tajawalFont),
                                ),
                                if (timeFormatted.isNotEmpty)
                                  Text(
                                    'الوقت: $timeFormatted',
                                    style: const TextStyle(
                                      fontFamily: tajawalFont,
                                      fontSize: 12,
                                      color: Colors.grey,
                                    ),
                                  ),
                                if (log['error'] != null)
                                  Text(
                                    'خطأ: ${log['error']}',
                                    style: const TextStyle(
                                      fontFamily: tajawalFont,
                                      fontSize: 12,
                                      color: Colors.red,
                                    ),
                                  ),
                              ],
                            ),
                            trailing: IconButton(
                              icon: Icon(
                                Icons.delete_forever_rounded,
                                color: Theme.of(context).colorScheme.error,
                              ),
                              tooltip: 'حذف السجل',
                              onPressed: () {
                                _removeTransferLog(i);
                                Navigator.pop(context);
                                Future.delayed(
                                  Duration(milliseconds: 100),
                                  _showTransferLogsDialog,
                                );
                              },
                            ),
                          );
                        },
                      ),
                    ),
          ),
          actions: [
            TextButton(
              onPressed: () => Navigator.pop(context),
              child: const Text(
                'إغلاق',
                style: TextStyle(fontFamily: tajawalFont),
              ),
            ),
            TextButton(
              onPressed: () {
                setState(() {
                  _transferLogs.clear();
                });
                _saveTransferHistory();
                Navigator.pop(context);
                _showSnackBar('تم حذف جميع سجلات التحويل');
              },
              child: const Text(
                'حذف الكل',
                style: TextStyle(fontFamily: tajawalFont),
              ),
            ),

            // هذا هو زر التصدير الجديد داخل السجل
            TextButton(
              onPressed: () {
                Navigator.pop(context);
                _exportTransferLogsToCsv();
              },
              child: const Text(
                'تصدير Excel',
                style: TextStyle(fontFamily: tajawalFont),
              ),
            ),
          ],
        );
      },
    );
  }