flutter_size 0.0.2 copy "flutter_size: ^0.0.2" to clipboard
flutter_size: ^0.0.2 copied to clipboard

outdated

Get Size Of different types of widgets

Language: English

You can get size From BuildContext size and also size form Layout Builder Box Constraints size

Get started #

Add dependency #

dependencies:
  flutter_size: ^0.0.2

Super simple to use #

import 'package:flutter_size/get_size.dart';
class GetSize extends StatefulWidget {
  const GetSize({Key? key}) : super(key: key);

  @override
  State<GetSize> createState() => _GetSizeState();
}

class _GetSizeState extends State<GetSize> {
  @override
  Widget build(BuildContext context) {
    return Center(child : Container(
      width : context.getWidth(0.3),
      height : context.getHeight(0.9),
    ),
    );
  }
}

Examples #

import 'package:flutter_size/get_size.dart';
class GetSize extends StatefulWidget {
  const GetSize({Key? key}) : super(key: key);

  @override
  State<GetSize> createState() => _GetSizeState();
}

class _GetSizeState extends State<GetSize> {
  @override
  Widget build(BuildContext context) {
    return Center(child : Container(
      width : context.getDeviceWidth,
      height : context.getDeviceHeight,
    ),
    );
  }
}

4
likes
0
points
179
downloads

Publisher

unverified uploader

Weekly Downloads

Get Size Of different types of widgets

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on flutter_size