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

패키지 상세v1.8.4

al_downloader

URL 기반의 플러터 다운로더로, 어떤 유형의 파일도 다운로드할 수 있으며 많은 것을 자동으로 관리합니다.

AndroidiOS
30일 다운로드
333
좋아요
104
Pub 점수
120

패키지 설치

flutter pub add al_downloader

패키지 개요

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

al_downloader는 Android 및 iOS 플랫폼에서 URL 기반 파일 다운로드를 가능하게 하는 Flutter 패키지입니다. 모든 파일 유형을 다운로드할 수 있으며, 일반적인 작업인 다운로드 큐 관리, 진행률 추적, 스토리지 권한 관리를 자동으로 처리합니다. 이 패키지는 Flutter 앱 내에서 강력한 다운로드 기능을 구현하는 것을 간소화하여 신뢰할 수 있는 백그라운드 다운로드가 필요한 애플리케이션에 적합합니다. pub add를 통해 최소한의 설정만으로도 개발자는 강력한 다운로드 기능을 쉽게 통합할 수 있습니다.

사용 사례

  • URL에서 파일 다운로드
  • 백그라운드 파일 다운로드
  • 대용량 파일 전송 처리
  • 다운로드 진행 상황 관리
  • 자동 다운로드 대기열 관리

주요 기능

  • 모든 파일 형식을 지원합니다
  • 자동 다운로드 관리
  • 크로스 플랫폼(안드로이드 및 iOS)
  • 진도 추적
  • 백그라운드 다운로드 지원

적합한 대상

  • 파일 다운로드가 필요한 앱
  • 미디어 콘텐츠 전달
  • 오프라인 데이터 캐싱
  • 교육 또는 생산성 앱
  • 대규모 자산 라이브러리를 가진 애플리케이션

고려 사항

  • 안드로이드에서 인터넷 권한이 필요합니다
  • iOS에서 백그라운드 실행 권한이 필요할 수 있습니다
  • 큰 파일은 신중한 메모리 관리가 필요합니다
  • 파일 경로 처리는 플랫폼에 따라 달라질 수 있습니다
  • 내장된 복원 기능에 대한 언급 없음

원본 README

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

al_downloader

pub package

A URL-based flutter downloader that supports to download any type of file and automatically manages a lot of things.

If you need Chinese Document, click here.

Features

  • manage download tasks by url
  • simple download status
  • I/O infrequently
  • provide convenient download handle
  • support batch download
  • manage automatically files without requiring to be specified a download path
  • based on flutter_downloader

Integration

Native Config: same as flutter_downloader native config

add the following line to your pubspec.yaml

dependencies:
  al_downloader: ^1.8.4

run the following line with your command line

flutter packages get

import the following line, then you can use al_downloader

import 'package:al_downloader/al_downloader.dart';

Usage

ALDownloader
Initialize
ALDownloader.initialize();
Configure print
ALDownloader.configurePrint(true, frequentEnabled: false);
Download
ALDownloader.download(url,
    directoryPath: directoryPath,
    fileName: fileName,
    handlerInterface:
        ALDownloaderHandlerInterface(progressHandler: (progress) {
      debugPrint(
          'ALDownloader | download progress = $progress, url = $url\n');
    }, succeededHandler: () {
      debugPrint('ALDownloader | download succeeded, url = $url\n');
    }, failedHandler: () {
      debugPrint('ALDownloader | download failed, url = $url\n');
    }, pausedHandler: () {
      debugPrint('ALDownloader | download paused, url = $url\n');
    }));
Add a handler interface
ALDownloader.addHandlerInterface(
    ALDownloaderHandlerInterface(progressHandler: (progress) {
      debugPrint(
          'ALDownloader | download progress = $progress, url = $url\n');
    }, succeededHandler: () {
      debugPrint('ALDownloader | download succeeded, url = $url\n');
    }, failedHandler: () {
      debugPrint('ALDownloader | download failed, url = $url\n');
    }, pausedHandler: () {
      debugPrint('ALDownloader | download paused, url = $url\n');
    }),
    url);
Add a forever handler interface
ALDownloader.addForeverHandlerInterface(
    ALDownloaderHandlerInterface(progressHandler: (progress) {
      debugPrint(
          'ALDownloader | download progress = $progress, url = $url\n');
    }, succeededHandler: () {
      debugPrint('ALDownloader | download succeeded, url = $url\n');
    }, failedHandler: () {
      debugPrint('ALDownloader | download failed, url = $url\n');
    }, pausedHandler: () {
      debugPrint('ALDownloader | download paused, url = $url\n');
    }),
    url);
Remove handler interface
ALDownloader.removeHandlerInterfaceForUrl(url);
Pause download
/// Stop download, but the incomplete data will not be deleted.
ALDownloader.pause(url);
Cancel download
/// Stop download, and the incomplete data will be deleted.
ALDownloader.cancel(url);
Remove download
/// Remove download, and all the data will be deleted.
ALDownloader.remove(url);
Get download status
final status = await ALDownloader.getStatusForUrl(url);
Get download progress
final progress = await ALDownloader.getProgressForUrl(url);
Get task
final task = await ALDownloader.getTaskForUrl(url);
Get all tasks
final tasks = await ALDownloader.tasks;
ALDownloaderBatcher
Batch download
ALDownloaderBatcher.download(urls,
    handlerInterface:
        ALDownloaderHandlerInterface(progressHandler: (progress) {
      debugPrint('ALDownloader | batch | download progress = $progress\n');
    }, succeededHandler: () {
      debugPrint('ALDownloader | batch | download succeeded\n');
    }, failedHandler: () {
      debugPrint('ALDownloader | batch | download failed\n');
    }, pausedHandler: () {
      debugPrint('ALDownloader | batch | download paused\n');
    }));
Add a handler interface for batch
ALDownloaderBatcher.addHandlerInterface(
    ALDownloaderHandlerInterface(progressHandler: (progress) {
      debugPrint('ALDownloader | batch | download progress = $progress\n');
    }, succeededHandler: () {
      debugPrint('ALDownloader | batch | download succeeded\n');
    }, failedHandler: () {
      debugPrint('ALDownloader | batch | download failed\n');
    }, pausedHandler: () {
      debugPrint('ALDownloader | batch | download paused\n');
    }),
    urls);
Get download status for a set of urls
final status = await ALDownloaderBatcher.getStatusForUrls(urls);
Get tasks
final tasks = await ALDownloaderBatcher.getTasksForUrls(urls);
ALDownloaderFileManager - A manager that manages file by url
final physicalFilePath =
    await ALDownloaderFileManager.getPhysicalFilePathForUrl(url);
debugPrint(
    'ALDownloader | get physical file path for [url], url = $url, path = $physicalFilePath\n');

Note:

1. If the persistent file was removed by exceptional means, such as the cache folder being deleted by some business code, call [remove] and then call [download] to re-download for fixing the problem.

Key File Of Example

iOS
Android

Contributing

Welcome contribution!

Welcome to open issue or PR for any problem, suggestion and idea!

Maintainer: jackleemeta (jackleemeta@outlook.com)

카테고리

의존성

의존성 목록 7 개

소스 저장소

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

아직 데이터가 없습니다.