0 purchases
breakpoints mq
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;
copied to clipboard
LayoutBuilder(
builder: (context, constraints) {
final breakpoint = Breakpoint.fromConstraints(constraints); // or constraints.breakpoint;
}
);
copied to clipboard
final double width = getWidth();
final breakpoint = Breakpoint.fromWidth(width);
copied to clipboard
Then, use breakpoint.column.
GridView.count(
crossAxisCount: 4,
children: List.generate(
100,
(index) => Padding(
child: Card(
child: Center(
child: Text('No.${index + 1}'),
),
),
),
),
),
copied to clipboard
Requirements #
Flutter 3.0.0 or higher
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.