入门flutter

demo 课程:
https://jspang.com/detailed?id=41#toc222   

https://www.bilibili.com/video/BV15t411U7yf?p=5&spm_id_from=pageDriver

 

安装环境 遇到问题:

1、启动虚拟机的时候报错:unable to locate adb

解决:https://stackoverflow.com/questions/39036796/unable-to-locate-adb-using-android-studio

 

 

 


 

flutter run 项目跑起来;

r:热更新

p:显示网格

o:切换IOS

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Flutter run key commands.
r Hot reload. 🔥🔥🔥
R Hot restart.
h Repeat this help message.
d Detach (terminate "flutter run" but leave application running).
c Clear the screen
q Quit (terminate the application on the device).
s Save a screenshot to flutter.png.
b Toggle the platform brightness setting (dark and light mode).                                                                     (debugBrightnessOverride)
w Dump widget hierarchy to the console.                                                                                                        (debugDumpApp)
t Dump rendering tree to the console.                                                                                                   (debugDumpRenderTree)
L Dump layer tree to the console.                                                                                                        (debugDumpLayerTree)
S Dump accessibility tree in traversal order.                                                                                            (debugDumpSemantics)
U Dump accessibility tree in inverse hit test order.                                                                                     (debugDumpSemantics)
i Toggle widget inspector.                                                                                           (WidgetsApp.showWidgetInspectorOverride)
I Toggle oversized image inversion 🖼️.                                                                                          (debugInvertOversizedImages)
p Toggle the display of construction lines.                                                                                           (debugPaintSizeEnabled)
o Simulate different operating systems.                                                                                               (defaultTargetPlatform)
z Toggle elevation checker.
g Run source code generators.
M Write SkSL shaders to a unique file in the project directory.
v Launch DevTools.
P Toggle performance overlay.                                                                                             (WidgetsApp.showPerformanceOverlay)
a Toggle timeline events for all widget build methods.                                                                             (debugProfileWidgetBuilds)
An Observatory debugger and profiler on sdk gphone x86 is available at: http://127.0.0.1:51189/uNV9UbpeHTc=/

  

 # Flutter hellow world demo

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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: Text('Welcome to Flutter')
        ),
        body: Center(
          child: Text('Hello World'),
        )
      )
    );
  }
}

  

vscode开发flutter

打开设备(虚拟机)

方法1:

mac 电脑就创建一个.sh文件:

/Users/XXXXXX/Library/Android/sdk/emulator/emulator -netdelay none -netspeed full -avd Nexus_5X_API_30
然后执行
 

方法2:

 

 

posted @   Sameen  阅读(111)  评论(0编辑  收藏  举报
编辑推荐:
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
阅读排行:
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
点击右上角即可分享
微信分享提示