Dart
[ Dart ] ์๋ฌ, ์์ธ ์ํฉ ์ ์ดํ๊ธฐ
Design-loving front-end engineer
2022. 2. 4. 08:46
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