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 '../../../../BuilderField/shared/fields/currency_field.dart';
import '../../../../BuilderField/shared/fields/field_group_field.dart';
import '../../../../BuilderField/shared/fields/qr_code_field.dart';
import '../../../../BuilderField/shared/fields/barcode_field.dart';
import '../../../../BuilderField/shared/fields/dependent_dropdown_field.dart';
 import '../Adv4_viewModel/Adv4_view_model_screen.dart';/// Field definitions for Adv4 entity
/// This defines the structure and validation for Adv4 forms
class Adv4Fields {
  /// Get field definitions for Adv4 entity
  static List<BaseField> getFields(BuildContext context) {
    final viewModel =
        Provider.of<Adv4ViewModelScreen>(context, listen: false);
    return [
      // Basic Information


  AutocompleteDropdownField(
        fieldKey: 'atoc',
        label: 'atoc',
        hint: 'Select atoc',
        optionsLoader: () async => await viewModel.getatoc(),

 
        valueKey: 'id',
        displayKey: 'name',
 

        isRequired: false,
      ),



  AutocompleteDropdownField(
        fieldKey: 'atc2',
        label: 'atc2',
        hint: 'Select atc2',
        optionsLoader: () async => await viewModel.getatc2(),

 
        valueKey: 'id',
        displayKey: 'name',
 

        isRequired: false,
      ),



  AutocompleteMultiSelectField(
        fieldKey: 'atdy1',
        label: 'atdy1',
        hint: 'Select atdy1',
   isRequired: false,
      optionsLoader: () async =>await viewModel.getatdy1(),

 
 valueKey: 'name',
        displayKey: 'name',
        
 

        
      ),



  AutocompleteMultiSelectField(
        fieldKey: 'atdy2',
        label: 'atdy2',
        hint: 'Select atdy2',
   isRequired: false,
      optionsLoader: () async =>await viewModel.getatdy2(),

 
 valueKey: 'description',
        displayKey: 'description',
        
 

        
      ),

OneToOneRelationField(
        fieldKey: 'support',
        label: 'support',
        hint: 'support details',
        relationSchema: {
          'title': 'support',
          'box': true,
          'fields': [

 
            {
              'type': 'text',
              'label': 'Description',
              'hint': 'Enter Description',
              'path': 'support.description',
            },

            

 
            {
              'type': 'text',
              'label': 'Name',
              'hint': 'Enter Name',
              'path': 'support.name',
            },

            
	
          ],
        },
      ),

OneToOneRelationField(
        fieldKey: 'childform',
        label: 'childform',
        hint: 'childform details',
        relationSchema: {
          'title': 'childform',
          'box': true,
          'fields': [

 
            {
              'type': 'text',
              'label': 'Active',
              'hint': 'Enter Active',
              'path': 'childform.active',
            },

            

 
            {
              'type': 'text',
              'label': 'Description',
              'hint': 'Enter Description',
              'path': 'childform.description',
            },

            

 
            {
              'type': 'text',
              'label': 'Name',
              'hint': 'Enter Name',
              'path': 'childform.name',
            },

            
	
          ],
        },
      ),

    ];
  }
}
