KonectarApp/lib/widgets/responsive_utils.dart

17 lines
625 B
Dart
Raw Normal View History

2024-09-06 06:30:31 +00:00
import 'package:flutter/material.dart';
class ResponsiveUtils {
// Check if the device is considered as mobile based on screen width.
static bool isMobile(BuildContext context) =>
MediaQuery.of(context).size.width <= 600;
// Check if the device is considered as tablet based on screen width.
static bool isTablet(BuildContext context) =>
MediaQuery.of(context).size.width > 600 &&
MediaQuery.of(context).size.width <= 1200;
// Check if the device is considered as desktop based on screen width.
static bool isDesktop(BuildContext context) =>
MediaQuery.of(context).size.width > 1200;
}