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

Animation hangs when the widget is just launched #204

Open
rocboronat opened this issue Oct 23, 2023 · 0 comments
Open

Animation hangs when the widget is just launched #204

rocboronat opened this issue Oct 23, 2023 · 0 comments

Comments

@rocboronat
Copy link
Contributor

rocboronat commented Oct 23, 2023

For some reason, when the screen that shows the indicator is launched, the animation of the indicator feels janky. It makes a big jump for some millis.

As I didn't know what was working wrong, I made an example project to check it, and yes: the issue is in the package itself.

Feel free to copy paste this example, and tap the circle. It will launch a new screen with a new circle, and you will see the jank.

By the way, thanks for this piece of magic! 😄

import 'package:flutter/material.dart';
import 'package:percent_indicator/circular_percent_indicator.dart';

void main() => runApp(const MyApp());

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(home: MyHomePage());
  }
}

class MyHomePage extends StatelessWidget {
  const MyHomePage({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        body: Center(
      child: GestureDetector(
        onTap: () => Navigator.of(context).push(
          MaterialPageRoute(builder: (context) => const MyHomePage()),
        ),
        child: CircularPercentIndicator(
          radius: 83,
          percent: 0.83,
          animation: true,
          animationDuration: const Duration(seconds: 3).inMilliseconds,
        ),
      ),
    ));
  }
}

Oh, and here's a video to show the effect:

Screen_Recording_20231024_010915.mp4
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

1 participant