본문 바로가기

Flutter62

Flutter - Json 데이터 사용하는 방법 Flutter 에서 Json 데이터를 파싱해서 사용하기 위해서는 파싱할 수 있도록 설정 작업을 해야한다. 1. pubspec.yaml 에 라이브러리를 추가한다. 라이브러리 추가 방버 : 링크 참조 dependencies: # Your other regular dependencies here json_annotation: dev_dependencies: # Your other dev_dependencies here build_runner: json_serializable: json_serializable 링크 2. Json 을 받을 수 있는 Object 클래스를 만든다. @JsonSerializable() class User { User(this.name, this.email); String name; S.. 2022. 1. 11.
Flutter - Calendar / SfCalendar / Syncfusion / 캘린더 Flutter 에도 많은 라이브러리들이 존재한다. 그리고 잘 만들어져 있고 커스텀하기 좋은 Calendar 라이브러리가 Syncfusion 에서 만든 Calendar 입니다. - Syncfusion Flutter Calendar 라이브러리 링크 ✔️ 데이터 리로딩 이슈 SfCalendar 를 사용할때, 데이터를 셋팅해주는 부분이 있다. 그런데 여기서 나는 API 에서 데이터를 다시 받아와서 캘린더에 뿌려줘야하는데 종종 데이터를 제대로 뿌려주지 못하는 이슈가 발생했는데, API 에서는 데이터를 잘 내려받지만 캘린더에 표시가 됐다가 안됐다가를 반복해서 이래저래 시도해보다가 검색해서 데이터를 다시 리로딩하는 방법을 찾고 수정했습니다. - 리로딩 이슈 해결 방법 링크 ❗ 처음 시도한 방식 1. 아래와 같이 UI.. 2022. 1. 7.
Flutter - Divider(구분선) Flutter 에서 구분선을 구현하는 방법 1. 기본적인 가로 구분선 구현 Divider(thickness: 1, height: 1, color: myColor) Divider.dart 생성자 const Divider({ Key? key, this.height, this.thickness, this.indent, this.endIndent, this.color, }) 2. 세로 구분선 VerticalDivider(thickness: 1, width: 1, color: color) VerticalDivider.dart 생성자 const VerticalDivider({ Key? key, this.width, this.thickness, this.indent, this.endIndent, this.color,.. 2021. 12. 29.
Flutter - TextButton 기본 레이아웃 스타일 없애는 방법 2가지 1. Style 로 없애는 방법 TextButton( onPressed: (){}, child: Text('버튼'), style: TextButton.styleFrom( minimumSize: Size.zero, padding: EdgeInsets.zero, tapTargetSize: MaterialTapTargetSize.shrinkWrap, ), ) https://stackoverflow.com/a/69382707/3897810 2. InkWell 로 감싸는 방법 InkWell( onTap: () { // Text 클릭시 반응하는 곳 }, child: const Padding( padding: EdgeInsets.all(5.0), child: Text('버튼'), ), ), 2021. 12. 16.
Flutter - Local Notification 참고 1. Local Notification 을 만들기 위한 참고 영상 - https://www.youtube.com/watch?v=bRy5dmts3X8 2. timezone 설정을 위한 import 순서 - https://stackoverflow.com/a/64312779/3897810 2021. 12. 6.
Flutter - border 적용 https://stackoverflow.com/a/53680045/3897810 How can I add a border to a widget in Flutter? I'm using Flutter and I'd like to add a border to a widget (in this case, a Text widget). I tried TextStyle and Text, but I didn't see how to add a border. stackoverflow.com Container( decoration: BoxDecoration( border: Border.all(width: 1), borderRadius: const BorderRadius.all(Radius.circular(5))), child.. 2021. 11. 24.