type
status
date
slug
summary
tags
category
icon
password
 
Where does initialization code go?
The main entrypoint in a starter Flutter app is in lib/main.dart. The default main method looks like the following:
lib/main.dart
dart
content_copy
Perform any quick initialization (less than a frame or two) before calling runApp(), though be aware that the widget tree hasn't been created yet. If you want to perform initialization that takes awhile, such as loading data from disk or over a network, do it in a way that won't block the main UI thread. For more information, check out Asynchronous programming, the FutureBuilder API, Deferred components, or the Working with long lists cookbook recipe, as appropriate.
Every stateful widget has an initState() method that is called when the widget is created and added to the widget tree. You can override this method and perform initialization there, though the first line of this method must be super.initState().
Finally, hot reloading your app does not call initState or main again. Hot restart calls both.
notion image
 
先不看了 试着做个app 边做边看看需要啥吧
 
Leetcode记录「2」Flutter tutorial 记录
Loading...
ran2323
ran2323
我们再来一次, 这一次, 好好来!
Latest posts
GGUF
2025-1-10
Git 指令 小总结
2025-1-9
Leetcode记录「2」
2024-12-27
Flutter 基础 记录
2024-12-25
Flutter tutorial 记录
2024-12-25
Privicy policy for GitHub To Text (Chrome Extension)
2024-12-22
Announcement
 
 
 
 
暂时没有新的内容