본문 바로가기

# 02/Flutter

[Flutter] Image File Size ????? flutter 에서 앨범 이미지 또는 비디오를 불러올 때 용량을 알고 싶은 경우! https://pub.dev/packages/photo_manager photo_manager | Flutter Package A Flutter plugin that provides assets abstraction management APIs on Android, iOS, and macOS. pub.dev 보통 위의 라이브러리로 앨범 리스트를 불러오면, AssetPathEntity 해당 클래스 객체로 가져오게 되고, AssetEntity photo final File? file = await photo.file; byte = (await file?.length() ?? 0) / (1024 * 1024); 위의 코드로 이미..
[Flutter] LG 폰 Camera Flash 안꺼져요.. flutter 에서 카메라 기능을 구현할 때 쓰는 플러그인 camera camera | Flutter Package A Flutter plugin for controlling the camera. Supports previewing the camera feed, capturing images and video, and streaming image buffers to Dart. pub.dev 여기에는 LG폰만 나타나는 버그가 있다. 바로 어두운 곳에서 사진을 찍으면 자동으로 flash가 켜지는데 LG폰은 flash가 꺼지지 않는다... 어떻게 구현을 할까 하다가 사진 찍기 전에 cameraController?.setFlashMode(FlashMode.auto); 사진 찍은 후 cameraController..
[Flutter] HTML \n 줄바꿈 처리 안되는 현상! flutter 에서 HTML 코드를 표현하기 위해 쓰는 라이브러리 flutter_html flutter_html | Flutter Package A Flutter widget rendering static HTML and CSS as Flutter widgets. pub.dev Html( data: """ Render this item Do not render this item or any other item """, ); 이런식으로 간단하게 사용할 수 있는데!! 단, \n 줄바꿈 처리 안되는 문제가 있다. /// 첫번째 줄두번째 줄 Html( data: '첫번째 줄\n두번째 줄', ); /// 첫번째 줄 /// 두번째 줄 Html( data: '첫번째 줄\n두번째 줄'.replaceAll('\n', '..
[Flutter] Bluetooth Keyboard Error!! flutter 2.2.0 버전 이후부터!! 안드로이드 삼성 폰에서 flutter 앱을 실행 후 블루투스 키보드를 연결하고 텍스트를 입력하면 키보드가 올라갔다 내려갔다 하는 이상한 버그를 확인 할 수 있다!! https://github.com/flutter/flutter/issues/95697 [Android][Bluetooth Keyboard] The software keyboard repeatedly opens and closes while typing with bluetooth keyboard. · Issue # The software keyboard is repeatedly open and close when I type characters with bluetooth keyboard. I have ..
[Flutter] show Performance Overlay MaterialApp 에 show Performance Overlay: true, 추가해주면 앱 실행시 퍼포먼스 체크 할 수 있다! void main() { runApp(const MyApp()); } class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @override Widget build(BuildContext context) { return const MaterialApp( title: 'Flutter Demo', showPerformanceOverlay: true, home: MyHomePage(title: 'Flutter Demo Home Page'), ); } }
[Flutter] Native Shared Preferences ! 지금 회사에서 네이티브 앱을 flutter 앱으로 리뉴얼 하는 작업을 진행 중이다. 업데이트 되는 시점에서 자동 로그인이 풀리지 않도록 shared preferences 값을 마이그레이션 하는 작업이 필요하다고 하여 찾게된 라이브러리 Native Shared Preferences! 처음에 안드로이드 네이티브 앱을 설치하고 flutter 앱을 설치 해주면 자꾸 삭제되고 다시 설치가 되었다. 업데이트가 아니라! 패키지명도 같은데 와이? ✓ Built build/app/outputs/flutter-apk/app-live-debug.apk. Installing build/app/outputs/flutter-apk/app.apk... Uninstalling old version... Error: ADB exite..
[Flutter] How to use Expanded in SingleChildScrollView? Instead of using SingleChildScrollView, It's easier to use CustomScrollView with a SliverFillRemaining. Try this: CustomScrollView( slivers: [ SliverFillRemaining( hasScrollBody: false, child: Column( children: [ const Text('Header'), Expanded(child: Container(color: Colors.red)), const Text('Footer'), ], ), ), ], ) 출처 - https://stackoverflow.com/questions/56326005/how-to-use-expanded-in-singlec..
[Flutter] scroll physics no bounce no scroll physics: const ClampingScrollPhysics( parent: NeverScrollableScrollPhysics(), ),