constants.dart 2.01 KB
Newer Older
Ian Hickson's avatar
Ian Hickson committed
1
// Copyright 2014 The Flutter Authors. All rights reserved.
2 3 4
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

5 6
// @dart = 2.8

7 8
import 'package:flutter/painting.dart';

9 10 11 12 13 14 15 16 17 18 19 20 21 22
/// The minimum dimension of any interactive region according to Material
/// guidelines.
///
/// This is used to avoid small regions that are hard for the user to interact
/// with. It applies to both dimensions of a region, so a square of size
/// kMinInteractiveDimension x kMinInteractiveDimension is the smallest
/// acceptable region that should respond to gestures.
///
/// See also:
///
///  * [kMinInteractiveDimensionCupertino]
///  * The Material spec on touch targets at <https://material.io/design/usability/accessibility.html#layout-typography>.
const double kMinInteractiveDimension = 48.0;

23 24
/// The height of the toolbar component of the [AppBar].
const double kToolbarHeight = 56.0;
25

26
/// The height of the bottom navigation bar.
27
const double kBottomNavigationBarHeight = 56.0;
28

29
/// The height of a tab bar containing text.
30
const double kTextTabBarHeight = kMinInteractiveDimension;
Adam Barth's avatar
Adam Barth committed
31

32
/// The amount of time theme change animations should last.
33
const Duration kThemeChangeDuration = Duration(milliseconds: 200);
Adam Barth's avatar
Adam Barth committed
34

35
/// The radius of a circular material ink response in logical pixels.
36
const double kRadialReactionRadius = 20.0;
37

38
/// The amount of time a circular material ink response should take to expand to its full size.
39
const Duration kRadialReactionDuration = Duration(milliseconds: 100);
40 41

/// The value of the alpha channel to use when drawing a circular material ink response.
42
const int kRadialReactionAlpha = 0x1F;
Hans Muller's avatar
Hans Muller committed
43

44
/// The duration of the horizontal scroll animation that occurs when a tab is tapped.
45
const Duration kTabScrollDuration = Duration(milliseconds: 300);
46

47
/// The horizontal padding included by [Tab]s.
48
const EdgeInsets kTabLabelPadding = EdgeInsets.symmetric(horizontal: 16.0);
49

50
/// The padding added around material list items.
51
const EdgeInsets kMaterialListPadding = EdgeInsets.symmetric(vertical: 8.0);