Skip to content

Instantly share code, notes, and snippets.

@3t14
Created August 24, 2022 19:04
Show Gist options
  • Save 3t14/07c3a527380946836fe233f32f755f95 to your computer and use it in GitHub Desktop.
Save 3t14/07c3a527380946836fe233f32f755f95 to your computer and use it in GitHub Desktop.
レコードの定義と仮のデータの代入
// メモデータに関するモデル処理
// 1件分のメモデータ
class Item {
final int id; // ユニークな識別子
final String title; // メモのタイトル
final String memo; // メモの内容
// コンストラクタ
const Item({
this.id = -1,
required this.title,
required this.memo
});
}
// 全データ
List<Item> items = <Item>[
const Item(
id: 0,
title: 'Item 1',
memo: 'This is the first item.',
),
const Item(
id: 1,
title: 'Item 2',
memo: 'This is the second item.',
),
const Item(
id: 2,
title: 'Item 3',
memo: 'This is the third item.',
),
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment