https://docs.flutter.dev/get-started/install/macos
Update your path
You can update your PATH variable for the current session at the command line, as shown in Get the Flutter SDK. You’ll probably want to update this variable permanently, so you can run flutter commands in any terminal session.
정렬 방식이 특이하다.
Error: Cannot run with sound null safety, because the following dependencies
don't support null safety:
https://dart.dev/go/unsound-null-safety
dart package는 language version이 다르더라도 사용할 수 있게 한다. 이를 mixed-version programs라 부르고 unsound null safety로 구동된다.
https://dart.dev/go/unsound-null-safety
무시하고 구동하려면 다음과 같은 명령어를 쓴다.(둘 중 하나)
Disable sound null safety using the --no-sound-null-safety flag to the or flutter command:
$ dart --no-sound-null-safety run
$ flutter run --no-sound-null-safety
🤔 'Flutter에서는 정렬, 여백, 레이아웃 등 거의 모든것이 위젯입니다.' → 즉, 웹에서 html tag와 위젯이 비슷한 곳에 배치되는 것 처럼 느껴진다. 다만 StatefulWidget/StatelessWidget를 상속하여서 state에 대해 좀 더 중요하게 생각한다.
You might wonder why StatefulWidget and State are separate objects. In Flutter, these two types of objects have different life cycles. Widgets are temporary objects, used to construct a presentation of the application in its current state. State objects, on the other hand, are persistent between calls to build(), allowing them to remember information.
이제 그냥 primaryColor를 바꿀 수 없게 되었다(업데이트 이후에)
하지만 위의 방식대로 하면 scheme의 required 변수들을 엄청나게 필요로 하는데
MaterialApp(
theme: ThemeData(
colorScheme: ColorScheme.fromSwatch(
primarySwatch: Colors.grey,
),
)
)
위와 같은 방식으로 바꾸면 된다.
primaryColor는 아마 쓰기 힘들것 같고, primarySwatch를 사용하도록 강요하는 느낌이다.
'Programming > Flutter' 카테고리의 다른 글
[Flutter] ConstrainedBox를 사용하여 SingleChildScrollView full Height 채우기 (0) | 2022.03.17 |
---|---|
[Flutter] image full width 채우기 (0) | 2022.03.17 |
[Flutter] overflow 처리하기 (0) | 2022.01.28 |