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

分享壁纸时造成卡顿 #1

Open
AugustToko opened this issue Jan 22, 2021 · 0 comments
Open

分享壁纸时造成卡顿 #1

AugustToko opened this issue Jan 22, 2021 · 0 comments
Assignees

Comments

@AugustToko
Copy link
Owner

当分享一个大型壁纸 > 3mb 就会出现明显的卡顿。

  Future<void> shareWallpaper(Wallpaper wallpaper) async {
    final dir = Directory(wallpaper.getDirPath());

    final pak = await WallpaperFileUtil.packWallpaper(dir);

    print('----------------------------------');
    print(pak.path);
    print(pak.existsSync());

    final newPath = (await getTemporaryDirectory()).path +
        Platform.pathSeparator +
        FileUtils.basename(pak.path);

    pak.renameSync(newPath);

    print('----------------------------------');
    print(newPath);
    print(File(newPath));

    if (pak != null && pak.existsSync()) {
      Share.shareFiles([newPath],
          text: '${wallpaper.name}\n${wallpaper.description}');
    }
  }
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