Wednesday, November 13, 2019

Flutter Theme #2 - primarySwatch

Flutter에서 primarySwatch 사용하기

Flutter에서 primarySwatch에 대한 상세한 가이드를 제공하고자 합니다. primarySwatch는 MaterialColor를 활용하며, Material design에 주로 사용됩니다. 이때 사용되는 palette의 [500] 값이 일반적인 primaryColor 값으로 활용됩니다.

MaterialColor와 Custom MaterialColor

Flutter에서는 기본적으로 제공하는 MaterialColor를 사용하거나, 사용자가 직접 지정한 Custom MaterialColor를 사용할 수 있습니다.

colors green
custom material color

예를 들어, Theme의 primarySwatch를 colors.green으로 설정하고 앱을 실행하면 아래와 같이 green톤의 배경이 만들어집니다.

green toned background

0 개의 댓글:

Post a Comment