ほぼ完成:QRcodeトライ

This commit is contained in:
2024-08-01 20:08:12 +09:00
parent 3d7a5ae0c1
commit ee007795b9
25 changed files with 3214 additions and 1121 deletions

View File

@ -90,21 +90,40 @@ class EntryDetailPage extends GetView<EntryController> {
},
),
SizedBox(height: 32),
ElevatedButton(
child: Text(mode == 'new' ? 'エントリーを作成' : 'エントリーを更新'),
onPressed: () {
if (mode == 'new') {
controller.createEntry();
} else {
controller.updateEntry();
}
},
),
if (mode == 'edit' && controller.isOwner())
if (mode == 'new')
ElevatedButton(
child: Text('エントリーを削除'),
onPressed: () => controller.deleteEntry(),
style: ElevatedButton.styleFrom(backgroundColor: Colors.red),
child: Text('エントリーを作成'),
onPressed: () => controller.createEntry(),
style: ElevatedButton.styleFrom(
backgroundColor: Colors.blue,
minimumSize: Size(double.infinity, 50),
),
)
else
Row(
children: [
Expanded(
child: ElevatedButton(
child: Text('エントリーを削除'),
onPressed: () => controller.deleteEntry(),
style: ElevatedButton.styleFrom(
backgroundColor: Colors.red,
minimumSize: Size(0, 50),
),
),
),
SizedBox(width: 16),
Expanded(
child: ElevatedButton(
child: Text('エントリーを更新'),
onPressed: () => controller.updateEntry(),
style: ElevatedButton.styleFrom(
backgroundColor: Colors.lightBlue,
minimumSize: Size(0, 50),
),
),
),
],
),
],
),