getStep property

Step get getStep

Implementation

Step get getStep {
  StepState tempState = StepState.indexed;
  if (currentStep == stepNumber) {
    tempState = StepState.editing;
  } else if (currentStep > stepNumber) {
    tempState = StepState.complete;
  } else {
    tempState = StepState.indexed;
  }
  return Step(
    title: Text(
      title,
      style: const TextStyle(fontSize: 13, color: Colors.black),
    ),
    subtitle: subtitle != null
        ? Text(
            subtitle!,
            style: const TextStyle(fontSize: 12, color: Colors.grey),
          )
        : null,
    state: tempState,
    isActive: true,
    content: Form(
      key: formKey,
      autovalidateMode: autovalidateMode,
      child: Container(
        margin: const EdgeInsets.all(5),
        child: Column(
          mainAxisAlignment: MainAxisAlignment.start,
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            if (info != null) ...[
              ExpansionTile(
                initiallyExpanded: expandedInfo,
                title: const Text(
                  'More Info',
                  style: TextStyle(
                    fontSize: 12,
                    fontWeight: FontWeight.w500,
                    color: Colors.grey,
                  ),
                ),
                expandedCrossAxisAlignment: CrossAxisAlignment.start,
                expandedAlignment: Alignment.topLeft,
                children: [
                  Text(
                    info!.join(infoBreaker ?? '\n'),
                    style: const TextStyle(fontSize: 12, color: Colors.grey),
                  ),
                ],
              ),
              const SizedBox(height: 10),
            ],
            ...body,
            const SizedBox(height: 10),
            Row(
              mainAxisAlignment: MainAxisAlignment.spaceBetween,
              children: [
                if (extraButtons != null) ...extraButtons!,
                if (showNextButton == true)
                  FutureGestureDebounce(
                    isFree: isFreeNotifier,
                    builder: (BuildContext ctx, ValueNotifier<bool> isFree) {
                      return OutlinedButton(
                        style: OutlinedButton.styleFrom(
                          shape: RoundedRectangleBorder(
                            borderRadius: BorderRadius.circular(5),
                          ),
                          side: BorderSide(
                            width: 2,
                            color: theme.primaryColor,
                          ),
                        ),
                        onPressed: () async {
                          if (isFree.value) {
                            isFree.value = false;
                            await onPressed.call(isFree);
                            isFree.value = true;
                          }
                        },
                        child: SizedBox(
                          width: 80,
                          child: isFree.value
                              ? Text(
                                  buttonText,
                                  textAlign: TextAlign.center,
                                  style: TextStyle(
                                    fontSize: 13,
                                    color: theme.primaryColor,
                                    fontWeight: FontWeight.bold,
                                  ),
                                )
                              : SpinKitDoubleBounce(
                                  size: 13,
                                  color: theme.primaryColor,
                                ),
                        ),
                      );
                    },
                  ),
              ],
            ),
            if (trailingWidget != null) trailingWidget!,
          ],
        ),
      ),
    ),
  );
}