mirror of https://github.com/flutter/samples.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
455 B
14 lines
455 B
3 months ago
|
import 'package:flutter/rendering.dart';
|
||
|
|
||
|
extension SliverBreakpointUtils on SliverConstraints {
|
||
|
bool get isTablet => crossAxisExtent > 730 && crossAxisExtent < 1000;
|
||
|
bool get isDesktop => crossAxisExtent > 1000;
|
||
|
bool get isMobile => crossAxisExtent < 730;
|
||
|
}
|
||
|
|
||
|
extension BoxBreakpointUtils on BoxConstraints {
|
||
|
bool get isTablet => maxWidth > 730 && maxWidth < 1000;
|
||
|
bool get isDesktop => maxWidth > 1000;
|
||
|
bool get isMobile => maxWidth < 730;
|
||
|
}
|