breakpoints_mq 3.1.0 copy "breakpoints_mq: ^3.1.0" to clipboard
breakpoints_mq: ^3.1.0 copied to clipboard

A lightweight library for implementing Responsive layout grid. Provide body, margin.

breakpoints_mq #

A lightweight library for implementing window-size-classes. Provide body, margin.

How to use. #


Once you've added breakpoints to your project, you can get breakpoints like this.

final size = MediaQuery.of(context).size;
final breakpoint = Breakpoint.fromSize(size); // or MediaQuery.of(context).breakpoint;
LayoutBuilder(
  builder: (context, constraints) {
    final breakpoint = Breakpoint.fromConstraints(constraints); // or constraints.breakpoint;
  }
);
final double width = getWidth();
final breakpoint = Breakpoint.fromWidth(width);

Then, use breakpoint.column.

GridView.count(
  crossAxisCount: 4,
  children: List.generate(
    100,
    (index) => Padding(
      child: Card(
        child: Center(
          child: Text('No.${index + 1}'),
        ),
      ),
    ),
  ),
),

Requirements #

  • Flutter 3.0.0 or higher
0
likes
150
pub points
59%
popularity

Publisher

unverified uploader

A lightweight library for implementing Responsive layout grid. Provide body, margin.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on breakpoints_mq