Skip to content

A flutter widget that calculates the size of it's child in runtime.

License

Notifications You must be signed in to change notification settings

mattias-lonn/Measured-Size

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

measured_size

A flutter widget that calculates the size of it's child in runtime.

Getting Started

MeasuredSize Calculated the size of it's child in runtime. All you have to do is to wrap your widget with MeasuredSize and listen to size changes.

Usage

Complete example

MeasuredSize(
              onChange: (Size size) {
                setState(() {
                  print(size);
                });
              },
              child: Text(
                '$_counter',
                style: Theme.of(context).textTheme.headline4,
              ),
            );

onChange will be called when the [Size] changes.

onChange will return the value ONLY once if it didn't change, and it will NOT return a value if it's equals to Size.zero

About

A flutter widget that calculates the size of it's child in runtime.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dart 69.8%
  • HTML 21.9%
  • Swift 5.9%
  • Kotlin 1.8%
  • Objective-C 0.6%