الخطاء الذي يظهر
                    size: Size(320.8, 182.0)
                    additionalConstraints: BoxConstraints(0.0<=w<=Infinity, 0.0<=h<=341.7)
        child 3: RenderPadding#ccec9 relayoutBoundary=up8
            parentData: offset=Offset(0.0, 294.0); flex=null; fit=null (can use size)
            constraints: BoxConstraints(w=365.6, 0.0<=h<=Infinity)
            size: Size(365.6, 72.0)
            padding: EdgeInsets(24.0, 0.0, 24.0, 24.0)
            textDirection: ltr
            child: _RenderOverflowBar#9d60f relayoutBoundary=up9
                parentData: offset=Offset(24.0, 0.0) (can use size)
                constraints: BoxConstraints(w=317.6, 0.0<=h<=Infinity)
                size: Size(317.6, 48.0)
                spacing: 8.0
                overflowAlignment: end
                textDirection: ltr
                child 1: RenderSemanticsAnnotations#6e8f1 relayoutBoundary=up10
                    parentData: offset=Offset(115.6, 0.0) (can use size)
                    constraints: BoxConstraints(0.0<=w<=317.6, 0.0<=h<=Infinity)
                    semantic boundary
                    size: Size(90.9, 48.0)
                child 2: RenderConstrainedBox#28b75 relayoutBoundary=up10
                    parentData: offset=Offset(214.4, 24.0) (can use size)
                    constraints: BoxConstraints(0.0<=w<=317.6, 0.0<=h<=Infinity)
                    size: Size(12.0, 0.0)
                    additionalConstraints: BoxConstraints(w=12.0, 0.0<=h<=Infinity)
                child 3: RenderSemanticsAnnotations#c2461 relayoutBoundary=up10
                    parentData: offset=Offset(234.4, 0.0) (can use size)
                    constraints: BoxConstraints(0.0<=w<=317.6, 0.0<=h<=Infinity)
                    semantic boundary
                    size: Size(83.1, 48.0)
