전체 글

Flutter/기본

[Flutter] static 키워드

class A { static int aa = 1; static void aaPrint() { print(aa); } } 코드를 짜면서 가끔씩 나오는 "static" 무슨 역할을 할까요? static 이란? "static"은 프로그래밍에서 여러 의미를 가지는 키워드 중 하나입니다. 일반적으로 static 키워드가 붙은 변수나 함수는 메모리에 한번 할당되어 프로그램이 종료될 때 해제되는 것을 의미합니다. void main() { final b = B(); //B클래스 선언 print(b.bb); //출력 2 b.bbPrint(); //출력 2 } class B { int bb = 2; void bbPrint() { print(bb); } } 기본적으로 클래스의 멤버변수나 멤버함수는 클래스 객체를 생성해야지..

Flutter/기본

[Flutter] Container Gradient 설정하기

Container > decoration > BoxDecoration > gradient 속성을 사용하면 위에 사진처럼 Container에 Gradient를 설정할 수 있습니다. 1. 일반 Container( width: 200, height: 60, decoration: BoxDecoration( gradient: LinearGradient( begin: Alignment.centerLeft, end: Alignment.centerRight, colors: [ Colors.red, Colors.yellow, ], ), ), ), 2. 대각선 Container( width: 200, height: 60, decoration: BoxDecoration( gradient: LinearGradient( beg..

Flutter/기본

[Flutter] AppBar UnderLine 밑줄 설정

해당 사진처럼 AppBar에 회색 밑줄을 표시하고 싶을 때는 AppBar의 shape 속성을 사용하면 간단하게 할 수 있다. AppBar( ... ... ... shape: Border( bottom: BorderSide( color: Colors.grey, width: 1, ), ), ),

Flutter/기본

[Flutter] TextFormField 텍스트 밑줄 제거

TextFormField 에서 텍스트를 입력시 이렇게 밑줄이 뜨는 현상이 발생한다. 이를 해결하기 위해서는 아래와 같은 코드를 추가해주면 해결된다. TextFormField( ... style: TextStyle(decorationThickness: 0), ),

주톨
Jutole's programming