[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When use customeSize, CrossAxisAlignment does not working good... #28

Closed
NewLand-Ju opened this issue May 27, 2021 · 2 comments
Closed

Comments

@NewLand-Ju
Copy link
NewLand-Ju commented May 27, 2021
StepProgressIndicator(
                                  totalSteps: 20,
                                  currentStep: 7,
                                  crossAxisAlignment: CrossAxisAlignment.end,
                                  selectedColor: StudyColors.azul,
                                  unselectedColor: StudyColors.lightPeriwinkle,
                                  customSize: (index, _) {
                                    double size;
                                    if (index == 7 - 1) {
                                      size = 30;
                                    } else if (index == 7 - 2) {
                                      size = 20;
                                    } else {
                                      size = 10;
                                    }
                                    return size;
                                  },
                                ),

I want to all steps to make it aligned down.
but not working....

스크린샷 2021-05-27 오후 2 42 39

I want to make it like the picture below.

스크린샷 2021-05-27 오후 2 52 15

SandroMaglione added a commit that referenced this issue Jun 16, 2021
@SandroMaglione
Copy link
Owner

Hi @NewLand-Ju

I published v1.0.1 which has a new stepMainAxisAlignment and stepCrossAxisAlignment attributes. You can achieve the result of your example with the following code:

StepProgressIndicator(
  totalSteps: 20,
  currentStep: 7,
  stepMainAxisAlignment: MainAxisAlignment.end,
  customStep: (index, color, size) {
    return Container(
      decoration: BoxDecoration(
        color: color,
        borderRadius: BorderRadius.circular(30),
      ),
    );
  },
  selectedColor: Colors.blue,
  unselectedColor: Colors.grey[300]!,
  customSize: (index, _) {
    double size;
    if (index == 7 - 1) {
      size = 30;
    } else if (index == 7 - 2) {
      size = 20;
    } else {
      size = 10;
    }
    return size;
  },
),

Screenshot 2021-06-16 115745

@NewLand-Ju
Copy link
Author

Thank! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants