buildView method

  1. @override
Widget buildView(
  1. BuildContext context
)
override

Implementation

@override
Widget buildView(BuildContext context) {
  return isModal
      ? StandardDialog(
          title: title,
          actions: actions,
          content: SizedBox(
              width: 800,
              child: Column(mainAxisSize: MainAxisSize.min, children: [
                const SizedBox(height: 16),
                Flexible(
                    child: PageView(
                  physics: const NeverScrollableScrollPhysics(),
                  controller: _pageController,
                  children: buildPages()
                      .map((page) => Scrollbar(
                            thumbVisibility: true,
                            child: SingleChildScrollView(
                              padding: const EdgeInsets.only(bottom: 24),
                              child: ConstrainedBox(
                                constraints: const BoxConstraints(
                                  minHeight: 350,
                                  maxHeight: 1000,
                                ),
                                child: IntrinsicHeight(child: page),
                              ),
                            ),
                          ))
                      .toList(),
                ))
              ])),
        )
      : SizedBox(
          height: 350,
          child: Column(
            mainAxisSize: MainAxisSize.min,
            children: [
              title,
              const SizedBox(height: 16),
              Flexible(
                child: PageView(
                  physics: const NeverScrollableScrollPhysics(),
                  controller: _pageController,
                  children: buildPages()
                      .map((page) => Scrollbar(
                            thumbVisibility: true,
                            child: SingleChildScrollView(
                              padding: const EdgeInsets.only(bottom: 24),
                              child: Padding(
                                padding: const EdgeInsets.only(right: 8.0),
                                child: IntrinsicHeight(child: page),
                              ),
                            ),
                          ))
                      .toList(),
                ),
              ),
              const SizedBox(height: 16),
              Row(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                children: [
                  if (pages[vm.currentStep].hideBackButton == false &&
                      vm.currentStep > 0)
                    TextButton(
                      onPressed: () async {
                        await prevStep();
                      },
                      child: Text(pages[vm.currentStep].backButtonText),
                    )
                  else
                    const SizedBox.shrink(),
                  if (pages[vm.currentStep].hideNextButton == false)
                    TextButton(
                      onPressed: () async {
                        await nextStep(context);
                      },
                      child: Text(pages[vm.currentStep].nextButtonText),
                    )
                ],
              ),
            ],
          ),
        );
}