일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 플러터
- M1
- swift
- 데스크셋업
- 내돈내산
- 카카오
- sqflite
- error
- react
- Android
- visualstudiocode
- AppBar
- Git
- AppleSilicon
- GetX
- wrap
- 데스크테리어
- 라이언
- TextField
- listview
- Flutter
- database
- ios
- GitHub
- 간단리뷰
- 춘식
- xcode
- datetime
- list
- VSCode
- Today
- Total
목록Flutter (49)
welcome to my blog
현재 시간을 알고싶을 때 DateTime을 사용한다. 하지만 DateTime은 디바이스 로컬 시간을 가져온다는 점 유의하자. var now = DateTime.now(); String today = '${now.year}. ${now.month}. ${now.day}';//2021. 11. 5 now.year -> 년 now.month -> 월 now.day -> 일 UTC시간 : 협정 세계시 utc시간을 얻으려면 ntp라는 라이브러리를 사용하는듯 하다 (추후 사용하게된다면 정리) ListTile의 항목을 꾹 눌렀을 때(long press) 해당 내용을 복사하고싶다면 Clipboard 위젯을 사용한다. +)스낵바를 적용해보았다. ListTile( onLongPress: (){ Clipboard.setDa..
TextField( maxLines: 1, decoration: InputDecoration(border: InputBorder.none, hintText: '무엇이든 입력하세요'), ), TextField의 밑줄 없애는 방법 : decoration : InputDecoration의 border속성을 none으로 설정해준다. hintText : 텍스트필드에 입력하기 전에 어떤 내용을 작성해야하는지 알려주는 기능. 터치하는 순간 사라짐 Container( decoration: const BoxDecoration( image: DecorationImage( image: AssetImage("assets/background.jpg"), fit: BoxFit.fill ) ), ), 배경이미지 설정하는 방법: 먼..
키보드의 완료 버튼을 누르면 기본적으로 키보드가 내려가면서 포커스도 해제되지만, 꼭 완료 버튼을 누르지 않아도 배경을 터치했을 때나 특정 버튼을 눌렀을 때 키보드를 내리고 싶을때가 있다. 텍스트필드의 포커스를 해제시키고 싶을 때 사용할 수 있는 방법! 1. FocusNode 객체를 생성한다. FocusNode textFocus = FocusNode(); 2. TextField 위젯에 생성한 FocusNode를 연결한다. TextField( maxLines: 1, focusNode: widget.textFocus, ) 3. 원하는 이벤트가 발생했을 때 unfocus 해준다. widget.textFocus.unfocus(); 여기서 원하는 이벤트 예시 ---> 텍스트필드가 아닌곳을 선택했을때 혹은 버튼을 눌..
해볼것 : 1. database 생성 2. 항목 추가 3. 저장내용 읽어오기 4. 항목 삭제 5. 내용 수정(update) 필요한 패키지 : path, path_provider, sqflite void setPath() async { print('setPath !!!'); var databasePath = await getDatabasesPath(); _path = join(databasePath, 'demo123.db'); print('path @@ : ${_path}'); } void open() async { print('open !!!'); Database database = await openDatabase(_path, version: 1, onCreate: (Database db, int ve..
어플을 새로 켤때마다 초기화되지만, database를 이용하면 정보를 저장했다가 불러올 수 있다. 간단하게 database 생성, 추가, 읽어오기를 테스트 해보겠다. (수정, 삭제는 다음 포스팅에..) 설치 라이브러리 : sqflite, path path 라이브러리 : 경로 관련 라이브러리 join() : 경로를 병합시켜준다. 예시) p.join('path', 'to', 'foo'); // -> 'path/to/foo' sqflite 라이브러리 : database 관리 라이브러리 getDatabasesPath() : 기본 데이터베이스 경로를 가져온다. 일반적으로 Android는 data/data/ , iOS는 Documents 디렉토리 이다. Future getDatabasesPath() => datab..
MacOS 업데이트 이후 갑자기 오류메시지 발생 Launching lib/main.dart on iPhone 12 in debug mode... Warning: CocoaPods not installed. Skipping pod install. CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side. Without CocoaPods, plugins will not work on iOS or macOS. For more info, see https://flutter.dev/platform-plugins To install see htt..