Develop/Flutter
[Flutter #2] VScode로 프로젝트 만들기
팅코벨
2021. 7. 1. 17:41
728x90
새 플러터 프로젝트 생성
or
명령어
flutter create 프로젝트이름
프로젝트 생성 후
lib >main.dart 에 있는 기존 코드들은 다 지우고 아래의 코드로 붙여넣어줍니다.
// Copyright 2018 The Flutter team. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Welcome to Flutter',
home: Scaffold(
appBar: AppBar(
title: const Text('Welcome to Flutter'),
),
body: const Center(
child: Text('Hello world'),
),
),
);
}
}
Flutter 실행(run)
코드 상단의 Run 클릭
명령어
flutter run
Emulator 실행
mac일 경우 참고
728x90
반응형