status
type
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
SFT + DPO 塔罗解读
2025-4-14
Backtracking
2025-4-14
Leetcode 0001-1000 分组
2025-4-14
mcp 记录(1)
2025-4-14
DPO 相关
2025-3-29
今日paper(3/25) - MAGPIE
2025-3-27
Announcement
 
 
 
 
暂时没有新的内容