AnimatedOpacity( opacity: _isVisible ? 1.0 : 0.0, duration: Duration(milliseconds: 500), child: Text('Hello, world!'), ) 5. 條件渲染 特點: 直接根據(jù)條件渲染不同的組件,實現(xiàn)最簡單的隱藏與顯示。 用法: 1 2 3 4 5 if (_isVisible) { return Text('Hello, world!'); } else { ...
www.dbjr.com.cn/program/3286538...htm 2025-6-9