1. AndroidManifest.xml ํ์ผ์ ์ฝ๋ ์ถ๊ฐ
<uses-permission android:name="android.permission.VIBRATE"/>
2. ํ ํฑ ๋ฐ์ ์ ์ฉ
import 'package:flutter/services.dart';
Widget hapticBtn() {
return IconButton(
onPressed: () {
HapticFeedback.vibrate();
},
icon: Icon(Icons.vibration),
);
}
** iOS์์๋ ์ ์์ ์ผ๋ก ์๋ํ์ง๋ง ์ผ์ฑ ์๋๋ก์ด๋ ํฐ์์๋ ์๋ํ์ง ์์์ด์ใ ใ
Haptic Feedback does not work properly on Samsung devices ยท Issue #73987 ยท flutter/flutter
Steps to Reproduce Run flutter create bug. Update the files as follows: Add: <uses-permission android:name="android.permission.VIBRATE" /> to android/app/src/mainAndroidManifest.xml...
github.com
์์ ํ์ด์ง๋ฅผ ์ฐธ๊ณ ํ์ฌ, ์ผ์ฑ ๋๋ฐ์ด์ค ์์ฒด ์ง๋์ ์ค์ ํ๊ธฐ ์ํด
์ค์ -> ์๋ฆฌ ๋ฐ ์ง๋ -> ์์คํ ์๋ฆฌ/์ง๋ ์ ์ด
์์ ๊ฒฝ๋ก๋ก ๋ค์ด๊ฐ ๋ณด๋ ํฐ์น ํผ๋๋ฐฑ์ ๋ํ ์ค์ ์ด ๊บผ์ ธ ์์๋ค์ใ ใ ์ค์ ์ ์ผ์ฃผ๋ ์ ์์ ์ผ๋ก ์๋ํ์ต๋๋ค!
- ์ฐธ๊ณ ๋ฌธ์
Android forgets vibration and haptic feedback settings - Google Pixel Community
support.google.com
'๐พ ๊ฐ๋ฐ ๐พ > Flutter' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[Flutter] Searching for inspections failed: undefined method `map' for nil:NilClass (0) | 2022.08.22 |
---|---|
[Flutter] ... duplicate symbols for architecture ... ์๋ฌ (0) | 2022.08.11 |
[Flutter] ์นด์นด์ค ๋ก๊ทธ์ธํ๊ธฐ (iOS/Android) (1) | 2022.08.04 |
[Flutter] iOS ์ฒซ ๋น๋ (0) | 2022.08.04 |
[Flutter] Consumer ์์์ ๋ชจ๋ฌ ๋์ฐ๊ธฐ (0) | 2022.06.28 |