-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
69 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# 拡張 | ||
|
||
## implement | ||
|
||
全てのクラスは暗黙的なインターフェイスを持っている | ||
|
||
```dart | ||
class Animal { | ||
void bark() { | ||
print('bark'); | ||
} | ||
} | ||
/// implementsした場合は、オーバーライドが必須 | ||
class Dog implements Animal { | ||
@override | ||
void bark() { | ||
print('wanwan'); | ||
} | ||
} | ||
/// extendsした場合は、オーバーライドが任意 | ||
class Cat extends Animal { | ||
} | ||
``` | ||
|
||
## extension | ||
|
||
拡張名を省略した場合は、同一ファイルからのみ利用可能. | ||
|
||
```dart | ||
// 拡張名を省略 | ||
extension on List<T> { | ||
... | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# 例外処理 | ||
|
||
## フレームワークが例外処理 | ||
|
||
- Flutterは、フレームワークが例外を捕捉する機構を持っている | ||
- そのため、例外がスローされてもアプリは終了しない |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters