Move Brightness back to the material library (#4635)
This commit is contained in:
parent
3b9d8c5eb5
commit
5809a0cb71
@ -7,7 +7,7 @@ import 'package:meta/meta.dart';
|
|||||||
|
|
||||||
import 'theme_data.dart';
|
import 'theme_data.dart';
|
||||||
|
|
||||||
export 'theme_data.dart' show ThemeData;
|
export 'theme_data.dart' show Brightness, ThemeData;
|
||||||
|
|
||||||
/// The duration over which theme changes animate.
|
/// The duration over which theme changes animate.
|
||||||
const Duration kThemeAnimationDuration = const Duration(milliseconds: 200);
|
const Duration kThemeAnimationDuration = const Duration(milliseconds: 200);
|
||||||
|
@ -4,12 +4,25 @@
|
|||||||
|
|
||||||
import 'dart:ui' show Color, hashValues;
|
import 'dart:ui' show Color, hashValues;
|
||||||
|
|
||||||
import 'package:flutter/widgets.dart';
|
|
||||||
|
|
||||||
import 'colors.dart';
|
import 'colors.dart';
|
||||||
import 'icon_theme_data.dart';
|
import 'icon_theme_data.dart';
|
||||||
import 'typography.dart';
|
import 'typography.dart';
|
||||||
|
|
||||||
|
/// Describes the contrast needs of a color.
|
||||||
|
enum Brightness {
|
||||||
|
/// The color is dark and will require a light text color to achieve readable
|
||||||
|
/// contrast.
|
||||||
|
///
|
||||||
|
/// For example, the color might be dark grey, requiring white text.
|
||||||
|
dark,
|
||||||
|
|
||||||
|
/// The color is light and will require a dark text color to achieve readable
|
||||||
|
/// contrast.
|
||||||
|
///
|
||||||
|
/// For example, the color might be bright white, requiring black text.
|
||||||
|
light,
|
||||||
|
}
|
||||||
|
|
||||||
// Deriving these values is black magic. The spec claims that pressed buttons
|
// Deriving these values is black magic. The spec claims that pressed buttons
|
||||||
// have a highlight of 0x66999999, but that's clearly wrong. The videos in the
|
// have a highlight of 0x66999999, but that's clearly wrong. The videos in the
|
||||||
// spec show that buttons have a composited highlight of #E1E1E1 on a background
|
// spec show that buttons have a composited highlight of #E1E1E1 on a background
|
||||||
|
@ -382,21 +382,6 @@ class ClipPath extends SingleChildRenderObjectWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Describes the contrast needs of a color.
|
|
||||||
enum Brightness {
|
|
||||||
/// The color is dark and will require a light text color to achieve readable
|
|
||||||
/// contrast.
|
|
||||||
///
|
|
||||||
/// For example, the color might be dark grey, requiring white text.
|
|
||||||
dark,
|
|
||||||
|
|
||||||
/// The color is light and will require a dark text color to achieve readable
|
|
||||||
/// contrast.
|
|
||||||
///
|
|
||||||
/// For example, the color might be bright white, requiring black text.
|
|
||||||
light,
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// POSITIONING AND SIZING NODES
|
// POSITIONING AND SIZING NODES
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user