일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 안드로이드
- 계측
- 테스트
- binding
- android
- textview
- Kotlin
- livedata
- CustomScrollView
- viewmodel
- LifeCycle
- ScrollView
- scroll
- Navigation
- drift
- Coroutines
- TEST
- DART
- Compose
- activity
- tabbar
- Button
- textfield
- data
- appbar
- 앱바
- 앱
- intent
- Flutter
- Dialog
- Today
- Total
목록전체 글 (364)
Study Record

✍ 개발자 모드 플러터 프로젝트에서 pub get 을 실행하던 중 다음과 같은 오류가 나왔다. Please enable Developer Mode in your system settings. Run start ms-settings:developers to open settings. Windows 를 사용하고 있고 이 오류는 개발자 모드를 켜주면 된다. (Windows 10) 😶 과정 설명 ① [설정] → [업데이트 및 보안] 탭에 들어간다. ② [개발자용] 에 들어가 개발자 모드를 킨다.

✍ 입력 폼이 포함된 화면 입력 폼(TextField, TextFormField 등)이 포함된 화면은 키보드가 올라와 화면을 가리면서 overflowed 가 날 수 있다. 이럴 경우 SingleChildScrollView 를 최상단에 위젯 상단에 배치하면 키보드가 올라와도 스크롤이 가능하기 때문에 overflowed 문제가 생기지 않는다. 😶 예시) import 'package:flutter/material.dart'; void main() => runApp(MaterialApp(home: ScrollControlView())); class ScrollControlView extends StatelessWidget { const ScrollControlView({Key? key}) : super(key:..

✍ TextField 에서 비밀번호 입력 설정 입력 폼 중 비밀번호를 입력하는 형식이면 글자를 입력할 때 작은 원으로 보이는 기능은 TextField 의 obscureText 를 true 로 해주면 된다. TextField( obscureText: true, )

✍ 입력 폼 border TextField(TextFormField) 의 border 에는 여러 가지 종류가 있는데 여러 가지 상황에서 border 값을 따로 설정할 수 있다. 종류는 다음 표와 같다. border 인자만 설정했을 때 기본 border 값이지만 실제로 시작하고 focus가 없는 처음 상태에서 기본 border 로 적용이 안될 때가 있다. 이때는 enabledBorder 값을 설정해 주면 enabledBorder 값으로 적용된다. 인자 설명 border 기본 border focusBorder focus 가 있는 상태 errorBorder error 상태에서 focus 가 없는 상태 focusErrorBorder error 상태에서 focus 가 있는 상태 enabledBorder 사용 가능..

✍ Future 와 Stream drift 에서 select 로 데이터를 가져올 때 get() 함수로 가져오는 것과 watch() 함수로 가져올 수 있다. get() 함수는 Future 로 받고 watch() 함수는 Stream 으로 받는다. Stream 으로 가져오는 것은 데이터의 변화가 있으면 자동으로 업데이트해 준다는 점이다. 반면에 Future 는 딱 한 번 실행할 때 가져오고 데이터의 변화가 있어도 업데이트하지 않는다. import 'package:drift/drift.dart'; import 'dart:io'; import 'package:drift/native.dart'; import 'package:flutter/services.dart'; import 'package:path_provid..

✍ 데이터베이스 importing drift 에서 새로운 데이터 베이스를 만들지 않고 이미 있는 데이터 베이스를 importing 할 수 있다. 첫 번째로, assets 디렉터리에 데이터 베이스 파일을 넣고 pubspec.yaml 에 데이터 베이스 파일을 추가한다. 두 번째로, 데이터 베이스 클래스에 미리 생성된 데이터 베이스가 없으면 assets 에 저장한 데이터 베이스를 저장하는 걸로 importing 을 할 수 있다. import 'package:drift/drift.dart'; import 'package:flutter/services.dart' show rootBundle; import 'package:path/path.dart' as p; LazyDatabase _openConnection()..

🎁 drift 테이블과 데이터 test_database.dart import 'package:drift/drift.dart'; import 'dart:io'; import 'package:drift/native.dart'; import 'package:path_provider/path_provider.dart'; import 'package:path/path.dart' as p; part 'test_database.g.dart'; class Students extends Table { IntColumn get id => integer().autoIncrement()(); TextColumn get name => text()(); IntColumn get grade => integer()(); TextCo..
✍ table 만들기 drift 라이브러리에 table 을 만드는 방법 2가지를 소개하려 한다. sql 언어로 작성된 파일을 만들어 데이터베이스를 클래스에서 파일을 참고하는 방법과 Table 클래스를 상속받은 클래스를 만드는 방법이 있다. ✍ 파일을 사용한 방법 ./lib/database/tables.drift CREATE TABLE todos ( id INT NOT NULL PRIMARY KEY AUTOINCREMENT, title TEXT, body TEXT, category INT REFERENCES categories (id) ); CREATE TABLE categories ( id INT NOT NULL PRIMARY KEY AUTOINCREMENT, description TEXT ) AS Ca..