GithubHelp home page GithubHelp logo

Comments (7)

AhmedLSayed9 avatar AhmedLSayed9 commented on July 18, 2024

Can you provide a minimal sample that produces the issue, please?
Also, What version are you using?

from dropdown_button2.

heshesh2010 avatar heshesh2010 commented on July 18, 2024

Can you provide a minimal sample that produces the issue, please? Also, What version are you using?

using dropdown_button2: ^2.3.9

here is code sample


`  Padding workerJobDropMenuWidget() {
    return Padding(
      padding: EdgeInsets.symmetric(vertical: 8.0.h),
      child: Obx(() => DropdownButtonFormField2<WorkerJob>(
            focusNode: controller.workerJobFocusNode,
            isExpanded: true,
            decoration: dropMenuInputDecoration,
            hint: Text(
              'select_worker_job'.tr,
              //     style: const TextStyle(fontSize: 14),
            ),
            value: controller.selectedWorkerJob.value.id == null
                ? null
                : controller.selectedWorkerJob.value,
            items: controller.workerJobList
                .map((WorkerJob item) => DropdownMenuItem<WorkerJob>(
                      value: item,
                      child: Text(
                        Get.locale!.languageCode == "ar"
                            ? item.arName!
                            : item.enName!,
                        style: const TextStyle(
                          fontSize: 14,
                        ),
                      ),
                    ))
                .toList(),
            autovalidateMode: AutovalidateMode.onUserInteraction,
            validator: (value) {
              if (value == null) {
                return 'pls_select_worker_job'.tr;
              }
              return null;
            },
            onChanged: (WorkerJob? value) =>
                controller.selectedWorkerJob.value = value!,
            onSaved: (WorkerJob? value) {
              controller.selectedWorkerJob.value = value!;
            },
            style: Get.textTheme.bodyLarge!,
            buttonStyleData: const ButtonStyleData(
              padding: EdgeInsets.only(left: 8),
            ),
            iconStyleData: const IconStyleData(
              icon: Icon(
                Icons.keyboard_arrow_down,
                color: Colors.black,
                weight: 2,
              ),
              iconSize: 24,
            ),
            dropdownStyleData: DropdownStyleData(
              decoration: BoxDecoration(
                borderRadius: BorderRadius.circular(5),
              ),
            ),
          )),
    );
  }`

full class


`class AddWorkerStepOne extends GetWidget<AddWorkerController> {
  final ScrollController scrollController = ScrollController();

  AddWorkerStepOne({
    super.key,
  });

  @override
  Widget build(BuildContext context) {
    // scroll to bottom when page is loaded
    WidgetsBinding.instance.addPostFrameCallback((_) {
      scrollController.animateTo(
        scrollController.position.maxScrollExtent,
        duration: const Duration(milliseconds: 500),
        curve: Curves.easeOut,
      );
    });
    return Expanded(
      child: Padding(
        padding: const EdgeInsets.all(8.0),
        child: SingleChildScrollView(
          controller: scrollController,
          reverse: true,
          child: Form(
            key: controller.stepOneFormKey,
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                Text('main_worker_data'.tr, style: Get.textTheme.titleLarge!),
                16.verticalSpace,
                Text('complete_worker_data'.tr,
                    style: Get.textTheme.bodyMedium!),
                30.verticalSpace,
                const WorkerNameTitle(),
                WorkerNameEditText(controller: controller),
                32.verticalSpace,
                const WorkerJobTitle(),
                workerJobDropMenuWidget(),
                32.verticalSpace,
                const WorkerSalaryTitle(),
                SalaryEditText(controller: controller),
                32.verticalSpace,
                Text('worker_years_of_experience'.tr,
                    style: Get.textTheme.bodyLarge!),
                yearsOfExperienceDropMenuWidget(),
                32.verticalSpace,
                Text('about_worker_bio'.tr, style: Get.textTheme.bodyLarge!),
                WorkerBioTextEditField(controller: controller),
                16.verticalSpace,
                NextBtn(controller: controller),
                32.verticalSpace,
              ],
            ),
          ),
        ),
      ),
    );
  }`

from dropdown_button2.

AhmedLSayed9 avatar AhmedLSayed9 commented on July 18, 2024

Can you test the code using latest beta version?
Also, I need a working sample without dependencies to be able to test it.

from dropdown_button2.

heshesh2010 avatar heshesh2010 commented on July 18, 2024

Hi @AhmedLSayed9 I tested with the beta verison and it fixed , but when i try to type one other edit text widget and return to drop menu i notice there is space between menu and edit text as this video shows

RPReplay_Final1702639909.MP4

from dropdown_button2.

AhmedLSayed9 avatar AhmedLSayed9 commented on July 18, 2024

@heshesh2010 Can you provider a minimal working sample?

from dropdown_button2.

heshesh2010 avatar heshesh2010 commented on July 18, 2024

@heshesh2010 Can you provider a minimal working sample?

it was my mistake that i wrapped the drop-menu widget with reversed SingleChildScrollView with reverse: true,

do u know why then set reverse: true i got this animating behaviour on drop menu list space ?

from dropdown_button2.

AhmedLSayed9 avatar AhmedLSayed9 commented on July 18, 2024

do u know why then set reverse: true i got this animating behaviour on drop menu list space ?

I'm not sure what's the reason tbh. It needs a reproducible sample and further investigating.

from dropdown_button2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.