constants.dart 2 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
import 'package:flutter/painting.dart';

7 8 9 10 11 12 13 14 15 16 17 18 19 20
/// 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;

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

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

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

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

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

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

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

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

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

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