intent 패키지는 Android Intent 처리를 단순화하기 위해 설계된 간단한 Flutter 플러그인입니다. Flutter 앱과 네이티브 Android 컴포넌트 간의 원활한 통신을 가능하게 하며, 최소한의 코드로 활동 시작, 브로드캐스트 전송 및 인텐트 관리를 할 수 있습니다. 데이터 공유, 외부 앱 열기, 이메일 또는 메시지 보내기와 같은 시스템 작업을 트리거하는 데 이상적입니다. 이 플러그인은 Android의 복잡한 Intent API를 사용하기 쉬운 Dart 메서드로 추상화하여 초보자도 쉽게 활용할 수 있도록 합니다. 명확한 문서와 적극적인 유지보수를 통해 Flutter와 Android의 네이티브 기능 사이의 신뢰할 수 있는 연결 고리 역할을 합니다.
사용 사례
앱 간에 콘텐츠 공유
외부 응용 프로그램 실행
브로드캐스트 인텐트 전송
시스템 설정 열기
딥링크 처리
장치 작업 트리거
주요 기능
Android Intents용 간단한 Dart 인터페이스
암시적 및 명시적 인텐트를 지원합니다
Flutter 워크플로우와의 간편한 통합
최소한의 보일러플레이트 코드
활성 GitHub 저장소
명확한 문서
적합한 대상
안드로이드를 대상으로 하는 플러터 개발자
안드로이드 전용 작업이 필요한 앱
공유 및 심층 링크 기능
초보자가 Android 통합을 배우는 중
고려 사항
Android 전용 기능
Android 플랫폼에 한정
고급 사용을 위해서는 Android SDK 지식이 필요합니다
iOS 지원 없음
일부 인텐트에 추가 권한이 필요할 수 있습니다
원본 README
연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
Warning I've stopped maintaining this project !
intent
A simple flutter plugin to deal with Android Intents - your one stop solution for Android Intents, written with :heart:.
Show some :heart: by putting :star:
intent tries to help you in launching another android activity using Android Intents. This Dart API replicates Android Intent API, so for detailed information on how to use it efficiently, when to send what kind of data, you may be interested in taking a look here, which explains things more elaborately.
intent is your one stop solution for handling different Android Intents from Flutter app.
It provides an easy to use Dart API, which can be used to launch different kind of Android Activities
You can view / create documents
Pick document(s) from Document Tree
Open default Assist Activity
Perform a Web Search
Request definition of a certain string to default Assist Activity
Open image for editing / viewing
Share text / multimedia to another activity
Send Email to specific user, while also setting CC & BCC
Share multiple documents at a time
Sync system content
Translate text
Set Wallpaper
Open any URL
Open Dialer for calling a specific number
Can pick a contact from your default phone activity
Can capture a photo using default Camera Activity
latest addition
Newest Addition: You can pass extra data's type information, while invoking Intent.putExtra(String extra, dynamic data, {String type}) as optional named param type. You don't even need to hardcode type names as Strings, rather a class named TypedExtra has been given to developers, which has all currently supported type names as static variables. Consider using them. And last but not least, this is not a breaking change !!!
But if you're interested in creating a chooser i.e. all eligible candidates shown up system, which can handle this intent, make sure you set createChooser named parameter to true, which is by default false.
Send Email to certain ID while setting Content and CC/ BCC :
Path to captured image can be grabbed from Intent().startActivityForResult().then(() { ... } ), which will be provided in form of List<String>, open file using that path, File(data[0]). Now you can work on that image file.
Intent()
..setAction(Action.ACTION_IMAGE_CAPTURE)
..startActivityForResult().then((data) => print(data[0]), // gets you path to image captured
onError: (e) => print(e));
If you're not interested in showing default activity launch animation, set following flag.
If you request for certain Activity and no eligible candidate was found, you'll receive one error message, which you can listen for using Future.catchError((e) {},) method.
PlatformException(Error, android.content.ActivityNotFoundException: NoActivity found to handle Intent { act=android.intent.action.SYSTEM_TUTORIAL }, null)
Currently a limited number of Actions are provided in Action class, but you can always use a string constant as an Action, which will help you in dealing with many more Activities.