{"id":18712377,"url":"https://github.com/codenameakshay/async_wallpaper","last_synced_at":"2025-03-05T02:14:15.100Z","repository":{"id":45113072,"uuid":"424195888","full_name":"codenameakshay/async_wallpaper","owner":"codenameakshay","description":null,"archived":false,"fork":false,"pushed_at":"2024-09-05T06:36:01.000Z","size":7730,"stargazers_count":24,"open_issues_count":28,"forks_count":28,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-26T01:20:28.024Z","etag":null,"topics":["android","dart","flutter","flutter-plugin"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/async_wallpaper","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codenameakshay.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-03T11:25:52.000Z","updated_at":"2025-02-11T15:11:41.000Z","dependencies_parsed_at":"2024-08-23T12:32:18.356Z","dependency_job_id":"dea45afd-4f57-4107-bc11-bed11e6ebb98","html_url":"https://github.com/codenameakshay/async_wallpaper","commit_stats":{"total_commits":29,"total_committers":3,"mean_commits":9.666666666666666,"dds":0.06896551724137934,"last_synced_commit":"be47815a89574e54d5195e6b1647214c2e107719"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codenameakshay%2Fasync_wallpaper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codenameakshay%2Fasync_wallpaper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codenameakshay%2Fasync_wallpaper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codenameakshay%2Fasync_wallpaper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codenameakshay","download_url":"https://codeload.github.com/codenameakshay/async_wallpaper/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241950145,"owners_count":20047591,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","dart","flutter","flutter-plugin"],"created_at":"2024-11-07T12:42:37.182Z","updated_at":"2025-03-05T02:14:15.076Z","avatar_url":"https://github.com/codenameakshay.png","language":"Dart","funding_links":["https://www.paypal.me/codenameakshay"],"categories":[],"sub_categories":[],"readme":"\u003c!-- \nThis README describes the package. If you publish this package to pub.dev,\nthis README's contents appear on the landing page for your package.\n\nFor information about how to write a good package README, see the guide for\n[writing package pages](https://dart.dev/guides/libraries/writing-package-pages). \n\nFor general information about developing packages, see the Dart guide for\n[creating packages](https://dart.dev/guides/libraries/create-library-packages)\nand the Flutter guide for\n[developing packages and plugins](https://flutter.dev/developing-packages). \n--\u003e\n\n\u003ch1 align=\"center\"\u003eAsync Wallpaper\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003eA flutter package which contains a collection of some functions to set wallpaper on your Android device asynchronously. With this plugin you can also set video live wallpapers (.mp4) natively.\u003c/p\u003e\u003cbr\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://flutter.dev\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Platform-Flutter-02569B?logo=flutter\"\n      alt=\"Platform\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://pub.dartlang.org/packages/async_wallpaper\"\u003e\n    \u003cimg src=\"https://img.shields.io/pub/v/async_wallpaper.svg\"\n      alt=\"Pub Package\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://opensource.org/licenses/MIT\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/license/aagarwal1012/animated-text-kit?color=red\"\n      alt=\"License: MIT\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.paypal.me/codenameakshay\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Donate-PayPal-00457C?logo=paypal\"\n      alt=\"Donate\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\u003cbr\u003e\n\n| ![Example](https://raw.githubusercontent.com/codenameakshay/async_wallpaper/main/screenshots/demo.gif)  | ![Example App](https://raw.githubusercontent.com/codenameakshay/async_wallpaper/main/screenshots/image.jpg)  |\n|---|---|\n|  **Example in another app** |  **Example app screenshot** |\n\n## Features\n\nThe package allows you to set wallpaper on your Android device asynchronously, in the following ways.\n\n- Set wallpaper from a file path\n- Set wallpaper from a URL\n- Set wallpaper from a video file (file path)\n- Can select locations (HOME, LOCK, BOTH)\n- Open native wallpaper chooser\n- Minimise your app and go to Android home screen\n\n## Installing\n\n### 1. Depend on it\n\nAdd this to your package's `pubspec.yaml` file:\n\n```yaml\ndependencies:\n  async_wallpaper: ^2.1.0\n```\n\n### 2. Install it\n\nYou can install packages from the command line:\n\nwith `pub`:\n\n```bash\npub get\n```\n\nwith `Flutter`:\n\n```bash\nflutter pub get\n```\n\n### 3. Import it\n\nNow in your `Dart` code, you can use:\n\n```dart\nimport 'package:async_wallpaper/async_wallpaper.dart';\n```\n\n# Usage\n\n`AsyncWallpaper` is a _Class_ that exposes some methods, variables which you can call to set wallpapers.\nWhen you want to set wallpaper simply use it like:\n\n```dart\nawait AsyncWallpaper.setWallpaperFromFile(\n    filePath: file.path,\n    wallpaperLocation: AsyncWallpaper.HOME_SCREEN,\n    goToHome: goToHome,\n    toastDetails: ToastDetails.success(),\n    errorToastDetails: ToastDetails.error(),\n);\n```\n\nIt needs three arguments -\n\n- `filePath` – the path of the file to set as wallpaper\n- `wallpaperLocation` – the location where you want to set the wallpaper\n- `goToHome` – a bool, which redirects your app to home screen when wallpaper is set (optional)\n- `toastDetails:` - a `ToastDetails` object, which contains the details of the toast to be shown when wallpaper is set (optional)\n- `errorToastDetails:` - a `ToastDetails` object, which contains the details of the toast to be shown when wallpaper is not set or error (optional)\n\nAsyncWallpaper has three locations predefined -\n\n- `HOME_SCREEN` – set wallpaper on home screen\n- `LOCK_SCREEN` – set wallpaper on lock screen\n- `BOTH_SCREENS` – set wallpaper on both home and lock screen\n\n# Detailed Usage\n\nBelow is the detailed usage of the package, including all functions defined.\n\n## platformVersion\n\n```dart\nawait AsyncWallpaper.platformVersion ?? 'Unknown platform version';\n```\n\nIt returns the platform version of the device. Useful for all the Android 11, 12 permission related stuff.\n\n## setWallpaperFromFile\n\nSetting wallpaper from a file path, on home screen.\n\n```dart\nString result;\nvar file = await DefaultCacheManager().getSingleFile(url);\n// Platform messages may fail, so we use a try/catch PlatformException.\ntry {\n    result = await AsyncWallpaper.setWallpaperFromFile(\n    filePath: file.path,\n    wallpaperLocation: AsyncWallpaper.HOME_SCREEN,\n    goToHome: goToHome,\n    toastDetails: ToastDetails.success(),\n    errorToastDetails: ToastDetails.error(),\n    )\n        ? 'Wallpaper set'\n        : 'Failed to get wallpaper.';\n} on PlatformException {\n    result = 'Failed to get wallpaper.';\n}\n\n```\n\nSetting wallpaper from a file path, on lock screen.\n\n```dart\nString result;\nvar file = await DefaultCacheManager().getSingleFile(url);\n// Platform messages may fail, so we use a try/catch PlatformException.\ntry {\n    result = await AsyncWallpaper.setWallpaperFromFile(\n    filePath: file.path,\n    wallpaperLocation: AsyncWallpaper.LOCK_SCREEN,\n    goToHome: goToHome,\n    toastDetails: ToastDetails.success(),\n    errorToastDetails: ToastDetails.error(),\n    )\n        ? 'Wallpaper set'\n        : 'Failed to get wallpaper.';\n} on PlatformException {\n    result = 'Failed to get wallpaper.';\n}\n\n```\n\nSetting wallpaper from a file path, on both screens.\n\n```dart\nString result;\nvar file = await DefaultCacheManager().getSingleFile(url);\n// Platform messages may fail, so we use a try/catch PlatformException.\ntry {\n    result = await AsyncWallpaper.setWallpaperFromFile(\n    filePath: file.path,\n    wallpaperLocation: AsyncWallpaper.BOTH_SCREENS,\n    goToHome: goToHome,\n    toastDetails: ToastDetails.success(),\n    errorToastDetails: ToastDetails.error(),\n    )\n        ? 'Wallpaper set'\n        : 'Failed to get wallpaper.';\n} on PlatformException {\n    result = 'Failed to get wallpaper.';\n}\n\n```\n\n\u003e Note - You can use the `flutter_cache_manager` plugin to download the file from the internet, and get the file path.\n\n## setWallpaper\n\nSetting wallpaper from a url, on home screen.\n\n```dart\nString result;\n// Platform messages may fail, so we use a try/catch PlatformException.\ntry {\n    result = await AsyncWallpaper.setWallpaper(\n    url: url,\n    wallpaperLocation: AsyncWallpaper.HOME_SCREEN,\n    goToHome: goToHome,\n    toastDetails: ToastDetails.success(),\n    errorToastDetails: ToastDetails.error(),\n    )\n        ? 'Wallpaper set'\n        : 'Failed to get wallpaper.';\n} on PlatformException {\n    result = 'Failed to get wallpaper.';\n}\n\n```\n\nSetting wallpaper from a url, on lock screen.\n\n```dart\nString result;\n// Platform messages may fail, so we use a try/catch PlatformException.\ntry {\n    result = await AsyncWallpaper.setWallpaper(\n    url: url,\n    wallpaperLocation: AsyncWallpaper.LOCK_SCREEN,\n    goToHome: goToHome,\n    toastDetails: ToastDetails.success(),\n    errorToastDetails: ToastDetails.error(),\n    )\n        ? 'Wallpaper set'\n        : 'Failed to get wallpaper.';\n} on PlatformException {\n    result = 'Failed to get wallpaper.';\n}\n\n```\n\nSetting wallpaper from a url, on both screens.\n\n```dart\nString result;\n// Platform messages may fail, so we use a try/catch PlatformException.\ntry {\n    result = await AsyncWallpaper.setWallpaper(\n    url: url,\n    wallpaperLocation: AsyncWallpaper.BOTH_SCREENS,\n    goToHome: goToHome,\n    toastDetails: ToastDetails.success(),\n    errorToastDetails: ToastDetails.error(),\n    )\n        ? 'Wallpaper set'\n        : 'Failed to get wallpaper.';\n} on PlatformException {\n    result = 'Failed to get wallpaper.';\n}\n\n```\n\n## setLiveWallpaper\n\nSetting live wallpaper requires `.mp4` file. Also currently local files are only supported, so download it before calling this function. The method call redirect to native Android live wallpaper setting intent, so no locations are currently supported.\n\n```dart\nString result;\nvar file = await DefaultCacheManager().getSingleFile(liveUrl);\n// Platform messages may fail, so we use a try/catch PlatformException.\ntry {\n    result = await AsyncWallpaper.setLiveWallpaper(\n    filePath: file.path,\n    goToHome: goToHome,\n    toastDetails: ToastDetails.success(),\n    errorToastDetails: ToastDetails.error(),\n    )\n        ? 'Wallpaper set'\n        : 'Failed to get wallpaper.';\n} on PlatformException {\n    result = 'Failed to get wallpaper.';\n}\n\n```\n\n## openWallpaperChooser\n\nOpens Android native wallpaper chooser.\n\n```dart\nString result;\n// Platform messages may fail, so we use a try/catch PlatformException.\ntry {\n    result = await AsyncWallpaper.openWallpaperChooser(\n    filePath: file.path,\n    goToHome: goToHome,\n    toastDetails: ToastDetails.success(),\n    errorToastDetails: ToastDetails.error(),\n    )\n        ? 'Opened wallpaper chooser'\n        : 'Failed to open wallpaper chooser.';\n} on PlatformException {\n    result = 'Failed to open wallpaper chooser.';\n}\n\n```\n\n\u003e Note - You can find more detailed examples in the `example` directory.\n\n# Bugs or Requests\n\nIf you encounter any problems feel free to open an [issue](https://github.com/codenameakshay/async_wallpaper/issues/new?template=bug_report.md). If you feel the library is missing a feature, please raise a [ticket](https://github.com/codenameakshay/async_wallpaper/issues/new?template=feature_request.md) on GitHub and I'll look into it. Pull request are also welcome.\n\nSee [Contributing.md](https://github.com/codenameakshay/async_wallpaper/blob/master/CONTRIBUTING.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodenameakshay%2Fasync_wallpaper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodenameakshay%2Fasync_wallpaper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodenameakshay%2Fasync_wallpaper/lists"}