adambard / adambard/learnxinyminutes-docs

[dart/en] Learn Dart broken

Đang mở
#4,461 7 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Markdown
Star
12.3k
Fork
3.7k
Merge trung bình
13 giờ 10 phút
Pull request đã merge (30 ngày)
6

Mô tả

Hi there, thanks for this awesome resource.

Attempting to run the current Learn Dart page in the latest version of dart throws several errors:

```
: Warning: Operand of null-aware operation '??' has type 'bool' which excludes null.
var hasString = isBool ?? "default String";
^

: Error: Variables must be declared using the keywords 'const', 'final', 'var' or a type name.
Try adding the name of the type of the variable or the keyword 'var'.
CONSTANT_VALUE = "DID I?"; //Error
^^^^^^^^^^^^^^
: Error: 'CONSTANT_VALUE' is already declared in this scope.
CONSTANT_VALUE = "DID I?"; //Error
^^^^^^^^^^^^^^
: Context: Previous declaration of 'CONSTANT_VALUE'.
const CONSTANT_VALUE = "I CANNOT CHANGE";
^^^^^^^^^^^^^^
: Error: Variables must be declared using the keywords 'const', 'final', 'var' or a type name.
Try adding the name of the type of the variable or the keyword 'var'.
finalValue = "Seems not"; //Error
^^^^^^^^^^
: Error: 'finalValue' is already declared in this scope.
finalValue = "Seems not"; //Error
^^^^^^^^^^
: Context: Previous declaration of 'finalValue'.
final finalValue = "value cannot be change once instantiated";
^^^^^^^^^^
: Error: Variables must be declared using the keywords 'const', 'final', 'var' or a type name.
Try adding the name of the type of the variable or the keyword 'var'.
mutableValue = "this is valid";
^^^^^^^^^^^^
: Error: 'mutableValue' is already declared in this scope.
mutableValue = "this is valid";
^^^^^^^^^^^^
: Context: Previous declaration of 'mutableValue'.
var mutableValue = "Variable string";
^^^^^^^^^^^^
: Error: Variables must be declared using the keywords 'const', 'final', 'var' or a type name.
Try adding the name of the type of the variable or the keyword 'var'.
mutableValue = false; // Error.
^^^^^^^^^^^^

Exited (254)

```

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Start with the Learn Dart page identified by the issue and compare its examples with the latest Dart analyzer output. Reproduce the reported warnings and errors, then update the affected examples so the page runs without these errors and verify the corrected snippets with the current Dart version.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
dart
Lĩnh vực
documentation
Loại issue
Lỗi
Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
42/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.