Unverified Commit e7c7a58d authored by Siva's avatar Siva Committed by GitHub

Use identical instead of '==' in a constant expression. (#30921)

* Use identical instead of '==' in a constant expression.

* Fix analyzer warnings.

* Fix analyzer warnings.
parent cadde245
...@@ -53,7 +53,7 @@ class FlutterLogoDecoration extends Decoration { ...@@ -53,7 +53,7 @@ class FlutterLogoDecoration extends Decoration {
assert(textColor != null), assert(textColor != null),
assert(style != null), assert(style != null),
assert(margin != null), assert(margin != null),
_position = style == FlutterLogoStyle.markOnly ? 0.0 : style == FlutterLogoStyle.horizontal ? 1.0 : -1.0, // ignore: CONST_EVAL_TYPE_BOOL_NUM_STRING _position = identical(style, FlutterLogoStyle.markOnly) ? 0.0 : identical(style, FlutterLogoStyle.horizontal) ? 1.0 : -1.0,
// (see https://github.com/dart-lang/sdk/issues/26980 for details about that ignore statement) // (see https://github.com/dart-lang/sdk/issues/26980 for details about that ignore statement)
_opacity = 1.0; _opacity = 1.0;
......
...@@ -7,20 +7,20 @@ import 'package:flutter/painting.dart'; ...@@ -7,20 +7,20 @@ import 'package:flutter/painting.dart';
void main() { void main() {
// Here and below, see: https://github.com/dart-lang/sdk/issues/26980 // Here and below, see: https://github.com/dart-lang/sdk/issues/26980
final FlutterLogoDecoration start = FlutterLogoDecoration( const FlutterLogoDecoration start = FlutterLogoDecoration(
lightColor: const Color(0xFF000000), lightColor: Color(0xFF000000),
darkColor: const Color(0xFFFFFFFF), darkColor: Color(0xFFFFFFFF),
textColor: const Color(0xFFD4F144), textColor: Color(0xFFD4F144),
style: FlutterLogoStyle.stacked, style: FlutterLogoStyle.stacked,
margin: const EdgeInsets.all(10.0), margin: EdgeInsets.all(10.0),
); );
final FlutterLogoDecoration end = FlutterLogoDecoration( const FlutterLogoDecoration end = FlutterLogoDecoration(
lightColor: const Color(0xFFFFFFFF), lightColor: Color(0xFFFFFFFF),
darkColor: const Color(0xFF000000), darkColor: Color(0xFF000000),
textColor: const Color(0xFF81D4FA), textColor: Color(0xFF81D4FA),
style: FlutterLogoStyle.stacked, style: FlutterLogoStyle.stacked,
margin: const EdgeInsets.all(10.0), margin: EdgeInsets.all(10.0),
); );
test('FlutterLogoDecoration lerp from null to null is null', () { test('FlutterLogoDecoration lerp from null to null is null', () {
......
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