assert
๐ฌ ๊ฐ๋ฐ ๋ชจ๋์ debug ์ค์ผ ๋์๋ง ์ํฅ์ ๋ฏธ์น๋ฉฐ, ๋ฐฐํฌ ์ฝ๋์์๋ ํ๋ก๊ทธ๋จ์ ์ํฅ์ ์ฃผ์ง ์์
๐ฌ ์กฐ๊ฑด์ด ๊ฑฐ์ง์ธ ๊ฒฝ์ฐ ์คํ์ด ์ค๋จ๋๋ค.
assert(condition, optionalMessage);
โป๏ธ condition : boolean์ด ๋์ฌ ์ ์๋ ์กฐ๊ฑด์ ๋ฃ์ผ๋ฉฐ, false์ด๋ฉด ํ๋ก๊ทธ๋จ์ด ์ค๋จ๋๋ค.
โป๏ธ optionalMessage : ํ๋ก๊ทธ๋จ ์ค๋จ ์ ๋์ฌ ๋ฉ์์ง๋ฅผ ์ค์ ํ ์ ์๋ค.
assert(urlString.startsWith('https'),
'URL ($urlString) should start with "https".');
...
https://m.blog.naver.com/mingdyuo/221803704762
[flutter, dart] ์๋ฌ, ์์ธ์ํฉ ์ ์ดํ๊ธฐ : assert, throw, catch, finally
๋ด์ฉ ์ถ์ฒ : [FLUTTER] DART ์ธ์ด ๊ธฐ์ด๊ณผ์ - 2 / A Tour of the Dart Language A tour of...
blog.naver.com
'Dart' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[ Flutter ] Null Safety (0) | 2022.01.01 |
---|---|
[ Dart ] ๊ธฐํ ์ ์ฉํ ๊ธฐ๋ฒ (0) | 2021.12.21 |
[ Dart ] ํจ์ํ ํ๋ก๊ทธ๋๋ฐ (0) | 2021.12.21 |
[ Dart ] ์ปฌ๋ ์ (0) | 2021.12.21 |
[ Dart ] ๊ฐ์ฒด ์งํฅ ํ๋ก๊ทธ๋๋ฐ (0) | 2021.12.21 |