728x90
반응형

DART 18

[Flutter] GetX ① - 소개

이번 포스팅에서는 플러터의 거의 모든 것을 다 구현할 수 있는 GetX 에 대해서 포스팅합니다. get | Flutter Package Open screens/snackbars/dialogs without context, manage states and inject dependencies easily with GetX. pub.dev GetX 로 할 수 있는 것 라우팅 스낵바, 다이얼로그, 바텀시트 상태관리 종속성 관리 테마 http Shared Preference . . GetX 의 최대 강점은 생산성입니다. GetX 의 장점으로 가장 먼저 소개할 수 있는 부분이며 개발자가 가장 와닿을 수 있는 부분입니다. 상술한 모든 것들을 GetX 하나를 통해 GetX 없이 구현하는 것보다 직관적인 코드로 간단하게..

Flutter/Package 2022.08.28

[Flutter] TabBar , TabBarView

TabBar TabBar 는 TabController 와 List 인 tabs 를 필수로 받습니다. TabBar( controller: _tabController, tabs: [ Tab(text: 'First'), Tab(text: 'Second'), Tab(text: 'Third'), ], ) 속성 1. Indicator 현재 선택된 탭의 위치를 나타내는 indicator 를 꾸미는 인자는 다음과 같습니다. // indicator 의 색상 설정 indicatorColor: Colors.black, // indicator 색상 자동 설정 여부 automaticIndicatorColorAdjustment: true, // indicator 의 굵기 설정 indicatorWeight: 2.0, // indi..

Flutter/UI 2022.08.10

[Flutter] BottomNavigationBar

웬만한 앱에는 다 있는 BottomNavigationBar 에 대해서 포스팅 합니다. BottomNavigationBar Scaffold 내부에 bottomNavigationBar 를 통해 구현합니다. BottomNavigationBar 위젯에 List items 속성을 필수로 받습니다. import 'package:flutter/material.dart'; class SampleScreen extends StatefulWidget { const SampleScreen({Key? key}) : super(key: key); @override State createState() => _SampleScreenState(); } class _SampleScreenState extends State { @ove..

Flutter/UI 2022.08.09

[Flutter] Bloc ② - Cubit 과 Bloc

Bloc ① - 소개 https://dalgoodori.tistory.com/28 Bloc ② - Cubit 과 Bloc Bloc ③ - Bloc Widgets https://dalgoodori.tistory.com/30 Bloc ④ - context.read, context.watch, context.select https://dalgoodori.tistory.com/31 Bloc ⑤ - Bloc Test https://dalgoodori.tistory.com/32 Cubit Cubit 은 Bloc 과 다르게 이벤트 기반이 아니라 정말 간단하게 상태를 관리할 수 있습니다. Provider 의 ChangeNotifier 와 비슷합니다. 생성 Cubit 을 상속받는 클래스를 만들어주면 됩니다. 초기값은 내..

Flutter/Package 2022.08.04

[Flutter] Bloc ① - 소개

Bloc ① - 소개 Bloc ② - Cubit 과 Bloc https://dalgoodori.tistory.com/29 Bloc ③ - Bloc Widgets https://dalgoodori.tistory.com/30 Bloc ④ - context.read, context.watch, context.select https://dalgoodori.tistory.com/31 Bloc ⑤ - Bloc Test https://dalgoodori.tistory.com/32 Flutter에서는 UI 와 비즈니스 로직을 분리하기 위해서 많이 쓰이는 Bloc 에 대해서 포스팅 합니다. Provider 와 같이 관심사 분리를 위해 쓰이는 것은 동일하지만 Bloc 은 Provider 와 다르게 State와 Event를..

Flutter/Package 2022.08.03

[Flutter] DatePicker , TimePicker

간단한 날짜, 시간 선택할 때 사용되는 피커 입니다. 역시 구현하기 아주아주아주 쉽습니다. 1. DatePicker showDatePicker( context: context, initialDate: DateTime.now(), firstDate: DateTime(2022, 6, 22), lastDate: DateTime(2022, 8, 22), ).then((DateTime? value) => print('value = $value')); 2. TimePicker showTimePicker( context: context, initialTime: TimeOfDay(hour: 22, minute: 10), ); 3. CupertinoDatePicker showModalBottomSheet( context..

Flutter/UI 2022.07.30

[Flutter] AlertDialog

경고문구나 안내문구를 띄울 때 자주 쓰이는 AlertDialog 입니다. 아주아주아주 쉽게 구현할 수 있습니다. 창을 띄우는 것은 showDialog 로 시작합니다. showDialog BuildContext 를 받고 WidgetBuilder 로 임의의 위젯을 구현하면 됩니다. AlertDialog 를 구현하기 위해서 WidgetBuilder 에 Dialog 코드를 넣어줍니다. showDialog( context: context, builder: (BuildContext context) { return AlertDialog( title: const Text('AlertDialog Title'), content: const Text('Sample AlertDialog'), actions: [ TextBut..

Flutter/UI 2022.07.29

[Flutter] Provider

옛날 JSP, PHP 코드를 보면 UI 와 비즈니스 로직이 섞여 수천줄이나 되는 코드를 볼 수 있었습니다. 이런 코드는 가독성은 두말할 것도 없지만 코드를 작성한 사람도 시간이 지나면 알아보기 힘들 정도이기 때문에 유지보수에 굉장히 애를 먹습니다. 한사람이 처리하던 많은 일을 여러 사람과 분업을 하듯이 UI 와 비스니스 로직을 떼어놓는 관심사 분리 작업이 필요합니다. Flutter 에서는 Provider 로 관심사 분리를 할 수 있습니다. provider | Flutter Package A wrapper around InheritedWidget to make them easier to use and more reusable. pub.dev 앱을 처음 만들었을 때 기본으로 제공되는 카운팅 앱으로 예시로 했..

Flutter/Package 2022.07.27

[Flutter] Hive

Flutter Local DB 중에서는 Sqlflite, Drift 처럼 RDBMS 만 있는게 아닌 NoSql 도 존재합니다. Nosql 형태인 Hive 에 대해서 간단하게 포스팅 하려고 합니다. hive | Dart Package Lightweight and blazing fast key-value database written in pure Dart. Strongly encrypted using AES-256. pub.dev pubspec.yaml dependencies: hive: ^2.2.3 hive_flutter: ^1.1.0 dev_dependencies: build_runner: ^2.2.0 hive_generator: ^1.1.3 hive_todo.dart HiveObject 를 상속 후 ..

Flutter/Package 2022.07.26
728x90
반응형