Breakpoints
This commit is contained in:
@@ -51,16 +51,14 @@ class Breakpoint {
|
|||||||
///
|
///
|
||||||
/// Use [Breakpoint.fromConstraints] when the widget does not take up the full screen
|
/// Use [Breakpoint.fromConstraints] when the widget does not take up the full screen
|
||||||
factory Breakpoint.fromMediaQuery(BuildContext context) {
|
factory Breakpoint.fromMediaQuery(BuildContext context) {
|
||||||
final _media = MediaQuery.of(context);
|
final size = MediaQuery.sizeOf(context);
|
||||||
|
|
||||||
double _width = 359;
|
double width = size.width;
|
||||||
|
|
||||||
Orientation orientation = Orientation.portrait;
|
final orientation =
|
||||||
|
size.width > size.height ? Orientation.landscape : Orientation.portrait;
|
||||||
|
|
||||||
_width = _media.size.width;
|
return _calcBreakpoint(orientation, width);
|
||||||
orientation = _media.orientation;
|
|
||||||
|
|
||||||
return _calcBreakpoint(orientation, _width);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static Breakpoint _calcBreakpoint(Orientation orientation, double _width) {
|
static Breakpoint _calcBreakpoint(Orientation orientation, double _width) {
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
name: breakpoint
|
name: breakpoint
|
||||||
description: A Flutter plugin to calculate the material design breakpoints.
|
description: A Flutter plugin to calculate the material design breakpoints.
|
||||||
version: 1.3.0
|
version: 1.3.1
|
||||||
|
|
||||||
maintainer: Rody Davis (@rodydavis)
|
maintainer: Rody Davis (@rodydavis)
|
||||||
homepage: https://github.com/rodydavis/plugins
|
homepage: https://github.com/rodydavis/plugins
|
||||||
repository: https://github.com/fluttercommunity/breakpoint
|
repository: https://github.com/rodydavis/packages.dart/tree/main/packages/breakpoint
|
||||||
resolution: workspace
|
resolution: workspace
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
|
|||||||
Reference in New Issue
Block a user