Skip to content

Commit 41f58b3

Browse files
committed
Changes made :
1)Made neccesary changes as said 2)Delete 'src/content/language/patterns.md~' file 3)Undid unnecessary indentation in 'src/content/language/patterns.md' file
1 parent bc82de9 commit 41f58b3

File tree

3 files changed

+13
-462
lines changed

3 files changed

+13
-462
lines changed

src/content/effective-dart/design.md

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -519,9 +519,9 @@ class in a single library.
519519

520520
## Classes and mixins
521521

522-
Classes. But Dart does not require all code to be defined inside a
522+
classes. But Dart does not require all code to be defined inside a
523523
class—you can define top-level variables, constants, and functions like
524-
you can in a procedural or functional language
524+
you can in a procedural or functional language.
525525

526526
### AVOID defining a one-member abstract class when a simple function will do
527527

@@ -622,22 +622,20 @@ Otherwise, later changes to it may break your code.
622622

623623
### DO use class modifiers to control if your class can be extended
624624

625-
Class modifiers like `final`, `base`, or `sealed`
626-
allow you to enforce whether a class can be extended directly in code.
625+
Class modifiers like `final`, `base`, or `sealed`
626+
enforce whether a class can be extended.
627627
For example, use `final class A {}` to prevent extension,
628-
or `base class B {}` to allow extension only within the same library.
629-
Rely on these modifiers rather than documentation to communicate and
630-
enforce your intent.
628+
or `base class B {}` to allow extension only within the same library.
629+
Use these modifiers to communicate your intent, rather than relying on documentation.
631630

632631

633-
### ### DO use class modifiers to control if your class can be an interface
634-
635-
you can also restrict implementation using
636-
`final`, `base`, or `interface`. For example, `final class C {}`
637-
prevents implementation, while `interface class D {}` allows it explicitly.
638-
Use these modifiers to enforce your design intent instead of relying solely
639-
on documentation.
632+
### DO use class modifiers to control if your class can be an interface
640633

634+
When designing a library, use class modifiers like `final`, `base`, or `interface` to enforce intended
635+
usage. For example, `final class C {}` prevents implementation, while `interface class D {}`
636+
explicitly allows it. While it's ideal for all libraries to use these modifiers to enforce design intent,
637+
developers may still encounter cases where they aren't applied. In such cases, be mindful of
638+
unintended implementation issues.
641639

642640
<a id="do-use-mixin-to-define-a-mixin-type"></a>
643641
<a id="avoid-mixing-in-a-class-that-isnt-intended-to-be-a-mixin"></a>

src/content/language/patterns.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ if (data is Map<String, Object?> &&
390390
var name = user[0] as String;
391391
var age = user[1] as int;
392392
print('User $name is $age years old.');
393-
}
393+
}
394394
}
395395
```
396396

0 commit comments

Comments
 (0)