buildView method
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: 500,
maxHeight: 1000,
),
child: IntrinsicHeight(child: page),
),
),
))
.toList(),
))
])),
)
: SizedBox(
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: [
Row(spacing: 12, children: [
if (onCancel != null &&
pages[vm.currentStep].hideCancelButton == false)
SizedBox(
width: 120,
child: TextButton(
onPressed: () async {
await onCancel!();
},
child: Text("Cancel"),
),
),
if (pages[vm.currentStep].hideBackButton == false &&
vm.currentStep > 0)
SizedBox(
width: 120,
child: OutlinedButton(
onPressed: vm.isProcessing
? () {}
: () async {
await prevStep();
},
child: Text(pages[vm.currentStep].backButtonText),
),
)
else
const SizedBox.shrink(),
]),
if (pages[vm.currentStep].hideNextButton == false)
SizedBox(
width: 120,
child: FilledButton.tonal(
onPressed: vm.isProcessing
? () {}
: () async {
await nextStep(context);
},
child: vm.isProcessing
? const SizedBox(
width: 20,
height: 20,
child: CircularProgressIndicator(
strokeWidth: 2,
),
)
: Text(pages[vm.currentStep].nextButtonText),
),
)
],
),
],
),
);
}