no image
[Flutter]primarySwatch 색상 선택 시 주의사항
이런 식으로 Colors.white를 사용하면 에러가 난다. 에러를 읽어보면 Color는 MaterialColor 타입의 하위타입이 아니라서 그렇다는데, white의 내부 구성을 보면 자료형이 Color로 되어있다는 것을 알 수 있다. 그렇다면 primarySwatch에서 정상작동하는 blue는 어떻게 되어있을까? 신기하게도 MaterialColor자료형으로 선언되어 있는 모습을 확인할 수 있다. 결론은 primarySwatch에서 사용할 수 있는 색깔은 MaterialColor타입으로 선언되어 있는 색깔만 사용할 수 있다는 것. What is the difference between primaryColor and primarySwatch in Flutter? In Flutter, one can appl..
2020.10.02
[Flutter]상수 리스트 (const List) 선언 시 에러
static const List _widgetOptions = [ HomePage(), //여기 중요 Text( 'Index 1: Search', ), Text( 'Index 2: Account', ), ]; 이런식으로 _widgetOptions 리스트를 선언했더니 1. The values in a const list literal must be constants. Try removing the keyword 'const' from the list literal. - const 리스트 리터럴의 값은 상수여야합니다. 리스트 리터럴에서 키워드 'const'를 제거해보십시오. 2. The constructor being called isn't a const constructor. Try using 'new' ..
2020.10.02
[Flutter]Row 및 Column에서 Alignment 작동안함
Why CrossAxisAligment not Working in Flex,Row and Column? class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text( 'Flutter Demo' ), ),... stackoverflow.com 여기 글에서 SizedBox.expand를 추가하고 해결되었다. 이유는 Row don't take all the vertical space available by default. It takes only the needed space. (but it takes all the horizontal sp..
2020.09.28