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

add show download percentage on Android #116

Open
virskor opened this issue Jan 25, 2024 · 1 comment
Open

add show download percentage on Android #116

virskor opened this issue Jan 25, 2024 · 1 comment

Comments

@virskor
Copy link

virskor commented Jan 25, 2024

How can i notice user download process percentage on Androd? thanks

@ogak-github
Copy link

Sharing is caring.

You can take the value from OtaEvent.value

image

Calculate and convert to double
 var value2 = double.tryParse(event.value ?? '0.0') ?? 0.0;
    if (value2 > 0) value2 = value2 / 100;
    
 ## Applied it to your UI
Row(
      mainAxisAlignment: MainAxisAlignment.spaceBetween,
      children: [
        Text(text),
        status == OtaStatus.DOWNLOADING
            ? Text('${(value2 * 100).toStringAsFixed(0)}%')
            : const SizedBox.shrink(),
      ],
    ),

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