赞
踩
flutter create 项目名
flutter run
不终止项目的情况下输入r
r
Dart DevTools needs to be installed with ‘pub global activate devtools’ to use this feature.
Dart DevTools工具会自动打开,如果不自动打开,就使用快捷键command+shift+p然后在里面输入Open DevTools,接下来就vscode里面进行代码调试了
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
// 输入stf 有状态组件
// stss 无状态组件
class MyApp extends StatefulWidget {
const MyApp({ Key? key }) : super(key: key);
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: Text('我是title')),
body: Text('我是首页1')
),
);
}
}
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。