반응형

flutter 34

flutter container click

플러터에서 container widget을 클릭하기 위해서는 InkWell 위젯을 사용하면 된다. 그리고, inkwell widget안에 onTap 부분에 클릭하면 수행할 함수/동작을 넣어주면 된다. InkWell( onTap: (){ Navigator.of(context).pushReplacementNamed('/promise'); }, child: Container( padding: EdgeInsets.all(10), height: 150.0, width: 150.0, color: Colors.transparent, child: Container( decoration: BoxDecoration( color: Colors.grey.withOpacity(0.2), borderRadius: BorderRa..

flutter 2022.06.18

flutter bottom overflowed by pixels

플러터 screen에서 bottom overflowed by ~~ pixels라고 뜰 때가 있다. 노란색과 검정색의 빗금이 마구 쳐져있다. 이것을 해결하기 위한 방법은, Scaffold 하위에 resizeToAvoidBottomInset : false, body부분에 SingleChildScrollView 를 넣어주면 된다. resizetoAvoidBottomInset에 대해서 더 알아보자면, 이 값이 true 일 경우에는, body와 scaffold의 위젯들이 키보드 위에 존재하지 않도록 하는 것이다. 즉 키보드가 나타나면 이 값들이 키보드 밑에 존재하지 않도록 쭈욱 밀린다는 것이다. 따라서 이 값을 false로 설정해야 값들이 밀리지 않고 overflow 표시가 나지 않는다. 아래는 코드이다. cla..

flutter 2022.06.18

flutter background color 설정하기

플러터에서 전체 스크린의 배경색을 설정하는 방법을 알아보겠다. materialapp을 만들어주는 쪽에서 theme을 추가해주면 된다. return MaterialApp( // your other app initialization code theme: ThemeData(scaffoldBackgroundColor: Colors.white), ); 각 화면에서 배경색 설정하는 방법은 이렇게 scaffold 밑에 backgroundcolor로 배경색을 설정해주면 된다. void main() => runApp(new MyApp()); class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return new Mater..

flutter 2022.06.17

provider listview builder에 적용시 문제점

list view builder에 provider를 적용하였다. 그런데 데이터를 추가했을 때 데이터가 바로 업데이트 되지 않았다... 아래가 문제가되는 화면이다.. stackoverflow에서 찾은 방법인데,, 1번방법 이 방법은 stateful widget에서 initstate를 사용했다. 그런데 우리는 stateless widget을 사용하기 때문에 initstate가 없어서 이 방법으로는 해결 할 수 없다,, https://stackoverflow.com/questions/62994906/is-there-other-method-to-update-data-in-custom-listview-in-provider-flutter Is there other method to update data in cus..

flutter 2022.06.15

flutter quill editor provider 적용/ 저장했던 글 불러오기

저번 포스팅에서는 quill editor에 대해서 알아보았다. 오늘은 quill editor에 provider를 적용하는 방법에 대해서 알아보겠다. 사실 다른 provider 적용방법과 다르지 않다. 그냥 quill controller만 모델부분에서 정의해주고, class 만들어준다음에 screen 부분에서 불러와서 쓰면 된다..! toolbar(screen) 부분 class Toolbar extends StatelessWidget { late QuillModel quillmodel; Toolbar({Key? key}) : super(key: key); Future _onImagePickCallback(File file) async { // Copies the picked file from tempora..

flutter 2022.06.14

table calendar flutter provider

flutter에서 table calendar를 provider를 이용하는 방법에 대해서 알아보겠다. stateful widget에서 사용하는 예제는 table calendar github 예제에 이미 나와있다. https://github.com/aleksanderwozniak/table_calendar/tree/master/example GitHub - aleksanderwozniak/table_calendar: Highly customizable, feature-packed calendar widget for Flutter Highly customizable, feature-packed calendar widget for Flutter - GitHub - aleksanderwozniak/table_ca..

flutter 2022.06.07

flutter error - Error launching application on sdk gphone64 arm64

error: Failed to install APK again. Error launching application on sdk gphone64 arm64. 저장공간이 부족해서 뜨는 에러라고 한다. 에뮬레이터의 저장용량을 늘리면 된다. 안드로이드 스튜디오에서 Tools > AVD Manager Edit the virtual device Show advanced settings Increase internal storage 이렇게 하니까 에러 안났다! 성공~~ https://stackoverflow.com/questions/54010649/error-when-trying-to-install-second-flutter-app-on-the-emulator Error when trying to install se..

flutter 2022.06.01

flutter table calendar

플러터에서 달력을 사용하기 위한 대표적인 패키지가 두가지 있다. table calendar와 table carousel이다. 나는 table calendar를 사용했다. 원하는대로 ui를 바꾸기 위해서 깃헙에 들어가서 소스코드를 다 뜯어보는데 하루가 걸렸다.. 코딩실력 더 늘려야지..ㅠ 아래는 table calendar 깃헙주소다. https://github.com/aleksanderwozniak/table_calendar GitHub - aleksanderwozniak/table_calendar: Highly customizable, feature-packed calendar widget for Flutter Highly customizable, feature-packed calendar widget ..

flutter 2022.05.31
반응형