강의

멘토링

커뮤니티

Inflearn Community Q&A

henry0314's profile image
henry0314

asked

Let's make an app with flutter (beginner)

Learn the basics

기본 구조가 다릅니다

Written on

·

250

0

강의에서 프로젝트를 생성하면 기본 구조가

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override

이렇게 되어있는데

 

제가 프로젝트를 생성하면 기본 구조가

void main() {
runApp(const MyApp());
}

class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);

// This widget is the root of your application.
@override

이렇게 나옵니다

 

1. 둘의 차이가 무엇인지 궁금합니다.

2. 언제, 왜 바뀌었는지 궁금합니다.

Flutter

Answer 2

0

henry님의 프로필 이미지
henry
Questioner

한글 공식문서에는 강의와 같은 형태로 나와있고 영문 공식문서에는 제가 올린 프로젝트와 같은 형태로 되어있네요,, 뭔가 버전이 바뀌면서 형태가 바뀐건지,,, 좀 더 찾아봐야겠네요

 

0

bokchi님의 프로필 이미지
bokchi
Instructor

안녕하세요!

아래 공식문서에서 일부 다르게 표현된 것을 볼 수 있습니다.

https://flutter-ko.dev/docs/get-started/codelab

https://docs.flutter.dev/get-started/codelab

 

다른 부분에 대한 설명은 아래의 글을 참고해보시면 좋을 것 같습니다.

https://stackoverflow.com/questions/52056035/myhomepagekey-key-this-title-superkey-key-in-flutter-what-would-b/62462789

https://medium.com/flutter-community/the-flutter-const-keyword-demystified-c8d2a2609a80

 

감사합니다 :) 

henry0314's profile image
henry0314

asked

Ask a question