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

Unable to download file sometime . #68

Open
vijayvaghela72 opened this issue Dec 13, 2022 · 1 comment
Open

Unable to download file sometime . #68

vijayvaghela72 opened this issue Dec 13, 2022 · 1 comment

Comments

@vijayvaghela72
Copy link

getting this line in terminal and after that nothing happen .

Accessing hidden method Landroid/media/AudioManager;->getOutputLatency(I)I (greylist, reflection, allowed)

my code :
onTap: () async {
print("testing value : 1");
final status = await Permission.storage.request();

          if (status == PermissionStatus.granted) {
            context
                .read<UpdateOrdProvider>()
                .changeStatus(UpdateOrdStatus.inProgress);
            updateNow();
            print("testing value : 2");
          }
          print("testing value : 3");

          var targetPath;

          if (Platform.isIOS) {
            print("testing value : 4");

            var target = await getApplicationDocumentsDirectory();
            targetPath = target.path.toString();
          } else {
            print("testing value : 5");

            if (snapshot.hasData) {
              targetPath = (snapshot.data as List<Directory>).first.path;
            }
          }
          print("testing value : 6");

          var targetFileName = 'Invoice_${model.id!}';
          print(" Target File Name : $targetFileName");
          var generatedPdfFile, filePath;
          try {
            print("testing value : 7");

            generatedPdfFile =
                await FlutterHtmlToPdf.convertFromHtmlContent(
                    model.invoice!, targetPath, targetFileName);
            print("testing value : 8");
            filePath = generatedPdfFile.path;
            print("testing value : 9");
          } catch (e) {
            print("testing value : $e");

            context
                .read<UpdateOrdProvider>()
                .changeStatus(UpdateOrdStatus.inProgress);
            updateNow();

            setSnackbar(getTranslated(context, "somethingMSg")!, context);

            return;
          }
          print("testing value : 10");

          context
              .read<UpdateOrdProvider>()
              .changeStatus(UpdateOrdStatus.isSuccsess);
          updateNow();
          print("testing value : 11");

          ScaffoldMessenger.of(context).showSnackBar(
            SnackBar(
              content: Text(
                "${getTranslated(context, 'INVOICE_PATH')} $targetFileName",
                textAlign: TextAlign.center,
                style:
                    TextStyle(color: Theme.of(context).colorScheme.black),
              ),
              action: SnackBarAction(
                label: getTranslated(context, 'VIEW')!,
                textColor: Theme.of(context).colorScheme.fontColor,
                onPressed: () async {
                  await OpenFilex.open(filePath);
                },
              ),
              backgroundColor: Theme.of(context).colorScheme.white,
              elevation: 1.0,
            ),
          );
        },
@vijayvaghela72
Copy link
Author

hope fully i will get solution . Thank You in advance ...! :)

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