phymo / blog

前端技术笔记
0 stars 0 forks source link

flutter-tips #4

Open phymo opened 5 years ago

phymo commented 5 years ago
phymo commented 5 years ago

找到 sdk/emulator.exe, 复制路径

~\emulator.exe -netdelay none -netspeed full -avd Nexus_5x_API_28

保存为.bat 批处理文件 打开.bat 文件可以打开虚拟机

phymo commented 5 years ago

配置vs code ctrl +~ 打开终端 flutter run 打开热更新 如果遇到下面错误,可以把os 从Q 降到pie image

phymo commented 5 years ago

class MyApp extends StatelessWidget{ @override widget build(BuildContext context) { return MaterialApp{ title: 'hello dart', home: Scaffold( //页面主要文件 appBar: AppBar( .... ) } } }

phymo commented 5 years ago
  1. (更简单的方法不用创建.bat 文件)点一下右下角 No Device , 选择虚拟机或者创建虚拟机(创建虚拟机需要 AVD system image, 可以通过Android studio 安装,也可以通过sdk manager 直接安装)

  2. Android studio => tools => add device => add os

phymo commented 5 years ago

常用widget

  1. Text widget;
  2. Container widget;
phymo commented 5 years ago

hero widget

phymo commented 5 years ago

dismissible

phymo commented 5 years ago

valueListenBuilder

phymo commented 5 years ago

valueNotifier