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 CircularProgressIndicator's value is null, it paints nothing instead of displaying a loading spinner #15315

Closed
paolosoares opened this issue Mar 8, 2018 · 4 comments

Comments

@paolosoares
Copy link
Contributor

Running this app:

runApp(
  new MaterialApp(
    home: new Scaffold(
      body: new Center(
        child: new CircularProgressIndicator(),
      ),
    ),
  ),
);

I expected to see a circular spinner on the center of the screen, since CircularProgressIndicator's documentation says:

Indeterminate. Indeterminate progress indicators do not have a specific value at each point in time and instead indicate that progress is being made without indicating how much progress remains. To create an indeterminate progress indicator, use a null value.

However, all I see is a blank screen.

Looking at _CircularProgressIndicatorPainter, I see that it doesn't do any special handling for "value == null" besides changing the stroke cap, possibly to not paint a dot:

@override
void paint(Canvas canvas, Size size) {
  final Paint paint = new Paint()
    ..color = valueColor
    ..strokeWidth = strokeWidth
    ..style = PaintingStyle.stroke;

  if (value == null) // Indeterminate
    paint.strokeCap = StrokeCap.square;

  canvas.drawArc(Offset.zero & size, arcStart, arcSweep, false, paint);
}
@paolosoares
Copy link
Contributor Author

Actually, I've just found out that it behaves just fine on other clients. I'm trying to track down what's different on my setup.

@tvolkert
Copy link
Contributor

tvolkert commented Mar 8, 2018

We use a null value in the gallery, and it correctly spins:

Could it be that no animations are running in your case? Maybe you need a vsync?

@HansMuller

@paolosoares
Copy link
Contributor Author

Found it: I didn't enable OpenGL when starting the emulator.

@github-actions
Copy link

github-actions bot commented Sep 3, 2021

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants