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 '../Basicp1_viewModel/Basicp1_view_model_screen.dart';/// Field definitions for Basicp1 entity
/// This defines the structure and validation for Basicp1 forms
class Basicp1Fields {
  /// Get field definitions for Basicp1 entity
  static List<BaseField> getFields(BuildContext context) {
    final viewModel =
        Provider.of<Basicp1ViewModelScreen>(context, listen: false);
    return [
      // Basic Information
 CustomTextField(
        fieldKey: 'name',
        label: 'name',
        hint: 'Enter name',
        isRequired: true,
        maxLength: 50,
      ),

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

  // Number Fields
      NumberField(
        fieldKey: 'number1',
        label: 'number1',
        hint: 'Enter number1',
        isRequired: false,
        min: 0,
        decimalPlaces: 0,
      ),

  // Number Fields
      NumberField(
        fieldKey: 'number2',
        label: 'number2',
        hint: 'Enter number2',
        isRequired: false,
        min: 0,
        decimalPlaces: 0,
      ),

 PhoneField(
        fieldKey: 'phone_number',
        label: 'Phone Number',
        hint: 'Enter Phone Number',
        isRequired: false,
        countryCode: '+91',
      ),

 PhoneField(
        fieldKey: 'phone_number2',
        label: 'Phone Number2',
        hint: 'Enter Phone Number2',
        isRequired: false,
        countryCode: '+91',
      ),

CustomTextField(
        fieldKey: 'paragraph_field',
        label: 'Paragraph Field',
        hint: 'Enter Paragraph Field',
        isRequired: false,
        maxLength: 500,
      ),

CustomTextField(
        fieldKey: 'paragraph_field2',
        label: 'Paragraph Field2',
        hint: 'Enter Paragraph Field2',
        isRequired: false,
        maxLength: 500,
      ),


      // Password Fields (dynamic names supported via fieldKey)
      PasswordField(
        fieldKey: 'password_field',
        label: 'Password Field',
        hint: 'Enter Password Field',
        isRequired: false,
        maxLength: 50,
        groupId: 'p1',
      ),
      PasswordField(
        fieldKey: 'confirm+password_field',
        label: 'Confirm Password Field',
        hint: 'Confirm Password Field',
        isRequired: false,
        maxLength: 50,
        groupId: 'p1',
        isConfirm: true,
      ),

CustomTextField(
        fieldKey: 'textarea',
        label: 'Textarea',
        hint: 'Enter Textarea',
        isRequired: false,
        maxLength: 1000,
      ),

CustomTextField(
        fieldKey: 'textarea_field',
        label: 'Textarea Field',
        hint: 'Enter Textarea Field',
        isRequired: false,
        maxLength: 1000,
      ),

CustomTextField(
        fieldKey: 'textarea_field2',
        label: 'Textarea Field2',
        hint: 'Enter Textarea Field2',
        isRequired: false,
        maxLength: 1000,
      ),

    ];
  }
}
