'Dialog fixed positioning below TextButton

How do I achieve this design? "Filter by" is a button on which this start and end date dialog is opened. But not able exactly open this at the same position on different devices as this design.enter image description here

This is what I have tried:

filterDialog(BuildContext context) {
    return Center(
      child: Container(
        margin: EdgeInsets.only(left: 30, top: Get.height \* 0.06),
        width: 330,
        height: 65,
        decoration: BoxDecoration(
          boxShadow: [
            BoxShadow(
                color: Colors.grey.shade400,
                blurRadius: 5,
                spreadRadius: 1
            )
          ],
          borderRadius: BorderRadius.circular(5),
        ),
        clipBehavior: Clip.antiAlias,
        child: Scaffold(
          body: Row(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              GestureDetector(
                onTap: () {
                  _datePicker(context, true);
                },
                child: Container(
                  width: 150,
                  height: 40,
                  margin: const EdgeInsets.only(top: 12, right: 7),
                  child: TextFormField(
                    enabled: false,
                    controller: controller.startDateTec,
                    style: const TextStyle(color: AppConstants.appThemeColor, fontSize: 12, fontFamily: AppConstants.robotoRegular),
                    decoration: AppWidgets.calendarTextField("Start Date"),
                  ),
                ),
              ),
              GestureDetector(
                onTap: () {
                  _datePicker(context, false);
                },
                child: Container(
                  width: 150,
                  height: 40,
                  margin: const EdgeInsets.only(top: 12, right: 7),
                  child: TextFormField(
                    enabled: false,
                    controller: controller.endDateTec,
                    style: const TextStyle(color: AppConstants.appThemeColor, fontSize: 12, fontFamily: AppConstants.robotoRegular),
                    decoration: AppWidgets.calendarTextField("End Date"),
                  ),
                ),
              )
            ],
          ),
        ),
      ),
    );
  }

What changes can be done? Or else any other widget instead of dialog needs to be used?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source