1 | // Copyright 2014 The Flutter Authors. All rights reserved. |
---|---|
2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. |
4 | |
5 | import 'package:adaptive_breakpoints/adaptive_breakpoints.dart'; |
6 | import 'package:flutter/material.dart'; |
7 | |
8 | /// The maximum width taken up by each item on the home screen. |
9 | const double maxHomeItemWidth = 1400.0; |
10 | |
11 | /// Returns a boolean value whether the window is considered medium or large size. |
12 | /// |
13 | /// Widgets using this method might consider the display is |
14 | /// large enough for certain layouts, which is not the case on foldable devices, |
15 | /// where only part of the display is available to said widgets. |
16 | /// |
17 | /// Used to build adaptive and responsive layouts. |
18 | bool isDisplayDesktop(BuildContext context) => getWindowType(context) >= AdaptiveWindowType.medium; |
19 | |
20 | /// Returns boolean value whether the window is considered medium size. |
21 | /// |
22 | /// Used to build adaptive and responsive layouts. |
23 | bool isDisplaySmallDesktop(BuildContext context) { |
24 | return getWindowType(context) == AdaptiveWindowType.medium; |
25 | } |
26 |