Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- dart 변수
- API token
- There isn’t anything to compare
- fetch
- typescript react
- npm styled-reset
- bootstrap
- API 토큰
- 컨디셔널 렌더링
- rewrites
- createGlobalStyle
- Git
- getModifierState
- SCSS
- ngrok설치
- ngrok실행
- icon
- next.js css
- styled components
- git lab
- github io
- github
- react env
- react
- CSS
- input type=file
- nextjs .env
- nextjs 설치
- nextjs
- react typescript
Archives
- Today
- Total
꾸준히 성장하는 개발자
[Flutter] url_launcher 본문
https://pub.dev/packages/url_launcher
url_launcher | Flutter Package
Flutter plugin for launching a URL. Supports web, phone, SMS, and email schemes.
pub.dev
url_launcher를 사용하여 웹브라우저를 실행하거나 메일, 전화, 문자를 실행할 수 있다.
설치
pubspec.yaml 파일안에 dependencies아래와 같이 넣어준다.
dependencies:
url_launcher: ^6.1.10
pub get 실행
설정
url_launcher를 사용하려면 설정해줘야 하는것이 있다
ios
ios > Runner> Info.plist 파일로 들어가
<dict> </dict> 안에 아래처럼 넣어주면 된다.
<dict>
....
<key>LSApplicationQueriesSchemes</key>
<array>
<string>https</string>
<string>sms</string>
<string>tel</string>
</array>
</dict>
Android
android > app > src > main > AndroidManifest.xml 파일로 들어간다.
<manifest> </manifest> 하위로 아래처럼 넣어주면 된다.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.webtoon_app">
<queries>
<intent>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="sms" />
</intent>
<intent>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="tel" />
</intent>
</queries>
<application>
....
</application>
</manifest>
import 'package:url_launcher/url_launcher.dart';
onButtonTap() async {
final url=Uri.parse('https://google.com');
await launchUrl(url);
}
// 아니면 아래와 같이도 작성이 가능하다
onButtonTap() async {
launchUrlString("https://google.com");
}
GestureDetector(
onTap: onButtonTap, // 클릭을 했을때 설정한 페이지로 이동이 가능하다.
child:....,
)
'Flutter' 카테고리의 다른 글
[Flutter] card-swiper (0) | 2023.02.27 |
---|---|
[Flutter] TextField 클릭시 overflow 대응 (0) | 2023.02.27 |
[Flutter] flutter 아래 가려지는 부분 (0) | 2023.02.24 |
[Flutter] TextField 높이 상위 위젯에 맞추기 / button 높이 넣기 (0) | 2023.02.07 |
[Flutter] button 들 기본 크기, padding값 없애기 (0) | 2023.01.31 |