Skip to content

onNext is not wokring in IntroStepBuilder #31

Description

@vibhuti11604

See my code and please suggest me..

GlobalKey<State> step1Key = GlobalKey();
GlobalKey<State> step2Key = GlobalKey();

     IntroStepBuilder(
          order: 1,
          group: 'field',
          onWidgetLoad: () {
            WidgetsBinding.instance.addPostFrameCallback((_) {
              Intro.of(context).start(group: 'field');
            });
          },
          key: step1Key,
          overlayBuilder: (val) {
            return Container(
              padding: EdgeInsets.all(12),
              decoration: BoxDecoration(
                color: AppColor.secondaryColor,
                borderRadius: BorderRadius.circular(12),
              ),
              child: Column(
                children: [
                  Text("You can search here job by location ",
                    style: TextStyle().normal14w700.textColor(
                        AppColor.white),),
                  Align(
                    alignment: Alignment.bottomRight,
                    child: GestureDetector(
                      onTap: val.onNext,
                      child: Container(
                          padding: EdgeInsets.symmetric(vertical: 4,horizontal: 8),
                          decoration: BoxDecoration(
                            color: AppColor.primaryColor,
                            borderRadius: BorderRadius.circular(8),
                          ),
                          child: Text("Next", style: TextStyle().normal14w500
                              .textColor(AppColor.white),),),
                    ),
                  ),
                ],
              ),
            );
          },
          builder: (BuildContext context,
              GlobalKey<State<StatefulWidget>> key) {
            return CommonTextField(
              key: key,
              controller: jobLocationSearchController
                  .searchAddressController,
              hintText: "Search for the location",
              prefixIcon: const Icon(CupertinoIcons.search),
              onChange: (val) async {
                jobLocationSearchController.searchAddressString.value =
                val!;
                if (val.isEmpty) {
                  jobLocationSearchController.isShowLocation.value = false;
                } else {
                  jobLocationSearchController.isShowLocation.value = true;
                }
                List<String> data = await Get.find<GlobalController>()
                    .getSuggestion(
                    jobLocationSearchController.searchAddressString.value);
                jobLocationSearchController.locationList.addAll(data);
              },
              textInputAction: TextInputAction.done,
              suffix: Obx(
                    () =>
                jobLocationSearchController
                    .searchAddressString.value.isNotEmpty
                    ? GestureDetector(
                    onTap: () {
                      jobLocationSearchController.isShowLocation.value =
                      false;
                      jobLocationSearchController
                          .searchAddressString.value = "";
                      jobLocationSearchController.searchAddressController
                          .clear();
                      jobLocationSearchController.locationList.clear();

                      jobLocationSearchController.apiCall(
                          filterData:
                          jobLocationSearchController.filterData);
                    },
                    child: const Icon(
                      Icons.close,
                      size: 16,
                    ))
                    : const SizedBox(),
              ),
            );
          },

        )
    
    
    
    
      IntroStepBuilder(
        group:'filter',
        order: 2,
        key: step2Key,
        // onWidgetLoad: () {
        //   WidgetsBinding.instance.addPostFrameCallback((_) {
        //     Intro.of(context).start(group: 'filter');
        //   });
        // },
        overlayBuilder: (val) {
          return Container(
            padding: EdgeInsets.all(12),
            decoration: BoxDecoration(
              color: AppColor.secondaryColor,
              borderRadius: BorderRadius.circular(12),
            ),
            child: Column(
              children: [
                Text("You can search here job by location",
                  style: TextStyle().normal14w700.textColor(
                      AppColor.white),),
                Align(
                  alignment: Alignment.bottomRight,
                  child: GestureDetector(
                    onTap: val.onFinish,
                    child: Container(
                      padding: EdgeInsets.symmetric(vertical: 4,horizontal: 8),
                      decoration: BoxDecoration(
                        color: AppColor.primaryColor,
                        borderRadius: BorderRadius.circular(8),
                      ),
                      child: Text("Finish", style: TextStyle().normal14w500
                          .textColor(AppColor.white),),),
                  ),
                ),
              ],
            ),
          );
        },
        builder: (BuildContext context,
            GlobalKey<State<StatefulWidget>> key) {
          return  GestureDetector(
            key: key,
            onTap: () {
              Get.toNamed(AppRouter.filter)?.then((val) {
                jobLocationSearchController.filterData = val ?? "";
                jobLocationSearchController.apiCall(
                    location:
                    jobLocationSearchController.searchAddressString.value,
                    filterData: val);
              });
            },
            child: Container(
              padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 8),
              decoration: BoxDecoration(
                color: Colors.white12,
                borderRadius: BorderRadius.circular(
                  8,
                ),
                border: Border.all(color: AppColor.white, width: 2),
              ),
              child: SvgPicture.asset(
                AppImage.filterIcon,
              ),
            ),
          );
        },

      ),

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions