「Flutter/dart/基本文法」の版間の差分
提供: 初心者エンジニアの簡易メモ
(→foreach) |
|||
| 行1: | 行1: | ||
| + | ==if== | ||
| + | <pre> | ||
| + | int maxId = 0 | ||
| + | if (maxId > 1) { | ||
| + | } | ||
| + | if (maxId != null) { | ||
| + | } | ||
| + | </pre> | ||
| + | |||
==foreach== | ==foreach== | ||
List<String> names = new List<String>(); | List<String> names = new List<String>(); | ||
2019年5月4日 (土) 02:16時点における版
if
int maxId = 0
if (maxId > 1) {
}
if (maxId != null) {
}
foreach
List<String> names = new List<String>();
names.add("hoge");
names.forEach((item) {
print(item);
});
クラス生成
class ArticleDao {
void add(Article article) {
}
}
ArticleDao dao = new ArticleDao();
dao.add(article);
