1
0
mirror of https://github.com/flutter/samples.git synced 2025-11-08 22:09:06 +00:00

[linting_tool] Add Adaptive Layout with Theming (#852)

This commit is contained in:
Abdullah Deshmukh
2021-07-14 03:01:14 +05:30
committed by GitHub
parent 35f1670098
commit 8e73c73f4b
25 changed files with 984 additions and 80 deletions

View File

@@ -0,0 +1,23 @@
// Copyright 2021 The Flutter team. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:adaptive_breakpoints/adaptive_breakpoints.dart';
import 'package:flutter/material.dart';
/// Returns a boolean value whether the window is considered medium or large size.
/// Used to build adaptive and responsive layouts.
bool isDisplayLarge(BuildContext context) =>
getWindowType(context) >= AdaptiveWindowType.medium;
/// Returns boolean value whether the window is considered medium size.
/// Used to build adaptive and responsive layouts.
bool isDisplayMedium(BuildContext context) {
return getWindowType(context) == AdaptiveWindowType.medium;
}
/// Returns boolean value whether the window is considered small size.
/// Used to build adaptive and responsive layouts.
bool isDisplaySmall(BuildContext context) {
return getWindowType(context) <= AdaptiveWindowType.small;
}