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

flutter_media_downloader 표지
패키지 상세v2.0.0

flutter_media_downloader

이 플러그인은 사용자가 PDF 파일, 이미지 파일 등의 미디어를 다운로드하는 데 도움을 줍니다.

AndroidiOS
30일 다운로드
398
좋아요
52
Pub 점수
140

패키지 설치

flutter pub add flutter_media_downloader

패키지 개요

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

이미지, PDF 및 기타 일반적인 파일 유형과 같은 미디어 파일을 다운로드하는 과정을 간소화하도록 설계된 플러터 플러그인입니다. 다운로드를 시작하고 다운로드 진행 상황을 관리하며 안드로이드 및 iOS 플랫폼에서 파일 저장소를 처리하기 위한 간단한 API를 제공합니다. 신뢰할 수 있는 백그라운드 다운로드를 보장하기 위해 네이티브 다운로드 매니저와 통합되며, 완료 후 쉽게 액세스할 수 있도록 파일 경로 관리를 지원합니다. 오프라인 미디어 접근 또는 콘텐츠 캐싱이 필요한 앱에 적합합니다.

사용 사례

  • 오프라인 보기용 이미지 다운로드
  • URL에서 PDF 저장하기
  • 앱 사용을 위한 미디어 자산 캐싱
  • 사용자 시작 파일 다운로드 활성화
  • 앱에서 대규모 미디어 파일 관리하기

주요 기능

  • 여러 파일 형식(이미지, PDF 등)을 지원합니다
  • 백그라운드 다운로드 기능
  • 다운로드 중 진행 추적
  • 크로스 플랫폼 호환성 (Android 및 iOS)
  • pub.dev를 통한 간단한 통합
  • 다운로드 후 파일 경로 관리

적합한 대상

  • 오프라인 미디어 액세스가 필요한 앱
  • 콘텐츠 전달 플랫폼
  • 교육 또는 독서 앱
  • 미디어 중심 애플리케이션
  • 앱에서 파일을 직접 저장하고 싶은 사용자

고려 사항

  • Android 및 iOS에서 적절한 권한이 필요합니다
  • 파일 시스템 액세스를 위해 추가 처리가 필요할 수 있습니다
  • 다운로드 UI에 대한 사용자 정의 제한
  • 네이티브 다운로드 매니저에 의존합니다
  • 체크 없이 매우 큰 파일에는 적합하지 않습니다

원본 README

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

flutter_media_downloader

This plugin helps user to download medias for example pdf files, image files etc. A plugin for creating and managing download tasks. Supports iOS and Android.

This plugin is using native methods for push notifications for both platforms (Android & iOS). This is easy to use plugin.

Working Demo

DEMO

Android integration

You just need to add permissions in your manifest file for the push notification. And other permission for read external storage.

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
    <!-- For Android 13+ (API 33 and above) -->
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />
Open downloaded file from notification

To make tapping on notification open the downloaded file on Android, add the following code to AndroidManifest.xml:

<provider
    android:name="androidx.core.content.FileProvider"
    android:authorities="${applicationId}.provider"
    android:exported="false"
    android:grantUriPermissions="true">
    <meta-data
        android:name="android.support.FILE_PROVIDER_PATHS"
        android:resource="@xml/provider_paths" />
</provider>

Notes

  • By default location is provided you can also change it as per your need. Apart from this you can also provide filename if you want to change.
  • Here in this plugin for iOS device when media file is downloaded then it is open and from there you can store wherever you wan to store.
  • Here for push notifications in both the devices native methods are used.
  • For the permission handling you don't need manage it externally all the things are setup you just need to use it.

Usage

Import and full example of using this plugin
import 'dart:io';

import 'package:flutter/material.dart';
import 'package:flutter_media_downloader/flutter_media_downloader.dart';

void main() {

  runApp(const MyApp());
  WidgetsFlutterBinding.ensureInitialized();
}

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {

  final _flutterMediaDownloaderPlugin = MediaDownload();

  @override
  void initState() {
    super.initState();

  }
  @override
  Widget build(BuildContext context) {

    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: ElevatedButton(onPressed: () async {
            _flutterMediaDownloaderPlugin.downloadMedia(context,'https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf');
          }, child: const Text('Media Download')),
        ),
      ),
    );
  }
}

Support the Project

If you find this plugin helpful, consider supporting its development:

Your support is greatly appreciated!

Bugs/Requests

Feel free to open an issue if you encounter any problems or think that the plugin is missing some feature.

Email parthsheth100@gmail.com

카테고리

의존성

의존성 목록 3 개

소스 저장소

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

아직 데이터가 없습니다.