import 'package:base_project/BuilderField/shared/fields/number_field.dart';
import 'package:base_project/BuilderField/shared/fields/password_field.dart';
import 'package:base_project/BuilderField/shared/fields/phone_field.dart';
import 'package:base_project/BuilderField/shared/fields/custom_text_field.dart';

import '../../../../BuilderField/shared/fields/base_field.dart';

import '../../../../BuilderField/shared/fields/date_field.dart';
import '../../../../BuilderField/shared/fields/datetime_field.dart';
import '../../../../BuilderField/shared/fields/email_field.dart';
import 'package:base_project/BuilderField/shared/fields/url_field.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

import '../../../../BuilderField/shared/fields/custom_text_field.dart' as shared_text;
import '../../../../BuilderField/shared/fields/one_to_one_relation_field.dart';
import '../../../../BuilderField/shared/fields/calculated_field.dart';
import '../../../../BuilderField/shared/fields/one_to_many_field.dart';
import '../../../../BuilderField/shared/fields/value_list_picker_field.dart';
import '../../../../BuilderField/shared/fields/captcha_field.dart';
import '../../../../BuilderField/shared/fields/switch_field.dart';
import '../../../../BuilderField/shared/fields/url_field.dart';

import '../../../../BuilderField/shared/fields/audio_upload_field.dart';
import '../../../../BuilderField/shared/fields/checkbox_field.dart';
import '../../../../BuilderField/shared/fields/file_upload_field.dart';
import '../../../../BuilderField/shared/fields/image_upload_field.dart';
import '../../../../BuilderField/shared/fields/radio_field.dart';
import '../../../../BuilderField/shared/fields/video_upload_field.dart';

import '../../../../BuilderField/shared/fields/autocomplete_dropdown_field.dart';
import '../../../../BuilderField/shared/fields/autocomplete_multiselect_field.dart';
import '../../../../BuilderField/shared/fields/one_to_one_relation_field.dart';
import '../../../../BuilderField/shared/fields/data_grid_field.dart';
import '../../../../BuilderField/shared/fields/dropdown_field.dart';
import '../../../../BuilderField/shared/fields/dynamic_dropdown_field.dart';
import '../../../../BuilderField/shared/fields/dynamic_multiselect_dropdown_field.dart';
import '../../../../BuilderField/shared/fields/static_multiselect_field.dart';import '../Formb_viewModel/Formb_view_model_screen.dart';/// Field definitions for Formb entity
/// This defines the structure and validation for Formb forms
class FormbFields {
  /// Get field definitions for Formb entity
  static List<BaseField> getFields(BuildContext context) {
    final viewModel =
        Provider.of<FormbViewModelScreen>(context, listen: false);
    return [
      // Basic Information
 CustomTextField(
        fieldKey: 'namem',
        label: 'Namem',
        hint: 'Enter Namem',
        isRequired: true,
        maxLength: 50,
      ),

 CustomTextField(
        fieldKey: 'survey_formbs',
        label: 'Survey Formbs',
        hint: 'Enter Survey Formbs',
        isRequired: true,
        maxLength: 50,
      ),


// 3) Value list picker â fill fields from selection (provide your loader)
      ValueListPickerField(
        fieldKey: 'value_list_fields',
        label: 'Value List Fields',
       optionsLoader: () async {
           try {
            final response = viewModel.FormbList;
            return response;
          } catch (e) {
            // Return empty list if API fails
            return <Map<String, dynamic>>[];
          }
        },
        fillMappings: const {
	
 
          'namem': 'namem',
 

         
        },
      ),

  DataGridField(
        fieldKey: 'datagrid_fieldss',
        label: 'datagrid Fieldss',
        dataLoader: () => viewModel.getdatagrid_fieldssGrid(),
      ),

 CustomTextField(
        fieldKey: 'formb',
        label: 'Formb',
        hint: 'Enter Formb',
        isRequired: true,
        maxLength: 50,
      ),

    ];
  }
}
