๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

๐Ÿพ ๊ฐœ๋ฐœ ๐Ÿพ/Flutter

[Flutter] Haptic Feedback ํ–…ํ‹ฑ ๋ฐ˜์‘

๋ฐ˜์‘ํ˜•

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

 

๋ฐ˜์‘ํ˜•