صحح الخطا
The named parameter 'child' isn't defined.
Try correcting the name to an existing named parameter's name, or defining a named parameter with the name 'child'.dartundefined_named_parameter
و
The named parameter 'padding' isn't defined.
Try correcting the name to an existing named parameter's name, or defining a named parameter with the name 'padding'.dartundefined_named_parameter
في هذا الكود
Widget _buildEditProfileTab() {
    return StatefulBuilder(
      builder: (context, setInnerState) {
        return FutureBuilder<List<Map<String, dynamic>>>(
          future: _fetchProfiles(),
          builder: (context, snapshot) {
            if (snapshot.connectionState == ConnectionState.waiting) {
              return Center(child: CircularProgressIndicator());
            } else if (snapshot.hasError) {
              return Center(child: Text('حدث خطأ في جلب البيانات'));
            } else if (!snapshot.hasData || snapshot.data!.isEmpty) {
              return Center(child: Text('لا يوجد بروفايلات متاحة'));
            }

            final profiles = snapshot.data!;
            return SingleChildScrollView(
              padding: EdgeInsets.all(16),
              child: Column(
                children: [
                  SizedBox(height: 16),
                  Container(
                    decoration: BoxDecoration(
                      color: Colors.white.withOpacity(0.05),
                      borderRadius: BorderRadius.circular(15),
                      border: Border.all(color: Colors.white.withOpacity(0.1)),
                      padding: EdgeInsets.all(16),
                      child: Column(
                        children: [
                          Text(
                            'تعديل إعدادات البروفايل',
                            style: TextStyle(
                              fontFamily: 'Tajawal',
                              fontSize: 18,
                              fontWeight: FontWeight.bold,
                              color: _textColor,
                            ),
                          ),
                          SizedBox(height: 16),

                          // Dropdown لاختيار البروفايل
                          DropdownButtonFormField<String>(
                            value:
                                profiles.any((p) => p['name'] == _profileName)
                                    ? _profileName
                                    : null,
                            items:
                                profiles.map((profile) {
                                  return DropdownMenuItem<String>(
                                    value: profile['name'],
                                    child: Text(
                                      profile['name'],
                                      style: TextStyle(color: _textColor),
                                    ),
                                  );
                                }).toList(),
                            onChanged: (String? selectedProfile) {
                              if (selectedProfile != null) {
                                _loadProfileData(selectedProfile);
                              }
                            },
                            decoration: InputDecoration(
                              labelText: 'اختر البروفايل للتعديل',
                              labelStyle: TextStyle(
                                fontFamily: 'Tajawal',
                                color: _textColor.withOpacity(0.8),
                              ),
                              border: OutlineInputBorder(
                                borderRadius: BorderRadius.circular(8),
                                borderSide: BorderSide(
                                  color: Colors.white.withOpacity(0.2),
                                ),
                              ),
                              enabledBorder: OutlineInputBorder(
                                borderRadius: BorderRadius.circular(8),
                                borderSide: BorderSide(
                                  color: Colors.white.withOpacity(0.2),
                                ),
                              ),
                              focusedBorder: OutlineInputBorder(
                                borderRadius: BorderRadius.circular(8),
                                borderSide: BorderSide(color: _primaryColor),
                              ),
                              contentPadding: EdgeInsets.symmetric(
                                horizontal: 16,
                                vertical: 14,
                              ),
                              fillColor: _cardColor,
                              filled: true,
                            ),
                            dropdownColor: _cardColor,
                            style: TextStyle(color: _textColor),
                          ),
                          SizedBox(height: 12),

                          // حقل اسم البروفايل للمستخدمين
                          TextField(
                            controller: _nameForUsersController,
                            decoration: InputDecoration(
                              labelText: 'اسم البروفايل للمستخدمين',
                              labelStyle: TextStyle(
                                fontFamily: 'Tajawal',
                                color: _textColor.withOpacity(0.8),
                              ),
                              border: OutlineInputBorder(
                                borderRadius: BorderRadius.circular(8),
                                borderSide: BorderSide(
                                  color: Colors.white.withOpacity(0.2),
                                ),
                              ),
                              enabledBorder: OutlineInputBorder(
                                borderRadius: BorderRadius.circular(8),
                                borderSide: BorderSide(
                                  color: Colors.white.withOpacity(0.2),
                                ),
                              ),
                              focusedBorder: OutlineInputBorder(
                                borderRadius: BorderRadius.circular(8),
                                borderSide: BorderSide(color: _primaryColor),
                              ),
                              contentPadding: EdgeInsets.symmetric(
                                horizontal: 16,
                                vertical: 14,
                              ),
                              fillColor: _cardColor,
                              filled: true,
                            ),
                            style: TextStyle(
                              fontFamily: 'Tajawal',
                              color: _textColor,
                            ),
                          ),
                          SizedBox(height: 12),

                          // حقل السعر
                          TextField(
                            controller: _priceController,
                            decoration: InputDecoration(
                              labelText: 'السعر',
                              labelStyle: TextStyle(
                                fontFamily: 'Tajawal',
                                color: _textColor.withOpacity(0.8),
                              ),
                              border: OutlineInputBorder(
                                borderRadius: BorderRadius.circular(8),
                                borderSide: BorderSide(
                                  color: Colors.white.withOpacity(0.2),
                                ),
                              ),
                              enabledBorder: OutlineInputBorder(
                                borderRadius: BorderRadius.circular(8),
                                borderSide: BorderSide(
                                  color: Colors.white.withOpacity(0.2),
                                ),
                              ),
                              focusedBorder: OutlineInputBorder(
                                borderRadius: BorderRadius.circular(8),
                                borderSide: BorderSide(color: _primaryColor),
                              ),
                              contentPadding: EdgeInsets.symmetric(
                                horizontal: 16,
                                vertical: 14,
                              ),
                              fillColor: _cardColor,
                              filled: true,
                            ),
                            keyboardType: TextInputType.number,
                            inputFormatters: [
                              FilteringTextInputFormatter.digitsOnly,
                            ],
                          ),
                          SizedBox(height: 12),

                          // حقل مدة الصلاحية مع Dropdown للوحدات
                          Row(
                            children: [
                              Expanded(
                                flex: 3,
                                child: TextField(
                                  controller: _validityController,
                                  decoration: InputDecoration(
                                    labelText: 'مدة الصلاحية',
                                    labelStyle: TextStyle(
                                      fontFamily: 'Tajawal',
                                      color: _textColor.withOpacity(0.8),
                                    ),
                                    border: OutlineInputBorder(
                                      borderRadius: BorderRadius.only(
                                        topRight: Radius.circular(8),
                                        bottomRight: Radius.circular(8),
                                      ),
                                      borderSide: BorderSide(
                                        color: Colors.white.withOpacity(0.2),
                                      ),
                                    ),
                                    enabledBorder: OutlineInputBorder(
                                      borderRadius: BorderRadius.only(
                                        topRight: Radius.circular(8),
                                        bottomRight: Radius.circular(8),
                                      ),
                                      borderSide: BorderSide(
                                        color: Colors.white.withOpacity(0.2),
                                      ),
                                    ),
                                    focusedBorder: OutlineInputBorder(
                                      borderRadius: BorderRadius.only(
                                        topRight: Radius.circular(8),
                                        bottomRight: Radius.circular(8),
                                      ),
                                      borderSide: BorderSide(
                                        color: _primaryColor,
                                      ),
                                    ),
                                    contentPadding: EdgeInsets.symmetric(
                                      horizontal: 16,
                                      vertical: 14,
                                    ),
                                    fillColor: _cardColor,
                                    filled: true,
                                  ),
                                  keyboardType: TextInputType.number,
                                  inputFormatters: [
                                    FilteringTextInputFormatter.digitsOnly,
                                  ],
                                ),
                              ),
                              Expanded(
                                child: Container(
                                  decoration: BoxDecoration(
                                    color: _cardColor,
                                    borderRadius: BorderRadius.only(
                                      topLeft: Radius.circular(8),
                                      bottomLeft: Radius.circular(8),
                                    ),
                                    border: Border.all(
                                      color: Colors.white.withOpacity(0.2),
                                    ),
                                  ),
                                  child: DropdownButtonHideUnderline(
                                    child: DropdownButton<String>(
                                      value: _validityUnit,
                                      items:
                                          ['أيام', 'ساعات', 'دقائق'].map((
                                            String unit,
                                          ) {
                                            return DropdownMenuItem<String>(
                                              value: unit,
                                              child: Padding(
                                                padding: EdgeInsets.symmetric(
                                                  horizontal: 8,
                                                ),
                                                child: Text(
                                                  unit,
                                                  style: TextStyle(
                                                    fontFamily: 'Tajawal',
                                                    color: _textColor,
                                                  ),
                                                  overflow:
                                                      TextOverflow.ellipsis,
                                                ),
                                              ),
                                            );
                                          }).toList(),
                                      onChanged: (String? newValue) {
                                        setState(() {
                                          _validityUnit = newValue!;
                                        });
                                      },
                                      dropdownColor: _cardColor,
                                      icon: Icon(
                                        Icons.arrow_drop_down,
                                        color: _textColor,
                                      ),
                                      isExpanded: true,
                                    ),
                                  ),
                                ),
                              ),
                            ],
                          ),
                          SizedBox(height: 12),

                          // حقل حد البيانات مع Dropdown للوحدات
                          Row(
                            children: [
                              Expanded(
                                flex: 3,
                                child: TextField(
                                  controller: _transferLimitController,
                                  decoration: InputDecoration(
                                    labelText: 'حد البيانات',
                                    hintText: 'أدخل القيمة الرقمية',
                                    labelStyle: TextStyle(
                                      fontFamily: 'Tajawal',
                                      color: _textColor.withOpacity(0.8),
                                    ),
                                    border: OutlineInputBorder(
                                      borderRadius: BorderRadius.only(
                                        topRight: Radius.circular(8),
                                        bottomRight: Radius.circular(8),
                                      ),
                                      borderSide: BorderSide(
                                        color: Colors.white.withOpacity(0.2),
                                      ),
                                    ),
                                    enabledBorder: OutlineInputBorder(
                                      borderRadius: BorderRadius.only(
                                        topRight: Radius.circular(8),
                                        bottomRight: Radius.circular(8),
                                      ),
                                      borderSide: BorderSide(
                                        color: Colors.white.withOpacity(0.2),
                                      ),
                                    ),
                                    focusedBorder: OutlineInputBorder(
                                      borderRadius: BorderRadius.only(
                                        topRight: Radius.circular(8),
                                        bottomRight: Radius.circular(8),
                                      ),
                                      borderSide: BorderSide(
                                        color: _primaryColor,
                                      ),
                                    ),
                                    contentPadding: EdgeInsets.symmetric(
                                      horizontal: 16,
                                      vertical: 14,
                                    ),
                                    fillColor: _cardColor,
                                    filled: true,
                                  ),
                                  keyboardType: TextInputType.number,
                                  inputFormatters: [
                                    FilteringTextInputFormatter.digitsOnly,
                                  ],
                                  onChanged: (value) {
                                    setInnerState(() {
                                      _downloadLimitValue = value;
                                    });
                                  },
                                ),
                              ),
                              Expanded(
                                child: Container(
                                  decoration: BoxDecoration(
                                    color: _cardColor,
                                    borderRadius: BorderRadius.only(
                                      topLeft: Radius.circular(8),
                                      bottomLeft: Radius.circular(8),
                                    ),
                                    border: Border.all(
                                      color: Colors.white.withOpacity(0.2),
                                    ),
                                  ),
                                  constraints: BoxConstraints(minWidth: 100),
                                  child: DropdownButtonHideUnderline(
                                    child: DropdownButton<String>(
                                      value: _downloadLimitUnit,
                                      items:
                                          [
                                            'بايت',
                                            'كيلوبايت',
                                            'ميجابايت',
                                            'جيجابايت',
                                          ].map((String unit) {
                                            return DropdownMenuItem<String>(
                                              value: unit,
                                              child: Padding(
                                                padding: EdgeInsets.symmetric(
                                                  horizontal: 8,
                                                ),
                                                child: Text(
                                                  unit,
                                                  style: TextStyle(
                                                    fontFamily: 'Tajawal',
                                                    color: _textColor,
                                                  ),
                                                  overflow:
                                                      TextOverflow.ellipsis,
                                                ),
                                              ),
                                            );
                                          }).toList(),
                                      onChanged: (String? newValue) {
                                        setState(() {
                                          _downloadLimitUnit = newValue!;
                                        });
                                      },
                                      dropdownColor: _cardColor,
                                      icon: Icon(
                                        Icons.arrow_drop_down,
                                        color: _textColor,
                                      ),
                                      isExpanded: true,
                                    ),
                                  ),
                                ),
                              ),
                            ],
                          ),
                          SizedBox(height: 12),

                          // حقل حد الوقت مع Dropdown للوحدات
                          Row(
                            children: [
                              Expanded(
                                flex: 3,
                                child: TextField(
                                  controller: _uptimeLimitController,
                                  decoration: InputDecoration(
                                    labelText: 'حد الوقت',
                                    labelStyle: TextStyle(
                                      fontFamily: 'Tajawal',
                                      color: _textColor.withOpacity(0.8),
                                    ),
                                    border: OutlineInputBorder(
                                      borderRadius: BorderRadius.only(
                                        topRight: Radius.circular(8),
                                        bottomRight: Radius.circular(8),
                                      ),
                                      borderSide: BorderSide(
                                        color: Colors.white.withOpacity(0.2),
                                      ),
                                    ),
                                    enabledBorder: OutlineInputBorder(
                                      borderRadius: BorderRadius.only(
                                        topRight: Radius.circular(8),
                                        bottomRight: Radius.circular(8),
                                      ),
                                      borderSide: BorderSide(
                                        color: Colors.white.withOpacity(0.2),
                                      ),
                                    ),
                                    focusedBorder: OutlineInputBorder(
                                      borderRadius: BorderRadius.only(
                                        topRight: Radius.circular(8),
                                        bottomRight: Radius.circular(8),
                                      ),
                                      borderSide: BorderSide(
                                        color: _primaryColor,
                                      ),
                                    ),
                                    contentPadding: EdgeInsets.symmetric(
                                      horizontal: 16,
                                      vertical: 14,
                                    ),
                                    fillColor: _cardColor,
                                    filled: true,
                                  ),
                                  keyboardType: TextInputType.number,
                                  inputFormatters: [
                                    FilteringTextInputFormatter.digitsOnly,
                                  ],
                                  onChanged: (value) {
                                    setState(() {
                                      _uptimeLimitValue = value;
                                    });
                                  },
                                ),
                              ),
                              Expanded(
                                child: Container(
                                  decoration: BoxDecoration(
                                    color: _cardColor,
                                    borderRadius: BorderRadius.only(
                                      topLeft: Radius.circular(8),
                                      bottomLeft: Radius.circular(8),
                                    ),
                                    border: Border.all(
                                      color: Colors.white.withOpacity(0.2),
                                    ),
                                  ),
                                  constraints: BoxConstraints(minWidth: 100),
                                  child: DropdownButtonHideUnderline(
                                    child: DropdownButton<String>(
                                      value: _uptimeLimitUnit,
                                      items:
                                          [
                                            'ثواني',
                                            'دقائق',
                                            'ساعات',
                                            'أيام',
                                          ].map((String unit) {
                                            return DropdownMenuItem<String>(
                                              value: unit,
                                              child: Padding(
                                                padding: EdgeInsets.symmetric(
                                                  horizontal: 12,
                                                ),
                                                child: Text(
                                                  unit,
                                                  style: TextStyle(
                                                    fontFamily: 'Tajawal',
                                                    color: _textColor,
                                                    fontSize: 14,
                                                  ),
                                                  overflow:
                                                      TextOverflow.ellipsis,
                                                  textAlign: TextAlign.right,
                                                ),
                                              ),
                                            );
                                          }).toList(),
                                      onChanged: (String? newValue) {
                                        setState(() {
                                          _uptimeLimitUnit = newValue!;
                                        });
                                      },
                                      dropdownColor: _cardColor,
                                      icon: Icon(
                                        Icons.arrow_drop_down,
                                        color: _textColor,
                                      ),
                                      isExpanded: true,
                                      style: TextStyle(
                                        fontFamily: 'Tajawal',
                                        color: _textColor,
                                      ),
                                    ),
                                  ),
                                ),
                              ),
                            ],
                          ),
                          SizedBox(height: 16),

                          ElevatedButton(
                            onPressed: _updateProfile,
                            style: ElevatedButton.styleFrom(
                              backgroundColor: _primaryColor,
                              foregroundColor: _textColor,
                              padding: const EdgeInsets.symmetric(vertical: 16),
                              shape: RoundedRectangleBorder(
                                borderRadius: BorderRadius.circular(8),
                              ),
                              minimumSize: const Size(double.infinity, 50),
                            ),
                            child: const Text('تحديث البروفايل'),
                          ),
                        ],
                      ),
                    ),
                  ),
                ],
              ),
            );
          },
        );
      },
    );
  }