본문 바로가기

Flutter

[GRAMMAR] VoidCallback(), Function(x), ValueChanged<T> 위와 같은 함수들이 많이 헷갈렸기 때문에 이를 정리하기 위함이다. Function(x) Function의 경우에는 Parmeter를 넘겨줄 수도 있고, 리턴값 또한 받을 수 있다. 만약 부모로 부터 return 값을 받고 싶으면 Function(x)를 사용하면 된다. 예제를 살펴보면 확실하게 알 수 있다. import 'package:flutter/material.dart'; import 'count.dart'; class CounterPage extends StatefulWidget { _CounterPageState createState() => _CounterPageState(); } class _CounterPageState extends State { int count = 0; @override.. 더보기
[GRAMMAR] as, parse, to as TYPE (ex. as Map, as Pizza..) as는 다른 타입으로 바꿔주는 문법인데 클래스를 다운그레이드 시킬 때 많이 사용한다. type.parse(string) parse는 String 변수를 int 또는 double 등의 정수형 타입으로 바꿀 때 자주 사용한다. toInt, toString, toDouble .. to(TYPE)은 형 변환할 때에 가장 많이 사용하고 유용하다. 더보기
[GETX] BottomSheet 높이 변경하는 방법 Getx BottomSheet의 높이 Default는 화면 높이의 절반이라서 더 늘리고 싶다면 1. builder 사용 2. isScrollControlled: true [Link] - 🔗 https://stackoverflow.com/questions/48968176/how-do-you-adjust-the-height-and-borderradius-of-a-bottomsheet-in-flutter How do you adjust the height and borderRadius of a BottomSheet in Flutter? I'm probably missing something obvious here, but my BottomSheet only takes up the bottom half the .. 더보기
[Widget] CheckBox CheckBox Widget 1. Property 정리 shape : CheckBox의 Shape을 지정할 수 있다. shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(3), ), side: CheckBox의 border 지정할 수 있다. side: const BorderSide(color: Colors.black,), Example Checkbox( value: true, onChanged: (_) {}, // Background color of your checkbox if selected activeColor: Colors.deepOrange, // Color of your check mark checkColor: Colors.b.. 더보기
[PAKAGE] SharedPreference로 Login 정보 기억하기! [Link] - 🔗 https://lawrey.medium.com/flutter-local-storage-ac2eaf1194be Flutter: Local Storage Welcome to another part of my Flutter tutorials. As I am on a journey in exploring more about Flutter, I will be penning down useful… lawrey.medium.com - 🔗 https://stackoverflow.com/questions/54377188/how-to-use-shared-preferences-to-keep-user-logged-in-flutter How to use shared preferences to keep use.. 더보기
[PAKAGE] 유용한 PAKAGE 모음집 1. round check box - CheckBox를 custom 해서 사용할 수 있는 Pakage 이다. 🔗 https://pub.dev/packages/roundcheckbox roundcheckbox | Flutter Package Package to make easier the proccess of creating a round circle box. The component created is fully customizable to your needs. pub.dev 더보기
[ERROR] TextField, TextFormField PrefixIcon, SuffixIcon 사이즈 줄이기 해결 방법 Constranints property를 주면 된다!! TextField( decoration: InputDecoration( // choose any icon of your choice here prefixIcon: Icon(Icons.person), // set the prefix icon constraints prefixIconConstraints: BoxConstraints( minWidth: 25, minHeight: 25, ), ), ), [Link] - 🔗 https://stackoverflow.com/questions/61648677/how-to-reduce-padding-on-prefixicon-on-textfield How to reduce padding on prefixIc.. 더보기
[Widget] TextField, TextFormField (validate) 우선 TextField 와 TextFormField의 다른 점은 바로 FormKey를 사용해서 validate를 check 할 수 있냐 없냐이다. 코드를 통해 어떻게 Validate를 처리하는지 알아보자 어떻게 validate를 처리할까? 필요한건 우선 - GlobalKey key - Form widget - validate property @override Widget build(BuildContext context) { return DefaultAppbarLayout( child: Form( key: this.formKey, child: Padding( padding: EdgeInsets.all(16.0), child: Column( children: [ renderTextFormField( labe.. 더보기