패키지, 저장소 및 앱 카테고리 검색

패키지 상세v3.7.0

async_wallpaper

Android에서 비동기적으로 배경화면을 설정합니다. 또한 동영상 라이브 벽지도 지원합니다.

Android
30일 다운로드
2.4천
좋아요
91
Pub 점수
160

패키지 설치

flutter pub add async_wallpaper

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

Android 기기에서 비동기적으로 배경화면을 설정할 수 있도록 해주는 플러터 패키지로, 동영상 라이브 월페이퍼를 지원합니다. UI 스레드를 차단하지 않고 플러터 앱 내부에서 배경화면을 변경하는 간편하고 효율적인 방법을 제공합니다. 이 패키지는 Android 전용으로 설계되었으며 네이티브 Android API와 원활하게 통합됩니다. 개발자들이 동적 배경화면 사용자 맞춤 설정 옵션을 제공함으로써 사용자 경험을 향상시킬 수 있습니다. 소스 코드는 투명성과 기여를 위해 GitHub에 공개되어 있습니다.

사용 사례

  • 앱에서 정적 배경화면 설정
  • 비디오 라이브 월페이퍼 만들기
  • 개인화 기능 향상
  • 배경 벽지 업데이트
  • 사진 갤러리 앱과의 통합

주요 기능

  • 비동기 배경 설정
  • 비디오 라이브 벽지 지원
  • Android 전용 플랫폼 호환성
  • 간단한 API 통합
  • 비차단 UI 작업

적합한 대상

  • 안드로이드 앱 개발자
  • 배경화면 커스터마이징 앱
  • 사진 및 미디어 앱
  • 사용자 경험 향상 프로젝트
  • 동적 배경 변경이 필요한 앱

고려 사항

  • Android 플랫폼에 한정
  • 런타임 권한이 필요합니다
  • 비디오 벽지 지원은 기기의 기능에 따라 달라집니다
  • 모든 안드로이드 버전에서 작동하지 않을 수 있습니다
  • 비디오 벽지로 인한 배터리 영향 가능성

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

async_wallpaper

pub package

Flutter plugin to set wallpapers on Android and save them to Photos on iOS.

  • Static wallpaper from a URL, file path, content URI, or bytes
  • Home, lock, or both targets, with a separate result for each
  • Video and OpenGL live wallpapers
  • Scheduled wallpaper rotation
  • Capability checks before you show an action

Screenshots

Static wallpaper Capabilities More APIs iOS

Video live wallpaper: home screen before, the system preview, and the applied video.

Scale modes: centerCrop, fitCenter, center, fill, and stretch on a 1080x2400 phone.

Requirements

  • Flutter >=3.41.4, Dart >=3.9.0
  • Android minSdk 24
  • iOS 13.0+ (download only)

Installation

dependencies:
  async_wallpaper: ^3.3.0
import 'package:async_wallpaper/async_wallpaper.dart';

Usage

Check capabilities
final c = await AsyncWallpaper.getCapabilities();
if (c.supportsStaticWallpaper && c.canSetWallpaper) {
  // Show the action.
}
Static wallpaper
final result = await AsyncWallpaper.applyWallpaper(
  const StaticWallpaperRequest(
    source: WallpaperSource.url('https://example.com/wallpaper.jpg'),
    target: WallpaperTarget.both,
    scaleMode: WallpaperScaleMode.centerCrop,
    strategy: WallpaperApplyStrategy.direct,
  ),
);
if (result.status == WallpaperOperationStatus.applied) {
  // For `both`, read `result.home` and `result.lock`.
}

Sources: WallpaperSource.url (HTTPS), filePath, contentUri, bytes.

Video live wallpaper
final req = VideoWallpaperRequest(
  source: WallpaperSource.filePath('/storage/emulated/0/Download/loop.mp4'),
  target: WallpaperTarget.home,
);
final prepared = await AsyncWallpaper.setVideoWallpaper(req);
if (prepared.status == WallpaperOperationStatus.awaitingUserConfirmation) {
  await AsyncWallpaper.openLiveWallpaperPreview(req);
}

previewOpened means the system preview opened, not that the user applied it.

OpenGL live wallpaper

Check supportsOpenGlLiveWallpaper first, then call setOpenGlLiveWallpaper with a GLSL ES 1.00 fragment shader (1-60 FPS).

Wallpaper rotation
await AsyncWallpaper.startWallpaperRotation(
  const WallpaperRotationRequest(
    sources: <WallpaperRotationSource>[
      WallpaperRotationSource(sourceType: WallpaperSourceType.url, source: 'https://example.com/1.jpg'),
      WallpaperRotationSource(sourceType: WallpaperSourceType.file, source: '/storage/emulated/0/Download/2.jpg'),
    ],
    target: WallpaperTarget.both,
    intervalMinutes: 60,
    order: WallpaperRotationOrder.shuffle,
    triggers: <WallpaperRotationTrigger>{
      WallpaperRotationTrigger.interval,
      WallpaperRotationTrigger.charging,
      WallpaperRotationTrigger.timeOfDay,
    },
    activeHoursStart: 6,
    activeHoursEnd: 23,
  ),
);
await AsyncWallpaper.getWallpaperRotationStatus();
await AsyncWallpaper.rotateWallpaperNow();
await AsyncWallpaper.stopWallpaperRotation();

The minimum interval is 15 minutes. URLs must be HTTPS. Rotation uses WorkManager and needs no foreground service.

Download
await AsyncWallpaper.downloadWallpaper(
  const DownloadWallpaperRequest(url: 'https://example.com/wallpaper.jpg'),
);
  • iOS: add NSPhotoLibraryAddUsageDescription to Info.plist.
  • Android 9 and older: declare WRITE_EXTERNAL_STORAGE with android:maxSdkVersion="28" and request it before you call downloadWallpaper.

Platform support

Android iOS Web/desktop
Static, live, OpenGL, rotation Yes unsupported unsupported
Download Yes Yes unsupported
  • Background work (for example WorkManager): use WallpaperApplyStrategy.direct. The cropper, picker, and live previews need a foreground Activity and return foregroundRequired otherwise.
  • The plugin shows no toasts and does not navigate. Your app shows its own UI from the result.

Docs

Contributing

Report bugs with the bug report template and include the device model, Android version, and steps to reproduce. Request features with the feature request template. Read CONTRIBUTING.md before you open a PR.

License

MIT

카테고리

소스 저장소

이 패키지를 사용하는 프로젝트