plugin

gallery_saver 2.0.1
https://pub.dev/packages/gallery_saver#-readme-tab-

get package

dependencies:
  gallery_saver: ^2.0.1

setting android

projet > android > app > src > debug > AndroidManifest.xml
projet > android > app > src > profile > AndroidManifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="ai.example.candy">
    <!-- Flutter needs it to communicate with the running application
         to allow setting breakpoints, to provide hot reload, etc.
    -->
    
    ...
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
</manifest>

use code

import 'package:gallery_saver/gallery_saver.dart';

  onpressed : () {
	var file = 'https://pbs.twimg.com/media/CXs84g6UEAARaiV.jpg';
    
	GallerySaver.saveImage(file)
          .then((value) => print('>>>> save value= $value'))
          .catchError((err) {
            print('error :( $err');
          });
  }

result


profile
𝙸 𝚊𝚖 𝚊 𝚌𝚞𝚛𝚒𝚘𝚞𝚜 𝚍𝚎𝚟𝚎𝚕𝚘𝚙𝚎𝚛 𝚠𝚑𝚘 𝚎𝚗𝚓𝚘𝚢𝚜 𝚍𝚎𝚏𝚒𝚗𝚒𝚗𝚐 𝚊 𝚙𝚛𝚘𝚋𝚕𝚎𝚖. 🇰🇷👩🏻‍💻

1개의 댓글

comment-user-thumbnail
2021년 2월 17일

감사합니다! 덕분에 저장 성공했어요 ㅠㅠ

답글 달기