v1.0.0
widget_size
一个在构建并附加到组件树后计算其大小的组件
38喜欢 892近 30 天下载150Pub 分数
AndroidiOSWebmacOSWindowsLinux
一个在构建并附加到组件树后计算其大小的组件
{"sdk":"flutter"}{"sdk":"flutter"}^1.0.0以下为英文项目原文快照,最新内容请访问 GitHub。
A widget to calculate it's size after being built and attached to a widget tree
https://raw.githubusercontent.com/javaherisaber/widget_size/HEAD/demo.gif
To use this plugin, add widget_size as a dependency in your pubspec.yaml file.
dependencies:
widget_size: ^lastVersion
double _yourHeight = 50;
double _yourWidth = 50;
WidgetSize(
onChange: (Size size) {
// your Widget size available here
_yourHeight = size.height;
_yourWidth = size.width;
},
child: Container(
height: _yourHeight,
width: _yourWidth,
color: Theme.of(context).primaryColor,
),
)