@@ -187,7 +187,7 @@ class _PolygonsPageState extends ExamplePageState<PolygonsPage> {
187187 Future <void > _setFillColor () async {
188188 final Color oldColor = _selectedPolygon! .options.fillColor;
189189 final Color newColor = _colors.elementAtOrNull (
190- _colors.indexWhere ((Color e) => e.value == oldColor.value ) + 1 ) ??
190+ _colors.indexWhere ((Color e) => e == oldColor) + 1 ) ??
191191 _colors[0 ];
192192
193193 await _updateSelectedPolygonWithOptions (
@@ -197,21 +197,21 @@ class _PolygonsPageState extends ExamplePageState<PolygonsPage> {
197197 Future <void > _setStrokeColor () async {
198198 final Color oldColor = _selectedPolygon! .options.strokeColor;
199199 final Color newColor = _colors.elementAtOrNull (
200- _colors.indexWhere ((Color e) => e.value == oldColor.value ) + 1 ) ??
200+ _colors.indexWhere ((Color e) => e == oldColor) + 1 ) ??
201201 _colors[0 ];
202202
203203 await _updateSelectedPolygonWithOptions (
204204 _selectedPolygon! .options.copyWith (strokeColor: newColor));
205205 }
206206
207207 String _colorName (Color ? color) {
208- if (color? .value == Colors .black.value ) {
208+ if (color == Colors .black) {
209209 return 'Black' ;
210- } else if (color? .value == Colors .red.value ) {
210+ } else if (color == Colors .red) {
211211 return 'Red' ;
212- } else if (color? .value == Colors .green.value ) {
212+ } else if (color == Colors .green) {
213213 return 'Green' ;
214- } else if (color? .value == Colors .blue.value ) {
214+ } else if (color == Colors .blue) {
215215 return 'Blue' ;
216216 } else {
217217 return 'null' ;
0 commit comments