How do I solve this error code in pubspec.yaml?

Viewed 31

Error detected in pubspec.yaml: Error on line 38, column 3: Expected a key while parsing a block mapping. ╷ 38 │ cupertino_icons: ^1.0.2 │ ^ ╵ Please correct the pubspec.yaml file at C:\Users\Kia Com\Documents\Restaurant_App\resto\pubspec.yaml Exited (1)

My Code

enter image description here

enter image description here

1 Answers

The issue is with the indentation. The yaml file has strict indentation rule. Your pubspec.yaml should be like this.

dependencies:
  flutter:
    sdk: flutter
  http: ^0.13.1
  cupertino_icons: ^1.0.2

Notice the starting line of the http package. It should be one indent right of the dependencies tag and should match the indentation of flutter and cupertino_icons package.

Related