入门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:
标签:
flutter
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 开发者必知的日志记录最佳实践
· 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