════════════════════════════════════════════════════════════════════════════════
في الكود
await showDialog(
  context: context,
  barrierDismissible: false,
  builder: (context) {
    final maxHeight = MediaQuery.of(context).size.height * 0.5;
    
    return StatefulBuilder(
      builder: (context, setDialogState) {
        void addAmount(String value) {
          final raw = value.replaceAll(',', '').trim();
          final numAmount = int.tryParse(raw);
          if (numAmount == null || numAmount <= 0) {
            _showSnackBar('يرجى إدخال مبلغ صحيح أكبر من صفر');
            return;
          }
          if (_savedAmounts.contains(numAmount)) {
            _showSnackBar('هذا المبلغ موجود بالفعل');
            return;
          }
          setDialogState(() {
            _savedAmounts.add(numAmount);
            _savedAmounts.sort();
            amountsController.clear();
          });
        }

        bool isValidInput(String text) {
          final raw = text.replaceAll(',', '').trim();
          final numAmount = int.tryParse(raw);
          return numAmount != null && numAmount > 0 && !_savedAmounts.contains(numAmount);
        }

        return AlertDialog(
          shape: RoundedRectangleBorder(
            borderRadius: BorderRadius.circular(24),
          ),
          elevation: 8,
          insetPadding: const EdgeInsets.all(20),
          titlePadding: EdgeInsets.zero,
          contentPadding: const EdgeInsets.fromLTRB(24, 20, 24, 24),
          title: Padding(
            padding: const EdgeInsets.fromLTRB(24, 24, 24, 0),
            child: Row(
              children: [
                Container(
                  padding: const EdgeInsets.all(8),
                  decoration: BoxDecoration(
                    color: Theme.of(context).colorScheme.primary.withOpacity(0.1),
                    shape: BoxShape.circle,
                  ),
                  child: Icon(
                    Icons.monetization_on_rounded,
                    size: 28,
                    color: Theme.of(context).colorScheme.primary,
                  ),
                ),
                const SizedBox(width: 12),
                Text(
                  'المحفظة الرقمية',
                  style: TextStyle(
                    fontSize: 20,
                    fontWeight: FontWeight.bold,
                    fontFamily: tajawalFont,
                    color: Theme.of(context).colorScheme.onSurface,
                  ),
                ),
              ],
            ),
          ),
          content: ConstrainedBox(
            constraints: BoxConstraints(maxHeight: maxHeight),
            child: SingleChildScrollView(
              child: Column(
                mainAxisSize: MainAxisSize.min,
                crossAxisAlignment: CrossAxisAlignment.start,
                children: [
                  Container(
                    width: double.infinity,
                    padding: const EdgeInsets.all(16),
                    decoration: BoxDecoration(
                      color: Theme.of(context).colorScheme.surfaceVariant.withOpacity(0.1),
                      borderRadius: BorderRadius.circular(16),
                      border: Border.all(
                        color: Theme.of(context).colorScheme.outline.withOpacity(0.1),
                      ),
                    ),
                    child: _savedAmounts.isEmpty
                        ? Column(
                            children: [
                              Icon(
                                Icons.wallet_rounded,
                                size: 40,
                                color: Theme.of(context).colorScheme.primary.withOpacity(0.5),
                              ),
                              const SizedBox(height: 12),
                              Text(
                                'أضف المبالغ التي تريد استخدامها بشكل متكرر',
                                style: TextStyle(
                                  fontFamily: tajawalFont,
                                  color: Theme.of(context).colorScheme.onSurfaceVariant,
                                  fontSize: 14,
                                ),
                                textAlign: TextAlign.center,
                              ),
                            ],
                          )
                        : Column(
                            crossAxisAlignment: CrossAxisAlignment.start,
                            children: [
                              Text(
                                'اختر من المبالغ المحفوظة:',
                                style: TextStyle(
                                  fontFamily: tajawalFont,
                                  color: Theme.of(context).colorScheme.onSurfaceVariant,
                                ),
                              ),
                              const SizedBox(height: 12),
                              SizedBox(
                                height: 120,
                                child: ListView.builder(
                                  itemCount: _savedAmounts.length,
                                  itemBuilder: (context, index) {
                                    final amount = _savedAmounts[index];
                                    return ListTile(
                                      contentPadding: EdgeInsets.zero,
                                      leading: Radio<int>(
                                        value: amount,
                                        groupValue: _savedAmounts.first,
                                        onChanged: (value) {
                                          setDialogState(() {
                                            amountsController.text = _formatWithThousandsSeparator(value!);
                                          });
                                        },
                                      ),
                                      title: Text(
                                        _formatWithThousandsSeparator(amount),
                                        style: TextStyle(
                                          fontFamily: tajawalFont,
                                          fontWeight: FontWeight.w600,
                                        ),
                                      ),
                                      trailing: IconButton(
                                        icon: Icon(
                                          Icons.delete_outline,
                                          color: Theme.of(context).colorScheme.error,
                                        ),
                                        onPressed: () {
                                          setDialogState(() {
                                            _savedAmounts.remove(amount);
                                            if (_savedAmounts.isNotEmpty) {
                                              amountsController.text = _formatWithThousandsSeparator(_savedAmounts.first);
                                            } else {
                                              amountsController.clear();
                                            }
                                          });
                                        },
                                      ),
                                    );
                                  },
                                ),
                              ),
                            ],
                          ),
                  ),
                  const SizedBox(height: 20),
                  TextField(
                    controller: amountsController,
                    keyboardType: TextInputType.number,
                    inputFormatters: [ThousandsSeparatorInputFormatter()],
                    decoration: InputDecoration(
                      labelText: 'أو أدخل مبلغًا جديدًا',
                      filled: true,
                      fillColor: Colors.grey.withOpacity(0.15),
                      border: OutlineInputBorder(
                        borderRadius: BorderRadius.circular(14),
                        borderSide: BorderSide.none,
                      ),
                      suffixIcon: IconButton(
                        icon: Icon(
                          Icons.add_circle_rounded,
                          color: isValidInput(amountsController.text)
                              ? Theme.of(context).colorScheme.primary
                              : Theme.of(context).colorScheme.onSurface.withOpacity(0.3),
                          size: 28,
                        ),
                        onPressed: isValidInput(amountsController.text)
                            ? () => addAmount(amountsController.text)
                            : null,
                      ),
                    ),
                    onChanged: (value) => setDialogState(() {}),
                    onSubmitted: addAmount,
                  ),
                ],
              ),
            ),
          ),
          actionsPadding: const EdgeInsets.fromLTRB(24, 0, 24, 24),
          actionsAlignment: MainAxisAlignment.end,
          actions: [
            OutlinedButton(
              onPressed: () => Navigator.pop(context),
              style: OutlinedButton.styleFrom(
                foregroundColor: Theme.of(context).colorScheme.onSurface,
                side: BorderSide(
                  color: Theme.of(context).colorScheme.outline.withOpacity(0.4),
                ),
                padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 12),
                shape: RoundedRectangleBorder(
                  borderRadius: BorderRadius.circular(12),
                ),
              ),
              child: Text(
                'تخطي',
                style: TextStyle(
                  fontFamily: tajawalFont,
                  fontSize: 15,
                ),
              ),
            ),
            const SizedBox(width: 12),
            ElevatedButton(
              onPressed: () async {
                if (_savedAmounts.isEmpty) {
                  _showSnackBar('الرجاء إدخال مبلغ واحد على الأقل');
                  return;
                }
                await _saveSavedAmounts();
                Navigator.pop(context);
              },
              style: ElevatedButton.styleFrom(
                backgroundColor: Theme.of(context).colorScheme.primary,
                foregroundColor: Theme.of(context).colorScheme.onPrimary,
                padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 12),
                shape: RoundedRectangleBorder(
                  borderRadius: BorderRadius.circular(12),
                ),
              ),
              child: Text(
                'حفظ',
                style: TextStyle(
                  fontFamily: tajawalFont,
                  fontSize: 15,
                  fontWeight: FontWeight.bold,
                ),
              ),
            ),
          ],
        );
      },
    );
  },
);