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.
samples/ai_recipe_generation/lib/util/extensions.dart

14 lines
455 B

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;
}