Unverified Commit b5ce0616 authored by Alexandre Ardhuin's avatar Alexandre Ardhuin Committed by GitHub

enable lint use_full_hex_values_for_flutter_colors (#35056)

parent fecf99ff
...@@ -182,7 +182,7 @@ linter: ...@@ -182,7 +182,7 @@ linter:
- unnecessary_this - unnecessary_this
- unrelated_type_equality_checks - unrelated_type_equality_checks
# - unsafe_html # not yet tested # - unsafe_html # not yet tested
# - use_full_hex_values_for_flutter_colors # not yet tested - use_full_hex_values_for_flutter_colors
# - use_function_type_syntax_for_parameters # not yet tested # - use_function_type_syntax_for_parameters # not yet tested
- use_rethrow_when_possible - use_rethrow_when_possible
# - use_setters_to_change_properties # not yet tested # - use_setters_to_change_properties # not yet tested
......
...@@ -203,8 +203,8 @@ void main() { ...@@ -203,8 +203,8 @@ void main() {
testWidgets('Can specify colors', (WidgetTester tester) async { testWidgets('Can specify colors', (WidgetTester tester) async {
await tester.pumpWidget(boilerplate(child: CupertinoButton( await tester.pumpWidget(boilerplate(child: CupertinoButton(
child: const Text('Skeuomorph me'), child: const Text('Skeuomorph me'),
color: const Color(0x0000FF), color: const Color(0x000000FF),
disabledColor: const Color(0x00FF00), disabledColor: const Color(0x0000FF00),
onPressed: () { }, onPressed: () { },
))); )));
...@@ -212,12 +212,12 @@ void main() { ...@@ -212,12 +212,12 @@ void main() {
find.widgetWithText(DecoratedBox, 'Skeuomorph me') find.widgetWithText(DecoratedBox, 'Skeuomorph me')
).decoration; ).decoration;
expect(boxDecoration.color, const Color(0x0000FF)); expect(boxDecoration.color, const Color(0x000000FF));
await tester.pumpWidget(boilerplate(child: const CupertinoButton( await tester.pumpWidget(boilerplate(child: const CupertinoButton(
child: Text('Skeuomorph me'), child: Text('Skeuomorph me'),
color: Color(0x0000FF), color: Color(0x000000FF),
disabledColor: Color(0x00FF00), disabledColor: Color(0x0000FF00),
onPressed: null, onPressed: null,
))); )));
...@@ -225,7 +225,7 @@ void main() { ...@@ -225,7 +225,7 @@ void main() {
find.widgetWithText(DecoratedBox, 'Skeuomorph me') find.widgetWithText(DecoratedBox, 'Skeuomorph me')
).decoration; ).decoration;
expect(boxDecoration.color, const Color(0x00FF00)); expect(boxDecoration.color, const Color(0x0000FF00));
}); });
testWidgets('Button respects themes', (WidgetTester tester) async { testWidgets('Button respects themes', (WidgetTester tester) async {
......
...@@ -600,11 +600,11 @@ void main() { ...@@ -600,11 +600,11 @@ void main() {
child: CupertinoTextField( child: CupertinoTextField(
placeholder: 'placeholder', placeholder: 'placeholder',
style: TextStyle( style: TextStyle(
color: Color(0X00FFFFFF), color: Color(0x00FFFFFF),
fontWeight: FontWeight.w300, fontWeight: FontWeight.w300,
), ),
placeholderStyle: TextStyle( placeholderStyle: TextStyle(
color: Color(0XAAFFFFFF), color: Color(0xAAFFFFFF),
fontWeight: FontWeight.w600 fontWeight: FontWeight.w600
), ),
), ),
...@@ -613,14 +613,14 @@ void main() { ...@@ -613,14 +613,14 @@ void main() {
); );
final Text placeholder = tester.widget(find.text('placeholder')); final Text placeholder = tester.widget(find.text('placeholder'));
expect(placeholder.style.color, const Color(0XAAFFFFFF)); expect(placeholder.style.color, const Color(0xAAFFFFFF));
expect(placeholder.style.fontWeight, FontWeight.w600); expect(placeholder.style.fontWeight, FontWeight.w600);
await tester.enterText(find.byType(CupertinoTextField), 'input'); await tester.enterText(find.byType(CupertinoTextField), 'input');
await tester.pump(); await tester.pump();
final EditableText inputText = tester.widget(find.text('input')); final EditableText inputText = tester.widget(find.text('input'));
expect(inputText.style.color, const Color(0X00FFFFFF)); expect(inputText.style.color, const Color(0x00FFFFFF));
expect(inputText.style.fontWeight, FontWeight.w300); expect(inputText.style.fontWeight, FontWeight.w300);
}, },
); );
......
...@@ -199,8 +199,8 @@ void main() { ...@@ -199,8 +199,8 @@ void main() {
}); });
testWidgets('Custom selected and unselected icon themes', (WidgetTester tester) async { testWidgets('Custom selected and unselected icon themes', (WidgetTester tester) async {
const IconThemeData selectedIconTheme = IconThemeData(size: 36, color: Color(1)); const IconThemeData selectedIconTheme = IconThemeData(size: 36, color: Color(0x00000001));
const IconThemeData unselectedIconTheme = IconThemeData(size: 18, color: Color(2)); const IconThemeData unselectedIconTheme = IconThemeData(size: 18, color: Color(0x00000002));
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
...@@ -233,10 +233,10 @@ void main() { ...@@ -233,10 +233,10 @@ void main() {
}); });
testWidgets('color on icon theme overrides selected and unselected item colors', (WidgetTester tester) async { testWidgets('color on icon theme overrides selected and unselected item colors', (WidgetTester tester) async {
const IconThemeData selectedIconTheme = IconThemeData(size: 36, color: Color(1)); const IconThemeData selectedIconTheme = IconThemeData(size: 36, color: Color(0x00000001));
const IconThemeData unselectedIconTheme = IconThemeData(size: 18, color: Color(2)); const IconThemeData unselectedIconTheme = IconThemeData(size: 18, color: Color(0x00000002));
const Color selectedItemColor = Color(3); const Color selectedItemColor = Color(0x00000003);
const Color unselectedItemColor = Color(4); const Color unselectedItemColor = Color(0x00000004);
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
......
...@@ -70,7 +70,7 @@ void main() { ...@@ -70,7 +70,7 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
theme: ThemeData(accentColor: const Color(1)), theme: ThemeData(accentColor: const Color(0x00000001)),
home: Builder( home: Builder(
builder: (BuildContext context) { builder: (BuildContext context) {
return Center( return Center(
...@@ -104,7 +104,7 @@ void main() { ...@@ -104,7 +104,7 @@ void main() {
), ),
); );
expect(tester.widget<RawMaterialButton>(find.byType(RawMaterialButton)).textStyle.color, const Color(1)); expect(tester.widget<RawMaterialButton>(find.byType(RawMaterialButton)).textStyle.color, const Color(0x00000001));
// Show the dialog // Show the dialog
await tester.tap(find.text('button')); await tester.tap(find.text('button'));
...@@ -114,6 +114,6 @@ void main() { ...@@ -114,6 +114,6 @@ void main() {
of: find.text('enabled'), of: find.text('enabled'),
matching: find.byType(RawMaterialButton), matching: find.byType(RawMaterialButton),
); );
expect(tester.widget<RawMaterialButton>(dialogButton).textStyle.color, const Color(1)); expect(tester.widget<RawMaterialButton>(dialogButton).textStyle.color, const Color(0x00000001));
}); });
} }
...@@ -331,10 +331,10 @@ void main() { ...@@ -331,10 +331,10 @@ void main() {
testWidgets('button theme with stateful color changes color in states', (WidgetTester tester) async { testWidgets('button theme with stateful color changes color in states', (WidgetTester tester) async {
final FocusNode focusNode = FocusNode(); final FocusNode focusNode = FocusNode();
const Color pressedColor = Color(1); const Color pressedColor = Color(0x00000001);
const Color hoverColor = Color(2); const Color hoverColor = Color(0x00000002);
const Color focusedColor = Color(3); const Color focusedColor = Color(0x00000003);
const Color defaultColor = Color(4); const Color defaultColor = Color(0x00000004);
Color getTextColor(Set<MaterialState> states) { Color getTextColor(Set<MaterialState> states) {
if (states.contains(MaterialState.pressed)) { if (states.contains(MaterialState.pressed)) {
......
...@@ -14,42 +14,42 @@ void main() { ...@@ -14,42 +14,42 @@ void main() {
const MaterialColor color = MaterialColor( const MaterialColor color = MaterialColor(
500, 500,
<int, Color>{ <int, Color>{
50: Color(50), 50: Color(0x00000050),
100: Color(100), 100: Color(0x00000100),
200: Color(200), 200: Color(0x00000200),
300: Color(300), 300: Color(0x00000300),
400: Color(400), 400: Color(0x00000400),
500: Color(500), 500: Color(0x00000500),
600: Color(600), 600: Color(0x00000600),
700: Color(700), 700: Color(0x00000700),
800: Color(800), 800: Color(0x00000800),
900: Color(900), 900: Color(0x00000900),
}, },
); );
expect(color.value, 500); expect(color.value, 500);
expect(color[50].value, 50); expect(color[50].value, 0x00000050);
expect(color[100].value, 100); expect(color[100].value, 0x00000100);
expect(color[200].value, 200); expect(color[200].value, 0x00000200);
expect(color[300].value, 300); expect(color[300].value, 0x00000300);
expect(color[400].value, 400); expect(color[400].value, 0x00000400);
expect(color[500].value, 500); expect(color[500].value, 0x00000500);
expect(color[600].value, 600); expect(color[600].value, 0x00000600);
expect(color[700].value, 700); expect(color[700].value, 0x00000700);
expect(color[800].value, 800); expect(color[800].value, 0x00000800);
expect(color[900].value, 900); expect(color[900].value, 0x00000900);
expect(color.shade50.value, 50); expect(color.shade50.value, 0x00000050);
expect(color.shade100.value, 100); expect(color.shade100.value, 0x00000100);
expect(color.shade200.value, 200); expect(color.shade200.value, 0x00000200);
expect(color.shade300.value, 300); expect(color.shade300.value, 0x00000300);
expect(color.shade400.value, 400); expect(color.shade400.value, 0x00000400);
expect(color.shade500.value, 500); expect(color.shade500.value, 0x00000500);
expect(color.shade600.value, 600); expect(color.shade600.value, 0x00000600);
expect(color.shade700.value, 700); expect(color.shade700.value, 0x00000700);
expect(color.shade800.value, 800); expect(color.shade800.value, 0x00000800);
expect(color.shade900.value, 900); expect(color.shade900.value, 0x00000900);
}); });
test('Colors swatches do not contain duplicates', () { test('Colors swatches do not contain duplicates', () {
......
...@@ -147,10 +147,10 @@ void main() { ...@@ -147,10 +147,10 @@ void main() {
testWidgets('FlatButton uses stateful color for text color in different states', (WidgetTester tester) async { testWidgets('FlatButton uses stateful color for text color in different states', (WidgetTester tester) async {
final FocusNode focusNode = FocusNode(); final FocusNode focusNode = FocusNode();
const Color pressedColor = Color(1); const Color pressedColor = Color(0x00000001);
const Color hoverColor = Color(2); const Color hoverColor = Color(0x00000002);
const Color focusedColor = Color(3); const Color focusedColor = Color(0x00000003);
const Color defaultColor = Color(4); const Color defaultColor = Color(0x00000004);
Color getTextColor(Set<MaterialState> states) { Color getTextColor(Set<MaterialState> states) {
if (states.contains(MaterialState.pressed)) { if (states.contains(MaterialState.pressed)) {
...@@ -214,10 +214,10 @@ void main() { ...@@ -214,10 +214,10 @@ void main() {
final FocusNode focusNode = FocusNode(); final FocusNode focusNode = FocusNode();
final Key buttonKey = UniqueKey(); final Key buttonKey = UniqueKey();
const Color pressedColor = Color(1); const Color pressedColor = Color(0x00000001);
const Color hoverColor = Color(2); const Color hoverColor = Color(0x00000002);
const Color focusedColor = Color(3); const Color focusedColor = Color(0x00000003);
const Color defaultColor = Color(4); const Color defaultColor = Color(0x00000004);
Color getTextColor(Set<MaterialState> states) { Color getTextColor(Set<MaterialState> states) {
if (states.contains(MaterialState.pressed)) { if (states.contains(MaterialState.pressed)) {
...@@ -279,9 +279,9 @@ void main() { ...@@ -279,9 +279,9 @@ void main() {
testWidgets('FlatButton ignores disabled text color if text color is stateful', (WidgetTester tester) async { testWidgets('FlatButton ignores disabled text color if text color is stateful', (WidgetTester tester) async {
final FocusNode focusNode = FocusNode(); final FocusNode focusNode = FocusNode();
const Color disabledColor = Color(1); const Color disabledColor = Color(0x00000001);
const Color defaultColor = Color(2); const Color defaultColor = Color(0x00000002);
const Color unusedDisabledTextColor = Color(3); const Color unusedDisabledTextColor = Color(0x00000003);
Color getTextColor(Set<MaterialState> states) { Color getTextColor(Set<MaterialState> states) {
if (states.contains(MaterialState.disabled)) { if (states.contains(MaterialState.disabled)) {
......
...@@ -3015,8 +3015,8 @@ void main() { ...@@ -3015,8 +3015,8 @@ void main() {
suffixStyle: TextStyle(height: 8.0), suffixStyle: TextStyle(height: 8.0),
counterStyle: TextStyle(height: 9.0), counterStyle: TextStyle(height: 9.0),
filled: true, filled: true,
fillColor: Color(0x10), fillColor: Color(0x00000010),
focusColor: Color(0x20), focusColor: Color(0x00000020),
errorBorder: UnderlineInputBorder(), errorBorder: UnderlineInputBorder(),
focusedBorder: OutlineInputBorder(), focusedBorder: OutlineInputBorder(),
focusedErrorBorder: UnderlineInputBorder(), focusedErrorBorder: UnderlineInputBorder(),
......
...@@ -150,10 +150,10 @@ void main() { ...@@ -150,10 +150,10 @@ void main() {
testWidgets('OutlineButton uses stateful color for text color in different states', (WidgetTester tester) async { testWidgets('OutlineButton uses stateful color for text color in different states', (WidgetTester tester) async {
final FocusNode focusNode = FocusNode(); final FocusNode focusNode = FocusNode();
const Color pressedColor = Color(1); const Color pressedColor = Color(0x00000001);
const Color hoverColor = Color(2); const Color hoverColor = Color(0x00000002);
const Color focusedColor = Color(3); const Color focusedColor = Color(0x00000003);
const Color defaultColor = Color(4); const Color defaultColor = Color(0x00000004);
Color getTextColor(Set<MaterialState> states) { Color getTextColor(Set<MaterialState> states) {
if (states.contains(MaterialState.pressed)) { if (states.contains(MaterialState.pressed)) {
...@@ -217,10 +217,10 @@ void main() { ...@@ -217,10 +217,10 @@ void main() {
final FocusNode focusNode = FocusNode(); final FocusNode focusNode = FocusNode();
final Key buttonKey = UniqueKey(); final Key buttonKey = UniqueKey();
const Color pressedColor = Color(1); const Color pressedColor = Color(0x00000001);
const Color hoverColor = Color(2); const Color hoverColor = Color(0x00000002);
const Color focusedColor = Color(3); const Color focusedColor = Color(0x00000003);
const Color defaultColor = Color(4); const Color defaultColor = Color(0x00000004);
Color getTextColor(Set<MaterialState> states) { Color getTextColor(Set<MaterialState> states) {
if (states.contains(MaterialState.pressed)) { if (states.contains(MaterialState.pressed)) {
...@@ -282,9 +282,9 @@ void main() { ...@@ -282,9 +282,9 @@ void main() {
testWidgets('OutlineButton ignores disabled text color if text color is stateful', (WidgetTester tester) async { testWidgets('OutlineButton ignores disabled text color if text color is stateful', (WidgetTester tester) async {
final FocusNode focusNode = FocusNode(); final FocusNode focusNode = FocusNode();
const Color disabledColor = Color(1); const Color disabledColor = Color(0x00000001);
const Color defaultColor = Color(2); const Color defaultColor = Color(0x00000002);
const Color unusedDisabledTextColor = Color(3); const Color unusedDisabledTextColor = Color(0x00000003);
Color getTextColor(Set<MaterialState> states) { Color getTextColor(Set<MaterialState> states) {
if (states.contains(MaterialState.disabled)) { if (states.contains(MaterialState.disabled)) {
...@@ -425,7 +425,7 @@ void main() { ...@@ -425,7 +425,7 @@ void main() {
..path(color: disabledBorderColor, strokeWidth: borderWidth)); ..path(color: disabledBorderColor, strokeWidth: borderWidth));
_checkPhysicalLayer( _checkPhysicalLayer(
tester.element(outlineButton), tester.element(outlineButton),
const Color(0), const Color(0x00000000),
clipPath: clipPath, clipPath: clipPath,
clipRect: clipRect, clipRect: clipRect,
); );
......
...@@ -82,10 +82,10 @@ void main() { ...@@ -82,10 +82,10 @@ void main() {
testWidgets('RaisedButton uses stateful color for text color in different states', (WidgetTester tester) async { testWidgets('RaisedButton uses stateful color for text color in different states', (WidgetTester tester) async {
final FocusNode focusNode = FocusNode(); final FocusNode focusNode = FocusNode();
const Color pressedColor = Color(1); const Color pressedColor = Color(0x00000001);
const Color hoverColor = Color(2); const Color hoverColor = Color(0x00000002);
const Color focusedColor = Color(3); const Color focusedColor = Color(0x00000003);
const Color defaultColor = Color(4); const Color defaultColor = Color(0x00000004);
Color getTextColor(Set<MaterialState> states) { Color getTextColor(Set<MaterialState> states) {
if (states.contains(MaterialState.pressed)) { if (states.contains(MaterialState.pressed)) {
...@@ -150,10 +150,10 @@ void main() { ...@@ -150,10 +150,10 @@ void main() {
final FocusNode focusNode = FocusNode(); final FocusNode focusNode = FocusNode();
final Key buttonKey = UniqueKey(); final Key buttonKey = UniqueKey();
const Color pressedColor = Color(1); const Color pressedColor = Color(0x00000001);
const Color hoverColor = Color(2); const Color hoverColor = Color(0x00000002);
const Color focusedColor = Color(3); const Color focusedColor = Color(0x00000003);
const Color defaultColor = Color(4); const Color defaultColor = Color(0x00000004);
Color getTextColor(Set<MaterialState> states) { Color getTextColor(Set<MaterialState> states) {
if (states.contains(MaterialState.pressed)) { if (states.contains(MaterialState.pressed)) {
...@@ -215,9 +215,9 @@ void main() { ...@@ -215,9 +215,9 @@ void main() {
testWidgets('RaisedButton ignores disabled text color if text color is stateful', (WidgetTester tester) async { testWidgets('RaisedButton ignores disabled text color if text color is stateful', (WidgetTester tester) async {
final FocusNode focusNode = FocusNode(); final FocusNode focusNode = FocusNode();
const Color disabledColor = Color(1); const Color disabledColor = Color(0x00000001);
const Color defaultColor = Color(2); const Color defaultColor = Color(0x00000002);
const Color unusedDisabledTextColor = Color(3); const Color unusedDisabledTextColor = Color(0x00000003);
Color getTextColor(Set<MaterialState> states) { Color getTextColor(Set<MaterialState> states) {
if (states.contains(MaterialState.disabled)) { if (states.contains(MaterialState.disabled)) {
......
...@@ -2282,8 +2282,8 @@ void main() { ...@@ -2282,8 +2282,8 @@ void main() {
// Regression test for https://github.com/flutter/flutter/issues/15008. // Regression test for https://github.com/flutter/flutter/issues/15008.
testWidgets('TabBar with one tab has correct color', (WidgetTester tester) async { testWidgets('TabBar with one tab has correct color', (WidgetTester tester) async {
const Tab tab = Tab(text: 'A'); const Tab tab = Tab(text: 'A');
const Color selectedTabColor = Color(1); const Color selectedTabColor = Color(0x00000001);
const Color unselectedTabColor = Color(2); const Color unselectedTabColor = Color(0x00000002);
await tester.pumpWidget(boilerplate( await tester.pumpWidget(boilerplate(
child: const DefaultTabController( child: const DefaultTabController(
......
...@@ -74,10 +74,10 @@ void main() { ...@@ -74,10 +74,10 @@ void main() {
// The `displayColor` is applied to [display4], [display3], [display2], // The `displayColor` is applied to [display4], [display3], [display2],
// [display1], and [caption]. The `bodyColor` is applied to the remaining // [display1], and [caption]. The `bodyColor` is applied to the remaining
// text styles. // text styles.
const Color displayColor = Color(1); const Color displayColor = Color(0x00000001);
const Color bodyColor = Color(2); const Color bodyColor = Color(0x00000002);
const String fontFamily = 'fontFamily'; const String fontFamily = 'fontFamily';
const Color decorationColor = Color(3); const Color decorationColor = Color(0x00000003);
const TextDecorationStyle decorationStyle = TextDecorationStyle.dashed; const TextDecorationStyle decorationStyle = TextDecorationStyle.dashed;
final TextDecoration decoration = TextDecoration.combine(<TextDecoration>[ final TextDecoration decoration = TextDecoration.combine(<TextDecoration>[
TextDecoration.underline, TextDecoration.underline,
......
...@@ -251,7 +251,7 @@ void main() { ...@@ -251,7 +251,7 @@ void main() {
}); });
test('mutating ShaderMaskLayer fields triggers needsAddToScene', () { test('mutating ShaderMaskLayer fields triggers needsAddToScene', () {
const Gradient gradient = RadialGradient(colors: <Color>[Color(0), Color(1)]); const Gradient gradient = RadialGradient(colors: <Color>[Color(0x00000000), Color(0x00000001)]);
final Shader shader = gradient.createShader(Rect.zero); final Shader shader = gradient.createShader(Rect.zero);
final ShaderMaskLayer layer = ShaderMaskLayer(shader: shader, maskRect: Rect.zero, blendMode: BlendMode.clear); final ShaderMaskLayer layer = ShaderMaskLayer(shader: shader, maskRect: Rect.zero, blendMode: BlendMode.clear);
checkNeedsAddToScene(layer, () { checkNeedsAddToScene(layer, () {
...@@ -274,7 +274,7 @@ void main() { ...@@ -274,7 +274,7 @@ void main() {
test('mutating PhysicalModelLayer fields triggers needsAddToScene', () { test('mutating PhysicalModelLayer fields triggers needsAddToScene', () {
final PhysicalModelLayer layer = PhysicalModelLayer( final PhysicalModelLayer layer = PhysicalModelLayer(
clipPath: Path(), elevation: 0, color: const Color(0), shadowColor: const Color(0)); clipPath: Path(), elevation: 0, color: const Color(0x00000000), shadowColor: const Color(0x00000000));
checkNeedsAddToScene(layer, () { checkNeedsAddToScene(layer, () {
final Path newPath = Path(); final Path newPath = Path();
newPath.addRect(unitRect); newPath.addRect(unitRect);
...@@ -284,10 +284,10 @@ void main() { ...@@ -284,10 +284,10 @@ void main() {
layer.elevation = 1; layer.elevation = 1;
}); });
checkNeedsAddToScene(layer, () { checkNeedsAddToScene(layer, () {
layer.color = const Color(1); layer.color = const Color(0x00000001);
}); });
checkNeedsAddToScene(layer, () { checkNeedsAddToScene(layer, () {
layer.shadowColor = const Color(1); layer.shadowColor = const Color(0x00000001);
}); });
}); });
...@@ -330,14 +330,14 @@ void main() { ...@@ -330,14 +330,14 @@ void main() {
final PhysicalModelLayer layerA = PhysicalModelLayer( final PhysicalModelLayer layerA = PhysicalModelLayer(
clipPath: Path()..addRect(const Rect.fromLTWH(0, 0, 20, 20)), clipPath: Path()..addRect(const Rect.fromLTWH(0, 0, 20, 20)),
elevation: 3.0, elevation: 3.0,
color: const Color(0), color: const Color(0x00000000),
shadowColor: const Color(0), shadowColor: const Color(0x00000000),
); );
final PhysicalModelLayer layerB =PhysicalModelLayer( final PhysicalModelLayer layerB =PhysicalModelLayer(
clipPath: Path()..addRect(const Rect.fromLTWH(10, 10, 20, 20)), clipPath: Path()..addRect(const Rect.fromLTWH(10, 10, 20, 20)),
elevation: 2.0, elevation: 2.0,
color: const Color(0), color: const Color(0x00000000),
shadowColor: const Color(0), shadowColor: const Color(0x00000000),
); );
_testConflicts(layerA, layerB, expectedErrorCount: 1); _testConflicts(layerA, layerB, expectedErrorCount: 1);
}); });
...@@ -354,14 +354,14 @@ void main() { ...@@ -354,14 +354,14 @@ void main() {
final PhysicalModelLayer layerA = PhysicalModelLayer( final PhysicalModelLayer layerA = PhysicalModelLayer(
clipPath: Path()..addRect(const Rect.fromLTWH(0, 0, 20, 20)), clipPath: Path()..addRect(const Rect.fromLTWH(0, 0, 20, 20)),
elevation: 3.0, elevation: 3.0,
color: const Color(0), color: const Color(0x00000000),
shadowColor: const Color(0), shadowColor: const Color(0x00000000),
); );
final PhysicalModelLayer layerB =PhysicalModelLayer( final PhysicalModelLayer layerB =PhysicalModelLayer(
clipPath: Path()..addRect(const Rect.fromLTWH(10, 10, 20, 20)), clipPath: Path()..addRect(const Rect.fromLTWH(10, 10, 20, 20)),
elevation: 2.0, elevation: 2.0,
color: const Color(0), color: const Color(0x00000000),
shadowColor: const Color(0), shadowColor: const Color(0x00000000),
); );
_testConflicts(layerA, layerB, expectedErrorCount: 0, enableCheck: false); _testConflicts(layerA, layerB, expectedErrorCount: 0, enableCheck: false);
}); });
...@@ -376,14 +376,14 @@ void main() { ...@@ -376,14 +376,14 @@ void main() {
final PhysicalModelLayer layerA = PhysicalModelLayer( final PhysicalModelLayer layerA = PhysicalModelLayer(
clipPath: Path()..addRect(const Rect.fromLTWH(0, 0, 20, 20)), clipPath: Path()..addRect(const Rect.fromLTWH(0, 0, 20, 20)),
elevation: 3.0, elevation: 3.0,
color: const Color(0), color: const Color(0x00000000),
shadowColor: const Color(0), shadowColor: const Color(0x00000000),
); );
final PhysicalModelLayer layerB =PhysicalModelLayer( final PhysicalModelLayer layerB =PhysicalModelLayer(
clipPath: Path()..addRect(const Rect.fromLTWH(20, 20, 20, 20)), clipPath: Path()..addRect(const Rect.fromLTWH(20, 20, 20, 20)),
elevation: 2.0, elevation: 2.0,
color: const Color(0), color: const Color(0x00000000),
shadowColor: const Color(0), shadowColor: const Color(0x00000000),
); );
_testConflicts(layerA, layerB, expectedErrorCount: 0); _testConflicts(layerA, layerB, expectedErrorCount: 0);
}); });
...@@ -400,22 +400,22 @@ void main() { ...@@ -400,22 +400,22 @@ void main() {
final PhysicalModelLayer layerA = PhysicalModelLayer( final PhysicalModelLayer layerA = PhysicalModelLayer(
clipPath: Path()..addRect(const Rect.fromLTWH(0, 0, 20, 20)), clipPath: Path()..addRect(const Rect.fromLTWH(0, 0, 20, 20)),
elevation: 3.0, elevation: 3.0,
color: const Color(0), color: const Color(0x00000000),
shadowColor: const Color(0), shadowColor: const Color(0x00000000),
); );
layerA.append(PhysicalModelLayer( layerA.append(PhysicalModelLayer(
clipPath: Path()..addRect(const Rect.fromLTWH(2, 2, 10, 10)), clipPath: Path()..addRect(const Rect.fromLTWH(2, 2, 10, 10)),
elevation: 1.0, elevation: 1.0,
color: const Color(0), color: const Color(0x00000000),
shadowColor: const Color(0), shadowColor: const Color(0x00000000),
)); ));
final PhysicalModelLayer layerB =PhysicalModelLayer( final PhysicalModelLayer layerB =PhysicalModelLayer(
clipPath: Path()..addRect(const Rect.fromLTWH(20, 20, 20, 20)), clipPath: Path()..addRect(const Rect.fromLTWH(20, 20, 20, 20)),
elevation: 2.0, elevation: 2.0,
color: const Color(0), color: const Color(0x00000000),
shadowColor: const Color(0), shadowColor: const Color(0x00000000),
); );
_testConflicts(layerA, layerB, expectedErrorCount: 0); _testConflicts(layerA, layerB, expectedErrorCount: 0);
}); });
...@@ -435,22 +435,22 @@ void main() { ...@@ -435,22 +435,22 @@ void main() {
final PhysicalModelLayer layerA = PhysicalModelLayer( final PhysicalModelLayer layerA = PhysicalModelLayer(
clipPath: Path()..addRect(const Rect.fromLTWH(0, 0, 20, 20)), clipPath: Path()..addRect(const Rect.fromLTWH(0, 0, 20, 20)),
elevation: 3.0, elevation: 3.0,
color: const Color(0), color: const Color(0x00000000),
shadowColor: const Color(0), shadowColor: const Color(0x00000000),
); );
layerA.append(PhysicalModelLayer( layerA.append(PhysicalModelLayer(
clipPath: Path()..addRect(const Rect.fromLTWH(15, 15, 25, 25)), clipPath: Path()..addRect(const Rect.fromLTWH(15, 15, 25, 25)),
elevation: 2.0, elevation: 2.0,
color: const Color(0), color: const Color(0x00000000),
shadowColor: const Color(0), shadowColor: const Color(0x00000000),
)); ));
final PhysicalModelLayer layerB =PhysicalModelLayer( final PhysicalModelLayer layerB =PhysicalModelLayer(
clipPath: Path()..addRect(const Rect.fromLTWH(20, 20, 20, 20)), clipPath: Path()..addRect(const Rect.fromLTWH(20, 20, 20, 20)),
elevation: 4.0, elevation: 4.0,
color: const Color(0), color: const Color(0x00000000),
shadowColor: const Color(0), shadowColor: const Color(0x00000000),
); );
_testConflicts(layerA, layerB, expectedErrorCount: 1); _testConflicts(layerA, layerB, expectedErrorCount: 1);
......
...@@ -63,12 +63,12 @@ void main() { ...@@ -63,12 +63,12 @@ void main() {
}); });
test('TableBorder.lerp', () { test('TableBorder.lerp', () {
const BorderSide side1 = BorderSide(width: 1.0, color: Color(1)); const BorderSide side1 = BorderSide(width: 1.0, color: Color(0x00000001));
const BorderSide side2 = BorderSide(width: 2.0, color: Color(2)); const BorderSide side2 = BorderSide(width: 2.0, color: Color(0x00000002));
const BorderSide side3 = BorderSide(width: 3.0, color: Color(3)); const BorderSide side3 = BorderSide(width: 3.0, color: Color(0x00000003));
const BorderSide side4 = BorderSide(width: 4.0, color: Color(4)); const BorderSide side4 = BorderSide(width: 4.0, color: Color(0x00000004));
const BorderSide side5 = BorderSide(width: 5.0, color: Color(5)); const BorderSide side5 = BorderSide(width: 5.0, color: Color(0x00000005));
const BorderSide side6 = BorderSide(width: 6.0, color: Color(6)); const BorderSide side6 = BorderSide(width: 6.0, color: Color(0x00000006));
const TableBorder tableA = TableBorder( const TableBorder tableA = TableBorder(
top: side1, top: side1,
right: side2, right: side2,
......
...@@ -28,38 +28,38 @@ class FooState extends State<Foo> { ...@@ -28,38 +28,38 @@ class FooState extends State<Foo> {
scrollController.animateTo(200.0, duration: const Duration(milliseconds: 500), curve: Curves.linear); scrollController.animateTo(200.0, duration: const Duration(milliseconds: 500), curve: Curves.linear);
}, },
child: const DecoratedBox( child: const DecoratedBox(
decoration: BoxDecoration(color: Color(0)), decoration: BoxDecoration(color: Color(0x00000000)),
child: SizedBox( child: SizedBox(
height: 200.0, height: 200.0,
), ),
), ),
), ),
const DecoratedBox( const DecoratedBox(
decoration: BoxDecoration(color: Color(0)), decoration: BoxDecoration(color: Color(0x00000000)),
child: SizedBox( child: SizedBox(
height: 200.0, height: 200.0,
), ),
), ),
const DecoratedBox( const DecoratedBox(
decoration: BoxDecoration(color: Color(0)), decoration: BoxDecoration(color: Color(0x00000000)),
child: SizedBox( child: SizedBox(
height: 200.0, height: 200.0,
), ),
), ),
const DecoratedBox( const DecoratedBox(
decoration: BoxDecoration(color: Color(0)), decoration: BoxDecoration(color: Color(0x00000000)),
child: SizedBox( child: SizedBox(
height: 200.0, height: 200.0,
), ),
), ),
const DecoratedBox( const DecoratedBox(
decoration: BoxDecoration(color: Color(0)), decoration: BoxDecoration(color: Color(0x00000000)),
child: SizedBox( child: SizedBox(
height: 200.0, height: 200.0,
), ),
), ),
const DecoratedBox( const DecoratedBox(
decoration: BoxDecoration(color: Color(0)), decoration: BoxDecoration(color: Color(0x00000000)),
child: SizedBox( child: SizedBox(
height: 200.0, height: 200.0,
), ),
......
...@@ -736,13 +736,13 @@ void main() { ...@@ -736,13 +736,13 @@ void main() {
child: Text.rich( child: Text.rich(
TextSpan( TextSpan(
text: 'inner', text: 'inner',
style: TextStyle(color: Color(0xff402f4ff)), style: TextStyle(color: Color(0xf402f4ff)),
children: <InlineSpan>[ children: <InlineSpan>[
WidgetSpan( WidgetSpan(
child: Text.rich( child: Text.rich(
TextSpan( TextSpan(
text: 'inner2', text: 'inner2',
style: TextStyle(color: Color(0xff003ffff)), style: TextStyle(color: Color(0xf003ffff)),
children: <InlineSpan>[ children: <InlineSpan>[
WidgetSpan( WidgetSpan(
child: SizedBox( child: SizedBox(
......
...@@ -40,7 +40,7 @@ void main() { ...@@ -40,7 +40,7 @@ void main() {
testWidgets('should not allow non-opaque color', (WidgetTester tester) async { testWidgets('should not allow non-opaque color', (WidgetTester tester) async {
expect(() => Title( expect(() => Title(
color: const Color(0), color: const Color(0x00000000),
child: Container(), child: Container(),
), throwsAssertionError); ), throwsAssertionError);
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment